Interface PriceScheduleAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
PriceScheduleBatchAdminSession
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 Summary
Modifier and TypeMethodDescriptionvoidaliasPrice(Id priceId, Id aliasId) Adds anIdto aPricefor the purpose of creating compatibility.voidaliasPriceSchedule(Id priceScheduleId, Id aliasId) Adds anIdto aPriceSchedulefor the purpose of creating compatibility.booleancanCreatePrices(Id priceScheduleId) Tests if this user can createPricesfor aPriceSchedule.booleanTests if this user can createPriceSchedules.booleancanCreatePriceScheduleWithRecordTypes(Type[] priceScheduleRecordTypes) Tests if this user can create a singlePriceScheduleusing the desired record types.booleancanCreatePriceWithRecordTypes(Id priceScheduleId, Type[] priceRecordTypes) Tests if this user can create a singlePriceusing the desired record types.booleancanDeletePrices(Id priceScheduleId) Tests if this user can delete prices.booleanTests if this user can deletePriceSchedulesA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forPrices.booleanTests if this user can manageIdaliases forPriceSchedules.booleancanUpdatePrices(Id priceScheduleId) Tests if this user can updatePrices.booleanTests if this user can updatePriceSchedules.createPrice(PriceForm priceForm) Creates a newPrice.createPriceSchedule(PriceForm priceScheduleForm) Creates a newPriceSchedule.voiddeletePrice(Id priceId) Deletes aPrice.voiddeletePriceSchedule(Id priceScheduleId) Deletes aPriceSchedule.getPriceFormForCreate(Id priceScheduleId, Type[] priceRecordTypes) Gets the price form for creating new prices.getPriceFormForUpdate(Id priceId) Gets the price form for updating an existing price.getPriceScheduleFormForCreate(Type[] priceScheduleRecordTypes) Gets the price schedule form for creating new prices.getPriceScheduleFormForUpdate(Id priceScheduleId) Gets the price schedule form for updating an existing price schedule.getStore()Gets theStoreassociated with this session.Gets theStoreIdassociated with this session.voidupdatePrice(PriceForm priceForm) Updates an existing price.voidupdatePriceSchedule(PriceScheduleForm priceScheduleForm) Updates an existing price schedule.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getStoreId
Id getStoreId()Gets theStoreIdassociated with this session.- Returns:
- the
Store Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getStore
Gets theStoreassociated with this session.- Returns:
- the store
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreatePriceSchedules
boolean canCreatePriceSchedules()Tests if this user can createPriceSchedules. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aPricewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifPriceSchedulecreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreatePriceScheduleWithRecordTypes
Tests if this user can create a singlePriceScheduleusing the desired record types. WhileOrderingManager.getPriceScheduleRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificPriceSchedule. Providing an empty array tests if aPriceSchedulecan be created with no records.- Parameters:
priceScheduleRecordTypes- array of price schedule record types- Returns:
trueifPriceSchedulecreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-priceScheduleRecordTypesisnull- 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-priceScheduleRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- 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 newPriceSchedule.- Parameters:
priceScheduleForm- the form for thisPriceSchedule- Returns:
- the new
PriceSchedule - Throws:
IllegalStateException-priceScheduleFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-priceScheduleFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-priceScheduleFormdid not originate fromgetPriceScheduleFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdatePriceSchedules
boolean canUpdatePriceSchedules()Tests if this user can updatePriceSchedules. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aPriceSchedulewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifPriceSchedulemodification is not authorized,trueotherwise- 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- theIdof thePriceSchedule- Returns:
- the price schedule form
- Throws:
NotFoundException-priceScheduleIdis not foundNullArgumentException-priceScheduleIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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-priceScheduleFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-priceScheduleFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-priceScheduleFormdid not originate fromgetPriceScheduleFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeletePriceSchedules
boolean canDeletePriceSchedules()Tests if this user can deletePriceSchedulesA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aPriceSchedulewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifPriceScheduledeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deletePriceSchedule
void deletePriceSchedule(Id priceScheduleId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aPriceSchedule.- Parameters:
priceScheduleId- theIdof thePriceScheduleto remove- Throws:
NotFoundException-priceScheduleIdnot foundNullArgumentException-priceScheduleIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManagePriceScheduleAliases
boolean canManagePriceScheduleAliases()Tests if this user can manageIdaliases forPriceSchedules. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifPriceSchedulealiasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasPriceSchedule
void aliasPriceSchedule(Id priceScheduleId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aPriceSchedulefor the purpose of creating compatibility. The primaryIdof thePriceScheduleis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another price schedule, it is reassigned to the given price scheduleId.- Parameters:
priceScheduleId- theIdof aPriceSchedulealiasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-priceScheduleIdnot foundNullArgumentException-priceScheduleIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreatePrices
Tests if this user can createPricesfor aPriceSchedule. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aPriceSchedulewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Parameters:
priceScheduleId- theIdof aPriceSchedule- Returns:
falseifPricecreation is not authorized,trueotherwise- Throws:
NullArgumentException-priceScheduleIdisnull- Compliance:
mandatory- This method must be implemented.
-
canCreatePriceWithRecordTypes
Tests if this user can create a singlePriceusing the desired record types. WhileOrderingManager.getPriceRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificPrice. Providing an empty array tests if aGradecan be created with no records.- Parameters:
priceScheduleId- theIdof aPriceSchedulepriceRecordTypes- array of price record types- Returns:
trueifPricecreation using the specifiedTypesis supported,falseotherwise- Throws:
NullArgumentException-priceScheduleIdorpriceRecordTypesisnull- 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- theIdof aPriceSchedulepriceRecordTypes- array of price record types- Returns:
- the price form
- Throws:
NotFoundException-priceScheduleIdis not foundNullArgumentException-priceScheduleIdorpriceRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createPrice
Creates a newPrice.- Parameters:
priceForm- the form for thisPrice- Returns:
- the new
Price - Throws:
IllegalStateException-priceFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-priceFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-priceFormdid not originate fromgetPriceFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdatePrices
Tests if this user can updatePrices. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aPricewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Parameters:
priceScheduleId- theIdof aPriceSchedule- Returns:
falseifPricemodification is not authorized,trueotherwise- Throws:
NullArgumentException-priceScheduleisnull- Compliance:
mandatory- This method must be implemented.
-
getPriceFormForUpdate
PriceForm getPriceFormForUpdate(Id priceId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the price form for updating an existing price. A new price form should be requested for each update transaction.- Parameters:
priceId- theIdof thePrice- Returns:
- the price form
- Throws:
NotFoundException-priceIdis not foundNullArgumentException-priceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updatePrice
Updates an existing price.- Parameters:
priceForm- the form containing the elements to be updated- Throws:
IllegalStateException-priceFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-priceFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-priceFormdid not originate fromgetPriceFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeletePrices
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 aPricewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Parameters:
priceScheduleId- theIdof aPriceSchedule- Returns:
falseifGradedeletion is not authorized,trueotherwise- Throws:
NullArgumentException-priceScheduleIdisnull- Compliance:
mandatory- This method must be implemented.
-
deletePrice
void deletePrice(Id priceId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aPrice.- Parameters:
priceId- theIdof thePriceto remove- Throws:
NotFoundException-priceIdnot foundNullArgumentException-priceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManagePriceAliases
boolean canManagePriceAliases()Tests if this user can manageIdaliases forPrices. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifPricealiasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasPrice
void aliasPrice(Id priceId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aPricefor the purpose of creating compatibility. The primaryIdof thePriceis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another price, it is reassigned to the given priceId.- Parameters:
priceId- theIdof aPricealiasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-priceIdnot foundNullArgumentException-priceIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-