Interface TriggerBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, TriggerAdminSession
This session creates, updates, and deletes Triggers 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
Trigger , a TriggerForm is requested using
getTriggerFormsForCreate() specifying the desired controller and record
Types or none if no record Types are needed. Each of the
returned TriggerForms 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 TriggerForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each TriggerForm corresponds to
an attempted transaction.
The TriggerForms returned from
getTriggerFormsForCreate() may be linked to the originating request
through the peer Ids of the TriggerForm . In the case
where there may be duplicates, any TriggerForm of the same peer
Ids may be used for a create operation.
Once a batch of TriggerForm are submitted for create, a
CreateTrigger is returned for each TriggerForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createTriggers() , errors specific to
an individual TriggerForm are indicated in the corresponding
CreateTrigger . CreateTriggers may be linked to the
originating TriggerForm through the TriggerForm Id
.
For updates, TriggerForms are requested to the Trigger
Id that is to be updated using getTriggerFormsForUpdate()
where the reference Id in the TriggerForm may be used to
link the request. Similarly, the TriggerForm has metadata about
the data that can be updated and it can perform validation before
submitting the update. The TriggerForm can only be used once for a
successful update and cannot be reused.
Once a batch of TriggerForms are submitted for update, an
UpdateTrigger is returned for each TriggerForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateTriggers() , errors specific to
an individual TriggerForm are indicated in the corresponding
UpdateTrigger . UpdateTriggers may be linked to the
originating TriggerForm through the TriggerForm Id
.
The delete operations delete Triggers in bulk. To unmap a
Trigger from the current System , the
TriggerSystemAssignmentSession should be used. These delete operations
attempt to remove the Trigger itself thus removing it from all
known System catalogs. Bulk delete operations return the results
in DeleteTriggers .
-
Method Summary
Modifier and TypeMethodDescriptionaliasTriggers(AliasRequestList aliasRequests) Adds anIdto aTriggerfor the purpose of creating compatibility.createTriggers(TriggerBatchFormList triggerForms) Creates a new set ofTriggers.Deletes allTriggersin thisSystem.deleteTriggers(IdList triggerIds) Deletes triggers for the givenIds.deleteTriggersForController(Id controllerId) Deletes triggers for the givenController.getTriggerFormsForCreate(IdList controllerIds, Type[] triggerRecordTypes) Gets the trigger forms for creating a bunch of new triggers.getTriggerFormsForUpdate(IdList triggerIds) Gets the trigger forms for updating an existing set of triggers.updateTriggers(TriggerBatchFormList triggerForms) Updates existing triggers.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.Methods inherited from interface TriggerAdminSession
aliasTrigger, canCreateTriggers, canCreateTriggerWithRecordTypes, canDeleteTriggers, canManageTriggerAliases, canUpdateTriggers, createTrigger, deleteTrigger, getSystem, getSystemId, getTriggerFormForCreate, getTriggerFormForUpdate, updateTriggerModifier and TypeMethodDescriptionvoidaliasTrigger(Id triggerId, Id aliasId) Adds anIdto aTriggerfor the purpose of creating compatibility.booleanTests if this user can createTriggers.booleancanCreateTriggerWithRecordTypes(Type[] triggerRecordTypes) Tests if this user can create a singleTriggerusing the desired record types.booleanTests if this user can deleteTriggers.booleanTests if this user can manageIdaliases forTriggers.booleanTests if this user can updateTriggers.createTrigger(TriggerForm triggerForm) Creates a newTrigger.voiddeleteTrigger(Id triggerId) Deletes aTrigger.Gets theSystemassociated with this session.Gets theSystemIdassociated with this session.getTriggerFormForCreate(Id controllerId, Type[] triggerRecordTypes) Gets the trigger form for creating new triggers.getTriggerFormForUpdate(Id triggerId) Gets the trigger form for updating an existing trigger.voidupdateTrigger(TriggerForm triggerForm) Updates an existing trigger.
-
Method Details
-
getTriggerFormsForCreate
TriggerBatchFormList getTriggerFormsForCreate(IdList controllerIds, Type[] triggerRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the trigger forms for creating a bunch of new triggers. A form is retrieved for each controller.- Parameters:
controllerIds- list of controllerIdstriggerRecordTypes- array of trigger record types to be included in each create operation or an empty list if none- Returns:
- the trigger forms
- Throws:
NotFoundException- acontrollerIdis not foundNullArgumentException-controllerIdsortriggerRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createTriggers
CreateResponseList createTriggers(TriggerBatchFormList triggerForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofTriggers. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateTrigger.- Parameters:
triggerForms- the trigger forms- Returns:
- the create responses
- Throws:
NullArgumentException-triggerFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getTriggerFormsForUpdate
TriggerBatchFormList getTriggerFormsForUpdate(IdList triggerIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the trigger forms for updating an existing set of triggers. A new trigger form should be requested for each update transaction.- Parameters:
triggerIds- theIdsof theTrigger- Returns:
- the trigger form
- Throws:
NotFoundException- atriggerIdis not foundNullArgumentException-triggerIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateTriggers
UpdateResponseList updateTriggers(TriggerBatchFormList triggerForms) throws OperationFailedException, PermissionDeniedException Updates existing triggers. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateTrigger.- Parameters:
triggerForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-triggerFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllTriggers
Deletes allTriggersin thisSystem.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteTriggers
DeleteResponseList deleteTriggers(IdList triggerIds) throws OperationFailedException, PermissionDeniedException Deletes triggers for the givenIds.- Parameters:
triggerIds- theIdsof the triggers to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-triggerIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteTriggersForController
DeleteResponseList deleteTriggersForController(Id controllerId) throws OperationFailedException, PermissionDeniedException Deletes triggers for the givenController.- Parameters:
controllerId- a controllerId- Returns:
- the delete responses
- Throws:
NullArgumentException-controllerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasTriggers
AliasResponseList aliasTriggers(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aTriggerfor the purpose of creating compatibility. The primaryIdof theTriggeris determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another trigger, it is reassigned to the given triggerId.- 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.
-