Interface BidAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
BidBatchAdminSession
This session creates, updates, and deletes Bids . 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
Bid , a Bidform is requested using getBidFormForCreate()
specifying the desired record Types or none if no record
Types are needed. The returned BidForm 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 BidForm is submiited to
a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each BidForm
corresponds to an attempted transaction.
For updates, BidForms are requested to the Bid
Id that is to be updated using getBidFormForUpdate() . Similarly,
the BidForm has metadata about the data that can be updated and it
can perform validation before submitting the update. The BidForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Bids . To unmap a Bid
from the current AuctionHouse , the
BidAuctionHouseAssignmentSession should be used. These delete operations
attempt to remove the Bid 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 TypeMethodDescriptionvoidAdds anIdto aBidfor the purpose of creating compatibility.booleanTests if this user can createBids.booleancanCreateBidWithRecordTypes(Type[] bidRecordTypes) Tests if this user can create a singleBidusing the desired record types.booleanTests if this user can deleteBids.booleanTests if this user can manageIdaliases forBids.booleanTests if this user can updateBids.Creates a newBid.voidDeletes aBid.Gets theAuctionHouseassociated with this session.Gets theAuctionHouseIdassociated with this session.getBidFormForCreate(Id auctionId, Type[] bidRecordTypes) Gets the bid form for creating new bids.getBidFormForUpdate(Id bidId) Gets the bid form for updating an existing bid.voidUpdates an existing bid.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.
-
canCreateBids
boolean canCreateBids()Tests if this user can createBids. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aBidwill 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:
falseifBidcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateBidWithRecordTypes
Tests if this user can create a singleBidusing the desired record types. WhileBiddingManager.getBidRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificBid. Providing an empty array tests if aBidcan be created with no records.- Parameters:
bidRecordTypes- array of bid record types- Returns:
trueifBidcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-bidRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getBidFormForCreate
BidForm getBidFormForCreate(Id auctionId, Type[] bidRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the bid form for creating new bids. A new form should be requested for each create transaction.- Parameters:
auctionId- anAuctionIdbidRecordTypes- array of bid record types- Returns:
- the bid form
- Throws:
NotFoundException-auctionIdis not foundNullArgumentException-auctionIdorbidRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createBid
Creates a newBid.- Parameters:
bidForm- the form for thisBid- Returns:
- the new
Bid - Throws:
IllegalStateException-bidFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-bidFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-bidFormdid not originate fromgetBidFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateBids
boolean canUpdateBids()Tests if this user can updateBids. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aBidwill 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:
falseifBidmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getBidFormForUpdate
BidForm getBidFormForUpdate(Id bidId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the bid form for updating an existing bid. A new bid form should be requested for each update transaction.- Parameters:
bidId- theIdof theBid- Returns:
- the bid form
- Throws:
NotFoundException-bidIdis not foundNullArgumentException-bidIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateBid
Updates an existing bid.- Parameters:
bidForm- the form containing the elements to be updated- Throws:
IllegalStateException-bidFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-bidFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-bidFormdid not originate fromgetBidFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteBids
boolean canDeleteBids()Tests if this user can deleteBids. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aBidwill 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:
falseifBiddeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteBid
void deleteBid(Id bidId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aBid.- Parameters:
bidId- theIdof theBidto remove- Throws:
NotFoundException-bidIdnot foundNullArgumentException-bidIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageBidAliases
boolean canManageBidAliases()Tests if this user can manageIdaliases forBids. 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:
falseifBidaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasBid
void aliasBid(Id bidId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aBidfor the purpose of creating compatibility. The primaryIdof theBidis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another bid, it is reassigned to the given bidId.- Parameters:
bidId- theIdof aBidaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-bidIdnot foundNullArgumentException-bidIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-