Interface SubscriptionEnablerAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface SubscriptionEnablerAdminSession extends OsidSession

This session creates and removes subscription enablers. The data for create and update is provided via the SubscriptionEnablerForm.

  • 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.
    • canCreateSubscriptionEnabler

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

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

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

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

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

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

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

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

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

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

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