Interface DispatchEnablerAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface DispatchEnablerAdminSession extends OsidSession

This session creates, updates, and deletes DispatchEnablers . 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 DispatchEnabler , a DispatchEnablerForm is requested using getDispatchEnablerFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned DispatchEnablerForm 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 DispatchEnablerForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each DispatchEnablerForm corresponds to an attempted transaction.

For updates, DispatchEnablerForms are requested to the DispatchEnabler Id that is to be updated using getDispatchEnablerFormForUpdate() . Similarly, the DispatchEnablerForm has metadata about the data that can be updated and it can perform validation before submitting the update. The DispatchEnablerForm can only be used once for a successful update and cannot be reused.

The delete operations delete DispatchEnablers . To unmap a DispatchEnabler from the current Publisher , the DispatchEnablerPublisherAssignmentSession should be used. These delete operations attempt to remove the DispatchEnabler itself thus removing it from all known Publisher catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id .

  • Method Details

    • getPublisherId

      Id getPublisherId()
      Gets the Publisher Id associated with this session.
      Returns:
      the Publisher Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getPublisher

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

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

      boolean canCreateDispatchEnablerWithRecordTypes(Type[] dispatchEnablerRecordTypes)
      Tests if this user can create a single DispatchEnabler using the desired record types. While SubscriptionRulesManager.getDispatchEnablerRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific DispatchEnabler . Providing an empty array tests if a DispatchEnabler can be created with no records.
      Parameters:
      dispatchEnablerRecordTypes - array of dispatch enabler record types
      Returns:
      true if DispatchEnabler creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - dispatchEnablerRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getDispatchEnablerFormForCreate

      DispatchEnablerForm getDispatchEnablerFormForCreate(Type[] dispatchEnablerRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the dispatch enabler form for creating new dispatch enablers. A new form should be requested for each create transaction.
      Parameters:
      dispatchEnablerRecordTypes - array of dispatch enabler record types
      Returns:
      the dispatch enabler form
      Throws:
      NullArgumentException - dispatchEnablerRecordTypes 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.
    • createDispatchEnabler

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

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

      DispatchEnablerForm getDispatchEnablerFormForUpdate(Id dispatchEnablerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the dispatch enabler form for updating an existing dispatch enabler. A new dispatch enabler form should be requested for each update transaction.
      Parameters:
      dispatchEnablerId - the Id of the DispatchEnabler
      Returns:
      the dispatch enabler form
      Throws:
      NotFoundException - dispatchEnablerId is not found
      NullArgumentException - dispatchEnablerId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateDispatchEnabler

      void updateDispatchEnabler(DispatchEnablerForm dispatchEnablerForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing dispatch enabler.
      Parameters:
      dispatchEnablerForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - dispatchEnablerForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - dispatchEnablerForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - dispatchEnablerForm did not originate from getDispatchEnablerFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteDispatchEnablers

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

      void deleteDispatchEnabler(Id dispatchEnablerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a DispatchEnabler .
      Parameters:
      dispatchEnablerId - the Id of the DispatchEnabler to remove
      Throws:
      NotFoundException - dispatchEnablerId not found
      NullArgumentException - dispatchEnablerId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageDispatchEnablerAliases

      boolean canManageDispatchEnablerAliases()
      Tests if this user can manage Id aliases for DispatchEnablers 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 DispatchEnabler aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasDispatchEnabler

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