com.metamatrix.platform.security.audit.destination
Class DatabaseAuditDestination

java.lang.Object
  extended by com.metamatrix.platform.security.audit.destination.AbstractAuditDestination
      extended by com.metamatrix.platform.security.audit.destination.DatabaseAuditDestination
All Implemented Interfaces:
AuditDestination

public class DatabaseAuditDestination
extends AbstractAuditDestination


Nested Class Summary
static class DatabaseAuditDestination.ColumnName
           
 
Field Summary
static java.lang.String DATABASE_PROPERTY_NAME
          The name of the property that contains the name JDBC database to which log messages are to be recorded.
protected static int DEFAULT_MAX_GENERAL_LENGTH
           
protected static int DEFAULT_MAX_RESOURCE_LENGTH
           
protected static java.lang.String DEFAULT_RESOURCE_DELIMITER
           
protected static java.lang.String DEFAULT_TABLE_NAME
           
static java.lang.String MAX_GENERAL_LENGTH_PROPERTY_NAME
          The name of the property that contains the maximum length allowed for the general column (exception message and exception).
static java.lang.String MAX_RESOURCE_LENGTH_PROPERTY_NAME
          The name of the property that contains the maximum length allowed for the column that contains the resources portion.
static java.lang.String RESOURCE_DELIM_PROPERTY_NAME
          The name of the property that contains the delimiter used between resources.
static java.lang.String TABLE_PROPERTY_NAME
          The name of the property that contains the name of the table to which log messages are to be recorded.
 
Fields inherited from class com.metamatrix.platform.security.audit.destination.AbstractAuditDestination
DEFAULT_LOG_FORMAT_PROPERTY_NAME
 
Fields inherited from interface com.metamatrix.platform.security.audit.destination.AuditDestination
PROPERTY_PREFIX
 
Constructor Summary
DatabaseAuditDestination()
           
 
Method Summary
 java.lang.String getDescription()
          Return description
 java.util.List getPropertyNames()
          Get names of all properties used for this destination.
 void initialize(java.util.Properties props)
          Initialize this destination with the specified properties.
 void record(AuditMessage message)
          Print the message to the log destination.
 void recordMsg(AuditMessage message)
          Print to the file writer
 void shutdown()
          Shutdown - close database.
 
Methods inherited from class com.metamatrix.platform.security.audit.destination.AbstractAuditDestination
getDefaultFormatClassName, getFormat, setFormat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATABASE_PROPERTY_NAME

public static final java.lang.String DATABASE_PROPERTY_NAME
The name of the property that contains the name JDBC database to which log messages are to be recorded. This is a required property that has no default.

See Also:
Constant Field Values

TABLE_PROPERTY_NAME

public static final java.lang.String TABLE_PROPERTY_NAME
The name of the property that contains the name of the table to which log messages are to be recorded. This is an optional property that defaults to "log".

See Also:
Constant Field Values

RESOURCE_DELIM_PROPERTY_NAME

public static final java.lang.String RESOURCE_DELIM_PROPERTY_NAME
The name of the property that contains the delimiter used between resources. This is an optional property that defaults to ";".

See Also:
Constant Field Values

MAX_RESOURCE_LENGTH_PROPERTY_NAME

public static final java.lang.String MAX_RESOURCE_LENGTH_PROPERTY_NAME
The name of the property that contains the maximum length allowed for the column that contains the resources portion. This is an optional property that defaults to "4000"; if supplied value is 0 then the length is not checked for each message prior to insertion.

See Also:
Constant Field Values

MAX_GENERAL_LENGTH_PROPERTY_NAME

public static final java.lang.String MAX_GENERAL_LENGTH_PROPERTY_NAME
The name of the property that contains the maximum length allowed for the general column (exception message and exception). This is an optional property that defaults to "64"; if supplied value is 0 then the length is not checked for each message prior to insertion.

See Also:
Constant Field Values

DEFAULT_TABLE_NAME

protected static final java.lang.String DEFAULT_TABLE_NAME
See Also:
Constant Field Values

DEFAULT_RESOURCE_DELIMITER

protected static final java.lang.String DEFAULT_RESOURCE_DELIMITER
See Also:
Constant Field Values

DEFAULT_MAX_GENERAL_LENGTH

protected static final int DEFAULT_MAX_GENERAL_LENGTH
See Also:
Constant Field Values

DEFAULT_MAX_RESOURCE_LENGTH

protected static final int DEFAULT_MAX_RESOURCE_LENGTH
See Also:
Constant Field Values
Constructor Detail

DatabaseAuditDestination

public DatabaseAuditDestination()
Method Detail

getDescription

public java.lang.String getDescription()
Return description

Returns:
Description

initialize

public void initialize(java.util.Properties props)
                throws AuditDestinationInitFailedException
Initialize this destination with the specified properties.

Specified by:
initialize in interface AuditDestination
Overrides:
initialize in class AbstractAuditDestination
Parameters:
props - the properties that this destination should use to initialize itself.
Throws:
AuditDestinationInitFailedException - if there was an error during initialization.

getPropertyNames

public java.util.List getPropertyNames()
Get names of all properties used for this destination. The property name is "simple" and does not include the standard logger prefix.


record

public void record(AuditMessage message)
Description copied from interface: AuditDestination
Print the message to the log destination.

Parameters:
message - The message to print

recordMsg

public void recordMsg(AuditMessage message)
               throws java.sql.SQLException
Print to the file writer

Parameters:
message - Message to print
Throws:
java.sql.SQLException

shutdown

public void shutdown()
Shutdown - close database.



Copyright © 2009. All Rights Reserved.