Interface SubscriptionPublisherAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface SubscriptionPublisherAssignmentSession extends OsidSession

This session provides methods to re-assign Subscriptions to Publishers . A Subscription may map to multiple Publishers and removing the last reference to a Subscription is the equivalent of deleting it. Each Publisher may have its own authorizations governing who is allowed to operate on it.

Adding a reference of a Subscription to another Publisher is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignSubscriptions

      boolean canAssignSubscriptions()
      Tests if this user can alter subscription/publisher mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignSubscriptionsToPublisher

      boolean canAssignSubscriptionsToPublisher(Id publisherId)
      Tests if this user can alter subscription/publisher mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Parameters:
      publisherId - the Id of the Publisher
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - publisherId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignablePublisherIds

      IdList getAssignablePublisherIds(Id publisherId) throws OperationFailedException
      Gets a list of publishers including and under the given publisher node in which any subscription can be assigned.
      Parameters:
      publisherId - the Id of the Publisher
      Returns:
      list of assignable publisher Ids
      Throws:
      NullArgumentException - publisherId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignablePublisherIdsForSubscription

      IdList getAssignablePublisherIdsForSubscription(Id publisherId, Id subscriptionId) throws OperationFailedException
      Gets a list of publishers including and under the given publisher node in which a specific subscription can be assigned.
      Parameters:
      publisherId - the Id of the Publisher
      subscriptionId - the Id of the Subscription
      Returns:
      list of assignable publisher Ids
      Throws:
      NullArgumentException - publisherId or subscriptionId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignSubscriptionToPublisher

      void assignSubscriptionToPublisher(Id subscriptionId, Id publisherId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Subscription to a Publisher .
      Parameters:
      subscriptionId - the Id of the Subscription
      publisherId - the Id of the Publisher
      Throws:
      AlreadyExistsException - subscriptionId is already assigned to publisherId
      NotFoundException - subscriptionId or publisherId not found
      NullArgumentException - subscriptionId or publisherId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignSubscriptionFromPublisher

      void unassignSubscriptionFromPublisher(Id subscriptionId, Id publisherId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Subscription from a Publisher .
      Parameters:
      subscriptionId - the Id of the Subscription
      publisherId - the Id of the Publisher
      Throws:
      NotFoundException - subscriptionId or publisherId not found or subscriptionId not assigned to publisherId
      NullArgumentException - subscriptionId or publisherId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignSubscriptionToPublisher

      void reassignSubscriptionToPublisher(Id subscriptionId, Id fromPublisherId, Id toPublisherId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Subscription from one Publisher to another. Mappings to other Publishers are unaffected.
      Parameters:
      subscriptionId - the Id of the Subscription
      fromPublisherId - the Id of the current Publisher
      toPublisherId - the Id of the destination Publisher
      Throws:
      AlreadyExistsException - subscriptionId already assigned to toPublisherId
      NotFoundException - subscriptionId, fromPublisherId , or toPublisherId not found or subscriptionId not mapped to fromPublisherId
      NullArgumentException - subscriptionId, fromPublisherId , or toPublisherId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.