Interface BBjAdminAsynchTriggerJob
- All Superinterfaces:
BBjAdminCommitPropertyWriter
,BBjAdminCommitWriter
,BBjAdminPropertyReader
,BBjAdminPropertyWriter
,BBjAdminReplicationJob
,Remote
,Serializable
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:
Java Sample
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();
BBj Sample
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()
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
config.bbx to use when the trigger will execute the BBj handler code on the remote machine.static final String
Host name for the filesystem server where the trigger job will execute the BBj code to handle the trigger.static final String
Password to use to connect to the filesystem server where the trigger job will execute the BBj code to handle the trigger.static final String
Port number for the filesystem server where the trigger job will execute the BBj code to handle the trigger.static final String
Remove program to use to handle remove operations when a monitored file has a record removed.static final String
True if the filesystem server where the trigger job will execute the BBj code to handle the trigger is using SSL.static final String
static final String
User to use to connect to the filesystem server where the trigger job will execute the BBj code to handle the trigger.static final String
Working directory where the trigger will execute the BBj handler code on the remote machine.static final String
Write program to use to handle write operations when a monitored file is written to.Fields inherited from interface com.basis.api.admin.BBjAdminReplicationJob
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, LOCAL, MAX_BANDWIDTH, NAME, RECOPY_ENABLED, STATE_COPYING_FILES, STATE_ERROR, STATE_NOT_SINCE_START, SYNCHRONOUS
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addExclude
(String p_source) Adds a file to the list of files to exclude from being monitored.void
Adds the specified file to the list of files being monitored.void
addGlobExclude
(String p_sourceDir, String p_pattern, String p_destinationDir, boolean p_recursive, boolean p_matchPath, String p_modes) Adds a new file/directory to the list of files/directories being excluded by this trigger job.void
addGlobInclude
(String p_sourceDir, String p_pattern, String p_destinationDir, boolean p_recursive, boolean p_matchPath, boolean p_advisory, String p_modes) Adds a new file/directory to the list of files/directories being monitored by this trigger job.void
addRegexExclude
(String p_sourceDir, String p_pattern, String p_destinationDir, boolean p_recursive, boolean p_matchPath, String p_modes) Adds a new file/directory to the list of files/directories being excluded by this trigger job.void
addRegexInclude
(String p_sourceDir, String p_pattern, String p_destinationDir, boolean p_recursive, boolean p_matchPath, boolean p_advisory, String p_modes) Adds a new file/directory to the list of files/directories being monitored by this trigger job.void
Clears all exclusions configured for the job.void
Clears the entire list of files being monitored.void
Clears the list of all included filters.Returns a list of all the exclude filters used by this asynchronous trigger job.Returns a list of the excluded files and directories.getFiles()
Returns a list of files and directories that will be monitored.Returns a list of all the include filters used by this asynchronous trigger job.void
removeFile
(String p_file) Removes the specified file from the list of files being monitored.Methods inherited from interface com.basis.api.admin.BBjAdminCommitPropertyWriter
getChangedProperties, getClearedProperties, getOriginalProperties
Methods inherited from interface com.basis.api.admin.BBjAdminCommitWriter
commit, rollback
Methods inherited from interface com.basis.api.admin.BBjAdminPropertyReader
checkValueEqual, contains, contains, getBoolean, getDouble, getInt, getList, getLong, getProperties, getString, getType, getTypes, getValue
Methods inherited from interface com.basis.api.admin.BBjAdminPropertyWriter
addType, canAddNewProperties, canClear, clear, clearProperties, clearProperty, getReadOnly, hasChanged, isReadOnly, setBoolean, setDouble, setInt, setList, setLong, setProperties, setString, setValue
Methods inherited from interface com.basis.api.admin.BBjAdminReplicationJob
cancelDisableWhenCaughtUpToNow, disableWhenCaughtUpToNow, getCurrentError, getDescriptiveProperties, getLastInSync, getLastInSyncString, getLastLag, getLastOpRate, getLastTimestamp, getLastTimestampRatio, getLastTimestampSummary, getLastWaitForLog, getStartProcesses, setDescriptiveProperties, setEnabled, waitingToDisable
-
Field Details
-
HOST
Host name for the filesystem server where the trigger job will execute the BBj code to handle the trigger.- See Also:
-
PORT
Port number for the filesystem server where the trigger job will execute the BBj code to handle the trigger. Typically this will be 2000.- See Also:
-
SSL
True if the filesystem server where the trigger job will execute the BBj code to handle the trigger is using SSL. Must match that server's configuration.- See Also:
-
WORKING_DIR
Working directory where the trigger will execute the BBj handler code on the remote machine.- See Also:
-
CONFIG
config.bbx to use when the trigger will execute the BBj handler code on the remote machine.- See Also:
-
USER
User to use to connect to the filesystem server where the trigger job will execute the BBj code to handle the trigger.- See Also:
-
PASSWORD
Password to use to connect to the filesystem server where the trigger job will execute the BBj code to handle the trigger.- See Also:
-
USE_DEFAULT_ALIAS
- See Also:
-
WRITE_PROGRAM
Write program to use to handle write operations when a monitored file is written to.- See Also:
-
REMOVE_PROGRAM
Remove program to use to handle remove operations when a monitored file has a record removed.- See Also:
-
-
Method Details
-
getFiles
BBjAdminList<String> getFiles()Returns a list of files and directories that will be monitored. When one of these files is modified, it will trigger the configured write/remove BBj program to execute, passing in the information about the specific operation that occurred such as the record written, the key used for a remove, etc.- Returns:
- List of directories and files being monitored
-
addFile
Adds the specified file to the list of files being monitored.- Parameters:
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.).- Throws:
BBjAdminException
-
removeFile
Removes the specified file from the list of files being monitored.- Parameters:
p_file
- Full path to the file to remove from the job.- Throws:
BBjAdminException
-
clearFiles
Clears the entire list of files being monitored.- Throws:
BBjAdminException
-
clearExclusions
Clears all exclusions configured for the job.- Throws:
BBjAdminException
-
addExclude
Adds a file to the list of files to exclude from being monitored. This gives you the ability to add an entire directory, but then go and exclude particular files from the job.- Parameters:
p_source
- Full path to file to exclude.- Throws:
BBjAdminException
-
getExclusions
Returns a list of the excluded files and directories.- Returns:
- List of files and directories being excluded from the job.
- Throws:
BBjAdminException
-
addRegexInclude
void addRegexInclude(String p_sourceDir, String p_pattern, String p_destinationDir, boolean p_recursive, boolean p_matchPath, boolean p_advisory, String p_modes) throws BBjAdminException Adds a new file/directory to the list of files/directories being monitored by this trigger job. When any changes occur to the file or files in the directory, it will cause the handler write/remove programs to be executed on the target machine. Use regular expressions for matching pattern.- Parameters:
p_sourceDir
-p_pattern
-p_destinationDir
-p_recursive
-p_matchPath
-p_advisory
-p_modes
-- Throws:
BBjAdminException
-
addRegexExclude
void addRegexExclude(String p_sourceDir, String p_pattern, String p_destinationDir, boolean p_recursive, boolean p_matchPath, String p_modes) throws BBjAdminException Adds a new file/directory to the list of files/directories being excluded by this trigger job. This is used to exclude specific files/directories from a monitored directory if you do not want all files in a monitored directory to be handled.- Parameters:
p_sourceDir
-p_pattern
-p_destinationDir
-p_recursive
-p_matchPath
-p_modes
-- Throws:
BBjAdminException
-
addGlobInclude
void addGlobInclude(String p_sourceDir, String p_pattern, String p_destinationDir, boolean p_recursive, boolean p_matchPath, boolean p_advisory, String p_modes) throws BBjAdminException Adds a new file/directory to the list of files/directories being monitored by this trigger job. When any changes occur to the file or files in the directory, it will cause the handler write/remove programs to be executed on the target machine. Use * for wildcard for matching patterns.- Parameters:
p_sourceDir
-p_pattern
-p_destinationDir
-p_recursive
-p_matchPath
-p_modes
-- Throws:
BBjAdminException
-
addGlobExclude
void addGlobExclude(String p_sourceDir, String p_pattern, String p_destinationDir, boolean p_recursive, boolean p_matchPath, String p_modes) throws BBjAdminException Adds a new file/directory to the list of files/directories being excluded by this trigger job. This is used to exclude specific files/directories from a monitored directory if you do not want all files in a monitored directory to be handled.- Parameters:
p_sourceDir
-p_pattern
-p_destinationDir
-p_recursive
-p_matchPath
-p_modes
-- Throws:
BBjAdminException
-
getIncludeFilters
Returns a list of all the include filters used by this asynchronous trigger job.- Returns:
- List of all the include filters.
- Throws:
BBjAdminException
-
getExcludeFilters
Returns a list of all the exclude filters used by this asynchronous trigger job.- Returns:
- List of all the exclude filters.
- Throws:
BBjAdminException
-
clearInclusions
Clears the list of all included filters.- Throws:
BBjAdminException
-