com.waveset.object
Class LogRecord

java.lang.Object
  extended bycom.waveset.object.PersistentObject
      extended bycom.waveset.object.LogRecord
All Implemented Interfaces:
java.lang.Comparable, javax.naming.Referenceable, XmlObject

public class LogRecord
extends PersistentObject

Type.LOG rides again!

Wraps a LogRecord instance in a PersistentObject so the log record can be written to the Repository.


Nested Class Summary
 
Nested classes inherited from class com.waveset.object.PersistentObject
PersistentObject.Comparator, PersistentObject.InitialInstance
 
Field Summary
static java.lang.String code_id
           
 
Fields inherited from class com.waveset.object.PersistentObject
_trace, trace
 
Constructor Summary
LogRecord()
           
LogRecord(org.w3c.dom.Element e)
           
LogRecord(java.util.Hashtable event)
          Constructor used by AuditEventHandler to convert AuditEvents over to a persistent object.
 
Method Summary
protected  void addSubclassAttributes(java.lang.StringBuffer b)
          Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist).
protected  void addSubclassElements(java.lang.StringBuffer b)
          Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist).
 java.lang.String getAccountAttributesBlob()
          Accounts attribute blob.
 java.lang.String getAccountId()
          Get the resource which was associated with this record.
 java.lang.String getActionDbKey()
          Action maps loosely to our com.waveset.authz.Right.
protected  WSAttribute getAttributeValues(java.lang.String attrName)
           
 java.util.Map getAuditableAttributes()
          Get the attributes stored in the waveset.logattr table.
 java.lang.String getCanonicalDateTime()
           
 java.lang.String getClient()
          How (i.e., by what interface) did the subject request the action?
 java.lang.String getEventDateTime()
           
 java.lang.String getFormattedTimeStamp()
           
 java.lang.String getHashedText()
          Returns the blob of text which is to be hashed for log record signing The format of this is not guaranteed to make sense.
 java.lang.String getMessage()
          Get a raw string that is associated with this record.
 java.lang.String getObjectName()
          Which object was affected?
 java.lang.String getObjectTypeDbKey()
          What type of object was affected? When the record is coming in, all we have is the name of the type, so use the Type class and/or cache to resolve the db key.
 java.util.List getOrderedParameterList()
           
 java.util.Map getOverflowAttributes()
          Get the attributes stored in waveset.log.xml
 java.lang.String getOverflowAttributesXML()
           
 java.util.HashMap getParameters()
          "Expansion slots": other things the reporter recorded.
 java.lang.String getParameterValue(java.lang.String name)
           
 java.lang.String getReasonKey()
          Why was the requested action denied? Stored as a short code in the DB.
 java.lang.String getReasonMessage()
          Get the message catalog key that is associated with the reason that this request failed.
 java.lang.String getResourceName()
          Get the resource which was associated with this record.
 java.lang.String getRoleName()
          Get the role which was associated with this record.
 java.lang.Long getSequenceNumber()
          Get the sequence number.
 java.lang.String getSequenceNumberAsString()
          Returns the sequence number as a string suitable for querying
 java.lang.String getServer()
           
 java.lang.String getStatusDbKey()
          Did the action succeed?
 java.lang.String getSubjectName()
          Who acted?
 long getTimeStamp()
          Gets the time at which this record was created.
 Type getType()
          Return the type of this object.
 void listOperationalAttributes(java.util.List attrs)
          Add to the specified list the "built-in" attributes that are queryable just because the IDM Repository needs them in order to operate.
 java.util.List listQueryableAttributes()
           
 java.util.List listSummaryAttributes()
          Returns the complete list of defined attributes that this type of persistent object exposes as summary attributes (regardless of whether this particular object has a value for each).
protected  void parseSubclassAttributes(org.w3c.dom.Element e)
          Each concrete subclass should parse from the XML buffer any persisted subclass-specific fields (generally, the same ones that it writes into the buffer).
protected  void parseSubclassElements(org.w3c.dom.Element e)
          Each concrete subclass should parse from the XML buffer any persisted subclass-specific elements (generally, the same ones that it writes into the buffer).
 void set(Attribute attr, java.lang.String attrVal)
          Used by the repository to stuff LOG_COLUMN_ATTRS into LogRecord.
 void setAccountAttributesBlob(java.lang.String blob)
           
 void setAccountId(java.lang.String accountId)
           
 void setActionDbKey(java.lang.String dbKey)
           
 void setAuditableAttributes(java.util.Map map)
          Set the attributes stored in the waveset.logattr table.
 void setCanonicalDateTime(java.lang.String canonicalDateTime)
           
 void setClient(java.lang.String client)
           
 void setMemberObjectGroupRefs(java.util.ArrayList list)
           
 void setMessage(java.lang.String msg)
           
 void setObjectName(java.lang.String name)
           
 void setObjectTypeDbKey(java.lang.String dbKey)
          Set the dbKey.
 void setOverflowAttributes(java.util.Map map)
          Set the attributes stored in waveset.log.xml
 void setOverflowAttributesXML(java.lang.String xml)
           
 void setParameters(java.util.HashMap map)
           
 void setReasonDenied(java.lang.String reason)
           
 void setReasonDeniedKey(java.lang.String reason)
           
 void setResourceName(java.lang.String resource)
           
 void setRoleName(java.lang.String role)
           
 void setSequenceNumber(java.lang.Long sequenceNumber)
          Set the sequence number.
 void setServer(java.lang.String server)
           
 void setStatusDbKey(java.lang.String dbKey)
           
 void setSubjectName(java.lang.String subject)
           
 void setTimeStamp(long millis)
           
 void setTimeStamp(java.lang.String ts)
           
 
Methods inherited from class com.waveset.object.PersistentObject
addCommonElements, addEndTag, addMemberObjectGroup, addMemberObjectGroup, addPersistentAttributes, addStartTag, addSummaryAttributes, addXmlHeader, attributesMatch, attributesMatch, attributesMatch, checkReference, checkReferences, clearId, cloneAs, cloneObject, compareTo, create, create, create, create, createLastModItem, createLastModItem, createLastModItemList, directObjectGroupMember, dump, dumpFile, equals, fakeId, getAttribute, getAttributeValues, getAuthReferences, getAuthType, getBasicAttributes, getBasicAttributes, getBasicAttributes, getCache, getCounterValue, getCreateDate, getCreator, getDisplayableName, getDisplayName, getElementName, getEncryptedValues, getId, getIdOrName, getInitialInstances, getLastMod, getLastModDate, getLastModifier, getLastModItemId, getLockInfo, getMemberObjectGroupRefs, getMemberObjectGroupRefsUpTo, getMemberObjectGroups, getName, getNameOrId, getProperties, getProperty, getPropertyAsString, getPropertyList, getQueryableAttributes, getReference, getReferences, getRuleDrivenMemberObjectGroupRefs, getRuleDrivenMemberObjectGroupRefsUpTo, getRuleDrivenMemberObjectGroups, getSubtype, getSummaryAttributes, getSummaryString, hasEncryptedData, hashCode, identityEquals, isAlias, isHidden, isId, isProtected, isProtectedFromDelete, isReferencedIn, listQueryableReferenceAttributes, objectGroupMember, objectGroupMemberRef, parseCommonElement, parseCommonElements, parsePersistentAttributes, parseXml, parseXml, prepareForSerialization, prepareToSerialize, println, reEncrypt, reEncryptSubclassAttributes, removeMemberObjectGroup, removeProperty, resolve, resolve, resolve, resolveArray, resolveArrayByFetching, resolveObjectReference, resolveObjectReferences, resolveReference, resolveSummaryAttributes, resolveSummaryAttributes, ruleDrivenObjectGroupMemberRef, setAuthType, setAuthType, setCache, setCreateDate, setCreator, setDisplayName, setDisplayName, setHidden, setIsAlias, setLastMod, setLastMod, setLastModDate, setLastModifier, setMemberObjectGroupRef, setMemberObjectGroupRefs, setMemberObjectGroups, setName, setProperties, setProperty, setPropertyList, setProtected, setProtectedFromDelete, setRuleDrivenMembersCache, setSubtype, setTrace, toString, toXml, toXml, toXml, toXmlFile, visit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values
Constructor Detail

LogRecord

public LogRecord()

LogRecord

public LogRecord(org.w3c.dom.Element e)
          throws WavesetException

LogRecord

public LogRecord(java.util.Hashtable event)
          throws WavesetException
Constructor used by AuditEventHandler to convert AuditEvents over to a persistent object.

Method Detail

getObjectTypeDbKey

public java.lang.String getObjectTypeDbKey()
What type of object was affected? When the record is coming in, all we have is the name of the type, so use the Type class and/or cache to resolve the db key.


setObjectTypeDbKey

public void setObjectTypeDbKey(java.lang.String dbKey)
Set the dbKey. This will usually only be called from the Set( method when the repo is creating a new one of these objects from the database.


getActionDbKey

public java.lang.String getActionDbKey()
Action maps loosely to our com.waveset.authz.Right. What act was requested?


setActionDbKey

public void setActionDbKey(java.lang.String dbKey)

getStatusDbKey

public java.lang.String getStatusDbKey()
Did the action succeed?


setStatusDbKey

public void setStatusDbKey(java.lang.String dbKey)

getSubjectName

public java.lang.String getSubjectName()
Who acted?


setSubjectName

public void setSubjectName(java.lang.String subject)

getTimeStamp

public long getTimeStamp()
Gets the time at which this record was created. The value is returned as a long in milliseconds.


setTimeStamp

public void setTimeStamp(java.lang.String ts)
                  throws InvalidArgument
Throws:
InvalidArgument

setTimeStamp

public void setTimeStamp(long millis)

getFormattedTimeStamp

public java.lang.String getFormattedTimeStamp()

getCanonicalDateTime

public java.lang.String getCanonicalDateTime()
Returns:
string-formatted timestamp in GMT timezone so that an alphanumeric sort orders chronologically with sufficient precision to convert back to timestamp.

setCanonicalDateTime

public void setCanonicalDateTime(java.lang.String canonicalDateTime)

getObjectName

public java.lang.String getObjectName()
Which object was affected?


setObjectName

public void setObjectName(java.lang.String name)

getClient

public java.lang.String getClient()
How (i.e., by what interface) did the subject request the action?


setClient

public void setClient(java.lang.String client)

getServer

public java.lang.String getServer()

setServer

public void setServer(java.lang.String server)

setReasonDeniedKey

public void setReasonDeniedKey(java.lang.String reason)

setReasonDenied

public void setReasonDenied(java.lang.String reason)

getReasonKey

public java.lang.String getReasonKey()
Why was the requested action denied? Stored as a short code in the DB.


getReasonMessage

public java.lang.String getReasonMessage()
Get the message catalog key that is associated with the reason that this request failed.


getRoleName

public java.lang.String getRoleName()
Get the role which was associated with this record. If There was one... This will pick it out of an Event.


setRoleName

public void setRoleName(java.lang.String role)

getResourceName

public java.lang.String getResourceName()
Get the resource which was associated with this record. If applicable..


setResourceName

public void setResourceName(java.lang.String resource)

getAccountId

public java.lang.String getAccountId()
Get the resource which was associated with this record. If applicable..


setAccountId

public void setAccountId(java.lang.String accountId)

getMessage

public java.lang.String getMessage()
Get a raw string that is associated with this record. If applicable..


setMessage

public void setMessage(java.lang.String msg)

getAccountAttributesBlob

public java.lang.String getAccountAttributesBlob()
Accounts attribute blob. This is a string that contains ALL of the attributes which have changes in name=value format.


setAccountAttributesBlob

public void setAccountAttributesBlob(java.lang.String blob)

getAuditableAttributes

public java.util.Map getAuditableAttributes()
Get the attributes stored in the waveset.logattr table.


setAuditableAttributes

public void setAuditableAttributes(java.util.Map map)
Set the attributes stored in the waveset.logattr table.


getOverflowAttributes

public java.util.Map getOverflowAttributes()
Get the attributes stored in waveset.log.xml


getOverflowAttributesXML

public java.lang.String getOverflowAttributesXML()

setOverflowAttributesXML

public void setOverflowAttributesXML(java.lang.String xml)
                              throws WavesetException
Throws:
WavesetException

setOverflowAttributes

public void setOverflowAttributes(java.util.Map map)
Set the attributes stored in waveset.log.xml


getSequenceNumber

public java.lang.Long getSequenceNumber()
Get the sequence number. Used only for tamper resistant logs


getSequenceNumberAsString

public java.lang.String getSequenceNumberAsString()
Returns the sequence number as a string suitable for querying


setSequenceNumber

public void setSequenceNumber(java.lang.Long sequenceNumber)
Set the sequence number. Used only for tamper resistant logs


getParameters

public java.util.HashMap getParameters()
"Expansion slots": other things the reporter recorded. Name, Value map


setParameters

public void setParameters(java.util.HashMap map)

getParameterValue

public java.lang.String getParameterValue(java.lang.String name)

getOrderedParameterList

public java.util.List getOrderedParameterList()

setMemberObjectGroupRefs

public void setMemberObjectGroupRefs(java.util.ArrayList list)
                              throws WavesetException
Throws:
WavesetException

set

public void set(Attribute attr,
                java.lang.String attrVal)
         throws InvalidArgument,
                WavesetException
Used by the repository to stuff LOG_COLUMN_ATTRS into LogRecord.

Throws:
InvalidArgument
WavesetException

getType

public Type getType()
Description copied from class: PersistentObject
Return the type of this object. This must be implemented by each subclass.

Specified by:
getType in class PersistentObject

getEventDateTime

public java.lang.String getEventDateTime()

listSummaryAttributes

public java.util.List listSummaryAttributes()
Description copied from class: PersistentObject
Returns the complete list of defined attributes that this type of persistent object exposes as summary attributes (regardless of whether this particular object has a value for each).

Any subclass of PersistentObject that overrides this method should first invoke super.listSummaryAttributes() to ensure that the subclass includes summary attributes that are common to all PersistentObjects.

Any subclass that overrides this implementation must also consider the length of the summary string that will be generated from these attributes.

Overrides:
listSummaryAttributes in class PersistentObject
Returns:
the complete list of defined attributes that this type of persistent object exposes as summary attributes (regardless of whether this particular object has a value for each).

Any subclass of PersistentObject that overrides this method should first invoke super.listSummaryAttributes() to ensure that the subclass includes summary attributes that are common to all PersistentObjects.

See Also:
Constants.MAX_SUMMARY_STRING_LENGTH, PersistentObject.getSummaryString()

listQueryableAttributes

public java.util.List listQueryableAttributes()
Overrides:
listQueryableAttributes in class PersistentObject
Returns:
the complete list of defined attributes that this type of persistent object exposes as queryable attributes (regardless of whether this particular object has a value for each).

Any subclass of PersistentObject that overrides this method should first invoke super.listQueryableAttributes() to ensure that the subclass includes queryable attributes that are common to all PersistentObjects.


listOperationalAttributes

public void listOperationalAttributes(java.util.List attrs)
Add to the specified list the "built-in" attributes that are queryable just because the IDM Repository needs them in order to operate.

Overrides PersistentObject because Type.LOG is special.

Overrides:
listOperationalAttributes in class PersistentObject

getAttributeValues

protected WSAttribute getAttributeValues(java.lang.String attrName)
Overrides:
getAttributeValues in class PersistentObject
Parameters:
attrName - - the (name of the) attribute for which to return values.
Returns:
a WSAttribute that represents the value (or values) that this object contains for the specified attribute.


getHashedText

public java.lang.String getHashedText()
                               throws WavesetException
Returns the blob of text which is to be hashed for log record signing The format of this is not guaranteed to make sense. It must contain significant data to verify the integrity of the log record.

Throws:
WavesetException

addSubclassAttributes

protected void addSubclassAttributes(java.lang.StringBuffer b)
Description copied from class: PersistentObject
Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist). PersistentObject's default implementation is a no-op.

NOTE: Any subclass that overrides this method must similarly override parseSubclassAttributes() so that the subclass attributes are restored.

Overrides:
addSubclassAttributes in class PersistentObject
See Also:


addSubclassElements

protected void addSubclassElements(java.lang.StringBuffer b)
Description copied from class: PersistentObject
Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist). PersistentObject's default implementation is a no-op.

NOTE: Any subclass that overrides this method must similarly override parseSubclassElements() so that the subclass elements are restored.

Overrides:
addSubclassElements in class PersistentObject
See Also:


parseSubclassAttributes

protected void parseSubclassAttributes(org.w3c.dom.Element e)
                                throws WavesetException
Description copied from class: PersistentObject
Each concrete subclass should parse from the XML buffer any persisted subclass-specific fields (generally, the same ones that it writes into the buffer).

Overrides:
parseSubclassAttributes in class PersistentObject
Throws:
WavesetException
See Also:

PersistentObject's default implementation is a no-op.

, PersistentObject.parseXml(Element)

parseSubclassElements

protected void parseSubclassElements(org.w3c.dom.Element e)
                              throws WavesetException
Description copied from class: PersistentObject
Each concrete subclass should parse from the XML buffer any persisted subclass-specific elements (generally, the same ones that it writes into the buffer).

Overrides:
parseSubclassElements in class PersistentObject
Throws:
WavesetException
See Also:

PersistentObject's default implementation is a no-op.

, PersistentObject.parseXml(Element)