com.ibm.pim.job
Interface JobManager

All Superinterfaces:
Manager

public interface JobManager
extends Manager

Interface for JobManager

Since:
6.0.0

Field Summary
static java.lang.String copyright
           
 
Method Summary
 CategoryImport createCategoryImport(java.lang.String importName, DataSource dataSource, FileSpec fileSpec, CategoryCollaborationArea categoryCollabArea, java.lang.String workflowStepPath, java.util.Map<Import.OptionalArguments,java.lang.Object> optionalArgs)
          Creates a new hierarchy feed type import into CollaborationArea.
 CategoryImport createCategoryImport(java.lang.String importName, DataSource dataSource, FileSpec fileSpec, Hierarchy destHierarchy, java.util.Map<Import.OptionalArguments,java.lang.Object> optionalArgs)
          Creates a new hierarchy feed type import.
 Export createExport(java.lang.String exportName, DestinationSpec destSpec, Catalog sourceCatalog, SpecMap destMap, Export.Type exportContentType, java.util.Map<Export.OptionalArguments,java.lang.Object> optionalArgs)
          Creates a new export.
 ItemImport createItemImport(java.lang.String importName, DataSource dataSource, FileSpec fileSpec, Catalog destCatalog, java.util.Map<Import.OptionalArguments,java.lang.Object> optionalArgs)
          Creates a new Item feed type import.
 ItemImport createItemImport(java.lang.String importName, DataSource dataSource, FileSpec fileSpec, ItemCollaborationArea itemCollabArea, java.lang.String workflowStepPath, java.util.Map<Import.OptionalArguments,java.lang.Object> optionalArgs)
          Creates a new Item feed type import into CollaborationArea.
 Report createReport(java.lang.String reportName, Document reportScript, ScriptInputSpec reportInputSpec, Distribution distribution)
          Creates a new report
 Schedule createSchedule(Job job)
          Runs the specified job immediately.
 Schedule createSchedule(Job job, java.lang.String scheduleName, int intervalMinutes)
          Runs the specified job with type of Schedule.Type.MINUTE for every time of the given interval minutes based on the current time.
 Schedule createSchedule(Job job, java.lang.String scheduleName, Schedule.Type scheduleType)
          Runs the specified job with the given schedule type, based on the current time.
 Schedule createSchedule(Job job, java.lang.String scheduleName, Schedule.Type scheduleType, java.util.Date startTime)
          Runs the specified job with the given schedule type and running time.
 Export getExport(java.lang.String exportName)
          Fetches the export with the specified name
 java.util.Collection<Export> getExports()
          Fetches all the exports.
 Import getImport(java.lang.String importName)
          Fetches the import with the specified name
 java.util.Collection<Import> getImports()
          Fetches all the imports.
 Job getJob(java.lang.String jobDescription)
          Retrieves the detail information about the job.
 java.util.Collection<Job> getJobs()
          Gets all jobs in the system.
 Report getReport(java.lang.String reportName)
          Fetches the report with the specified name
 java.util.Collection<Report> getReports()
          Fetches all the reports.
 java.util.Collection<Schedule> searchSchedules(java.lang.String jobDescription, ScheduleStatus.Type statusType, java.util.Date startDate, java.util.Date endDate, java.lang.String creatorName, java.lang.String creatorCompanyName)
          Searches job schedules in the system by the given criteria.
 
Methods inherited from interface com.ibm.pim.common.Manager
getManagerName
 

Field Detail

copyright

static final java.lang.String copyright
See Also:
Constant Field Values
Method Detail

getJob

Job getJob(java.lang.String jobDescription)
Retrieves the detail information about the job.

Parameters:
jobDescription - the job description
Returns:
the Job object
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use.
java.lang.IllegalArgumentException - If the job is not persisted.

getJobs

java.util.Collection<Job> getJobs()
Gets all jobs in the system.

Returns:
a collection of Job objects
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use.

createSchedule

Schedule createSchedule(Job job)
Runs the specified job immediately.

Parameters:
job - the job object
Returns:
the running job schedule
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use.
java.lang.IllegalArgumentException - If the job object is null.
java.lang.IllegalStateException - If the job object is not persisted.

createSchedule

Schedule createSchedule(Job job,
                        java.lang.String scheduleName,
                        Schedule.Type scheduleType)
Runs the specified job with the given schedule type, based on the current time.

Notes: for type of Schedule.Type.MINUTE, the minutes of current time is the interval value.

Parameters:
job - the job object
scheduleName - the schedule name
scheduleType - one of the predefined job types in the enum Schedule.Type
Returns:
the new job schedule
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use.
java.lang.IllegalArgumentException - If the job object, scheduleName, or scheduleType is null or empty.
java.lang.IllegalStateException - If the job object is not persisted.

createSchedule

Schedule createSchedule(Job job,
                        java.lang.String scheduleName,
                        int intervalMinutes)
Runs the specified job with type of Schedule.Type.MINUTE for every time of the given interval minutes based on the current time.

Parameters:
job - the job object
scheduleName - the schedule name
intervalMinutes - the value for minute interval between successive runs of the schedule.
Returns:
the new job schedule
Throws:
PIMInternalException - If an internal error occurs
java.lang.UnsupportedOperationException - if the input Schedule.Type does not match any of the internal types.
PIMAuthorizationException - Reserved for future use.
java.lang.IllegalArgumentException - java.lang.IllegalArgumentException - If the job object is null, scheduleName is null or empty, or intervalMinutes is less than 0.
java.lang.IllegalStateException - If the job object is not persisted.

createSchedule

Schedule createSchedule(Job job,
                        java.lang.String scheduleName,
                        Schedule.Type scheduleType,
                        java.util.Date startTime)
Runs the specified job with the given schedule type and running time.

Notes: for type of Schedule.Type.MINUTE, the minutes of startTime is the interval value.

Parameters:
job - the job object
scheduleName - the schedule name
scheduleType - one of the predefined job types in the enum Schedule.Type
startTime - the start time for the schedule(Invalid if before current time)
Returns:
the new job schedule
Throws:
PIMInternalException - If start time is before current time(in the past)
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use.
java.lang.IllegalArgumentException - If the job object, scheduleName, scheduleType or startTime is null or empty.
java.lang.IllegalStateException - If the job object is not persisted.

searchSchedules

java.util.Collection<Schedule> searchSchedules(java.lang.String jobDescription,
                                               ScheduleStatus.Type statusType,
                                               java.util.Date startDate,
                                               java.util.Date endDate,
                                               java.lang.String creatorName,
                                               java.lang.String creatorCompanyName)
Searches job schedules in the system by the given criteria.

Parameters:
jobDescription - the job name or null for any
statusType - one of the job status defined in Scheduler.JobStatus or null for any
startDate - the start date of creation or null for any
endDate - the end date of creation or null for any
creatorName - the creator of the job
creatorCompanyName - the company name of the job creator
Returns:
a collection of Job Schedule objects
Throws:
PIMInternalException - If an internal error occurs
java.lang.UnsupportedOperationException - if the input Schedule.Type does not match any of the internal types.
java.lang.IllegalArgumentException - If the end date parameter is chronologically before the start date.
PIMAuthorizationException - Reserved for future use.

createCategoryImport

CategoryImport createCategoryImport(java.lang.String importName,
                                    DataSource dataSource,
                                    FileSpec fileSpec,
                                    Hierarchy destHierarchy,
                                    java.util.Map<Import.OptionalArguments,java.lang.Object> optionalArgs)
Creates a new hierarchy feed type import. Note that import semantics is always update.

Parameters:
importName - The name of the import
dataSource - The DataSource for this import
fileSpec - FileSpec for this import
destHierarchy - Destination hierarchy for the incoming categories
optionalArgs - Optional arguments supported by the import
Returns:
A CategoryImport object
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use
java.lang.IllegalArgumentException -
- If null or empty or special characters are passed in the import name
- If null dataSource is passed
- If null fileSpec is passed
- If null destHierarchy is passed

createItemImport

ItemImport createItemImport(java.lang.String importName,
                            DataSource dataSource,
                            FileSpec fileSpec,
                            Catalog destCatalog,
                            java.util.Map<Import.OptionalArguments,java.lang.Object> optionalArgs)
Creates a new Item feed type import. Items are added to unassigned category by-default. This can be changed by the import script to provide specific mappings.

Parameters:
importName - The name of the import
dataSource - The DataSource for this import
fileSpec - FileSpec to be used for this import
destCatalog - Destination catalog to which items are imported
optionalArgs - Optional arguments supported by the import
Returns:
A ItemImport object
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use
java.lang.IllegalArgumentException -
- If null or empty or special characters are passed in the import name
- If null dataSource is passed
- If null fileSpec is passed
- If null destCatalog is passed

createItemImport

ItemImport createItemImport(java.lang.String importName,
                            DataSource dataSource,
                            FileSpec fileSpec,
                            ItemCollaborationArea itemCollabArea,
                            java.lang.String workflowStepPath,
                            java.util.Map<Import.OptionalArguments,java.lang.Object> optionalArgs)
Creates a new Item feed type import into CollaborationArea. Items are added to specified workflow step associated with the Collaboration step.

Parameters:
importName - The name of the import
dataSource - The DataSource for this import
fileSpec - FileSpec to be used for this import
itemCollabArea - Destination Item Collaboration Area to which items are imported
workflowStepPath - Workflow step path associated to the collaboration step to to which items are imported
optionalArgs - Optional arguments supported by the import
Returns:
A ItemImport object
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use
java.lang.IllegalArgumentException -
- If null or empty or special characters are passed in the import name
- If null dataSource is passed
- If null fileSpec is passed
- If null itemCollabArea is passed
- If null or empty workflowStepPath is passed

createCategoryImport

CategoryImport createCategoryImport(java.lang.String importName,
                                    DataSource dataSource,
                                    FileSpec fileSpec,
                                    CategoryCollaborationArea categoryCollabArea,
                                    java.lang.String workflowStepPath,
                                    java.util.Map<Import.OptionalArguments,java.lang.Object> optionalArgs)
Creates a new hierarchy feed type import into CollaborationArea. Note that import semantics is always update.

Parameters:
importName - The name of the import
dataSource - The DataSource for this import
fileSpec - FileSpec for this import
categoryCollabArea - Destination category collaboration area for the incoming categories
workflowStepPath - Workflow step path associated to the collaboration step for the incoming categories
optionalArgs - Optional arguments supported by the import
Returns:
A CategoryImport object
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use
java.lang.IllegalArgumentException -
- If null or empty or special characters are passed in the import name
- If null dataSource is passed
- If null fileSpec is passed
- If null categoryCollabArea is passed
- If null or empty workflowStepPath is passed

getImport

Import getImport(java.lang.String importName)
Fetches the import with the specified name

Parameters:
importName - The name of the import
Returns:
The Import object with the given name
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use
java.lang.IllegalArgumentException - If null or empty import name is passed

getImports

java.util.Collection<Import> getImports()
Fetches all the imports. If no imports are present in the system, an empty collection will be returned.

Returns:
Collection of import objects.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use

createExport

Export createExport(java.lang.String exportName,
                    DestinationSpec destSpec,
                    Catalog sourceCatalog,
                    SpecMap destMap,
                    Export.Type exportContentType,
                    java.util.Map<Export.OptionalArguments,java.lang.Object> optionalArgs)
Creates a new export. This method does support creating version difference content using the optional arguments.

Parameters:
exportName - The name of the export
destSpec - Destination specification for the export
sourceCatalog - Catalog whose data is being exported
destMap - Catalog to destination map to be used for export
exportContentType - Type of the content in the export
optionalArgs - Optional arguments supported by the export.
The following are the KEY/VALUE pairs to be provided for the optional arguments :
CHARSET an instanceof Charset
APPROVER_USER an instanceof User
DISTRIBUTION an instanceof Collection of Distributions
DISTRIBUTION_GROUP an instanceof Collection of DistributionGroups
SELECTION an instanceof Selection
PARAMS_DOCPATH an instanceof String
FIRST_VERSION an instanceof VersionInfo
SECOND_VERSION an instanceof VersionInfo
CONTENTDIFF_TYPE an instanceof ContentDiffType
DOCSTOREPATH_TO_SCRIPT an instanceof String
Returns:
Export object
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use
java.lang.IllegalArgumentException -
If null or empty export name is passed
If null destSpec is passed
If null sourceCatalog is passed
If null destMap is passed
If null exportContentType is passed
If there is any mismatch between the optional argument type specified and the corresponding object passed
If the export type is any of the following
Export.Type.CONTENT_DIFFS_BETWEEN_TWO_VERSIONS,
Export.Type.CONTENT_DIFFS_SINCE_LAST_EXPORT,
Export.Type.IMAGES_BINARY_FILES_BETWEEN_TWO_VERSIONS,
Export.Type.IMAGES_BINARY_FILES_SINCE_LAST_EXPORT
and the optional arguments
Export.OptionalArguments.FIRST_VERSION,
Export.OptionalArguments.SECOND_VERSION,
Export.OptionalArguments.CONTENTDIFF_TYPE are not provided.

getExport

Export getExport(java.lang.String exportName)
Fetches the export with the specified name

Parameters:
exportName - The name of the export
Returns:
The Export object with the given name
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use
java.lang.IllegalArgumentException - If null or empty export name is passed

getExports

java.util.Collection<Export> getExports()
Fetches all the exports. If no exports are present in the system, an empty collection will be returned.

Returns:
Collection of export objects.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use

createReport

Report createReport(java.lang.String reportName,
                    Document reportScript,
                    ScriptInputSpec reportInputSpec,
                    Distribution distribution)
Creates a new report

Parameters:
reportName - The name of the report
reportScript - The document having the script to be executed when this report is run
reportInputSpec - The InputParametersSpec for this report.
distribution - The Distribution for this report
Returns:
Report object
Throws:
PIMInternalException - If an internal error occurs.
PIMInvalidPathException - If the document is not in directory "/scripts/reports" in the docstore.
PIMAuthorizationException - Reserved for future use
java.lang.IllegalArgumentException - If any of the input parameters is null or reportName is null or empty or reportScript's path contains one of the following characters - '\"<>/
java.lang.IllegalStateException - If reportInputSpec has not been persisted or distribution has not been persisted.

getReport

Report getReport(java.lang.String reportName)
Fetches the report with the specified name

Parameters:
reportName - The name of the report
Returns:
The Report object with the given name. Returns null if a report with the given name does not exist.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use.
java.lang.IllegalArgumentException - If the value of the input parameter 'reportName' is null or empty

getReports

java.util.Collection<Report> getReports()
Fetches all the reports. If no reports are present in the instance, an empty collection will be returned.

Returns:
Collection of Report objects.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use.