Keyple C++  0.9.0
Keyple, an Open Source SDK for Ticketing
Public Member Functions | List of all members
keyple::calypso::transaction::PoCommandManager Class Referencefinal

#include <PoCommandManager.h>

Public Member Functions

 PoCommandManager ()
 
void addRegularCommand (std::shared_ptr< AbstractPoCommandBuilder< AbstractPoResponseParser >> commandBuilder)
 
void addStoredValueCommand (std::shared_ptr< AbstractPoCommandBuilder< AbstractPoResponseParser >> commandBuilder, const Operation &svOperation)
 
void notifyCommandsProcessed ()
 
const std::vector< std::shared_ptr< AbstractPoCommandBuilder< AbstractPoResponseParser > > > getPoCommandBuilders ()
 
bool hasCommands () const
 
bool isSvOperationCompleteOneTime ()
 

Detailed Description

The PO command manager handles the AbstractPoCommandBuilder list updated by the "prepare" methods of PoTransaction. It is used to keep builders between the time the commands are created and the time their responses are parsed.

A flag (preparedCommandsProcessed) is used to manage the reset of the command list. It allows the builders to be kept until the application creates a new list of commands.

This flag is set by calling the method notifyCommandsProcessed and reset when a new AbstractPoCommandBuilder is added or when a attempt

Constructor & Destructor Documentation

◆ PoCommandManager()

keyple::calypso::transaction::PoCommandManager::PoCommandManager ( )

(package-private)
Constructor

Member Function Documentation

◆ addRegularCommand()

void keyple::calypso::transaction::PoCommandManager::addRegularCommand ( std::shared_ptr< AbstractPoCommandBuilder< AbstractPoResponseParser >>  commandBuilder)

(package-private)
Add a regular command to the builders and parsers list.

Parameters
commandBuilderthe command builder

◆ addStoredValueCommand()

void keyple::calypso::transaction::PoCommandManager::addStoredValueCommand ( std::shared_ptr< AbstractPoCommandBuilder< AbstractPoResponseParser >>  commandBuilder,
const Operation svOperation 
)

(package-private)
Add a StoredValue command to the builders and parsers list.

Set up a mini state machine to manage the scheduling of Stored Value commands.

The keyple::calypso::transaction::PoTransaction::SvSettings::Operation and keyple::calypso::transaction::PoTransaction::SvSettings::Action are also used to check the consistency of the SV process.

The svOperationPending flag is set when an SV operation (Reload/Debit/Undebit) command is added.

Parameters
commandBuilderthe StoredValue command builder
svOperationthe type of the current SV operation (Realod/Debit/Undebit)
Exceptions
IllegalStateExceptionif the provided command is not an SV command
CalypsoPoTransactionIllegalStateExceptionif the SV API is not properly used.

◆ getPoCommandBuilders()

const std::vector< std::shared_ptr< AbstractPoCommandBuilder< AbstractPoResponseParser > > > keyple::calypso::transaction::PoCommandManager::getPoCommandBuilders ( )

(package-private)

Returns
the current AbstractPoCommandBuilder list

◆ hasCommands()

bool keyple::calypso::transaction::PoCommandManager::hasCommands ( ) const

(package-private)

Returns
true if the keyple::calypso::transaction::PoCommandManager has commands

◆ isSvOperationCompleteOneTime()

bool keyple::calypso::transaction::PoCommandManager::isSvOperationCompleteOneTime ( )

(package-private)
Indicates whether an SV Operation has been completed (Reload/Debit/Undebit requested)
This method is dedicated to triggering the signature verification after an SV transaction has been executed. It is a single-use method, as the flag is systematically reset to false after it is called.

Returns
true if a reload or debit command has been requested

◆ notifyCommandsProcessed()

void keyple::calypso::transaction::PoCommandManager::notifyCommandsProcessed ( )

(package-private)
Informs that the commands have been processed.

Just record the information. The initialization of the list of commands will be done only the next time a command is added, this allows access to the parsers contained in the list..


The documentation for this class was generated from the following files: