org.processmining.framework.log.rfb
Class AuditTrailEntryImpl

java.lang.Object
  extended by org.processmining.framework.log.LogEntity
      extended by org.processmining.framework.log.AuditTrailEntry
          extended by org.processmining.framework.log.rfb.AuditTrailEntryImpl

public class AuditTrailEntryImpl
extends AuditTrailEntry

This class implements an audit trail entry.

Author:
Christian W. Guenther (christian at deckfour dot org)

Field Summary
protected  java.util.Map<java.lang.String,java.lang.String> attributes
           
protected  java.lang.String element
           
protected  java.lang.String eventType
           
protected  long instanceNumber
           
protected static long instanceNumberCounter
           
protected  java.lang.String originator
           
protected  java.util.Date timestamp
           
 
Constructor Summary
AuditTrailEntryImpl()
          creates a new audit trail entry with initialized data hashtable
AuditTrailEntryImpl(AuditTrailEntry toBeCloned)
          clones the parameter object
AuditTrailEntryImpl(java.util.Map<java.lang.String,java.lang.String> aAttributes, java.lang.String aWFMElement, java.lang.String anEventType, java.util.Date aTimestamp, java.lang.String anOriginator)
          Internal constructor.
AuditTrailEntryImpl(java.util.Map<java.lang.String,java.lang.String> aAttributes, java.lang.String aWFMElement, java.lang.String anEventType, java.util.Date aTimestamp, java.lang.String anOriginator, long anID)
          Internal constructor.
 
Method Summary
 java.lang.Object clone()
          overriding Object's 'clone' method
 int compareTo(java.lang.Object arg0)
          implements the 'Comparable' interface
 boolean equals(java.lang.Object arg0)
          implements the 'Comparable' interface
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
          Returns the meta-data, as map of key-value pairs, associated to this entity.
 java.lang.String getDescription()
          Returns the description of this entity.
 java.lang.String getName()
          Returns the name of this entity.
 java.lang.String getOriginator()
          Returns the originator, i.e.
 java.util.Date getTimestamp()
          Returns the exact date and time, at which this event has occurred.
 java.lang.String getType()
          Retrieves the type of this event
 int hashCode()
          Overridden to produce the same hash code for equal objects.
 long id()
          Retrieves the log-wide unique ID of this event
protected static long nextInstanceNumber()
           
 void removeAttribute(java.lang.String key)
          Removes the attribute with the given key from the set of attributes of this entity.
 void setAttribute(java.lang.String key, java.lang.String value)
          Sets an attribute of this entity as a key-value pair.
 void setAttributes(java.util.Map<java.lang.String,java.lang.String> data)
          Sets the set of attributes, given as key-value pairs, for this entity.
 void setDescription(java.lang.String description)
          Sets the description of this entity
 void setName(java.lang.String name)
          Sets the name, or ID, of this entity
 void setOriginator(java.lang.String originator)
          Sets the name or identifier of the organizational entity which has triggered the occurrence of this event.
Notice: Implementations of this interface may support modification of instances to varying degrees.
 void setTimestamp(java.util.Date aDate)
          set timestamp using a Date object
 void setTimestamp(long aDateInMilliseconds)
          set the timestamp using a date in milliseconds UN*X time
 void setTimestamp(java.sql.Timestamp timestamp)
           
 void setType(java.lang.String type)
          Sets this event's type
 java.lang.String toString()
          Returns a string representation of this entity.
 
Methods inherited from class org.processmining.framework.log.AuditTrailEntry
addDataAttribute, getData, getElement, setData, setElement
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

element

protected java.lang.String element

eventType

protected java.lang.String eventType

timestamp

protected java.util.Date timestamp

originator

protected java.lang.String originator

attributes

protected java.util.Map<java.lang.String,java.lang.String> attributes

instanceNumber

protected long instanceNumber

instanceNumberCounter

protected static long instanceNumberCounter
Constructor Detail

AuditTrailEntryImpl

public AuditTrailEntryImpl()
creates a new audit trail entry with initialized data hashtable


AuditTrailEntryImpl

public AuditTrailEntryImpl(java.util.Map<java.lang.String,java.lang.String> aAttributes,
                           java.lang.String aWFMElement,
                           java.lang.String anEventType,
                           java.util.Date aTimestamp,
                           java.lang.String anOriginator)
Internal constructor. Should only be used within parts of the framework whose core responsibility is managing and reading / writing logs!

Parameters:
aAttributes - hash table containing data attributes (may be null)
aWFMElement - workflow model element
anEventType - event type
anUnknownType - unknown event type (null or empty string if well-known)
aTimestamp - timestamp of audit trail entry (may be null)
anOriginator - originator string (may be null)

AuditTrailEntryImpl

public AuditTrailEntryImpl(java.util.Map<java.lang.String,java.lang.String> aAttributes,
                           java.lang.String aWFMElement,
                           java.lang.String anEventType,
                           java.util.Date aTimestamp,
                           java.lang.String anOriginator,
                           long anID)
Internal constructor. Should only be used within parts of the framework whose core responsibility is managing and reading / writing logs!

Parameters:
aAttributes - hash table containing data attributes (may be null)
aWFMElement - workflow model element
anEventType - event type
anUnknownType - unknown event type (null or empty string if well-known)
aTimestamp - timestamp of audit trail entry (may be null)
anOriginator - originator string (may be null)
anID - ID of the audit trail entry.

Warning: Only use this constructor if you wish to reconstruct a properly saved ATE, otherwise you're up for serious identity crisis!


AuditTrailEntryImpl

public AuditTrailEntryImpl(AuditTrailEntry toBeCloned)
clones the parameter object

Parameters:
toBeCloned -
Method Detail

nextInstanceNumber

protected static long nextInstanceNumber()

clone

public java.lang.Object clone()
overriding Object's 'clone' method

Specified by:
clone in class AuditTrailEntry
Returns:
Object The cloned object.

getType

public java.lang.String getType()
Retrieves the type of this event

Specified by:
getType in class AuditTrailEntry
Returns:
String

id

public long id()
Retrieves the log-wide unique ID of this event

Specified by:
id in class AuditTrailEntry
Returns:

setType

public void setType(java.lang.String type)
Sets this event's type

Specified by:
setType in class AuditTrailEntry
Parameters:
type - String identifier of the event type to set.

getOriginator

public java.lang.String getOriginator()
Description copied from class: AuditTrailEntry
Returns the originator, i.e. the name or identifier of the entity which has triggered the occurrence of the described event.

Specified by:
getOriginator in class AuditTrailEntry
Returns:
Returns the originator.

setOriginator

public void setOriginator(java.lang.String originator)
Description copied from class: AuditTrailEntry
Sets the name or identifier of the organizational entity which has triggered the occurrence of this event.
Notice: Implementations of this interface may support modification of instances to varying degrees. It is suggested that you test the modification support of the underlying implementation by use of the isMutable() method.

Specified by:
setOriginator in class AuditTrailEntry
Parameters:
originator - The originator to set.

getTimestamp

public java.util.Date getTimestamp()
Description copied from class: AuditTrailEntry
Returns the exact date and time, at which this event has occurred. Notice that this is an optional attribute, thus null may be returned.

Specified by:
getTimestamp in class AuditTrailEntry
Returns:
Returns the timestamp.

setTimestamp

public void setTimestamp(java.sql.Timestamp timestamp)
Parameters:
timestamp - The timestamp to set.

setTimestamp

public void setTimestamp(java.util.Date aDate)
set timestamp using a Date object

Specified by:
setTimestamp in class AuditTrailEntry
Parameters:
aDate -

setTimestamp

public void setTimestamp(long aDateInMilliseconds)
set the timestamp using a date in milliseconds UN*X time

Parameters:
aDateInMilliseconds -

compareTo

public int compareTo(java.lang.Object arg0)
implements the 'Comparable' interface


equals

public boolean equals(java.lang.Object arg0)
implements the 'Comparable' interface

Specified by:
equals in class AuditTrailEntry
Parameters:
arg0 - Object The AuditTrailEntry to be compared with.
Returns:
boolean True if all attributes are equal, false otherwise.

hashCode

public int hashCode()
Description copied from class: AuditTrailEntry
Overridden to produce the same hash code for equal objects.

Specified by:
hashCode in class AuditTrailEntry
Returns:
int The hash code calculated.

toString

public java.lang.String toString()
Description copied from class: LogEntity
Returns a string representation of this entity.

Specified by:
toString in class LogEntity

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Description copied from class: LogEntity
Returns the meta-data, as map of key-value pairs, associated to this entity.

Specified by:
getAttributes in class LogEntity
Returns:

getDescription

public java.lang.String getDescription()
Description copied from class: LogEntity
Returns the description of this entity.

Specified by:
getDescription in class LogEntity
Returns:

getName

public java.lang.String getName()
Description copied from class: LogEntity
Returns the name of this entity.

Specified by:
getName in class LogEntity
Returns:

removeAttribute

public void removeAttribute(java.lang.String key)
Description copied from class: LogEntity
Removes the attribute with the given key from the set of attributes of this entity.

Specified by:
removeAttribute in class LogEntity

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.String value)
Description copied from class: LogEntity
Sets an attribute of this entity as a key-value pair. If a previous mapping for the given key exists, it will be removed. Otherwise a new mapping will be added.

Specified by:
setAttribute in class LogEntity

setAttributes

public void setAttributes(java.util.Map<java.lang.String,java.lang.String> data)
Description copied from class: LogEntity
Sets the set of attributes, given as key-value pairs, for this entity. Replaces the previously contained set of attributes.

Specified by:
setAttributes in class LogEntity

setDescription

public void setDescription(java.lang.String description)
Description copied from class: LogEntity
Sets the description of this entity

Specified by:
setDescription in class LogEntity

setName

public void setName(java.lang.String name)
Description copied from class: LogEntity
Sets the name, or ID, of this entity

Specified by:
setName in class LogEntity