Interface TriggerAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
TriggerBatchAdminSession
This session creates, updates, and deletes Triggers . 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
getTriggerFormForCreate() specifying the desired controller and record
Types or none if no record Types are needed. The returned
TriggerForm 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 the 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.
For updates, TriggerForms are requested to the Trigger
Id that is to be updated using getTriggerFormForUpdate() .
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.
The delete operations delete Triggers . 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.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier 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.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
-
getSystemId
Id getSystemId()Gets theSystemIdassociated with this session.- Returns:
- the
System Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getSystem
Gets theSystemassociated with this session.- Returns:
- the system
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateTriggers
boolean canCreateTriggers()Tests if this user can createTriggers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aTriggerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifTriggercreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateTriggerWithRecordTypes
Tests if this user can create a singleTriggerusing the desired record types. WhileControlManager.getTriggerRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificTrigger. Providing an empty array tests if aTriggercan be created with no records.- Parameters:
triggerRecordTypes- array of trigger record types- Returns:
trueifTriggercreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-triggerRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getTriggerFormForCreate
TriggerForm getTriggerFormForCreate(Id controllerId, Type[] triggerRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the trigger form for creating new triggers. A new form should be requested for each create transaction.- Parameters:
controllerId- a controllerIdtriggerRecordTypes- array of trigger record types- Returns:
- the trigger form
- Throws:
NotFoundException-controllerIdis not foundNullArgumentException-controllerIdortriggerRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createTrigger
Trigger createTrigger(TriggerForm triggerForm) throws OperationFailedException, PermissionDeniedException Creates a newTrigger.- Parameters:
triggerForm- the form for thisTrigger- Returns:
- the new
Trigger - Throws:
IllegalStateException-triggerFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-triggerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-triggerFormdid not originate fromgetTriggerFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateTriggers
boolean canUpdateTriggers()Tests if this user can updateTriggers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aTriggerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifTriggermodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getTriggerFormForUpdate
TriggerForm getTriggerFormForUpdate(Id triggerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the trigger form for updating an existing trigger. A new trigger form should be requested for each update transaction.- Parameters:
triggerId- theIdof theTrigger- Returns:
- the trigger form
- Throws:
NotFoundException-triggerIdis not foundNullArgumentException-triggerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateTrigger
void updateTrigger(TriggerForm triggerForm) throws OperationFailedException, PermissionDeniedException Updates an existing trigger.- Parameters:
triggerForm- the form containing the elements to be updated- Throws:
IllegalStateException-triggerFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-triggerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-triggerFormdid not originate fromgetTriggerFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteTriggers
boolean canDeleteTriggers()Tests if this user can deleteTriggers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aTriggerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifTriggerdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteTrigger
void deleteTrigger(Id triggerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aTrigger.- Parameters:
triggerId- theIdof theTriggerto remove- Throws:
NotFoundException-triggerIdnot foundNullArgumentException-triggerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageTriggerAliases
boolean canManageTriggerAliases()Tests if this user can manageIdaliases forTriggers. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifTriggeraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasTrigger
void aliasTrigger(Id triggerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aTriggerfor the purpose of creating compatibility. The primaryIdof theTriggeris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another trigger, it is reassigned to the given triggerId.- Parameters:
triggerId- theIdof aTriggeraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-triggerIdnot foundNullArgumentException-triggerIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-