Interface TriggerAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
TriggerBatchAdminSession

public interface TriggerAdminSession extends OsidSession

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 Details

    • getSystemId

      Id getSystemId()
      Gets the System Id associated with this session.
      Returns:
      the System Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getSystem

      Gets the System associated with this session.
      Returns:
      the system
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateTriggers

      boolean canCreateTriggers()
      Tests if this user can create Triggers . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Trigger will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
      Returns:
      false if Trigger creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateTriggerWithRecordTypes

      boolean canCreateTriggerWithRecordTypes(Type[] triggerRecordTypes)
      Tests if this user can create a single Trigger using the desired record types. While ControlManager.getTriggerRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Trigger . Providing an empty array tests if a Trigger can be created with no records.
      Parameters:
      triggerRecordTypes - array of trigger record types
      Returns:
      true if Trigger creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - triggerRecordTypes is null
      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 controller Id
      triggerRecordTypes - array of trigger record types
      Returns:
      the trigger form
      Throws:
      NotFoundException - controllerId is not found
      NullArgumentException - controllerId or triggerRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createTrigger

      Creates a new Trigger .
      Parameters:
      triggerForm - the form for this Trigger
      Returns:
      the new Trigger
      Throws:
      IllegalStateException - triggerForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - triggerForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - triggerForm did not originate from getTriggerFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateTriggers

      boolean canUpdateTriggers()
      Tests if this user can update Triggers . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Trigger will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
      Returns:
      false if Trigger modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getTriggerFormForUpdate

      Gets the trigger form for updating an existing trigger. A new trigger form should be requested for each update transaction.
      Parameters:
      triggerId - the Id of the Trigger
      Returns:
      the trigger form
      Throws:
      NotFoundException - triggerId is not found
      NullArgumentException - triggerId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 - triggerForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - triggerForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - triggerForm did not originate from getTriggerFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteTriggers

      boolean canDeleteTriggers()
      Tests if this user can delete Triggers . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Trigger will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
      Returns:
      false if Trigger deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteTrigger

      Deletes a Trigger .
      Parameters:
      triggerId - the Id of the Trigger to remove
      Throws:
      NotFoundException - triggerId not found
      NullArgumentException - triggerId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageTriggerAliases

      boolean canManageTriggerAliases()
      Tests if this user can manage Id aliases for Triggers . A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
      Returns:
      false if Trigger aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasTrigger

      Adds an Id to a Trigger for the purpose of creating compatibility. The primary Id of the Trigger is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another trigger, it is reassigned to the given trigger Id .
      Parameters:
      triggerId - the Id of a Trigger
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - triggerId not found
      NullArgumentException - triggerId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.