Interface BidAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
BidBatchAdminSession

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.

  • Method Details

    • getAuctionHouseId

      Id getAuctionHouseId()
      Gets the AuctionHouse Id associated with this session.
      Returns:
      the AuctionHouse Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getAuctionHouse

      Gets the AuctionHouse associated with this session.
      Returns:
      the auction house
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateBids

      boolean canCreateBids()
      Tests if this user can create 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.
      Returns:
      false if Bid creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateBidWithRecordTypes

      boolean canCreateBidWithRecordTypes(Type[] bidRecordTypes)
      Tests if this user can create a single 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.
      Parameters:
      bidRecordTypes - array of bid record types
      Returns:
      true if Bid creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - bidRecordTypes is null
      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 - an Auction Id
      bidRecordTypes - array of bid record types
      Returns:
      the bid form
      Throws:
      NotFoundException - auctionId is not found
      NullArgumentException - auctionId or bidRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createBid

      Creates a new Bid .
      Parameters:
      bidForm - the form for this Bid
      Returns:
      the new Bid
      Throws:
      IllegalStateException - bidForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - bidForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - bidForm did not originate from getBidFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateBids

      boolean canUpdateBids()
      Tests if this user can update 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.
      Returns:
      false if Bid modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getBidFormForUpdate

      Gets the bid form for updating an existing bid. A new bid form should be requested for each update transaction.
      Parameters:
      bidId - the Id of the Bid
      Returns:
      the bid form
      Throws:
      NotFoundException - bidId is not found
      NullArgumentException - bidId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 - bidForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - bidForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - bidForm did not originate from getBidFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteBids

      boolean canDeleteBids()
      Tests if this user can delete 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.
      Returns:
      false if Bid deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteBid

      Deletes a Bid .
      Parameters:
      bidId - the Id of the Bid to remove
      Throws:
      NotFoundException - bidId not found
      NullArgumentException - bidId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageBidAliases

      boolean canManageBidAliases()
      Tests if this user can manage 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.
      Returns:
      false if Bid aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasBid

      Adds an 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 .
      Parameters:
      bidId - the Id of a Bid
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - bidId not found
      NullArgumentException - bidId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.