Interface JobBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, JobAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Jobs in bulk. The
data for create and update is provided by the consumer via the form
object. OsidForms are requested for each create or update and may
not be reused.
Create and update operations differ in their usage. To create a
Job , a JobForm is requested using getJobFormsForCreate()
specifying the desired record Types or none if no record
Types are needed. Each of the returned JobForms will indicate
that it is to be used with a create operation and can be used to examine
metdata or validate data prior to creation. Once a JobForm is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
JobForm corresponds to an attempted transaction.
The JobForms returned from getJobFormsForCreate() may
be linked to the originating request through the peer Ids of the
JobForm . In the case where there may be duplicates, any
JobForm of the same peer Ids may be used for a create operation.
Once a batch of JobForms are submitted for create, a
CreateResponse is returned for each JobForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createJobs() , errors specific to an
individual JobForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
JobForm through the JobForm Id .
For updates, JobForms are requested to the Job
Id that is to be updated using getJobFormsForUpdate() where the
reference Id in the JobForm may be used to link the
request. Similarly, the JobForm has metadata about the data that
can be updated and it can perform validation before submitting the update.
The JobForm can only be used once for a successful update and
cannot be reused.
Once a batch of JobForms are submitted for update, an
UpdateResponse is returned for each JobForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateJobs() , errors specific to an
individual JobForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
JobForm through the JobForm Id .
The delete operations delete Jobs in bulk. To unmap a
Job from the current Foundry , the
JobFoundryAssignmentSession should be used. These delete operations
attempt to remove the Job itself thus removing it from all known
Foundry catalogs. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasJobs(AliasRequestList aliasRequests) Adds anIdto aJobfor the purpose of creating compatibility.createJobs(JobBatchFormList jobForms) Creates a new set ofJobs.Deletes allJobsin thisFoundry.deleteJobs(IdList jobIds) Deletes jobs for the givenIds.getJobFormsForCreate(long number, Type[] jobRecordTypes) Gets the job forms for creating a bunch of new jobs.getJobFormsForUpdate(IdList jobIds) Gets the job forms for updating an existing set of jobs.updateJobs(JobBatchFormList jobForms) Updates existing jobs.Methods inherited from interface JobAdminSession
aliasJob, canCreateJobs, canCreateJobWithRecordTypes, canDeleteJobs, canManageJobAliases, canUpdateJobs, createJob, deleteJob, getFoundry, getFoundryId, getJobFormForCreate, getJobFormForUpdate, updateJobModifier and TypeMethodDescriptionvoidAdds anIdto aJobfor the purpose of creating compatibility.booleanTests if this user can createJobs.booleancanCreateJobWithRecordTypes(Type[] jobRecordTypes) Tests if this user can create a singleJobusing the desired record types.booleanTests if this user can deleteJobs.booleanTests if this user can manageIdaliases forJobs.booleanTests if this user can updateJobs.Creates a newJob.voidDeletes aJob.Gets theFoundryassociated with this session.Gets theFoundryIdassociated with this session.getJobFormForCreate(Type[] jobRecordTypes) Gets the job form for creating new jobs.getJobFormForUpdate(Id jobId) Gets the job form for updating an existing job.voidUpdates an existing job.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getJobFormsForCreate
JobBatchFormList getJobFormsForCreate(long number, Type[] jobRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the job forms for creating a bunch of new jobs.- Parameters:
number- the number of forms to retrievejobRecordTypes- array of job record types to be included in each create operation or an empty list if none- Returns:
- the job forms
- Throws:
NullArgumentException-jobRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createJobs
CreateResponseList createJobs(JobBatchFormList jobForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofJobs. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
jobForms- the job forms- Returns:
- the create responses
- Throws:
NullArgumentException-jobFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getJobFormsForUpdate
JobBatchFormList getJobFormsForUpdate(IdList jobIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the job forms for updating an existing set of jobs. A new job form should be requested for each update transaction.- Parameters:
jobIds- theIdsof theJob- Returns:
- the job form
- Throws:
NotFoundException- ajobIdis not foundNullArgumentException-jobIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateJobs
UpdateResponseList updateJobs(JobBatchFormList jobForms) throws OperationFailedException, PermissionDeniedException Updates existing jobs. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
jobForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-jobFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllJobs
Deletes allJobsin thisFoundry.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteJobs
DeleteResponseList deleteJobs(IdList jobIds) throws OperationFailedException, PermissionDeniedException Deletes jobs for the givenIds.- Parameters:
jobIds- theIdsof the jobs to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-jobIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasJobs
AliasResponseList aliasJobs(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aJobfor the purpose of creating compatibility. The primaryIdof theJobis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another job, it is reassigned to the given jobId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-