com.ecebs.rtd.enabler
Class TransactionController

java.lang.Object
  extended by com.ecebs.rtd.enabler.TransactionController
All Implemented Interfaces:
ITransactionController

public class TransactionController
extends Object
implements ITransactionController

Carries out operations that interact with a presented CM, asynchronously. Only one operation can be carried out at a time. Attempting to start another operation when one is in progress will result in an IllegalStateException being thrown. The operation that was being executed will continue if this situation occurs.

Author:
kyleb

Method Summary
 void addStoredUse(AddStoredUseRequest product, DownloadMode mode, ITransactionControllerCallback callback)
          The DEDUCT JOURNEYS/PASSES function can be called by the APPLICATION to request the RTD SERVER deducts a number of stored passes from an ITSO TYP22 product, or a number of journeys from an ITSO TYP23 or TYP24 product.
 void addStrValue(AddSTRRequest product, DownloadMode mode, ITransactionControllerCallback callback)
          The ADD STR VALUE function can be called by the APPLICATION to request the RTD SERVER adds or credits value to the STR Product of the specified CM .
 void cancelRequest(String requestId, ITransactionControllerCallback listener)
          Cancels a previously registered request.
 void deductStoredUse(DeductStoredUseRequest product, DownloadMode mode, ITransactionControllerCallback callback)
          The ADD JOURNEYS/PASSES function can be called by the APPLICATION to request the RTD SERVER adds a number of stored passes to an ITSO TYP22 product, or a number of journeys to an ITSO TYP23 or TYP24 product.
 void deductStrValue(DeductSTRRequest product, DownloadMode mode, ITransactionControllerCallback callback)
          The DEDUCT STR VALUE function can be called by the APPLICATION to request the RTD SERVER deduct or debit value from the STR Product of the specified CM .
 void deleteProduct(DeleteProductRequest product, DownloadMode mode, ITransactionControllerCallback callback)
          The DELETE PRODUCT function is called by the APPLICATION to request the RTD SERVER deletes one or more products from the CM.
static ITransactionController getInstance()
          Get an instance of ITransactionController.
 void loadProduct(LoadProductRequest product, DownloadMode mode, ITransactionControllerCallback callback)
          The LOAD PRODUCT function is called by the application to request a Product from the RTD SERVER and load it onto the specified CM.
 void performPendingRequests(ITransactionControllerCallback callback)
          The PERFORM PENDING REQUESTS function is called by the application to download one or more previously requested product loads and/or modifications.
 void performPendingRequests(String cardId, CardType cardType, ITransactionControllerCallback callback)
          The PERFORM PENDING REQUESTS function is called by the application to download one or more previously requested product loads and/or modifications.
 void performPendingRequests(String requestId, ITransactionControllerCallback callback)
          The PERFORM PENDING REQUESTS function is called by the application to download one or more previously requested product loads and/or modifications.
 void performPendingRequests(String requestId, String cardId, CardType cardType, ITransactionControllerCallback callback)
          The PERFORM PENDING REQUESTS function is called by the application to download one or more previously requested product loads and/or modifications.
 void queryStatus(String requestId, QueryMode mode, ITransactionControllerCallback listener)
          Get details about the requests handled during the last download involving the CM with the specified Id
 void updatePassExpiryDate(UpdatePassExpiryDateRequest product, DownloadMode mode, ITransactionControllerCallback callback)
          The UPDATE PASS EXPIRY DATE function can be called by the APPLICATION to request the RTD SERVER updates the current pass expiry date of a ITSO TYP22 product.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ITransactionController getInstance()
Get an instance of ITransactionController. The instance returned will be appropriate for the platform associated with the initialised ConfigManager. Note that the instance is a singleton.

Returns:
Singleton instance of ITransactionController

addStoredUse

public void addStoredUse(AddStoredUseRequest product,
                         DownloadMode mode,
                         ITransactionControllerCallback callback)
Description copied from interface: ITransactionController
The DEDUCT JOURNEYS/PASSES function can be called by the APPLICATION to request the RTD SERVER deducts a number of stored passes from an ITSO TYP22 product, or a number of journeys from an ITSO TYP23 or TYP24 product.

Specified by:
addStoredUse in interface ITransactionController
Parameters:
product - An instance containing the details of the operation to be carried out
mode - Specifies what to do, i.e. just register, register and download, etc
callback - Callback used to inform the application on the progress of the operation

deductStoredUse

public void deductStoredUse(DeductStoredUseRequest product,
                            DownloadMode mode,
                            ITransactionControllerCallback callback)
Description copied from interface: ITransactionController
The ADD JOURNEYS/PASSES function can be called by the APPLICATION to request the RTD SERVER adds a number of stored passes to an ITSO TYP22 product, or a number of journeys to an ITSO TYP23 or TYP24 product.

Specified by:
deductStoredUse in interface ITransactionController
Parameters:
product - An instance containing the details of the operation to be carried out
mode - Specifies what to do, i.e. just register, register and download, etc
callback - Callback used to inform the application on the progress of the operation

addStrValue

public void addStrValue(AddSTRRequest product,
                        DownloadMode mode,
                        ITransactionControllerCallback callback)
Description copied from interface: ITransactionController
The ADD STR VALUE function can be called by the APPLICATION to request the RTD SERVER adds or credits value to the STR Product of the specified CM . All of the communications between the RTD SERVER and CM are handled by the call to this function. The STR product to update will be specified by a Product Name, with any non-default or customer specific field values passed in the Product Data field. The Product Name is scheme specific. Conversion from the Product Name to product instantiation is performed by the RTD SERVER.

Specified by:
addStrValue in interface ITransactionController
Parameters:
product - An instance containing the details of the operation to be carried out
mode - Specifies what to do, i.e. just register, register and download, etc
callback - Callback used to inform the application on the progress of the operation

deductStrValue

public void deductStrValue(DeductSTRRequest product,
                           DownloadMode mode,
                           ITransactionControllerCallback callback)
Description copied from interface: ITransactionController
The DEDUCT STR VALUE function can be called by the APPLICATION to request the RTD SERVER deduct or debit value from the STR Product of the specified CM . All of the communications between the RTD SERVER and CM are handled by the call to this function. The STR product to update will be specified by a Product Name, with any non-default or customer specific field values passed in the Product Data field. The Product Name is scheme specific. Conversion from the Product Name to product instantiation is performed by the RTD SERVER.

Specified by:
deductStrValue in interface ITransactionController
Parameters:
product - An instance containing the details of the operation to be carried out
mode - Specifies what to do, i.e. just register, register and download, etc
callback - Callback used to inform the application on the progress of the operation

deleteProduct

public void deleteProduct(DeleteProductRequest product,
                          DownloadMode mode,
                          ITransactionControllerCallback callback)
Description copied from interface: ITransactionController
The DELETE PRODUCT function is called by the APPLICATION to request the RTD SERVER deletes one or more products from the CM.

Specified by:
deleteProduct in interface ITransactionController
Parameters:
product - An instance containing the details of the operation to be carried out
mode - Specifies what to do, i.e. just register, register and download, etc
callback - Callback used to inform the application on the progress of the operation

loadProduct

public void loadProduct(LoadProductRequest product,
                        DownloadMode mode,
                        ITransactionControllerCallback callback)
Description copied from interface: ITransactionController
The LOAD PRODUCT function is called by the application to request a Product from the RTD SERVER and load it onto the specified CM. All of the communications between the RTD SERVER and CM are handled by the call to this function. The product to load will be specified by a Product Name, with any non-default or customer specific field values passed in the Product Data parameter. The Product Name is scheme specific, and may be something like "Single Journey" or "Season Ticket". Conversion from the Product Name to product instantiation is performed by the RTD SERVER. Examples of the specific customer field values could be Expiry Date, Product Cost or Journey Start and End Locations.

Specified by:
loadProduct in interface ITransactionController
Parameters:
product - An instance containing the details of the operation to be carried out
mode - Specifies what to do, i.e. just register, register and download, etc
callback - Callback used to inform the application on the progress of the operation

updatePassExpiryDate

public void updatePassExpiryDate(UpdatePassExpiryDateRequest product,
                                 DownloadMode mode,
                                 ITransactionControllerCallback callback)
Description copied from interface: ITransactionController
The UPDATE PASS EXPIRY DATE function can be called by the APPLICATION to request the RTD SERVER updates the current pass expiry date of a ITSO TYP22 product. This function will update the ExpiryDateCurrent field (not the EXP field) in the ITSO TYP22 product.

Specified by:
updatePassExpiryDate in interface ITransactionController
Parameters:
product - An instance containing the details of the operation to be carried out
mode - Specifies what to do, i.e. just register, register and download, etc
callback - Callback used to inform the application on the progress of the operation

performPendingRequests

public void performPendingRequests(ITransactionControllerCallback callback)
Description copied from interface: ITransactionController
The PERFORM PENDING REQUESTS function is called by the application to download one or more previously requested product loads and/or modifications. The card holder may have previously ordered the product from a retailing website and is using this terminal to collect the product. In the case the terminal can only request all products pending for the CM to be loaded and/or modified.

Specified by:
performPendingRequests in interface ITransactionController
Parameters:
callback - Callback used to inform the application on the progress of the operation

performPendingRequests

public void performPendingRequests(String requestId,
                                   ITransactionControllerCallback callback)
Description copied from interface: ITransactionController
The PERFORM PENDING REQUESTS function is called by the application to download one or more previously requested product loads and/or modifications. The card holder may have previously ordered the product from a retailing website and is using this terminal to collect the product. In the case the terminal can only request all products pending for the CM to be loaded and/or modified.

Specified by:
performPendingRequests in interface ITransactionController
Parameters:
requestId - ID of a specific request that should be completed
callback - Callback used to inform the application on the progress of the operation

performPendingRequests

public void performPendingRequests(String cardId,
                                   CardType cardType,
                                   ITransactionControllerCallback callback)
Description copied from interface: ITransactionController
The PERFORM PENDING REQUESTS function is called by the application to download one or more previously requested product loads and/or modifications. The card holder may have previously ordered the product from a retailing website and is using this terminal to collect the product. In the case the terminal can only request all products pending for the CM to be loaded and/or modified.

Specified by:
performPendingRequests in interface ITransactionController
Parameters:
cardId - ID of a specific card to perform pending requests for
cardType - Type of card to perform pending requests for
callback - Callback used to inform the application on the progress of the operation

performPendingRequests

public void performPendingRequests(String requestId,
                                   String cardId,
                                   CardType cardType,
                                   ITransactionControllerCallback callback)
Description copied from interface: ITransactionController
The PERFORM PENDING REQUESTS function is called by the application to download one or more previously requested product loads and/or modifications. The card holder may have previously ordered the product from a retailing website and is using this terminal to collect the product. In the case the terminal can only request all products pending for the CM to be loaded and/or modified.

Specified by:
performPendingRequests in interface ITransactionController
Parameters:
requestId - ID of a specific request that should be completed
cardId - ID of a specific card to perform pending requests for
cardType - Type of card to perform pending requests for
callback - Callback used to inform the application on the progress of the operation

queryStatus

public void queryStatus(String requestId,
                        QueryMode mode,
                        ITransactionControllerCallback listener)
Description copied from interface: ITransactionController
Get details about the requests handled during the last download involving the CM with the specified Id

Specified by:
queryStatus in interface ITransactionController
Parameters:
requestId - ID that is of interest
listener - Used to pass back the outcome of the operation asynchronously

cancelRequest

public void cancelRequest(String requestId,
                          ITransactionControllerCallback listener)
Description copied from interface: ITransactionController
Cancels a previously registered request.

Specified by:
cancelRequest in interface ITransactionController
Parameters:
requestId - ID of the request to be cancelled
listener - Used to pass back the outcome of the operation asynchronously


Copyright © 2013 Ecebs Ltd. All Rights Reserved.