Interface AuctionAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
AuctionBatchAdminSession
This session creates, updates, and deletes Auctions . 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 an
Auction , an AuctionForm is requested using
getAuctionFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned
AuctionForm 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 AuctionForm is submiited to a create operation, it cannot
be reused with another create operation unless the first operation was
unsuccessful. Each AuctionForm corresponds to an attempted
transaction.
For updates, AuctionForms are requested to the Auction
Id that is to be updated using getAuctionFormForUpdate() .
Similarly, the AuctionForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
AuctionForm can only be used once for a successful update and
cannot be reused.
The delete operations delete Auctions . To unmap an
Auction from the current AuctionHouse , the
AuctionAuctionHouseAssignmentSession should be used. These delete
operations attempt to remove the Auction itself thus removing it
from all known AuctionHouse catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasAuction(Id auctionId, Id aliasId) Adds anIdto anAuctionfor the purpose of creating compatibility.booleanTests if this user can createAuctions.booleancanCreateAuctionWithRecordTypes(Type[] auctionRecordTypes) Tests if this user can create a singleAuctionusing the desired record types.booleanTests if this user can deleteAuctions.booleanTests if this user can manageIdaliases forAuctions.booleanTests if this user can updateAuctions.createAuction(AuctionForm auctionForm) Creates a newAuction.voiddeleteAuction(Id auctionId) Deletes anAuction.getAuctionFormForCreate(Type[] auctionRecordTypes) Gets the auction form for creating new auctions.getAuctionFormForUpdate(Id auctionId) Gets the auction form for updating an existing auction.Gets theAuctionHouseassociated with this session.Gets theAuctionHouseIdassociated with this session.voidupdateAuction(AuctionForm auctionForm) Updates an existing auction.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
-
getAuctionHouseId
Id getAuctionHouseId()Gets theAuctionHouseIdassociated with this session.- Returns:
- the
AuctionHouse Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getAuctionHouse
Gets theAuctionHouseassociated with this session.- Returns:
- the auction house
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateAuctions
boolean canCreateAuctions()Tests if this user can createAuctions. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anAuctionwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifAuctioncreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateAuctionWithRecordTypes
Tests if this user can create a singleAuctionusing the desired record types. WhileBiddingManager.getAuctionRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificAuction. Providing an empty array tests if anAuctioncan be created with no records.- Parameters:
auctionRecordTypes- array of auction record types- Returns:
trueifAuctioncreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-auctionRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getAuctionFormForCreate
AuctionForm getAuctionFormForCreate(Type[] auctionRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the auction form for creating new auctions. A new form should be requested for each create transaction.- Parameters:
auctionRecordTypes- array of auction record types- Returns:
- the auction form
- Throws:
NullArgumentException-auctionRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createAuction
Auction createAuction(AuctionForm auctionForm) throws OperationFailedException, PermissionDeniedException Creates a newAuction.- Parameters:
auctionForm- the form for thisAuction- Returns:
- the new
Auction - Throws:
IllegalStateException-auctionFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-auctionFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-auctionFormdid not originate fromgetAuctionFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateAuctions
boolean canUpdateAuctions()Tests if this user can updateAuctions. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anAuctionwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifAuctionmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getAuctionFormForUpdate
AuctionForm getAuctionFormForUpdate(Id auctionId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the auction form for updating an existing auction. A new auction form should be requested for each update transaction.- Parameters:
auctionId- theIdof theAuction- Returns:
- the auction form
- Throws:
NotFoundException-auctionIdis not foundNullArgumentException-auctionIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAuction
void updateAuction(AuctionForm auctionForm) throws OperationFailedException, PermissionDeniedException Updates an existing auction.- Parameters:
auctionForm- the form containing the elements to be updated- Throws:
IllegalStateException-auctionFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-auctionFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-auctionFormdid not originate fromgetAuctionFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteAuctions
boolean canDeleteAuctions()Tests if this user can deleteAuctions. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anAuctionwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifAuctiondeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteAuction
void deleteAuction(Id auctionId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anAuction.- Parameters:
auctionId- theIdof theAuctionto remove- Throws:
NotFoundException-auctionIdnot foundNullArgumentException-auctionIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageAuctionAliases
boolean canManageAuctionAliases()Tests if this user can manageIdaliases forAuctions. 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:
falseifAuctionaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasAuction
void aliasAuction(Id auctionId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anAuctionfor the purpose of creating compatibility. The primaryIdof theAuctionis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another auction, it is reassigned to the given auctionId.- Parameters:
auctionId- theIdof anAuctionaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-auctionIdnot foundNullArgumentException-auctionIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-