com.novell.nds.dirxml.job
Interface JobManager


public interface JobManager

Interface that supplies the various parameters, scope, and other aspects of a job. Also allows for reporting job results.


Method Summary
 DirectoryObject allocateDirectoryObject(long entryID)
          Get a DirectoryObject implementation.
 DirectoryObject allocateDirectoryObject(String dn, int dnType)
          Get a DirectoryObject implementation.
 CheckPrivilegesResult allocateDriverPrivilegesResult(int privilegeNeeded)
          Allocate a CheckPrivilegesResult instance and fill in the details about what eDirectory privileges are needed based on the "meta-privileges" passed in.
 CheckPrivilegesResult allocateDriverPrivilegesResult(int privilegeNeeded, DirectoryObject driverObject)
          Allocate a CheckPrivilegesResult instance and fill in the details about what eDirectory privileges are needed based on the "meta-privileges" passed in.
 CheckParamResult allocateParamResult()
          Allocate a CheckParamResult implementation for use in returning a Job.checkConfig() result.
 CheckPrivilegesResult allocatePrivilegesResult()
          Allocate a CheckPrivilegesResult implementation for use in returning a Job.checkConfig() result.
 JobResult allocateResult()
          Get a JobResult implementation through which to report a job result.
 CheckPrivileges getCheckPrivileges()
          Return an implementation of the CheckPrivileges interface which can be used to check eDirectory rights.
 XmlCommandProcessor getCommandProcessor()
          Return an XmlCommandProcessor implementation that can be used for queries and commands to the directory.
 DriverInterface getDriverInterface()
          Get an interface through which to interact with the containing DirXML driver.
 DriverInterface getDriverInterface(DirectoryObject driverObject)
          Get an interface through which to interact with a DirXML driver.
 DirectoryObject getJobContainer()
          Return information on the container object of the DirXML-Job object that defines the job.
 JobEmail getJobEmail()
          Return an implementation of the JobEmail interface which can be used to check email configuration and to send email.
 DirectoryObject getJobObject()
          Return the information on the DirXML-Job object that defines the job.
 Map getJobParameters()
          Return a Map containing the names and values of job parameters.
 JobScope getScope()
          Return an interface that will return any directory objects that are in scope for this job.
 boolean mustAbort()
          Return true if the job should abort.
 void reportResult(JobResult result)
          Report a job result.
 

Method Detail

mustAbort

boolean mustAbort()
Return true if the job should abort.

Returns:
true if job should abort.

getJobObject

DirectoryObject getJobObject()
Return the information on the DirXML-Job object that defines the job.

Returns:
job object

getJobParameters

Map getJobParameters()
Return a Map containing the names and values of job parameters.

The following table indicates the Java types used in the Map values to contain the values of the job parameters:

Job parameter type to Java type mapping
Parameter typeJava type
stringjava.lang.String
booleanjava.lang.Boolean
integerjava.lang.Integer
realjava.lang.Double
dnjava.lang.String
enumjava.lang.String
listjava.lang.String []
structuredjava.lang.Map [] Each map contains the values of one instance of the structured value.
password-refchar []
dn-refcom.novell.nds.dirxml.job.DirectoryObject []

Returns:
name-value mapping of job parameters

getCommandProcessor

XmlCommandProcessor getCommandProcessor()
Return an XmlCommandProcessor implementation that can be used for queries and commands to the directory.

Returns:
command processor

getScope

JobScope getScope()
Return an interface that will return any directory objects that are in scope for this job. Returns null if no scope has been defined for the job.

Returns:
scope interface (possibly null)

allocateResult

JobResult allocateResult()
Get a JobResult implementation through which to report a job result.

Returns:
result implementation

allocateParamResult

CheckParamResult allocateParamResult()
Allocate a CheckParamResult implementation for use in returning a Job.checkConfig() result.

Returns:
an implementation of CheckParamResult to be used to return the parameter error information

allocatePrivilegesResult

CheckPrivilegesResult allocatePrivilegesResult()
Allocate a CheckPrivilegesResult implementation for use in returning a Job.checkConfig() result.

Returns:
an implementation of CheckPrivilegesResult to be used to return the privileges error information

allocateDriverPrivilegesResult

CheckPrivilegesResult allocateDriverPrivilegesResult(int privilegeNeeded)
                                                     throws IllegalArgumentException,
                                                            IllegalStateException
Allocate a CheckPrivilegesResult instance and fill in the details about what eDirectory privileges are needed based on the "meta-privileges" passed in. This will set the target object (driver object), trustee object (job object), and attribute name. This is a convenience method that minimizes the need for the job author to know the details of how rights to a driver are specified.

This method reports the privileges of the DirXML-Job object with respect to its containing DirXML-Driver object.

Parameters:
privilegeNeeded - one of CheckPrivileges.DRIVER_MIGRATE_APP, CheckPrivileges.DRIVER_SUBMIT_COMMAND, CheckPrivileges.DRIVER_RUN, CheckPrivileges.DRIVER_CONFIGURE, CheckPrivileges.DRIVER_CHECK_OBJECT_PASSWORD, or CheckPrivileges.DRIVER_MANAGE.
Returns:
instance that can be used to report the results of a "check config" instantiation
Throws:
IllegalArgumentException - if the privilegeNeeded parameter does not specify exactly one of the allowed values.
IllegalStateException - if the job is not contained by a driver

allocateDriverPrivilegesResult

CheckPrivilegesResult allocateDriverPrivilegesResult(int privilegeNeeded,
                                                     DirectoryObject driverObject)
                                                     throws IllegalArgumentException,
                                                            IllegalStateException
Allocate a CheckPrivilegesResult instance and fill in the details about what eDirectory privileges are needed based on the "meta-privileges" passed in. This will set the target object (driver object), trustee object (job object), and attribute name. This is a convenience method that minimizes the need for the job author to know the details of how rights to a driver are specified.

The parameter driverObject must refer to a DirXML-Driver object in the same driver set as the DirXML-Job object representing the calling job.

Parameters:
privilegeNeeded - one of CheckPrivileges.DRIVER_MIGRATE_APP, CheckPrivileges.DRIVER_SUBMIT_COMMAND, CheckPrivileges.DRIVER_RUN, CheckPrivileges.DRIVER_CONFIGURE, CheckPrivileges.DRIVER_CHECK_OBJECT_PASSWORD, or CheckPrivileges.DRIVER_MANAGE.
driverObject - reference to the desired DirXML-Driver
Returns:
instance that can be used to report the results of a "check config" instantiation
Throws:
IllegalArgumentException - if the privilegeNeeded parameter does not specify exactly one of the allowed values.
IllegalStateException - if the job is not contained by a driver

reportResult

void reportResult(JobResult result)
Report a job result.

Parameters:
result - implementation of JobResult

allocateDirectoryObject

DirectoryObject allocateDirectoryObject(long entryID)
Get a DirectoryObject implementation. This is designed for use with the JobResult interface.

Parameters:
entryID - entry ID of directory object.
Returns:
an implementation of DirectoryObject representing the directory object. The return will be null if no directory object has the passed entry ID.

allocateDirectoryObject

DirectoryObject allocateDirectoryObject(String dn,
                                        int dnType)
                                        throws IllegalArgumentException
Get a DirectoryObject implementation. This is designed for use with the JobResult interface.

Parameters:
dn - DN of directory object
dnType - DirectoryObject.LDAP, DirectoryObject.SLASH, DirectoryObject.QUALIFIED_SLASH, DirectoryObject.DOT, DirectoryObject.QUALIFIED_DOT
Returns:
an implementation of DirectoryObject representing the directory object. The return will be null if no directory object has the passed DN.
Throws:
IllegalArgumentException - thrown if dnType is not one of the listed values

getDriverInterface

DriverInterface getDriverInterface()
Get an interface through which to interact with the containing DirXML driver. This method will return null if the DirXML-Job object representing the calling job is not contained by a DirXML-Driver object.

Returns:
DriverInterface implementation or null

getDriverInterface

DriverInterface getDriverInterface(DirectoryObject driverObject)
Get an interface through which to interact with a DirXML driver. This method will return null if the parameter does not refer to a valid DirXML-Driver object, or if the local server has no replica containing the driver object.

The parameter driverObject must refer to a DirXML-Driver object in the same driver set as the DirXML-Job object representing the calling job.

Parameters:
driverObject - reference to the desired DirXML-Driver
Returns:
DriverInterface implementation or null

getJobContainer

DirectoryObject getJobContainer()
Return information on the container object of the DirXML-Job object that defines the job.

Returns:
container object

getCheckPrivileges

CheckPrivileges getCheckPrivileges()
Return an implementation of the CheckPrivileges interface which can be used to check eDirectory rights. Generally only used for the Job.checkConfig method. method.

Returns:
implementation of CheckPrivileges

getJobEmail

JobEmail getJobEmail()
Return an implementation of the JobEmail interface which can be used to check email configuration and to send email.

Returns:
implementation of JobEmail