Interface DispatchConstrainerAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface DispatchConstrainerAdminSession extends OsidSession

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

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

The delete operations delete DispatchConstrainers . To unmap a DispatchConstrainer from the current Publisher , the DispatchConstrainerPublisherAssignmentSession should be used. These delete operations attempt to remove the DispatchConstrainer 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.
    • canCreateDispatchConstrainers

      boolean canCreateDispatchConstrainers()
      Tests if this user can create DispatchConstrainers . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a DispatchConstrainer 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 DispatchConstrainer creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateDispatchConstrainerWithRecordTypes

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

      DispatchConstrainerForm getDispatchConstrainerFormForCreate(Type[] dispatchConstrainerRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the dispatch constrainer form for creating new dispatch constrainers. A new form should be requested for each create transaction.
      Parameters:
      dispatchConstrainerRecordTypes - array of dispatch constrainer record types
      Returns:
      the dispatch constrainer form
      Throws:
      NullArgumentException - dispatchConstrainerRecordTypes 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.
    • createDispatchConstrainer

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

      boolean canUpdateDispatchConstrainers()
      Tests if this user can update DispatchConstrainers . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a DispatchConstrainer 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 DispatchConstrainer modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getDispatchConstrainerFormForUpdate

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

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

      boolean canDeleteDispatchConstrainers()
      Tests if this user can delete DispatchConstrainers . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a DispatchConstrainer 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 DispatchConstrainer deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteDispatchConstrainer

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

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

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