#include <StubPluginImpl.h>
Inherits keyple::core::seproxy::plugin::AbstractThreadedObservablePlugin, and keyple::plugin::stub::StubPlugin.
|
| StubPluginImpl (const std::string &pluginName) |
|
const std::map< const std::string, const std::string > & | getParameters () const override |
|
void | setParameter (const std::string &key, const std::string &value) override |
|
void | plugStubReader (const std::string &readerName, bool synchronous) override |
|
void | plugStubReader (const std::string &readerName, TransmissionMode transmissionMode, bool synchronous) override |
|
void | plugStubReaders (const std::set< std::string > &readerNames, const bool synchronous) override |
|
void | unplugStubReader (const std::string &readerName, const bool synchronous) override |
|
void | unplugStubReaders (const std::set< std::string > &readerNames, const bool synchronous) override |
|
const std::set< std::string > & | fetchNativeReadersNames () override |
|
const std::string & | getName () const override |
|
void | setParameters (const std::map< const std::string, const std::string > ¶meters) |
|
void | addObserver (const std::shared_ptr< ObservablePlugin::PluginObserver > observer) final |
|
void | removeObserver (const std::shared_ptr< ObservablePlugin::PluginObserver > observer) final |
|
void | clearObservers () final |
|
virtual | ~AbstractThreadedObservablePlugin () |
|
virtual int | countObservers () const final |
|
virtual void | notifyObservers (const std::shared_ptr< PluginEvent > event) final |
|
virtual ConcurrentMap< const std::string, std::shared_ptr< SeReader > > & | getReaders () override |
|
virtual const std::set< std::string > | getReaderNames () const override |
|
const std::shared_ptr< SeReader > | getReader (const std::string &name) final |
|
const std::string & | getName () const |
|
| AbstractSeProxyComponent (const std::string &name) |
|
virtual | ~AbstractSeProxyComponent ()=default |
|
const std::string & | getName () const |
|
void | setParameters (const std::map< const std::string, const std::string > ¶meters) |
|
virtual | ~ReaderPlugin ()=default |
|
virtual | ~ProxyElement ()=default |
|
virtual void | setParameters (const std::map< const std::string, const std::string > ¶meters) |
|
virtual | ~ObservablePluginNotifier ()=default |
|
virtual | ~ObservablePlugin ()=default |
|
virtual void | addObserver (const std::shared_ptr< PluginObserver > observer)=0 |
|
virtual void | removeObserver (const std::shared_ptr< PluginObserver > observer)=0 |
|
This plugin allows to simulate Secure Element communication by creating keyple::core::seproxy::protocol::TransmissionMode and keyple::plugin::stub::StubSecureElement. Plug a new StubReader with plugStubReader() and insert an implementation of your own of keyple::plugin::stub::StubSecureElement to start simulation communication. This class is a singleton, use StubPlugin::getInstance to access it
◆ StubPluginImpl()
keyple::plugin::stub::StubPluginImpl::StubPluginImpl |
( |
const std::string & |
pluginName | ) |
|
|
explicit |
Constructor
- Parameters
-
pluginName | : custom name for the plugin |
◆ fetchNativeReader()
std::shared_ptr< SeReader > keyple::plugin::stub::StubPluginImpl::fetchNativeReader |
( |
const std::string & |
readerName | ) |
|
|
overrideprotectedvirtual |
Fetch the reader whose name is provided as an argument. Returns the current reader if it is already listed. Creates and returns a new reader if not.
Throw an exception if the wanted reader is not found.
- Parameters
-
readerName | name of the reader |
- Returns
- the reader object
Implements keyple::core::seproxy::plugin::AbstractThreadedObservablePlugin.
◆ fetchNativeReadersNames()
const std::set< std::string > & keyple::plugin::stub::StubPluginImpl::fetchNativeReadersNames |
( |
| ) |
|
|
overridevirtual |
◆ getName()
const std::string& keyple::plugin::stub::StubPluginImpl::getName |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ getParameters()
const std::map< const std::string, const std::string > & keyple::plugin::stub::StubPluginImpl::getParameters |
( |
| ) |
const |
|
overridevirtual |
◆ initNativeReaders()
ConcurrentMap< const std::string, std::shared_ptr< SeReader > > & keyple::plugin::stub::StubPluginImpl::initNativeReaders |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ plugStubReader() [1/2]
void keyple::plugin::stub::StubPluginImpl::plugStubReader |
( |
const std::string & |
name, |
|
|
bool |
synchronous |
|
) |
| |
|
overridevirtual |
Plug a Stub Reader
- Parameters
-
name | : name of the created reader |
synchronous | : should the stubreader added synchronously (without waiting for the observation thread) |
Implements keyple::plugin::stub::StubPlugin.
◆ plugStubReader() [2/2]
void keyple::plugin::stub::StubPluginImpl::plugStubReader |
( |
const std::string & |
name, |
|
|
TransmissionMode |
transmissionMode, |
|
|
bool |
synchronous |
|
) |
| |
|
overridevirtual |
Plug a Stub Reader
- Parameters
-
name | : name of the created reader |
transmissionMode | : transmissionMode of the created reader |
synchronous | : should the stubreader added synchronously (without waiting for the observation thread) |
Implements keyple::plugin::stub::StubPlugin.
◆ plugStubReaders()
void keyple::plugin::stub::StubPluginImpl::plugStubReaders |
( |
const std::set< std::string > & |
names, |
|
|
const bool |
synchronous |
|
) |
| |
|
overridevirtual |
Plug a list of stub Reader at once
- Parameters
-
names | : names of readers to be connected |
synchronous | : should the stubreader be added synchronously (without waiting for the observation thread). An READER_CONNECTED event is raised in both cases |
Implements keyple::plugin::stub::StubPlugin.
◆ setParameter()
void keyple::plugin::stub::StubPluginImpl::setParameter |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
|
overridevirtual |
This method has to be implemented by the reader plugin.
Allows to define a proprietary setting for a reader or a plugin (contactless protocols polling sequence, baud rate, … etc.).
- Parameters
-
key | the parameter key |
value | the parameter value |
- Exceptions
-
IllegalArgumentException | if the parameter or the value is not supported |
KeypleReaderIOException | if the communication with the reader or the SE has failed |
Implements keyple::core::seproxy::plugin::AbstractSeProxyComponent.
◆ setParameters()
void keyple::core::seproxy::plugin::AbstractSeProxyComponent::setParameters |
Sets at once a set of parameters for a reader
See setParameter() for more details
- Parameters
-
parameters | a Map <String, String> parameter set |
- Exceptions
-
KeypleBaseException | if one of the parameters could not be set up |
◆ unplugStubReader()
void keyple::plugin::stub::StubPluginImpl::unplugStubReader |
( |
const std::string & |
name, |
|
|
const bool |
synchronous |
|
) |
| |
|
overridevirtual |
Unplug a Stub Reader
- Parameters
-
name | the name of the reader |
- Exceptions
-
KeypleReaderException | in case of a reader exception |
- Parameters
-
synchronous | : should the stubreader be removed synchronously (without waiting for the observation thread). An READER_DISCONNECTED event is raised in both cases |
Implements keyple::plugin::stub::StubPlugin.
◆ unplugStubReaders()
void keyple::plugin::stub::StubPluginImpl::unplugStubReaders |
( |
const std::set< std::string > & |
names, |
|
|
const bool |
synchronous |
|
) |
| |
|
overridevirtual |
Unplug a list of readers
- Parameters
-
names | : names of the reader to be unplugged |
synchronous | : should the stubreader removed synchronously (without waiting for the observation thread). An READER_DISCONNECTED event is raised in both cases |
Implements keyple::plugin::stub::StubPlugin.
The documentation for this class was generated from the following files: