public interface BidAdminSession extends OsidSession
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.
Modifier and Type | Method and Description |
---|---|
void |
aliasBid(Id bidId,
Id aliasId)
Adds an
Id to a Bid for the purpose of
creating compatibility. |
boolean |
canCreateBids()
Tests if this user can create
Bids. |
boolean |
canCreateBidWithRecordTypes(Type[] bidRecordTypes)
Tests if this user can create a single
Bid using the
desired record types. |
boolean |
canDeleteBids()
Tests if this user can delete
Bids. |
boolean |
canManageBidAliases()
Tests if this user can manage
Id aliases for
Bids. |
boolean |
canUpdateBids()
Tests if this user can update
Bids. |
Bid |
createBid(BidForm bidForm)
Creates a new
Bid. |
void |
deleteBid(Id bidId)
Deletes a
Bid. |
AuctionHouse |
getAuctionHouse()
Gets the
AuctionHouse associated with this session. |
Id |
getAuctionHouseId()
Gets the
AuctionHouse Id associated with
this session. |
BidForm |
getBidFormForCreate(Id auctionId,
Type[] bidRecordTypes)
Gets the bid form for creating new bids.
|
BidForm |
getBidFormForUpdate(Id bidId)
Gets the bid form for updating an existing bid.
|
void |
updateBid(BidForm bidForm)
Updates an existing bid.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getAuctionHouseId()
AuctionHouse
Id
associated with
this session. AuctionHouse Id
associated with this
sessionmandatory
- This method must be implemented. AuctionHouse getAuctionHouse() throws OperationFailedException, PermissionDeniedException
AuctionHouse
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateBids()
Bids.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Bid
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer create operations to an
unauthorized user. false
if Bid
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateBidWithRecordTypes(Type[] bidRecordTypes)
Bid
using the
desired record types. While BiddingManager.getBidRecordTypes()
can be used to examine which records are supported, this
method tests which record(s) are required for creating a specific
Bid.
Providing an empty array tests if a Bid
can be created with no records.bidRecordTypes
- array of bid record types true
if Bid
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- bidRecordTypes
is null
mandatory
- This method must be implemented. BidForm getBidFormForCreate(Id auctionId, Type[] bidRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
auctionId
- an Auction
Id
bidRecordTypes
- array of bid record typesNotFoundException
- auctionId
is not
foundNullArgumentException
- auctionId
or
bidRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Bid createBid(BidForm bidForm) throws OperationFailedException, PermissionDeniedException
Bid.
bidForm
- the form for this Bid
Bid
IllegalStateException
- bidForm
already
used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- bidForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- bidForm
did not
originate from getBidFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateBids()
Bids.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Bid
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer update operations to an
unauthorized user. false
if Bid
modification is not
authorized, true
otherwisemandatory
- This method must be implemented. BidForm getBidFormForUpdate(Id bidId) throws NotFoundException, OperationFailedException, PermissionDeniedException
bidId
- the Id
of the Bid
NotFoundException
- bidId
is not foundNullArgumentException
- bidId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateBid(BidForm bidForm) throws OperationFailedException, PermissionDeniedException
bidForm
- the form containing the elements to be updatedIllegalStateException
- bidForm
already
used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- bidForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- bidForm
did not
originate from getBidFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteBids()
Bids.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Bid
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer delete operations to an
unauthorized user. false
if Bid
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteBid(Id bidId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Bid.
bidId
- the Id
of the Bid
to
removeNotFoundException
- bidId
not foundNullArgumentException
- bidId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageBidAliases()
Id
aliases for
Bids.
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 Bid
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasBid(Id bidId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Bid
for the purpose of
creating compatibility. The primary Id
of the
Bid
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the alias is
a pointer to another bid, it is reassigned to the given bid Id.
bidId
- the Id
of a Bid
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- bidId
not foundNullArgumentException
- bidId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.