Package org.eclipse.keyple.core.service
Interface Plugin
-
- All Known Subinterfaces:
ObservablePlugin
,PoolPlugin
public interface Plugin
Manager for one or moreCardReader
from the same family.Provides the means to get the plugin name, enumerate and retrieve the readers.
- Since:
- 2.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends org.eclipse.keyple.core.common.KeyplePluginExtension>
TgetExtension(java.lang.Class<T> pluginExtensionClass)
Returns theKeyplePluginExtension
that is plugin-specific.java.lang.String
getName()
Gets the name of the plugin.Reader
getReader(java.lang.String name)
Gets theCardReader
whose name is provided.<T extends org.eclipse.keyple.core.common.KeypleReaderExtension>
TgetReaderExtension(java.lang.Class<T> readerExtensionClass, java.lang.String readerName)
Returns theKeypleReaderExtension
that is reader-specific.java.util.Set<java.lang.String>
getReaderNames()
Gets the names of all connected readers.java.util.Set<Reader>
getReaders()
Gets all connected readers.
-
-
-
Method Detail
-
getName
java.lang.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(java.lang.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(java.lang.Class<T> readerExtensionClass, java.lang.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:
java.lang.IllegalStateException
- If plugin or reader is no longer registered.java.lang.IllegalArgumentException
- If the reader name is unknown.- Since:
- 2.1.0
-
getReaderNames
java.util.Set<java.lang.String> getReaderNames()
Gets the names of all connected readers.- Returns:
- An empty set if there's no reader connected.
- Throws:
java.lang.IllegalStateException
- if plugin is no longer registered.- Since:
- 2.0.0
-
getReaders
java.util.Set<Reader> getReaders()
Gets all connected readers.- Returns:
- An empty Set if there's no reader connected.
- Throws:
java.lang.IllegalStateException
- if the plugin is no longer registered.- Since:
- 2.0.0
-
getReader
Reader getReader(java.lang.String name)
Gets theCardReader
whose name is provided.- Parameters:
name
- The name of the reader.- Returns:
- Null if the reader has not been found.
- Throws:
java.lang.IllegalStateException
- if the plugin is no longer registered.- Since:
- 2.0.0
-
-