atg.agent.logging
Class ItemUpdateRecorder

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.agent.logging.AgentAuditRecorder
              extended by atg.agent.logging.ItemUpdateRecorder
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, DataListener, java.util.EventListener

public class ItemUpdateRecorder
extends AgentAuditRecorder

Recorder used to record ItemUpdateAgentEvents.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  ProfileTools mProfileTools
           
static java.lang.String NEW_VALUE_PROPERTY_NAME
          The name of the property in the property update item descriptor that holds the new value
static java.lang.String OLD_VALUE_PROPERTY_NAME
          The name of the property in the property update item descriptor that holds the old value
static java.lang.String OWNER_PROPERTY_NAME
          The name of the property in the property update item descriptor that holds the owner
static java.lang.String PROPERTY_UPDATES_PROPERTY_NAME
          The name of the property in the audit item that holds the collecton of property update items
static java.lang.String UPDATE_TYPE_PROPERT_NAME
          The name of the property in the property update item descriptor that holds the updated type
static java.lang.String UPDATED_ITEM_ID_PROPERTY_NAME
          The name of the property in the audit item that holds the updated item id
static java.lang.String UPDATED_PROPERTY_PROPERTY_NAME
          The name of the property in the property update item descriptor that holds the property name
 
Fields inherited from class atg.agent.logging.AgentAuditRecorder
CUSTOMER_PROFILE_ID_PROPERTY_NAME, EVENT_DATE_PROPERTY_NAME, IP_ADDRESS_PROPERTY_NAME, ORGANIZATION_ID_PROPERTY_NAME, PARENT_SESSION_ID_PROPERTY_NAME, PROFILE_ID_PROPERTY_NAME, SESSION_ID_PROPERTY_NAME
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
ItemUpdateRecorder()
           
 
Method Summary
protected  java.lang.String convertToString(java.lang.Object pObject)
          Deprecated. in favor of ProfileTools#convertNewValueToString and ProfileTools#convertOldValueToString
protected  MutableRepositoryItem createPropertyUpdateItem(MutableRepository pAgentAuditRepository, MutableRepositoryItem pAuditItem, atg.userprofiling.PropertyUpdate pPropertyUpdate)
          Creates a property update repository item.
protected  java.lang.String getItemDescriptorType(RepositoryItem pItem, java.lang.String pPropertyName)
          This method determines the item descriptor type for the property on the given item.
 ProfileTools getProfileTools()
           
 boolean isRecordOldNewValues()
          Returns property RecordOldNewValues
protected  void populateCustomProperties(MutableRepository pAgentAuditRepository, MutableRepositoryItem pAuditItem, AgentEvent pAgentEvent)
          Fills in the base properties of the audit item and creates the property update repository items based on the propertyUpdates in the event.
 void setProfileTools(ProfileTools pProfileTools)
          Sets the property ProfileTools.
 void setRecordOldNewValues(boolean pRecordOldNewValues)
          Sets property RecordOldNewValues.
 
Methods inherited from class atg.agent.logging.AgentAuditRecorder
addDataItem, createAgentAuditItem, getAgentAuditRepository, populateBaseProperties, setAgentAuditRepository
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

PROPERTY_UPDATES_PROPERTY_NAME

public static final java.lang.String PROPERTY_UPDATES_PROPERTY_NAME
The name of the property in the audit item that holds the collecton of property update items

See Also:
Constant Field Values

UPDATED_PROPERTY_PROPERTY_NAME

public static final java.lang.String UPDATED_PROPERTY_PROPERTY_NAME
The name of the property in the property update item descriptor that holds the property name

See Also:
Constant Field Values

OLD_VALUE_PROPERTY_NAME

public static final java.lang.String OLD_VALUE_PROPERTY_NAME
The name of the property in the property update item descriptor that holds the old value

See Also:
Constant Field Values

NEW_VALUE_PROPERTY_NAME

public static final java.lang.String NEW_VALUE_PROPERTY_NAME
The name of the property in the property update item descriptor that holds the new value

See Also:
Constant Field Values

OWNER_PROPERTY_NAME

public static final java.lang.String OWNER_PROPERTY_NAME
The name of the property in the property update item descriptor that holds the owner

See Also:
Constant Field Values

UPDATED_ITEM_ID_PROPERTY_NAME

public static final java.lang.String UPDATED_ITEM_ID_PROPERTY_NAME
The name of the property in the audit item that holds the updated item id

See Also:
Constant Field Values

UPDATE_TYPE_PROPERT_NAME

public static final java.lang.String UPDATE_TYPE_PROPERT_NAME
The name of the property in the property update item descriptor that holds the updated type

See Also:
Constant Field Values

mProfileTools

protected ProfileTools mProfileTools
Constructor Detail

ItemUpdateRecorder

public ItemUpdateRecorder()
Method Detail

setProfileTools

public void setProfileTools(ProfileTools pProfileTools)
Sets the property ProfileTools.


getProfileTools

public ProfileTools getProfileTools()
Returns:
The value of the property ProfileTools.

setRecordOldNewValues

public void setRecordOldNewValues(boolean pRecordOldNewValues)
Sets property RecordOldNewValues.

The default setting is true.

Parameters:
pRecordOldNewValues - boolean determining if the old and new property values are recorded in the audit table

isRecordOldNewValues

public boolean isRecordOldNewValues()
Returns property RecordOldNewValues


populateCustomProperties

protected void populateCustomProperties(MutableRepository pAgentAuditRepository,
                                        MutableRepositoryItem pAuditItem,
                                        AgentEvent pAgentEvent)
                                 throws AgentAuditLoggingException
Fills in the base properties of the audit item and creates the property update repository items based on the propertyUpdates in the event.

Overrides:
populateCustomProperties in class AgentAuditRecorder
Throws:
AgentAuditLoggingException

createPropertyUpdateItem

protected MutableRepositoryItem createPropertyUpdateItem(MutableRepository pAgentAuditRepository,
                                                         MutableRepositoryItem pAuditItem,
                                                         atg.userprofiling.PropertyUpdate pPropertyUpdate)
Creates a property update repository item. The item type is derived from the pAuditItem's propertyUpdates property descriptor.

The item is not created if both the old an new values convert to empty strings.

Parameters:
pAgentAuditRepository - the audit repository
pAuditItem - the parent audit item.
pPropertyUpdate - the property update object used to populate the new repository item.
Returns:
a property update repository item

getItemDescriptorType

protected java.lang.String getItemDescriptorType(RepositoryItem pItem,
                                                 java.lang.String pPropertyName)
This method determines the item descriptor type for the property on the given item.

Parameters:
pItem - the repository item that contains the property.
pPropertyName - the name of the property for which you want the type.
Returns:
item descriptor type

convertToString

protected java.lang.String convertToString(java.lang.Object pObject)
Deprecated. in favor of ProfileTools#convertNewValueToString and ProfileTools#convertOldValueToString

Converts an object to a string representation. Primarily used to convert property update values into string representations before persisting them in the audit repository.

Parameters:
pObject - the object to convert to a string.
Returns:
String representation of the object.
See Also:
ProfileTools.convertNewValueToString(PropertyUpdate), ProfileTools.convertOldValueToString(PropertyUpdate)