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.
 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 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

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

Returns:
true if job should abort.

getJobObject

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

Returns:
job object

getJobParameters

public 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 []
password-refchar []
dn-refcom.novell.nds.dirxml.job.DirectoryObject []

Returns:
name-value mapping of job parameters

getCommandProcessor

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

Returns:
command processor

getScope

public 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

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

Returns:
result implementation

allocateParamResult

public 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

public 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

public 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.

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

reportResult

public void reportResult(JobResult result)
Report a job result.

Parameters:
result - implementation of JobResult

allocateDirectoryObject

public 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

public 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

public DriverInterface getDriverInterface()
Get an interface through which to interact with a 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

getJobContainer

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

Returns:
container object

getCheckPrivileges

public 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

public 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