Interface DispatchAdminSession

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

public interface DispatchAdminSession extends OsidSession

This session creates, updates, and deletes Dispatches . The data for create and update is provided by the consumer via the form. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a Dispatch , a DispatchForm is requested using getDispatchFormForCreate() specifying the desired relationship peers and record Types or none if no record Types are needed. The returned DispatchForm 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 DispatchForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each DispatchForm corresponds to an attempted transaction.

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

The delete operations delete Dispatches . To unmap a Dispatch from the current Publisher , the DispatchPublisherAssignmentSession should be used. These delete operations attempt to remove the Dispatch 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.
    • canCreateDispatches

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

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

      DispatchForm getDispatchFormForCreate(Type[] dispatchRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the dispatch form for creating new dispatches. A new form should be requested for each create transaction.
      Parameters:
      dispatchRecordTypes - array of dispatch record types
      Returns:
      the dispatch form
      Throws:
      NullArgumentException - dispatchRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get from for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createDispatch

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

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

      Gets the dispatch form for updating an existing dispatch. A new dispatch form should be requested for each update transaction.
      Parameters:
      dispatchId - the Id of the Dispatch
      Returns:
      the dispatch form
      Throws:
      NotFoundException - dispatchId is not found
      NullArgumentException - dispatchId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateDispatch

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

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

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

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

      Adds an Id to a Dispatch for the purpose of creating compatibility. The primary Id of the Dispatch 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, it is reassigned to the given dispatch Id .
      Parameters:
      dispatchId - the Id of a Dispatch
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - dispatchId not found
      NullArgumentException - dispatchId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.