public class ScriptHandler extends AuditEventHandlerAdapter
Modifier and Type | Class and Description |
---|---|
class |
ScriptHandler.LocalScriptDriver
LocalScriptDriver extends EcmScriptDriver to capture the log
output, so that a result document can be created to show the results.
|
Modifier and Type | Field and Description |
---|---|
static String |
SYSTEM__SCRIPT_OPERATIONS_REQUESTED
Custom event type for a script operations request.
|
DEFAULT_BATCHSIZE
Constructor and Description |
---|
ScriptHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
createScriptResultDocument(LibrarySession session,
String path,
StringBuffer result)
Create a document with the script results, as indicated by the
specified path.
|
protected String |
getDefaultScriptOperationsClass()
Returns the fully qualified operations class name to use by default
in executing the script operations, or null if the default shouldbe used.
|
void |
handleEventPosted(AuditEventHandlerContext context)
Called when at least one registered event is posted.
|
void |
handleInitialize(AuditEventHandlerContext context)
Initializes this handler.
|
void |
handleTimerExpired(AuditEventHandlerContext context)
Called when the timer for this AuditEventHandler expires.
|
protected boolean |
isValidEvent(AuditEventHandlerContext context,
LibrarySession session,
AuditEvent event)
Verify that the event represents a valid request by a valid user.
|
protected void |
processEvent(AuditEventHandlerContext context,
AuditEvent event)
Process an event, by executing a set of script operations.
|
deleteEvents, getAuditHandlerSpecification, getAuditSpecification, getHandlerProperty, handleDispose, processEvents, processEvents, selectEvents, selectEvents, selectMaximumEventId, setHandlerProperty
public static final String SYSTEM__SCRIPT_OPERATIONS_REQUESTED
Double underscore is intentional, as this is the name of this custom event.
public void handleInitialize(AuditEventHandlerContext context) throws Exception
AuditEventHandlerAdapter
Called immediately after construction.
handleInitialize
in interface AuditEventHandler
handleInitialize
in class AuditEventHandlerAdapter
context
- the AuditEventHandlerContext to use for processingException
- if the operation failspublic void handleEventPosted(AuditEventHandlerContext context) throws Exception
AuditEventHandlerAdapter
handleEventPosted
in interface AuditEventHandler
handleEventPosted
in class AuditEventHandlerAdapter
context
- the AuditEventHandlerContext to use for processingException
- if the operation failspublic void handleTimerExpired(AuditEventHandlerContext context) throws Exception
AuditEventHandlerAdapter
handleTimerExpired
in interface AuditEventHandler
handleTimerExpired
in class AuditEventHandlerAdapter
context
- the AuditEventHandlerContext to use for processingException
- if the operation failsprotected void processEvent(AuditEventHandlerContext context, AuditEvent event) throws IfsException
Delete the event after processing.
processEvent
in class AuditEventHandlerAdapter
context
- the AuditEventHandlerContext to use for processingevent
- the event to processIfsException
- if the operation failsprotected boolean isValidEvent(AuditEventHandlerContext context, LibrarySession session, AuditEvent event) throws IfsException
context
- the AuditEventHandlerContext to use for processingsession
- the session contextevent
- the event to processIfsException
- if the operation failsprotected String getDefaultScriptOperationsClass()
IfsException
- if the operation failsprotected void createScriptResultDocument(LibrarySession session, String path, StringBuffer result) throws IfsException
session
- the session contextpath
- the path to the document to createresult
- the script results that should be the content
of the documentIfsException
- if the operation failsCopyright © 2023. All rights reserved.