Interface PublisherAdminSession

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

public interface PublisherAdminSession extends OsidSession

This session creates and removes publishers. The data for create and update is provided by the consumer via the form.

  • Method Details

    • canCreatePublishers

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

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

      PublisherForm getPublisherFormForCreate(Type[] publisherRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the publisher form for creating new publishers. A new form should be requested for each create transaction.
      Parameters:
      publisherRecordTypes - array of publisher record types
      Returns:
      the publisher form
      Throws:
      NullArgumentException - publisherRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get foem for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createPublisher

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

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

      PublisherForm getPublisherFormForUpdate(Id publisherId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the publisher form for updating an existing publisher. A new publisher form should be requested for each update transaction.
      Parameters:
      publisherId - the Id of the Publisher
      Returns:
      the publisher form
      Throws:
      NotFoundException - publisherId is not found
      NullArgumentException - publisherId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updatePublisher

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

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

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

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

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