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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasPrice(Id priceId,
Id aliasId)
Adds an
Id to a Price for the purpose of
creating compatibility. |
void |
aliasPriceSchedule(Id priceScheduleId,
Id aliasId)
Adds an
Id to a PriceSchedule for the
purpose of creating compatibility. |
boolean |
canCreatePrices(Id priceScheduleId)
Tests if this user can create
Prices for a
PriceSchedule. |
boolean |
canCreatePriceSchedules()
Tests if this user can create
PriceSchedules. |
boolean |
canCreatePriceScheduleWithRecordTypes(Type[] priceScheduleRecordTypes)
Tests if this user can create a single
PriceSchedule
using the desired record types. |
boolean |
canCreatePriceWithRecordTypes(Id priceScheduleId,
Type[] priceRecordTypes)
Tests if this user can create a single
Price using the
desired record types. |
boolean |
canDeletePrices(Id priceScheduleId)
Tests if this user can delete prices.
|
boolean |
canDeletePriceSchedules()
Tests if this user can delete
PriceSchedules A return
of true does not guarantee successful authorization. |
boolean |
canManagePriceAliases()
Tests if this user can manage
Id aliases for
Prices. |
boolean |
canManagePriceScheduleAliases()
Tests if this user can manage
Id aliases for
PriceSchedules. |
boolean |
canUpdatePrices(Id priceScheduleId)
Tests if this user can update
Prices. |
boolean |
canUpdatePriceSchedules()
Tests if this user can update
PriceSchedules. |
Price |
createPrice(PriceForm priceForm)
Creates a new
Price. |
PriceSchedule |
createPriceSchedule(PriceForm priceScheduleForm)
Creates a new
PriceSchedule. |
void |
deletePrice(Id priceId)
Deletes a
Price. |
void |
deletePriceSchedule(Id priceScheduleId)
Deletes a
PriceSchedule. |
GradeForm |
getPriceFormForCreate(Id priceScheduleId,
Type[] priceRecordTypes)
Gets the price form for creating new prices.
|
PriceForm |
getPriceFormForUpdate(Id priceId)
Gets the price form for updating an existing price.
|
PriceScheduleForm |
getPriceScheduleFormForCreate(Type[] priceScheduleRecordTypes)
Gets the price schedule form for creating new prices.
|
PriceScheduleForm |
getPriceScheduleFormForUpdate(Id priceScheduleId)
Gets the price S\schedule form for updating an existing price.
|
Store |
getStore()
Gets the
Store associated with this session. |
Id |
getStoreId()
Gets the
Store Id associated with this
session. |
void |
updatePrice(PriceForm priceForm)
Updates an existing price.
|
void |
updatePriceSchedule(PriceScheduleForm priceScheduleForm)
Updates an existing price schedule.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getStoreId()
Store Id associated with this
session. Store Id associated with this sessionmandatory - This method must be implemented. Store getStore() throws OperationFailedException, PermissionDeniedException
Store associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreatePriceSchedules()
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. false if PriceSchedule creation
is not authorized, true otherwisemandatory - This method must be implemented. boolean canCreatePriceScheduleWithRecordTypes(Type[] priceScheduleRecordTypes)
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.priceScheduleRecordTypes - array of price schedule record types true if PriceSchedule creation
using the specified record Types is supported,
false otherwiseNullArgumentException - priceScheduleRecordTypes
is null mandatory - This method must be implemented. PriceScheduleForm getPriceScheduleFormForCreate(Type[] priceScheduleRecordTypes) throws OperationFailedException, PermissionDeniedException
priceScheduleRecordTypes - array of price schedule record typesNullArgumentException - priceScheduleRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. PriceSchedule createPriceSchedule(PriceForm priceScheduleForm) throws OperationFailedException, PermissionDeniedException
PriceSchedule. priceScheduleForm - the form for this PriceSchedule
PriceSchedule IllegalStateException - priceScheduleForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - priceScheduleForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - priceScheduleForm
did not originate from getPriceScheduleFormForCreate()
mandatory - This method must be implemented. boolean canUpdatePriceSchedules()
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. false if PriceSchedule
modification is not authorized, true otherwisemandatory - This method must be implemented. PriceScheduleForm getPriceScheduleFormForUpdate(Id priceScheduleId)
priceScheduleId - the Id of the Price
NullArgumentException - priceScheduleId
is null mandatory - This method must be implemented. void updatePriceSchedule(PriceScheduleForm priceScheduleForm) throws OperationFailedException, PermissionDeniedException
priceScheduleForm - the form containing the elements to be
updatedIllegalStateException - priceScheduleForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - priceScheduleForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - priceScheduleForm
did not originate from getPriceScheduleFormForUpdate()
mandatory - This method must be implemented. boolean canDeletePriceSchedules()
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. false if PriceSchedule deletion
is not authorized, true otherwisemandatory - This method must be implemented. void deletePriceSchedule(Id priceScheduleId) throws NotFoundException, OperationFailedException, PermissionDeniedException
PriceSchedule. priceScheduleId - the Id of the
PriceSchedule to removeNotFoundException - priceScheduleId not
foundNullArgumentException - priceScheduleId
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManagePriceScheduleAliases()
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. false if PriceSchedule aliasing
is not authorized, true otherwisemandatory - This method must be implemented. void aliasPriceSchedule(Id priceScheduleId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
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. priceScheduleId - the Id of a
PriceSchedule aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - priceScheduleId not
foundNullArgumentException - priceScheduleId
or aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreatePrices(Id priceScheduleId)
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.priceScheduleId - the Id of a
PriceSchedule false if Price creation is not
authorized, true otherwiseNullArgumentException - priceScheduleId
is null mandatory - This method must be implemented. boolean canCreatePriceWithRecordTypes(Id priceScheduleId, Type[] priceRecordTypes)
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.priceScheduleId - the Id of a
PriceSchedule priceRecordTypes - array of price record types true if Price creation using the
specified Types is supported, false
otherwiseNullArgumentException - priceScheduleId
or priceRecordTypes is null mandatory - This method must be implemented. GradeForm getPriceFormForCreate(Id priceScheduleId, Type[] priceRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
priceScheduleId - the Id of a
PriceSchedule priceRecordTypes - array of price record typesNotFoundException - priceScheduleId is
not foundNullArgumentException - priceScheduleId
or priceRecordTypes is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Price createPrice(PriceForm priceForm) throws OperationFailedException, PermissionDeniedException
Price. priceForm - the form for this Price Price IllegalStateException - priceForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - priceForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - priceForm did not
originate from getPriceFormForCreate() mandatory - This method must be implemented. boolean canUpdatePrices(Id priceScheduleId)
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.priceScheduleId - the Id of a
PriceSchedule false if Price modification is
not authorized, true otherwiseNullArgumentException - priceSchedule is
null mandatory - This method must be implemented. PriceForm getPriceFormForUpdate(Id priceId) throws NotFoundException, OperationFailedException
priceId - the Id of the Price NotFoundException - priceId is not foundNullArgumentException - priceId is
null OperationFailedException - unable to complete requestmandatory - This method must be implemented. void updatePrice(PriceForm priceForm) throws OperationFailedException, PermissionDeniedException
priceForm - the form containing the elements to be updatedIllegalStateException - priceForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - priceForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - priceForm did not
originate from getPriceFormForUpdate() mandatory - This method must be implemented. boolean canDeletePrices(Id priceScheduleId)
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.priceScheduleId - the Id of a
PriceSchedule false if Grade deletion is not
authorized, true otherwiseNullArgumentException - priceScheduleId
is null mandatory - This method must be implemented. void deletePrice(Id priceId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Price. priceId - the Id of the Price to
removeNotFoundException - priceId not foundNullArgumentException - priceId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManagePriceAliases()
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. false if Price aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasPrice(Id priceId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
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. priceId - the Id of a Price aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - priceId not foundNullArgumentException - priceId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.