Interface ChainAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ChainAdminSession extends OsidSession

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

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

The delete operations delete Chains . To unmap a Chain from the current Antimatroid , the ChainAntimatroidAssignmentSession should be used. These delete operations attempt to remove the Chain itself thus removing it from all known Antimatroid catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • getAntimatroidId

      Id getAntimatroidId()
      Gets the Antimatroid Id associated with this session.
      Returns:
      the Antimatroid Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getAntimatroid

      Gets the Antimatroid associated with this session.
      Returns:
      the antimatroid
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateChains

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

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

      ChainForm getChainFormForCreate(Type[] chainRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the chain form for creating new chains. A new form should be requested for each create transaction.
      Parameters:
      chainRecordTypes - array of chain record types
      Returns:
      the chain form
      Throws:
      NullArgumentException - chainRecordTypes 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.
    • createChain

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

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

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

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

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

      Deletes a Chain .
      Parameters:
      chainId - the Id of the Chain to remove
      Throws:
      NotFoundException - chainId not found
      NullArgumentException - chainId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageChainAliases

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

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