Interface PriceScheduleAdminSession

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

public interface PriceScheduleAdminSession extends OsidSession

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

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

The delete operations delete PriceSchedules . To unmap a PriceSchedule from the current Store , the PriceScheduleStoreAssignmentSession should be used. These delete operations attempt to remove the PriceSchedule itself thus removing it from all known Store catalogs.

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

  • Method Details

    • getStoreId

      Id getStoreId()
      Gets the Store Id associated with this session.
      Returns:
      the Store Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getStore

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

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

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

      PriceScheduleForm getPriceScheduleFormForCreate(Type[] priceScheduleRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the price schedule form for creating new prices. A new form should be requested for each create transaction.
      Parameters:
      priceScheduleRecordTypes - array of price schedule record types
      Returns:
      the price schedule form
      Throws:
      NullArgumentException - priceScheduleRecordTypes 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.
    • createPriceSchedule

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

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

      PriceScheduleForm getPriceScheduleFormForUpdate(Id priceScheduleId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the price schedule form for updating an existing price schedule. A new price schedule form should be requested for each update transaction.
      Parameters:
      priceScheduleId - the Id of the PriceSchedule
      Returns:
      the price schedule form
      Throws:
      NotFoundException - priceScheduleId is not found
      NullArgumentException - priceScheduleId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updatePriceSchedule

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

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

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

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

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

      boolean canCreatePrices(Id priceScheduleId)
      Tests if this user can create Prices for a PriceSchedule . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a PriceSchedule 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.
      Parameters:
      priceScheduleId - the Id of a PriceSchedule
      Returns:
      false if Price creation is not authorized, true otherwise
      Throws:
      NullArgumentException - priceScheduleId is null
      Compliance:
      mandatory - This method must be implemented.
    • canCreatePriceWithRecordTypes

      boolean canCreatePriceWithRecordTypes(Id priceScheduleId, Type[] priceRecordTypes)
      Tests if this user can create a single Price using the desired record types. While OrderingManager.getPriceRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Price . Providing an empty array tests if a Grade can be created with no records.
      Parameters:
      priceScheduleId - the Id of a PriceSchedule
      priceRecordTypes - array of price record types
      Returns:
      true if Price creation using the specified Types is supported, false otherwise
      Throws:
      NullArgumentException - priceScheduleId or priceRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getPriceFormForCreate

      GradeForm getPriceFormForCreate(Id priceScheduleId, Type[] priceRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the price form for creating new prices. A new form should be requested for each create transaction.
      Parameters:
      priceScheduleId - the Id of a PriceSchedule
      priceRecordTypes - array of price record types
      Returns:
      the price form
      Throws:
      NotFoundException - priceScheduleId is not found
      NullArgumentException - priceScheduleId or priceRecordTypes 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.
    • createPrice

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

      boolean canUpdatePrices(Id priceScheduleId)
      Tests if this user can update Prices . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Price 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.
      Parameters:
      priceScheduleId - the Id of a PriceSchedule
      Returns:
      false if Price modification is not authorized, true otherwise
      Throws:
      NullArgumentException - priceSchedule is null
      Compliance:
      mandatory - This method must be implemented.
    • getPriceFormForUpdate

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

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

      boolean canDeletePrices(Id priceScheduleId)
      Tests if this user can delete prices. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Price 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.
      Parameters:
      priceScheduleId - the Id of a PriceSchedule
      Returns:
      false if Grade deletion is not authorized, true otherwise
      Throws:
      NullArgumentException - priceScheduleId is null
      Compliance:
      mandatory - This method must be implemented.
    • deletePrice

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

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

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