Package org.eclipse.keyple.core.service
Interface Plugin
- All Known Subinterfaces:
ObservablePlugin
,PoolPlugin
public interface Plugin
Manager for one or more
CardReader
from the same family.
Provides the means to get the plugin name, enumerate and retrieve the readers.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.keypop.reader.CardReader
findReader
(String readerNameRegex) Returns the first reader whose name matches the provided regular expression.<T extends org.eclipse.keyple.core.common.KeyplePluginExtension>
TgetExtension
(Class<T> pluginExtensionClass) Returns theKeyplePluginExtension
that is plugin-specific.getName()
Gets the name of the plugin.org.eclipse.keypop.reader.CardReader
Gets theCardReader
whose name is provided.<T extends org.eclipse.keyple.core.common.KeypleReaderExtension>
TgetReaderExtension
(Class<T> readerExtensionClass, String readerName) Returns theKeypleReaderExtension
that is reader-specific.Gets the names of all connected readers.Set<org.eclipse.keypop.reader.CardReader>
Gets all connected readers.
-
Method Details
-
getName
String getName()Gets the name of the plugin.- Returns:
- A not empty string.
- Since:
- 2.0.0
-
getExtension
<T extends org.eclipse.keyple.core.common.KeyplePluginExtension> T getExtension(Class<T> pluginExtensionClass) Returns theKeyplePluginExtension
that is plugin-specific.Note: the provided argument is used at compile time to check the type consistency.
- Type Parameters:
T
- The type of the plugin extension.- Parameters:
pluginExtensionClass
- The specific class of the plugin.- Returns:
- A not null reference.
- Since:
- 2.0.0
-
getReaderExtension
<T extends org.eclipse.keyple.core.common.KeypleReaderExtension> T getReaderExtension(Class<T> readerExtensionClass, String readerName) Returns theKeypleReaderExtension
that is reader-specific.Note: the provided argument is used at compile time to check the type consistency.
- Type Parameters:
T
- The type of the reader extension.- Parameters:
readerExtensionClass
- The specific class of the reader.readerName
- The name of the reader.- Returns:
- A
KeypleReaderExtension
. - Throws:
IllegalStateException
- If plugin or reader is no longer registered.IllegalArgumentException
- If the reader name is unknown.- Since:
- 2.1.0
-
getReaderNames
Gets the names of all connected readers.- Returns:
- An empty set if there's no reader connected.
- Throws:
IllegalStateException
- if plugin is no longer registered.- Since:
- 2.0.0
-
getReaders
Set<org.eclipse.keypop.reader.CardReader> getReaders()Gets all connected readers.- Returns:
- An empty Set if there's no reader connected.
- Throws:
IllegalStateException
- if the plugin is no longer registered.- Since:
- 2.0.0
-
getReader
Gets theCardReader
whose name is provided.- Parameters:
name
- The name of the reader.- Returns:
- Null if the reader has not been found.
- Throws:
IllegalStateException
- if the plugin is no longer registered.- Since:
- 2.0.0
-
findReader
Returns the first reader whose name matches the provided regular expression.- Parameters:
readerNameRegex
- The name of the card reader as a regular expression string.- Returns:
- Null if the reader is not found or no longer registered.
- Throws:
IllegalArgumentException
- If the provided regex is invalid.- Since:
- 3.1.0
-