public interface BBjAdminAsynchTriggerJob extends BBjAdminReplicationJob
A single asynchronous trigger job configured on the system. An asynchronous trigger job consists of a list of directories and/or files to monitor for changes, a BBj program to be run when a monitored file is written to, and another program to execute when a file has a record removed from it.
These triggers differ from standard file triggers in that the file operation does not wait for the trigger operation to complete, before continuing. This means there is almost no overhead on the file system. Further, these triggers can be configured to run on a remote BBj Services installation to allow the administrator to distribute the interpreter workload to another machine.
Take special note that BBjAdminAsynchTriggerJob extends the BBjAdminReplicationJob
interface which means
the methods and properties on BBjAdminReplicationJob
are also present for BBjAdminAsynchTriggerJob. This
is due to the fact that the asynchronous triggers are built on top of the replication framework and operate
in a similar fashion.
The following code sample show how to interact with a BBjAdminAsynchTriggerJob to get its enabled status as well as find out if there is currently an error condition on the job:
import com.basis.api.admin.BBjAdminBase;
import com.basis.api.admin.BBjAdminFactory;
import com.basis.api.admin.BBjAdminList;
import com.basis.api.admin.BBjAdminAsynchTriggerJob;
...
// Get the API instance
BBjAdminBase api = BBjAdminFactory.getBBjAdmin(InetAddress.getByName("myserver"), 2002, true, "admin", "mypassword");
// Get the list of asynchronous trigger jobs
BBjAdminList jobList = api.getAsynchTriggerJobs();
// Check each job to see if an error is present on any of them.
for (int j = 0; j < jobList.size(); j++) {
BBjAdminAsynchTriggerJob job = jobList.get(j);
String jobName = job.getString(BBjAdminAsynchTriggerJob.NAME);
if (!job.getBoolean(BBjAdminAsynchTriggerJob.ENABLED)) {
System.out.println("Job " + jobName + " is not currently enabled.");
}
if (job.getCurrentError() != null) {
System.out.println("Job " + jobName + " currently has a problem: " + job.getCurrentError().getMessage());
}
}
// Release the API instance
api.release();
REM Get the API instance
api! = BBjAdminFactory.getBBjAdmin("admin", "admin123")
REM Get the list of asynchronous trigger jobs
jobList! = api!.getAsynchTriggerJobs()
REM Check each job to see if an error is present on any of them.
for j = 0 to jobList!.size() - 1
job! = jobList!.get(j)
jobName$ = job!.getString(BBjAdminAsynchTriggerJob.NAME)
if job!.getBoolean(BBjAdminAsynchTriggerJob.ENABLED) = 0 then
PRINT "Job " + jobName$ + " is not currently enabled."
endif
if job!.getCurrentError() <> NULL() then
PRINT "Job " + jobName$ + " currently has a problem: " + job!.getCurrentError().getMessage()
endif
next j
REM Release the API instance.
api!.release()
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIG
config.bbx to use when the trigger will execute the BBj handler code on the remote machine.
|
static java.lang.String |
HOST
Host name for the filesystem server where the trigger job will execute the BBj code to handle the trigger.
|
static java.lang.String |
PASSWORD
Password to use to connect to the filesystem server where the trigger job will execute the BBj
code to handle the trigger.
|
static java.lang.String |
PORT
Port number for the filesystem server where the trigger job will execute
the BBj code to handle the trigger.
|
static java.lang.String |
REMOVE_PROGRAM
Remove program to use to handle remove operations when a monitored file has a record removed.
|
static java.lang.String |
SSL
True if the filesystem server where the trigger job will execute the BBj
code to handle the trigger is using SSL.
|
static java.lang.String |
USE_DEFAULT_ALIAS |
static java.lang.String |
USER
User to use to connect to the filesystem server where the trigger job will execute the BBj
code to handle the trigger.
|
static java.lang.String |
WORKING_DIR
Working directory where the trigger will execute the BBj handler code on the remote machine.
|
static java.lang.String |
WRITE_PROGRAM
Write program to use to handle write operations when a monitored file is written to.
|
ADVISORY_LOCKING, ENABLED, EVENT_EMAIL_RECIPIENTS, EVENT_EMAIL_SERVICE, EVENT_HANDLER, EVENT_HANDLER_CLASSPATH, EVENT_HANDLER_CONFIG, EVENT_HANDLER_PWD, EVENT_HANDLER_USER, EVENT_HANDLER_WORKING_DIR, ID, MAX_BANDWIDTH, NAME, RECOPY_ENABLED, STATE_COPYING_FILES, STATE_ERROR, STATE_NOT_SINCE_START, SYNCHRONOUS
Modifier and Type | Method and Description |
---|---|
void |
addExclude(java.lang.String p_source)
Adds a file to the list of files to exclude from being monitored.
|
void |
addFile(java.lang.String p_file,
boolean p_advisory,
java.lang.String p_modes)
Adds the specified file to the list of files being monitored.
|
void |
addGlobExclude(java.lang.String p_sourceDir,
java.lang.String p_pattern,
java.lang.String p_destinationDir,
boolean p_recursive,
boolean p_matchPath,
java.lang.String p_modes)
Adds a new file/directory to the list of files/directories being excluded by this trigger job.
|
void |
addGlobInclude(java.lang.String p_sourceDir,
java.lang.String p_pattern,
java.lang.String p_destinationDir,
boolean p_recursive,
boolean p_matchPath,
boolean p_advisory,
java.lang.String p_modes)
Adds a new file/directory to the list of files/directories being monitored by this trigger job.
|
void |
addRegexExclude(java.lang.String p_sourceDir,
java.lang.String p_pattern,
java.lang.String p_destinationDir,
boolean p_recursive,
boolean p_matchPath,
java.lang.String p_modes)
Adds a new file/directory to the list of files/directories being excluded by this trigger job.
|
void |
addRegexInclude(java.lang.String p_sourceDir,
java.lang.String p_pattern,
java.lang.String p_destinationDir,
boolean p_recursive,
boolean p_matchPath,
boolean p_advisory,
java.lang.String p_modes)
Adds a new file/directory to the list of files/directories being monitored by this trigger job.
|
void |
clearExclusions()
Clears all exclusions configured for the job.
|
void |
clearFiles()
Clears the entire list of files being monitored.
|
void |
clearInclusions()
Clears the list of all included filters.
|
BBjAdminList<BBjAdminReplicationFilter> |
getExcludeFilters()
Returns a list of all the exclude filters used by this asynchronous trigger job.
|
java.util.List<java.lang.String> |
getExclusions()
Returns a list of the excluded files and directories.
|
BBjAdminList<java.lang.String> |
getFiles()
Returns a list of files and directories that will be monitored.
|
BBjAdminList<BBjAdminReplicationFilter> |
getIncludeFilters()
Returns a list of all the include filters used by this asynchronous trigger job.
|
void |
removeFile(java.lang.String p_file)
Removes the specified file from the list of files being monitored.
|
cancelDisableWhenCaughtUpToNow, disableWhenCaughtUpToNow, getCurrentError, getDescriptiveProperties, getLastInSync, getLastInSyncString, getLastLag, getLastOpRate, getLastTimestamp, getLastTimestampRatio, getLastTimestampSummary, getLastWaitForLog, getStartProcesses, setDescriptiveProperties, setEnabled, waitingToDisable
getChangedProperties, getClearedProperties, getOriginalProperties
addType, canAddNewProperties, canClear, clear, clearProperties, clearProperty, getReadOnly, hasChanged, isReadOnly, setBoolean, setDouble, setInt, setList, setLong, setProperties, setString, setValue
checkValueEqual, contains, contains, getBoolean, getDouble, getInt, getList, getLong, getProperties, getString, getType, getTypes, getValue
commit, rollback
static final java.lang.String HOST
static final java.lang.String PORT
static final java.lang.String SSL
static final java.lang.String WORKING_DIR
static final java.lang.String CONFIG
static final java.lang.String USER
static final java.lang.String PASSWORD
static final java.lang.String USE_DEFAULT_ALIAS
static final java.lang.String WRITE_PROGRAM
static final java.lang.String REMOVE_PROGRAM
BBjAdminList<java.lang.String> getFiles()
void addFile(java.lang.String p_file, boolean p_advisory, java.lang.String p_modes) throws BBjAdminException
p_file
- Full path to the file to be added to the job.p_advisory
- True if the system should use advisory locking to open the file.p_modes
- Any mode string necessary to properly access the file (i.e. encrypted file info, etc.).BBjAdminException
void removeFile(java.lang.String p_file) throws BBjAdminException
p_file
- Full path to the file to remove from the job.BBjAdminException
void clearFiles() throws BBjAdminException
BBjAdminException
void clearExclusions() throws BBjAdminException
BBjAdminException
void addExclude(java.lang.String p_source) throws BBjAdminException
p_source
- Full path to file to exclude.BBjAdminException
java.util.List<java.lang.String> getExclusions() throws BBjAdminException
BBjAdminException
void addRegexInclude(java.lang.String p_sourceDir, java.lang.String p_pattern, java.lang.String p_destinationDir, boolean p_recursive, boolean p_matchPath, boolean p_advisory, java.lang.String p_modes) throws BBjAdminException
p_sourceDir
- p_pattern
- p_destinationDir
- p_recursive
- p_matchPath
- p_advisory
- p_modes
- BBjAdminException
void addRegexExclude(java.lang.String p_sourceDir, java.lang.String p_pattern, java.lang.String p_destinationDir, boolean p_recursive, boolean p_matchPath, java.lang.String p_modes) throws BBjAdminException
p_sourceDir
- p_pattern
- p_destinationDir
- p_recursive
- p_matchPath
- p_modes
- BBjAdminException
void addGlobInclude(java.lang.String p_sourceDir, java.lang.String p_pattern, java.lang.String p_destinationDir, boolean p_recursive, boolean p_matchPath, boolean p_advisory, java.lang.String p_modes) throws BBjAdminException
p_sourceDir
- p_pattern
- p_destinationDir
- p_recursive
- p_matchPath
- p_modes
- BBjAdminException
void addGlobExclude(java.lang.String p_sourceDir, java.lang.String p_pattern, java.lang.String p_destinationDir, boolean p_recursive, boolean p_matchPath, java.lang.String p_modes) throws BBjAdminException
p_sourceDir
- p_pattern
- p_destinationDir
- p_recursive
- p_matchPath
- p_modes
- BBjAdminException
BBjAdminList<BBjAdminReplicationFilter> getIncludeFilters() throws BBjAdminException
BBjAdminException
BBjAdminList<BBjAdminReplicationFilter> getExcludeFilters() throws BBjAdminException
BBjAdminException
void clearInclusions() throws BBjAdminException
BBjAdminException