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

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

public class SingleFileAuditDestination
extends AbstractAuditDestination

This is a auditing destination that writes to a single file.


Field Summary
static java.lang.String APPEND_PROPERTY_NAME
          The name of the property that specifies whether the file should be appened or overwritten.
protected static java.lang.String DEFAULT_APPEND
           
protected static java.lang.String DEFAULT_FILE_NAME
           
static java.lang.String FILE_NAME_PROPERTY_NAME
          The name of the property that contains the name of the file to which log messages are to be recorded.
static java.lang.String MESSAGE_FORMAT_PROPERTY_NAME
          The name of the property that contains the name of the AuditMessageFormat class that is used to format messages sent to the file destination.
static java.lang.String VM_NAME_TOKEN
          The token that is used in the filename and that is replaced with the name of the property that specifies whether the file should be appened or overwritten.
 
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
SingleFileAuditDestination()
           
 
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 to the file writer
 void shutdown()
          Shutdown - close file.
 
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

MESSAGE_FORMAT_PROPERTY_NAME

public static final java.lang.String MESSAGE_FORMAT_PROPERTY_NAME
The name of the property that contains the name of the AuditMessageFormat class that is used to format messages sent to the file destination. This is an optional property; if not specified then the DelimitedAuditMessageFormat is used.

See Also:
Constant Field Values

FILE_NAME_PROPERTY_NAME

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

To have multiple VMs on the same machine output to different files (without having to know explicitly what each output filename ahead of time), the %VM_NAME% token can be included in the value for this property. In this case, the %VM_NAME% token gets replaced with the name of the VM (which is a System environment property) or a unique ID if the name is not specified. Note: if %VM_NAME% is specified in the file name but no name is supplied to the VM, a pseudo-random number is used in place of the name.

See Also:
NetUtils, Constant Field Values

APPEND_PROPERTY_NAME

public static final java.lang.String APPEND_PROPERTY_NAME
The name of the property that specifies whether the file should be appened or overwritten. This is an optional property that defaults to "false".

See Also:
Constant Field Values

VM_NAME_TOKEN

public static final java.lang.String VM_NAME_TOKEN
The token that is used in the filename and that is replaced with the name of the property that specifies whether the file should be appened or overwritten. This is an optional property that defaults to "false".

See Also:
Constant Field Values

DEFAULT_FILE_NAME

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

DEFAULT_APPEND

protected static final java.lang.String DEFAULT_APPEND
See Also:
Constant Field Values
Constructor Detail

SingleFileAuditDestination

public SingleFileAuditDestination()
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.


record

public void record(AuditMessage message)
Print to the file writer

Parameters:
message - Message to print

shutdown

public void shutdown()
Shutdown - close file.



Copyright © 2009. All Rights Reserved.