public final class AuditEvent extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static int |
POST_AS_FAILURE
Enumerated value indicating that the AuditEvent should be posted
as a failure.
|
static int |
POST_NONE
Enumerated value indicating that the AuditEvent should not be posted
as a RawAuditEvent; only used for direct dispatch.
|
static int |
POST_NORMALLY
Enumerated value indicating that the AuditEvent should be posted
with "normal" semantics, meaning that it should be recorded as
a success if the transaction is committed, and a failure otherwise.
|
static int |
POST_ONLY_ON_FAILURE
Enumerated value indicating that the AuditEvent should be posted
as a failure if the transaction fails, and not at all otherwise.
|
static int |
POST_ONLY_ON_SUCCESS
Enumerated value indicating that the AuditEvent should be posted
as a success if the transaction succeeds, and not at all otherwise.
|
Constructor and Description |
---|
AuditEvent()
Constructs an AuditEvent.
|
AuditEvent(String opTypeKey,
LibraryObjectInterface target,
LibraryObjectInterface domain,
LibraryObjectInterface[] auxObjects,
AttributeValue[] properties)
Constructs an AuditEvent in preparation for saving into the repository.
|
AuditEvent(String opTypeKey,
LibraryObjectInterface target,
LibraryObjectInterface domain,
LibraryObjectInterface[] auxObjects,
String auxString,
Long auxNumber,
AttributeValue[] properties)
Constructs an AuditEvent in preparation for saving into the repository.
|
Modifier and Type | Method and Description |
---|---|
String |
getApplicationContext()
Gets the Application context (if any) for the event.
|
long |
getApplicationContextReference()
Gets the Application context reference (if any) for the event.
|
long |
getApplicationSessionId()
Gets the identifier of the application session context (if any)
which performed the operation that resulted in creating this event.
|
String |
getApplicationUser()
Gets the Application User (if any) for the event.
|
long |
getApplicationUserReference()
Gets the Application User reference (if any) for the event.
|
long |
getAuditSpecificationId()
Gets the ID of the AuditSpecification for which this event
is associated.
|
long[] |
getAuxiliaryClassIds()
Gets the IDs of the auxiliary object's class associated with this event.
|
Long |
getAuxiliaryNumber()
Gets the auxiliary number (if any) for the event.
|
long[] |
getAuxiliaryObjectIds()
Gets the IDs of the auxiliary objects associated with this event.
|
String |
getAuxiliaryString()
Gets the auxiliary String (if any) for the event.
|
long |
getAuxiliaryStringReference()
Gets the auxiliary String reference (if any) for the event.
|
Date |
getCreateDate()
Gets the date the event was created.
|
long |
getCreatorId()
Gets the ID of the user whose operation resulted in creating this event.
|
long |
getDomainId()
Gets the ID of the Domain for which this event
is associated.
|
long |
getFolderContextId()
Gets the ID of the folder context for this event.
|
AttributeValue |
getFolderContextValue()
Returns the folder context established for this event during
pre-insert processing.
|
long |
getId()
Gets the audit event identifier.
|
int |
getOperationType()
Gets the numeric representation of the Audit Operation type for the event.
|
String |
getOperationTypeKey()
Gets the String key representing the Audit Operation type
for the event.
|
AttributeValue[] |
getProperties()
Gets the properties associated with this event.
|
AttributeValue[] |
getProperties(AuditExecutor executor)
Gets the properties associated with this event.
|
long |
getPropertyId()
Gets the ID that defines the properties (if any) for the
event.
|
long |
getSessionId()
Gets the identifier of the LibrarySession which performed the
operation that resulted in creating this event.
|
long |
getSessionUserId()
The ID of the actual session user that created the event.
|
Long |
getTargetObjectClassId()
Gets the Class ID of the target object for which this event
is associated.
|
long |
getTargetObjectClassIdValue()
Gets the numeric value of the Class ID of the target object for which
this event is associated.
|
Long |
getTargetObjectId()
Gets the ID of the target object for which this event
is associated.
|
long |
getTargetObjectIdValue()
Gets the numeric value of the ID of the target object for which this event
is associated.
|
boolean |
isCustomEvent()
Returns indication as to whether the event referenced is for a custom
operation type.
|
boolean |
isOperationSuccessful()
Returns indication as to whether the operation sttempted which resulted
in the creation of this event actually succeeded.
|
void |
setFolderContextValue(AttributeValue context)
Sets the folder context established for this event during
pre-insert processing.
|
void |
setPersistentData(AuditExecutor executor,
long id,
long auditSpecId,
int opType,
Date createDate,
long creatorId,
long sessionUserId,
long sessionId,
long appSessionId,
boolean opSuccess,
long propId,
long domainId,
String opTypeKey,
long targetId,
long targetClassId,
long folderContextId,
long[] auxIds,
long[] auxClassIds,
long appUserRef,
String appUser,
long appContextRef,
String appContext,
long auxStringRef,
String auxString,
Long auxNumber)
Sets the persistent information regarding the event.
|
void |
setProperties(AuditExecutor executor,
AttributeValue[] properties)
Sets the properties associated with this event.
|
public static final int POST_NONE
Has the numeric value of 0.
public static final int POST_NORMALLY
Has the numeric value of 1.
public static final int POST_ONLY_ON_FAILURE
Has the numeric value of 2.
public static final int POST_ONLY_ON_SUCCESS
Has the numeric value of 3.
public static final int POST_AS_FAILURE
Has the numeric value of 4.
public AuditEvent()
public AuditEvent(String opTypeKey, LibraryObjectInterface target, LibraryObjectInterface domain, LibraryObjectInterface[] auxObjects, AttributeValue[] properties) throws IfsException
A maximum of 3 auxiliary objects can be specified. Additional auxiliary objects are ignored.
Delegates to the 7-arg variant, using null for the auxiliary string and auxiliary number.
opTypeKey
- the operation type keytarget
- the target objectdomain
- the domain context for the target objectauxObjects
- the auxiliary objectsproperties
- the event propertiesIfsException
public AuditEvent(String opTypeKey, LibraryObjectInterface target, LibraryObjectInterface domain, LibraryObjectInterface[] auxObjects, String auxString, Long auxNumber, AttributeValue[] properties) throws IfsException
A maximum of 3 auxiliary objects can be specified. Additional auxiliary objects are ignored.
opTypeKey
- the operation type keytarget
- the target objectdomain
- the domain context for the target objectauxObjects
- the auxiliary objectsauxString
- the auxiliary stringauxNumber
- the auxiliary numberproperties
- the event propertiesIfsException
public long getId()
Returns 0 for an event that is not persistent.
public long getAuditSpecificationId()
Returns 0 for an event that is not persistent.
public long getDomainId()
public int getOperationType()
Returns 0 for an event that is not persistent.
public String getOperationTypeKey()
public Date getCreateDate()
Returns null for an event that is not persistent.
public long getCreatorId()
Returns 0 for an event that is not persistent.
public long getSessionUserId()
Can be different from the creator ID if the sesison uses impersonation or other kind of "switch into admin mode" paradigm.
public long getSessionId()
Returns 0 for an event that is not persistent.
public long getApplicationSessionId()
Returns 0 for an event that is not persistent. Also returns 0 if the operation was performed without any special application context.
public boolean isOperationSuccessful()
Returns false for an event that is not persistent.
public Long getTargetObjectId()
Will return a Long with the value of zero for an event with no target.
public long getTargetObjectIdValue()
public Long getTargetObjectClassId()
public long getTargetObjectClassIdValue()
public long[] getAuxiliaryObjectIds()
public long[] getAuxiliaryClassIds()
public long getApplicationUserReference()
public String getApplicationUser()
public long getApplicationContextReference()
public String getApplicationContext()
public long getAuxiliaryStringReference()
public String getAuxiliaryString()
public Long getAuxiliaryNumber()
public long getPropertyId()
public long getFolderContextId()
Returns zero if the folder context is the Domain.
public AttributeValue[] getProperties()
public AttributeValue[] getProperties(AuditExecutor executor)
Avoids cloning if a valid AuditExecutor is specified.
executor
- the executor constructing this event;
must not be nullpublic boolean isCustomEvent()
public AttributeValue getFolderContextValue()
This can return null, in which case the folder context should be established and saved back onto this instance.
public void setPersistentData(AuditExecutor executor, long id, long auditSpecId, int opType, Date createDate, long creatorId, long sessionUserId, long sessionId, long appSessionId, boolean opSuccess, long propId, long domainId, String opTypeKey, long targetId, long targetClassId, long folderContextId, long[] auxIds, long[] auxClassIds, long appUserRef, String appUser, long appContextRef, String appContext, long auxStringRef, String auxString, Long auxNumber)
This is called as part of constructing an event that is already persistent.
executor
- the executor constructing this event;
must not be nullid
- the event idauditSpecId
- the AuditSpecification idopType
- the numeric operation typecreateDate
- the date the event was createdcreatorId
- the user that created the eventsessionUserId
- the ID of actual session user; can be different
if the sesison uses impersonation or other
kind of "switch into admin mode" paradigmsessionId
- the session ID that created the eventappSessionId
- the application session ID that created the eventopSuccess
- whether the operation was successfulpropId
- the ID for any event propertiesdomainId
- the Domain IDopTypeKey
- the operation type keytargetId
- the Target object IDtargetClassId
- the Target object's Class IDfolderContextId
- the Folder context for the target objectauxIds
- the auxiliary object IDsauxClassIds
- the auxiliary class IDsappUserRef
- the Application user string referenceappUser
- the Application user stringappContextRef
- the Application context string referenceappContext
- the Application context stringauxStringRef
- the auxiliary string referenceauxString
- the auxiliary stringauxNumber
- the auxiliary numberpublic void setProperties(AuditExecutor executor, AttributeValue[] properties)
This variant does not clone the specified properties, as they are provided by the trusted AuditExecutor.
executor
- the executor constructing this event;
must not be nullproperties
- the event propertiespublic void setFolderContextValue(AttributeValue context)
The value specified can be null, which forces the server-side code to compute the folder context, or it can represent a null value, which indicates that the domain should be used as the folder context.
context
- the folder context valueCopyright © 2023. All rights reserved.