com.ibm.retail.saf.provider.kiosk
Class KioskPOSProviderImpl

java.lang.Object
  |
  +--com.ibm.retail.saf.provider.kiosk.KioskPOSProviderImpl
All Implemented Interfaces:
KioskPOSProvider, POSProvider, PriceProvider, java.rmi.Remote, SalesProvider

public class KioskPOSProviderImpl
extends java.lang.Object
implements KioskPOSProvider

Provides an implementation of the KioskPOSProvider interface.


Constructor Summary
protected KioskPOSProviderImpl(com.ibm.retail.saf.provider.ProviderRequest request)
          Constructor.
 
Method Summary
 com.ibm.retail.saf.provider.PriceResult getBaseItemPrices(com.ibm.retail.saf.provider.PriceRequest priceRequest)
          Sends a request to the point-of-sale system to obtain the current unit sales price for a list of items.
protected  com.ibm.retail.saf.provider.kiosk.KioskPOSProvider getPOSServer()
          Get the POSServer for this instance.
 com.ibm.retail.saf.provider.POSStatus getPOSStatus()
          Get status of the virtual POS session This method provides a means for the client to interrogate the status of the virtual POS session state and whether point-of-sale exception log.
 com.ibm.retail.saf.provider.TransactionResult getTransactionPrices(com.ibm.retail.saf.provider.TransactionRequest transactionRequest)
          Sends a request to the point-of-sale system to obtain the extended prices and transaction totals for an order.
 boolean isPOSActive()
          Checks the point-of-sale system associated with this provider to determine if it is in a state which allows requests to be sent from a client.
 com.ibm.retail.saf.provider.SalesTransaction makeSalesTransaction()
          Sends a request to the point-of-sale system to create a new sales transaction.
 void release()
          Releases the point-of-sale resources associated with this POSProvider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KioskPOSProviderImpl

protected KioskPOSProviderImpl(com.ibm.retail.saf.provider.ProviderRequest request)
                        throws java.rmi.RemoteException,
                               POSException
Constructor.

Parameters:
request - Provider request
Throws:
java.rmi.RemoteException
POSException
Method Detail

isPOSActive

public boolean isPOSActive()
                    throws POSException
Description copied from interface: POSProvider
Checks the point-of-sale system associated with this provider to determine if it is in a state which allows requests to be sent from a client.

This function performs a general "health check" of the communication between the provider and the point-of-sale system. It checks that the function on the point-of-sale system used by the provider is currently available.

If the POS is not able to receive and process requests, an exception is thrown which details the error condition.

Specified by:
isPOSActive in interface POSProvider
Throws:
POSException - if the POS is not active.

getBaseItemPrices

public com.ibm.retail.saf.provider.PriceResult getBaseItemPrices(com.ibm.retail.saf.provider.PriceRequest priceRequest)
                                                          throws POSException
Description copied from interface: PriceProvider
Sends a request to the point-of-sale system to obtain the current unit sales price for a list of items.

This method provides a means to obtain a price list for a set of items contained in the PriceRequest. Results of the inquiry are returned in the PriceResult object.

If the point-of-sale system is not able to receive and process requests, an exception is thrown which details the error condition.

Specified by:
getBaseItemPrices in interface PriceProvider
Parameters:
priceRequest - contains the information for the point-of-sale to process this request
Returns:
priceResult contains the results from the point-of-sale system
Throws:
POSException - if the point-of-sale system is unable to process the request. The exception wrappers the cause and provides further details on the current condition.

makeSalesTransaction

public com.ibm.retail.saf.provider.SalesTransaction makeSalesTransaction()
                                                                  throws TransactionInProgressException,
                                                                         RecoveryException,
                                                                         POSException
Description copied from interface: SalesProvider
Sends a request to the point-of-sale system to create a new sales transaction.

This method provides a means to submit a request to the point-of-sale system to initiate processing of a normal sales transaction.

The point-of-sale system will process the request and will return a SalesTransaction object if no exceptions occur. If the processing is unsuccessful, an exception is thrown detailing the error condition.

If a transaction is successfully created on the POS and no exceptions are thrown, the SalesTransaction object returned to the client is used to perform the item sales, tender the payment, and confirm the operation.

If the POS is not able to receive and process the request, an exception is thrown which details the error condition.

The SalesTransaction must be completed and confirmed before subsequent provider methods may be called. A SalesTransaction that can not be completed due to exceptions must be cancelled to allow a new transaction to be started.

Only a single transaction can be active for an instance of a SalesProvider. Additional SalesProvider instances are need to provide the capability to process more than one transaction simultaneously.

Specified by:
makeSalesTransaction in interface SalesProvider
Returns:
active transaction contains the results from the point-of-sale system.
Throws:
RecoveryException - if the POSProvider is in an error recovery state and is unable to process this request.
TransactionInProgressException - if there is already a transaction in progress.
POSException - if the point-of-sale system is unable to process the request. The exception wrappers the cause and provides further details on the current condition.

getPOSStatus

public com.ibm.retail.saf.provider.POSStatus getPOSStatus()
                                                   throws POSException
Description copied from interface: POSProvider
Get status of the virtual POS session

This method provides a means for the client to interrogate the status of the virtual POS session state and whether point-of-sale exception log. This is useful in cases where the processing of a transaction failed to complete normally and may require store attention to reconcile.

Specified by:
getPOSStatus in interface POSProvider
Throws:
POSException - if the point-of-sale system is unable to process the request. The exception wrappers the cause and provides further details on the current condition.

release

public void release()
             throws POSException
Description copied from interface: POSProvider
Releases the point-of-sale resources associated with this POSProvider.

If the provider has a transaction still in progress it will cancel the transaction prior to the release.

Specified by:
release in interface POSProvider
Throws:
POSException - if the point-of-sale system is unable to process the request. The exception wrappers the cause and provides further details on the current condition.

getTransactionPrices

public com.ibm.retail.saf.provider.TransactionResult getTransactionPrices(com.ibm.retail.saf.provider.TransactionRequest transactionRequest)
                                                                   throws POSException
Description copied from interface: PriceProvider
Sends a request to the point-of-sale system to obtain the extended prices and transaction totals for an order.

This method provides a means to determine extended prices, discounts, totals, and tax for a list of items contained in the TransactionRequest object. The results are returned in the TransactionResult object.

The TransactionRequest provided by the caller must include the item information required for the point-of-sale system to process the items and obtain prices and totals. Additional information such as customer loyalty information may also be included in the request.

Payment information is not needed to obtain prices and totals. Any payment information contained in the TransactionRequest is ignored.

The point-of-sale system will process the request and put item and transaction totals information in the TransactionResult object. If the POS is not able to receive and process the request, an exception is thrown which details the error condition.

Specified by:
getTransactionPrices in interface PriceProvider
Parameters:
transactionRequest - contains the information for the point-of-sale to process this request
Returns:
transactionResult contains the results from the point-of-sale system
Throws:
POSException - if the point-of-sale system is unable to process the request. The exception wrappers the cause and provides further details on the current condition.

getPOSServer

protected com.ibm.retail.saf.provider.kiosk.KioskPOSProvider getPOSServer()
Get the POSServer for this instance.

Returns:
server instance associated with this server