Interface AuctionAdminSession

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

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.

  • 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.
    • canCreateAuctions

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

      boolean canCreateAuctionWithRecordTypes(Type[] auctionRecordTypes)
      Tests if this user can create a single 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.
      Parameters:
      auctionRecordTypes - array of auction record types
      Returns:
      true if Auction creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - auctionRecordTypes is null
      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 - auctionRecordTypes 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.
    • createAuction

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

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

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

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

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

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

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