Interface BinAdminSession

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

public interface BinAdminSession extends OsidSession

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

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

The delete operations delete Bins .

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

  • Method Details

    • canCreateBins

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

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

      BinForm getBinFormForCreate(Type[] binRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the bin form for creating new bins.
      Parameters:
      binRecordTypes - array of bin record types
      Returns:
      the bin form
      Throws:
      NullArgumentException - binRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form with requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createBin

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

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

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

      Updates an existing bin.
      Parameters:
      binForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - binForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - binId or binForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - binForm did not originate from getBinFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteBins

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

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

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

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