Interface StoreAdminSession

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

public interface StoreAdminSession extends OsidSession

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

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

The delete operations delete Stores .

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

  • Method Details

    • canCreateStores

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

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

      StoreForm getStoreFormForCreate(Type[] storeRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the store form for creating new stores. A new form should be requested for each create transaction.
      Parameters:
      storeRecordTypes - array of store record types
      Returns:
      the store form
      Throws:
      NullArgumentException - storeRecordTypes 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.
    • createStore

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

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

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

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

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

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

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

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