public class AuditExecutor extends Object
This class is used in a single-threaded manner by S_LibrarySession.
Modifier and Type | Class and Description |
---|---|
class |
AuditExecutor.PreparedAuditFolderPath
A PreparedAuditFolderPath holds the folder path information that is
used during event dispatch.
|
class |
AuditExecutor.PreparedRawAuditEvent
A PreparedRawAuditEvent holds an AuditEvent and additional information
used to post a raw Audit event.
|
Modifier and Type | Field and Description |
---|---|
static String |
AUDIT_CERTIFICATE_TABLE_NAME
The name of the audit certificate table.
|
static String |
AUDIT_CUSTOM_OPCODE_TABLE_NAME
The name of the custom audit operaton code table.
|
protected static String |
AUDIT_EVENT_COLUMNS
The SQL column list for audit events.
|
static String |
AUDIT_EVENT_INLINE_STRING_TABLE_NAME
The name of the audit event inline String table.
|
protected static String |
AUDIT_EVENT_INSERT_VALUES
The SQL bind list for audit events.
|
static String |
AUDIT_EVENT_PROPERTY_TABLE_NAME
The name of the audit event property (auxilliary info) table.
|
static String |
AUDIT_EVENT_PROPERTY_TABLE_PREFIX
The prefix to use for custom audit event property tables.
|
static String |
AUDIT_EVENT_TABLE_NAME
The name of the audit event table.
|
static String |
AUDIT_EVENT_TABLE_PREFIX
The prefix to use for custom audit event tables.
|
static String |
AUDIT_EVENT_UNIONED_PROPERTY_VIEW
The name of the view that provides a unioned view across all audit event
tables (including raw) of the active property IDs.
|
static String |
AUDIT_EVENT_VIEW_NAME
The name of the default audit event view used for searches.
|
static String |
AUDIT_EVENT_VIEW_PREFIX
The prefix to use for custom audit event views (used by search).
|
protected static String |
AUDIT_FOLDER_PATH_COLUMNS
The SQL column list for the audit folder path table.
|
protected static int |
AUDIT_FOLDER_PATH_ENTRY_LIMIT
The limit of the number of items that are stored in the base table
for an AuditFolderPath.
|
protected static String |
AUDIT_FOLDER_PATH_INSERT_VALUES
The SQL bind list for the audit folder path table.
|
static String |
AUDIT_FOLDER_PATH_OVERFLOW_TABLE_NAME
The name of the overflow audit folder path table.
|
static String |
AUDIT_FOLDER_PATH_TABLE_NAME
The name of the main audit folder path table.
|
static String |
AUDIT_NEXT_CUSTOM_OPCODE_TABLE_NAME
The name of the table that holds the next custom audit operaton code.
|
static String |
AUDIT_OPTYPE_TABLE_NAME
The name of the audit operaton type table.
|
static String |
AUDIT_TARGET_CODE_VIEW_NAME
The name of the audit target code view.
|
protected static String |
COMMON_AUDIT_EVENT_COLUMNS
The SQL column list for columns common to both raw and dispatched
audit events.
|
protected static String |
COMMON_AUDIT_EVENT_INSERT_VALUES
The SQL bind list for columns common to both raw and dispatched
audit events.
|
protected static String |
CREATED_OPERATIONTYPE_MARKER
The string marker used to indicate that a registered operation type
represents an operation that creates a new object.
|
protected static long |
DEFAULT_AUDIT_FOLDER_PATH_EXPIRATION_PERIOD
The default expiration period (in milliseconds)
for an AuditFolderPath.
|
protected static String |
FREED_OPERATIONTYPE_MARKER
The string marker used to indicate that a registered operation type
represents an operation that frees an existing object.
|
protected static int |
JDBC_BATCH_SIZE_THRESHHOLD
The maximum number of SQL Statement executed in one batch when using
JDBC batching.
|
static int |
MINIMUM_CUSTOM_OPERATION_CODE
The lowest custom operation code; defined in odmmain.sql as the initial
value in table ODMZA_NEXTCUSTOMOPCODE.
|
static int |
OPERATION_TYPE_OFFSET
The offset of the operation code within an operation type.
|
protected static String |
RAW_AUDIT_EVENT_COLUMNS
The SQL column list for RAW audit events.
|
protected static String |
RAW_AUDIT_EVENT_INSERT_VALUES
The SQL bind list for RAW audit events.
|
static String |
RAW_AUDIT_EVENT_TABLE_NAME
The name of the audit event table.
|
Modifier | Constructor and Description |
---|---|
protected |
AuditExecutor()
Constructs an AuditExecutor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyAuditCertificateName(S_LibrarySession session,
AuditCertificate cert)
Apply current name of the target object referenced in an AuditCertificate.
|
protected int |
calculateOperationCode(int opType)
Calculate a numeric Operation code from a specified operation type.
|
protected int |
calculateOperationType(int targetCode,
int opCode)
Calculate a numeric Operation type from a target code and
operation code.
|
protected AttributeValue |
convertListToAttributeValue(List list,
int dataType)
Convert the specified list to an AttributeValue that encapsulates
an array of the corresponding type.
|
protected long |
createInlineString(S_LibrarySession session,
LibraryConnection lconn,
Connection conn,
String inlineString)
Create a new inline String reference.
|
protected void |
deleteCertificate(S_LibrarySession session,
long targetId)
Delete a certificate.
|
protected void |
deleteExpiredAuditFolderPaths(S_LibrarySession session,
long expPeriod)
Delete any expired Audit folder paths, that have expired
longer than the specified period.
|
protected void |
deleteExpiredGlobalAuditEvents(S_LibrarySession session,
Long domainId,
Long specId,
Long expPeriod)
Deletes expired audit events from global audit history.
|
protected void |
deleteUnusedAuditFolderPathOverflowEntries(S_LibrarySession session)
Delete any unused overflow entries for Audit folder paths.
|
protected void |
deleteUnusedAuditProperties(S_LibrarySession session)
Delete any unreferenced Audit event properties.
|
protected Long |
directlyDispatchAuditEvent(S_LibrarySession session,
AuditEvent event,
Long specId)
Directly dispatch an AuditEvent to the specified AuditSpecifcation's
event history.
|
protected Long |
extractObjectId(LibraryObjectInterface obj)
Extract ID from an object, which could be null.
|
protected Object |
extractValueFromResultSet(ResultSet rset,
int position,
int datatype)
Gets the selected value of the specified type.
|
protected String |
findInlineString(S_LibrarySession session,
LibraryConnection lconn,
Connection conn,
long stringRef)
Find inline String by inline String reference.
|
protected long |
findInlineStringReference(S_LibrarySession session,
LibraryConnection lconn,
Connection conn,
String inlineString)
Find inline String reference (sequence) by String value.
|
protected AuditCertificate |
findOrSelectAuditCertificate(S_LibrarySession session,
LibraryConnection lconn,
Connection conn,
Long objectId)
Find or select AuditCertificate for the specified object ID.
|
AuditCertificate[] |
getAuditCertificates(S_LibrarySession session,
Long[] objectIds)
Select AuditCertificates for the specified object IDs.
|
protected int |
getAuditColumnDatatype(String columnName)
Get the data type that matches the specified audit event
column name.
|
protected S_Folder |
getAuditEventFolderContext(S_LibrarySession session,
Long targetId,
Long targetClassId)
Gets the folder context for the target of an Audit Event.
|
protected long |
getAuditFolderPathExpirationPeriod(S_LibrarySession session)
Get the expiration period to use for newly created AuditFolderPaths.
|
protected AuditTargetCode |
getAuditTargetCode(S_LibrarySession session,
String className)
Looks up an audit target code structure from the specified Class name or
other registered alias for the desired type.
|
protected AttributeValue[] |
getAuditTypesForClass(S_LibrarySession session,
String className,
boolean includeNested)
Gets the audit operation type values for a specified
class name, optionally including any types that are
applicable to a class that is considered a descendent of the
specified class.
|
protected AttributeValue[] |
getAuditTypesForCreateOperations(S_LibrarySession session)
Gets the audit operation type values that correspond to "CREATED"
operations.
|
protected AttributeValue[] |
getAuditTypesForFreeOperations(S_LibrarySession session)
Gets the audit operation type values that correspond to "FREE" operations.
|
protected AttributeValue[] |
getAuditTypesWithOperationMarker(S_LibrarySession session,
String marker)
Gets the audit operation type values that have a created or freed marker.
|
protected long |
getCurrentAuditSequenceId(S_LibrarySession session)
Gets the current Audit sequence, established via a previous call
to "nextval" on the sequence.
|
protected long |
getCurrentAuditSequenceId(S_LibrarySession session,
LibraryConnection lconn,
Connection conn)
Gets the current Audit sequence, established via a previous call
to "nextval" on the sequence.
|
protected AttributeValue[] |
getCustomAuditTypes(S_LibrarySession session)
Gets the custom audit operation type values.
|
protected long |
getNextAuditId(S_LibrarySession session)
Gets the next available audit id value.
|
protected long |
getNextAuditId(S_LibrarySession session,
LibraryConnection lconn,
Connection conn)
Gets the next available audit id value.
|
protected int |
getOperationType(S_LibrarySession session,
String opTypeKey)
Get the numeric Operation type given an operation type key.
|
protected String |
getOperationTypeKey(S_LibrarySession session,
int opType)
Get the Operation type key given an operation type.
|
protected String |
getSelectAggregateString(Long auditSpec,
String viewName,
String[] selColumnNames,
String[] columnNames,
String[] innerColNames,
String filterClause,
String sortClause)
Gets the SQL string for selecting the list of distinct values
along with an optional aggregate function.
|
protected String |
getSelectString(Long auditSpec,
String viewName,
String filterClause,
String sortClause,
int maxItems)
Get the SQL select statement for an audit event search.
|
protected String |
getSelectUnusedAuditTypeListsSql()
Gets the SQL to select unused Audit lists.
|
protected void |
handleAuditEventDispatchRequests(S_LibrarySession session,
ArrayList reqList,
String tableName)
Handle a list of AuditEvent dispatch requests.
|
protected void |
insertCertificate(S_LibrarySession session,
long targetId,
long targetClassId,
boolean freed,
long createTime,
long creatorId,
long domainId,
boolean secured,
long freeTime,
long deletorId,
long tombstoneId,
S_LibraryObject target,
String targetName,
String targetClassName)
Insert an audit certificate.
|
protected void |
insertCreateCertificate(S_LibrarySession session,
long targetId,
long targetClassId,
long createTime,
long creatorId,
long domainId)
Insert a certificate for an object being created.
|
protected void |
insertFreeCertificate(S_LibrarySession session,
long targetId,
long targetClassId,
long freeTime,
long deletorId,
long domainId)
Insert a certificate for an object being freed.
|
protected void |
invalidateAuditTypeMaps()
Invalidate the audit type maps cached in this session.
|
protected boolean |
isCreateOperation(S_LibrarySession session,
int opType)
Returns true if the specified operation type reflects an object being
created.
|
protected boolean |
isFreeOperation(S_LibrarySession session,
int opType)
Returns true if the specified operation type reflects an object being
freed.
|
protected String |
lookupAuditEventOperationTypeKey(S_LibrarySession session,
int opType)
Looks up audit event operation type key by its numeric value,
returning the string key.
|
protected String[] |
lookupAuditEventOperationTypeKeys(S_LibrarySession session,
int[] opTypes)
Looks up audit event operation type keys by their numeric values,
returning the string keys.
|
protected int[] |
lookupAuditEventOperationTypes(S_LibrarySession session,
String[] opTypeKeys)
Looks up audit event operation types by their string key,
returning the corresponding numeric equivalents.
|
protected AuditTargetCode |
lookupAuditTargetCode(S_LibrarySession session,
String className)
Looks up an audit target code structure from the specified Class name or
other registered alias for the desired type.
|
protected void |
postAuditCertificateChange(S_LibrarySession session,
S_LibraryObject target)
Post an event that will invalidate any caching of audit certificate
information for the specified object.
|
protected void |
postAuditEvent(S_LibrarySession session,
AuditEvent event,
int postMode)
Create an audit event.
|
protected void |
postAuditEventsUponCommit(S_LibrarySession session,
LibraryConnection lconn,
Connection conn,
List rawEventList)
Create audit events as a result of a normal completeTransaction
occurring.
|
protected void |
postAuditTypeMapInvalidation(S_LibrarySession session)
Post an event that will invalidate the audit type maps cached in
all sessions in all services.
|
protected void |
postFailedAuditEventsUponRollback(S_LibrarySession session,
LibraryConnection lconn,
Connection conn,
List rawEventList)
Create audit events as a result of a rollback operation occurring.
|
protected int |
registerAuditEventOperationType(S_LibrarySession session,
String opTypeKey,
int targetCode,
String targetClass,
int opCode,
Boolean createOrFree)
Register new operation type key.
|
protected int |
registerCustomAuditEventOperationCodeKey(S_LibrarySession session,
String opCodeKey)
Register new custom operation code key.
|
protected void |
removeAuditEvents(S_LibrarySession session,
long[] ids,
String tableName)
Remove audit events.
|
protected void |
removeAuditEventsForTarget(S_LibrarySession session,
Long specId,
Long targetId)
Free audit events from a specific Audit history, by target ID.
|
protected void |
removeRawAuditEvents(S_LibrarySession session,
RawAuditEvent[] rawEvents)
Remove raw audit events.
|
AttributeValue[] |
selectAggregateAuditEventColumns(S_LibrarySession session,
Long auditSpec,
String aggFunction,
String[] columnNames,
String[] innerColNames,
String filterClause,
String sortClause)
Returns the list of distinct values of the specified AuditEvent columns,
along with an optional aggregate function.
|
protected AuditCertificate |
selectAuditCertificate(S_LibrarySession session,
LibraryConnection lconn,
Connection conn,
Long objectId)
Select AuditCertificate for the specified object ID.
|
protected AuditEvent[] |
selectAuditEvents(S_LibrarySession session,
Long auditSpec,
String filterClause,
AttributeValue[] bindValues,
String sortClause,
int maxItems)
Select audit events.
|
protected AttributeValue[] |
selectAuditProperties(S_LibrarySession session,
LibraryConnection lconn,
Connection conn,
long propId,
String propTblName)
Select all the properties stored for the specified property ID.
|
protected AuditFolderPath |
selectLatestAuditFolderPath(S_LibrarySession session,
Long folderId)
Select the latest AuditFolderPath for a folder.
|
protected RawAuditEvent[] |
selectRawAuditEvents(S_LibrarySession session,
String filterClause,
int maxItems)
Select raw audit events.
|
protected AuditFolderPath |
selectSpecificAuditFolderPath(S_LibrarySession session,
long folderPathId)
Select the specific AuditFolderPath for a given primary key.
|
protected ArrayList |
selectUnusedAuditTypeLists(S_LibrarySession session,
long expPeriod)
Returns an ArrayList filled with ids of AuditTypeList objects that are
ready for freeing.
|
protected void |
setLongInStatement(PreparedStatement stmt,
boolean isNull,
int position,
long value)
Set a long value into a PreparedStatement, handling nulls.
|
protected void |
setStringInStatement(PreparedStatement stmt,
int position,
String value)
Set a String value into a PreparedStatement, handling nulls.
|
protected void |
unregisterAuditEventOperationType(S_LibrarySession session,
String opTypeKey)
Unregister an operation type key.
|
protected int |
updateCertificateWithFreeInfo(S_LibrarySession session,
long targetId,
boolean secured,
long freeTime,
long deletorId,
long tombstoneId,
S_LibraryObject target,
String targetName,
String targetClassName)
Update an audit certificate to reflect a freed state.
|
public static final String RAW_AUDIT_EVENT_TABLE_NAME
public static final String AUDIT_EVENT_TABLE_NAME
public static final String AUDIT_EVENT_PROPERTY_TABLE_NAME
public static final String AUDIT_EVENT_UNIONED_PROPERTY_VIEW
public static final String AUDIT_EVENT_INLINE_STRING_TABLE_NAME
public static final String AUDIT_OPTYPE_TABLE_NAME
public static final String AUDIT_TARGET_CODE_VIEW_NAME
public static final String AUDIT_CUSTOM_OPCODE_TABLE_NAME
public static final String AUDIT_NEXT_CUSTOM_OPCODE_TABLE_NAME
public static final String AUDIT_FOLDER_PATH_TABLE_NAME
public static final String AUDIT_FOLDER_PATH_OVERFLOW_TABLE_NAME
public static final String AUDIT_CERTIFICATE_TABLE_NAME
public static final String AUDIT_EVENT_TABLE_PREFIX
public static final String AUDIT_EVENT_VIEW_PREFIX
public static final String AUDIT_EVENT_PROPERTY_TABLE_PREFIX
public static final String AUDIT_EVENT_VIEW_NAME
protected static final String COMMON_AUDIT_EVENT_COLUMNS
protected static final String COMMON_AUDIT_EVENT_INSERT_VALUES
protected static final String RAW_AUDIT_EVENT_COLUMNS
Same as COMMON_AUDIT_EVENT_COLUMNS
,
with ", folderpathid, inobjecthistory" appended.
protected static final String RAW_AUDIT_EVENT_INSERT_VALUES
COMMON_AUDIT_EVENT_INSERT_VALUES
,
with three extra commas appended.protected static final String AUDIT_EVENT_COLUMNS
Same as COMMON_AUDIT_EVENT_COLUMNS
,
with ", auditspecid" appended.
protected static final String AUDIT_EVENT_INSERT_VALUES
Same as COMMON_AUDIT_EVENT_INSERT_VALUES
,
with an extra comma appended.
protected static final String AUDIT_FOLDER_PATH_COLUMNS
protected static final String AUDIT_FOLDER_PATH_INSERT_VALUES
Should be 24 commas, matching the length of AUDIT_FOLDER_PATH_COLUMNS.
protected static final int AUDIT_FOLDER_PATH_ENTRY_LIMIT
If a path exceeds this limit, the remaining items are stored in the AuditFolderPath overflow table.
protected static final long DEFAULT_AUDIT_FOLDER_PATH_EXPIRATION_PERIOD
Defaults to 10 days.
protected static String CREATED_OPERATIONTYPE_MARKER
protected static String FREED_OPERATIONTYPE_MARKER
protected static int JDBC_BATCH_SIZE_THRESHHOLD
public static int OPERATION_TYPE_OFFSET
public static int MINIMUM_CUSTOM_OPERATION_CODE
protected AuditExecutor() throws IfsException
Scope is protected to prevent constructing an instance of AuditExecutor to
casually construct an AuditEvent for use in invoking
setPersistentData
on the AuditEvent
to result in an AuditEvent that looks like it is persistent.
IfsException
- if the operation failsprotected Long directlyDispatchAuditEvent(S_LibrarySession session, AuditEvent event, Long specId) throws IfsException
Unusual method for posting events, which bypasses the creation of a raw audit event, and bypasses the AuditEventDispatcher.
session
- the sessionevent
- the event to directly addspecId
- the AuditSpecification (event history) IDIfsException
- if the operation failsprotected void postAuditEvent(S_LibrarySession session, AuditEvent event, int postMode) throws IfsException
Normal method for posting events.
session
- the sessionevent
- the event to savepostMode
- how to post the event based on success/failureIfsException
- if the operation failsprotected void postAuditEventsUponCommit(S_LibrarySession session, LibraryConnection lconn, Connection conn, List rawEventList) throws IfsException
This is called as a normal part of an completeTransaction operation,
initiated from within UncommittedLibraryObjectDataCache
.
session
- the sessionlconn
- the repos connectionconn
- the JDBC connectionrawEventList
- the events to save (list of PreparedRawAuditEvent)IfsException
- if the operation failsprotected void postFailedAuditEventsUponRollback(S_LibrarySession session, LibraryConnection lconn, Connection conn, List rawEventList) throws IfsException
This is called as a normal part of an abortTransaction operation,
initiated from within UncommittedLibraryObjectDataCache
.
session
- the sessionlconn
- the repos connectionconn
- the JDBC connectionrawEventList
- the events to save (list of PreparedRawAuditEvent)IfsException
- if the operation failsprotected RawAuditEvent[] selectRawAuditEvents(S_LibrarySession session, String filterClause, int maxItems) throws IfsException
Always sorts by ID.
session
- the session contextfilterClause
- the filter criteria (where clause)maxItems
- max number of items to returnIfsException
- if the operation failsprotected void removeRawAuditEvents(S_LibrarySession session, RawAuditEvent[] rawEvents) throws IfsException
session
- the session contextrawEvents
- array of events to freeIfsException
- if the operation failsprotected void handleAuditEventDispatchRequests(S_LibrarySession session, ArrayList reqList, String tableName) throws IfsException
session
- the session contextreqList
- a list of AuditEventDispatchRequesttableName
- the table name where the events are to be storedIfsException
- if the operation failsprotected AuditEvent[] selectAuditEvents(S_LibrarySession session, Long auditSpec, String filterClause, AttributeValue[] bindValues, String sortClause, int maxItems) throws IfsException
session
- the session contextauditSpec
- the audit history ID to searchfilterClause
- the filter criteria (where clause)bindValues
- the bind values to include withthe filter clausesortClause
- the sort criteria (order by clause)maxItems
- max number of items to returnIfsException
- if the operation failspublic AttributeValue[] selectAggregateAuditEventColumns(S_LibrarySession session, Long auditSpec, String aggFunction, String[] columnNames, String[] innerColNames, String filterClause, String sortClause) throws IfsException
session
- the session contextauditSpec
- the audit history ID to searchaggFunction
- the SQL aggregate function (can be null)columnNames
- the audit table column names to selectinnerColNames
- the audit table column names to use in the
inner select; if null, no inner select is usedfilterClause
- the filter criteria (where clause)sortClause
- the sort criteria (order by clause)IfsException
- if the operation failsprotected void removeAuditEvents(S_LibrarySession session, long[] ids, String tableName) throws IfsException
session
- the session contextids
- array of event IDstableName
- the audit event table nameIfsException
- if the operation failsprotected void removeAuditEventsForTarget(S_LibrarySession session, Long specId, Long targetId) throws IfsException
session
- the session contextspecId
- the audit history identifiertargetId
- the target IDIfsException
- if the operation failsprotected void deleteUnusedAuditProperties(S_LibrarySession session) throws IfsException
Performed as a periodic cleanup task.
session
- the session contextIfsException
- if the operation failsprotected AuditFolderPath selectLatestAuditFolderPath(S_LibrarySession session, Long folderId) throws IfsException
session
- the session contextfolderId
- the folder ID of interestIfsException
- if the operation failsprotected AuditFolderPath selectSpecificAuditFolderPath(S_LibrarySession session, long folderPathId) throws IfsException
session
- the session contextfolderPathId
- the folder path ID of interestIfsException
- if the operation failsprotected void deleteExpiredAuditFolderPaths(S_LibrarySession session, long expPeriod) throws IfsException
Performed as a periodic cleanup task.
session
- the session contextexpPeriod
- the threshhold period in milliseconds; only
AuditFolderPaths that have expired for longer
than this period will be deletedIfsException
- if the operation failsprotected ArrayList selectUnusedAuditTypeLists(S_LibrarySession session, long expPeriod) throws IfsException
session
- library sessionexpPeriod
- expiration periodIfsException
- if the operation failsprotected void deleteUnusedAuditFolderPathOverflowEntries(S_LibrarySession session) throws IfsException
Performed as a periodic cleanup task.
session
- the session contextIfsException
- if the operation failsprotected long getAuditFolderPathExpirationPeriod(S_LibrarySession session) throws IfsException
session
- the session contextIfsException
- if the operation failsprotected int registerAuditEventOperationType(S_LibrarySession session, String opTypeKey, int targetCode, String targetClass, int opCode, Boolean createOrFree) throws IfsException
session
- the session contextopTypeKey
- the string key for the operation typetargetCode
- the numeric code for the target item typetargetClass
- class name for the target object typeopCode
- the numeric code for the type of operationcreateOrFree
- indication as to whther the operation is
a Create (true) or Free (false) operation;
should be null if neitherIfsException
- if the operation failsprotected void unregisterAuditEventOperationType(S_LibrarySession session, String opTypeKey) throws IfsException
session
- the session contextopTypeKey
- the string key for the operation typeIfsException
- if the operation failsprotected int[] lookupAuditEventOperationTypes(S_LibrarySession session, String[] opTypeKeys) throws IfsException
session
- session contextopTypeKeys
- operation type keysIfsException
- if the operation failsprotected String[] lookupAuditEventOperationTypeKeys(S_LibrarySession session, int[] opTypes) throws IfsException
session
- session contextopTypes
- numeric operation typesIfsException
- if the operation failsprotected AuditTargetCode lookupAuditTargetCode(S_LibrarySession session, String className) throws IfsException
session
- session contextclassName
- class name associated with a registered
audit target typeIfsException
- if the operation failsprotected String lookupAuditEventOperationTypeKey(S_LibrarySession session, int opType) throws IfsException
session
- session contextopType
- numeric operation typeIfsException
- if the operation failsprotected void invalidateAuditTypeMaps()
IfsException
- if the operation failsprotected int registerCustomAuditEventOperationCodeKey(S_LibrarySession session, String opCodeKey) throws IfsException
This is done by customizers to register the suffix to be used for custom event opTypeKeys. For example, the operation code key "FAXED" might get registered, so that the custom event "DOCUMENT__FAXED" can get registered (double underscore is intentional, and is the convention for custom event keys).
Note: if this key was previously registered, the value assigned in the previous registration is returned.
session
- the session contextopCodeKey
- the string key for the operation code (e.g. "FAXED")IfsException
- if the operation failsprotected long getNextAuditId(S_LibrarySession session) throws IfsException
session
- the session contextIfsException
- if the operation failsprotected long getCurrentAuditSequenceId(S_LibrarySession session) throws IfsException
session
- the session contextIfsException
- if the operation failspublic AuditCertificate[] getAuditCertificates(S_LibrarySession session, Long[] objectIds) throws IfsException
The array of certificates returned will be the same length as the specified set of object IDs, and in the same order as the corresponding IDs. The array may contain nulls when any of the following conditions are true:
session
- the session contextobjectIds
- object IDsIfsException
- if the operation failsprotected long getNextAuditId(S_LibrarySession session, LibraryConnection lconn, Connection conn) throws IfsException
session
- the session contextlconn
- the repos connectionconn
- the JDBC connectionIfsException
- if the operation failsprotected long getCurrentAuditSequenceId(S_LibrarySession session, LibraryConnection lconn, Connection conn) throws IfsException
session
- the session contextlconn
- the repos connectionconn
- the JDBC connectionIfsException
- if the operation failsprotected void setLongInStatement(PreparedStatement stmt, boolean isNull, int position, long value) throws SQLException
stmt
- the prepared statementisNull
- is the value null?position
- position in the statementvalue
- the long valueSQLException
- if the operation failsprotected void setStringInStatement(PreparedStatement stmt, int position, String value) throws SQLException
stmt
- the prepared statementposition
- position in the statementvalue
- the String valueSQLException
- if the operation failsprotected Object extractValueFromResultSet(ResultSet rset, int position, int datatype) throws SQLException, IfsException
The specified data type indicates the type of object to return.
rset
- the result setposition
- the positiondatatype
- the datatype of the valueIfsException
- if the operation failsSQLException
protected int getAuditColumnDatatype(String columnName) throws IfsException
columnName
- the name of the audit event columnIfsException
- if the operation failsprotected AttributeValue convertListToAttributeValue(List list, int dataType) throws IfsException
list
- the list of valuesdataType
- the datatypeIfsException
- if the operation failsprotected AttributeValue[] getAuditTypesForClass(S_LibrarySession session, String className, boolean includeNested) throws IfsException
The AttributeValues returned use the operation type key as the name, and the numeric operation type as the value.
session
- the session contextclassName
- the class name of interest, force to upper case
(e.g. FOLDER)includeNested
- whether or not to include operations for classes
that are descendents of the specified classIfsException
- if the operation failsprotected AttributeValue[] getAuditTypesForCreateOperations(S_LibrarySession session) throws IfsException
Used to indicate when an object has been created simply by inspecting event types.
session
- the session contextIfsException
- if the operation failsprotected AttributeValue[] getAuditTypesForFreeOperations(S_LibrarySession session) throws IfsException
Used to indicate when an object has been freed simply by inspecting event types.
session
- the session contextIfsException
- if the operation failsprotected AttributeValue[] getCustomAuditTypes(S_LibrarySession session) throws IfsException
session
- the session contextIfsException
- if the operation failsprotected AttributeValue[] getAuditTypesWithOperationMarker(S_LibrarySession session, String marker) throws IfsException
session
- the session contextmarker
- the CREATED or FREED markerIfsException
- if the operation failsprotected String getSelectString(Long auditSpec, String viewName, String filterClause, String sortClause, int maxItems)
auditSpec
- the new audit history IDviewName
- the view name to select fromfilterClause
- The where clause criteria (does not include "where")sortClause
- The sort clause criteria (does not include "order by)maxItems
- max number of items to returnprotected String getSelectAggregateString(Long auditSpec, String viewName, String[] selColumnNames, String[] columnNames, String[] innerColNames, String filterClause, String sortClause)
auditSpec
- the audit history ID to searchviewName
- the event table to select fromselColumnNames
- the selected columns; may include
aggregate function prepended; array length be > 0columnNames
- the audit table column names to select and group byinnerColNames
- the audit table column names to use in the
inner select and inner group by; if null, no
inner select is usedfilterClause
- the filter criteria (where clause)sortClause
- the sort criteria (order by clause)IfsException
- if the operation failsprotected AttributeValue[] selectAuditProperties(S_LibrarySession session, LibraryConnection lconn, Connection conn, long propId, String propTblName) throws IfsException
session
- the session contextlconn
- the repos connectionconn
- the JDBC connectionpropId
- the property IDpropTblName
- the property table nameIfsException
- if the operation failsprotected long findInlineStringReference(S_LibrarySession session, LibraryConnection lconn, Connection conn, String inlineString) throws IfsException
session
- the session contextlconn
- the repos connectionconn
- the JDBC connectioninlineString
- the inline String valueIfsException
- if the operation failsprotected String findInlineString(S_LibrarySession session, LibraryConnection lconn, Connection conn, long stringRef) throws IfsException
session
- the session contextlconn
- the repos connectionconn
- the JDBC connectionstringRef
- the inline String referenceIfsException
- if the operation failsprotected long createInlineString(S_LibrarySession session, LibraryConnection lconn, Connection conn, String inlineString) throws IfsException
session
- the session contextlconn
- the repos connectionconn
- the JDBC connectioninlineString
- the inline String valueIfsException
- if the operation failsprotected void insertCreateCertificate(S_LibrarySession session, long targetId, long targetClassId, long createTime, long creatorId, long domainId) throws IfsException
session
- the session contexttargetId
- the target object IDtargetClassId
- the target object's class IDcreateTime
- the time the new object is createdcreatorId
- the user ID creating the new objectdomainId
- the domain IDIfsException
- if the operation failsprotected void insertFreeCertificate(S_LibrarySession session, long targetId, long targetClassId, long freeTime, long deletorId, long domainId) throws IfsException
session
- the session contexttargetId
- the target object IDtargetClassId
- the target object's class IDfreeTime
- the time the object is freeddeletorId
- the user ID freeing the objectdomainId
- the domain IDIfsException
- if the operation failsprotected void insertCertificate(S_LibrarySession session, long targetId, long targetClassId, boolean freed, long createTime, long creatorId, long domainId, boolean secured, long freeTime, long deletorId, long tombstoneId, S_LibraryObject target, String targetName, String targetClassName) throws IfsException
session
- the session contexttargetId
- the target object IDtargetClassId
- the target object's class IDfreed
- true if the certificate is to reflect a freed statecreateTime
- the time the new object is createdcreatorId
- the user ID creating the new objectdomainId
- the domain IDsecured
- whether the certificate can only be viewed
by administratorsfreeTime
- the time the object was freeddeletorId
- the user ID freeing the objecttombstoneId
- the tombtone ID created for the freed objecttarget
- the target objecttargetName
- the name of the target objecttargetClassName
- the name of the target object's classIfsException
- if the operation failsprotected int updateCertificateWithFreeInfo(S_LibrarySession session, long targetId, boolean secured, long freeTime, long deletorId, long tombstoneId, S_LibraryObject target, String targetName, String targetClassName) throws IfsException
session
- the session contexttargetId
- the target object IDsecured
- whether the certificate can only be viewed
by administratorsfreeTime
- the time the object was freeddeletorId
- the user ID freeing the objecttombstoneId
- the tombtone ID created for the freed objecttarget
- the target objecttargetName
- the name of the target objecttargetClassName
- the name of the target object's classIfsException
- if the operation failsprotected AuditCertificate findOrSelectAuditCertificate(S_LibrarySession session, LibraryConnection lconn, Connection conn, Long objectId) throws IfsException
session
- the session contextlconn
- the repos connectionconn
- the JDBC connectionobjectId
- the object IDIfsException
- if the operation failsprotected AuditCertificate selectAuditCertificate(S_LibrarySession session, LibraryConnection lconn, Connection conn, Long objectId) throws IfsException
session
- the session contextlconn
- the repos connectionconn
- the JDBC connectionobjectId
- the object IDIfsException
- if the operation failsprotected void applyAuditCertificateName(S_LibrarySession session, AuditCertificate cert) throws IfsException
Only has an effect if the certificate is for a non-freed object.
session
- the session contextcert
- the AuditCertificateIfsException
- if the operation failsprotected void deleteCertificate(S_LibrarySession session, long targetId) throws IfsException
session
- the session contexttargetId
- the target IDIfsException
- if the operation failsprotected void deleteExpiredGlobalAuditEvents(S_LibrarySession session, Long domainId, Long specId, Long expPeriod) throws IfsException
session
- session contextdomainId
- id of the domain to work onspecId
- id of the domain to work onexpPeriod
- time since object freeing the event should
remain; if null, no expirationIfsException
- if the operation failsprotected void postAuditCertificateChange(S_LibrarySession session, S_LibraryObject target) throws IfsException
session
- the session contexttarget
- the target objectIfsException
- if the operation failsprotected String getSelectUnusedAuditTypeListsSql() throws IfsException
The SQL text must define one bind variable, which will be set to the
System.currentTimeMillis() -
IfsException
- if the operation failsprotected void postAuditTypeMapInvalidation(S_LibrarySession session) throws IfsException
session
- the session contextIfsException
- if the operation failsprotected String getOperationTypeKey(S_LibrarySession session, int opType) throws IfsException
session
- the session contextopType
- the numeric operation typeIfsException
- if the operation failsprotected int getOperationType(S_LibrarySession session, String opTypeKey) throws IfsException
session
- the session contextopTypeKey
- the operation type keyIfsException
- if the operation failsprotected int calculateOperationType(int targetCode, int opCode)
targetCode
- target codeopCode
- operation codeprotected int calculateOperationCode(int opType)
opType
- Operation typeprotected boolean isCreateOperation(S_LibrarySession session, int opType) throws IfsException
session
- the session contextopType
- operation typeIfsException
- if the operation failsprotected boolean isFreeOperation(S_LibrarySession session, int opType) throws IfsException
session
- the session contextopType
- operation typeIfsException
- if the operation failsprotected AuditTargetCode getAuditTargetCode(S_LibrarySession session, String className) throws IfsException
session
- session contextclassName
- class name associated with a registered
audit target typeIfsException
- if the operation failsprotected S_Folder getAuditEventFolderContext(S_LibrarySession session, Long targetId, Long targetClassId) throws IfsException
session
- the session contexttargetId
- the target object's IDtargetClassId
- the target object's Class IDIfsException
- if the operation failsprotected Long extractObjectId(LibraryObjectInterface obj) throws IfsException
obj
- the objectIfsException
- if the operation failsCopyright © 2023. All rights reserved.