public interface AuctionAdminSession extends OsidSession
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.
Modifier and Type | Method and Description |
---|---|
void |
aliasAuction(Id auctionId,
Id aliasId)
Adds an
Id to an Auction for the purpose
of creating compatibility. |
boolean |
canCreateAuctions()
Tests if this user can create
Auctions. |
boolean |
canCreateAuctionWithRecordTypes(Type[] auctionRecordTypes)
Tests if this user can create a single
Auction using
the desired record types. |
boolean |
canDeleteAuctions()
Tests if this user can delete
Auctions. |
boolean |
canManageAuctionAliases()
Tests if this user can manage
Id aliases for
Auctions. |
boolean |
canUpdateAuctions()
Tests if this user can update
Auctions. |
Auction |
createAuction(AuctionForm auctionForm)
Creates a new
Auction. |
void |
deleteAuction(Id auctionId)
Deletes an
Auction. |
AuctionForm |
getAuctionFormForCreate(Type[] auctionRecordTypes)
Gets the auction form for creating new auctions.
|
AuctionForm |
getAuctionFormForUpdate(Id auctionId)
Gets the auction form for updating an existing auction.
|
AuctionHouse |
getAuctionHouse()
Gets the
AuctionHouse associated with this session. |
Id |
getAuctionHouseId()
Gets the
AuctionHouse Id associated with
this session. |
void |
updateAuction(AuctionForm auctionForm)
Updates an existing auction.
|
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 canCreateAuctions()
Auctions.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating an Auction
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 Auction
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateAuctionWithRecordTypes(Type[] auctionRecordTypes)
Auction
using
the desired record types. While
BiddingManager.getAuctionRecordTypes()
can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Auction.
Providing an
empty array tests if an Auction
can be created with no
records.auctionRecordTypes
- array of auction record types true
if Auction
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- auctionRecordTypes
is null
mandatory
- This method must be implemented. AuctionForm getAuctionFormForCreate(Type[] auctionRecordTypes) throws OperationFailedException, PermissionDeniedException
auctionRecordTypes
- array of auction record typesNullArgumentException
- auctionRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Auction createAuction(AuctionForm auctionForm) throws OperationFailedException, PermissionDeniedException
Auction.
auctionForm
- the form for this Auction
Auction
IllegalStateException
- auctionForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- auctionForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- auctionForm
did
not originate from getAuctionFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateAuctions()
Auctions.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating an Auction
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 Auction
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. AuctionForm getAuctionFormForUpdate(Id auctionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
auctionId
- the Id
of the Auction
NotFoundException
- auctionId
is not
foundNullArgumentException
- auctionId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateAuction(AuctionForm auctionForm) throws OperationFailedException, PermissionDeniedException
auctionForm
- the form containing the elements to be updatedIllegalStateException
- auctionForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- auctionForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- auctionForm
did
not originate from getAuctionFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteAuctions()
Auctions.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting an Auction
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 Auction
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteAuction(Id auctionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Auction.
auctionId
- the Id
of the Auction
to removeNotFoundException
- auctionId
not foundNullArgumentException
- auctionId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageAuctionAliases()
Id
aliases for
Auctions.
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 Auction
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasAuction(Id auctionId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to an Auction
for the purpose
of creating compatibility. The primary Id
of the
Auction
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the
alias is a pointer to another auction, it is reassigned to the given
auction Id.
auctionId
- the Id
of an Auction
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- auctionId
not foundNullArgumentException
- auctionId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.