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 Type
    Method
    Description
    <T extends org.eclipse.keyple.core.common.KeyplePluginExtension>
    T
    getExtension(Class<T> pluginExtensionClass)
    Returns the KeyplePluginExtension that is plugin-specific.
    Gets the name of the plugin.
    Gets the CardReader whose name is provided.
    <T extends org.eclipse.keyple.core.common.KeypleReaderExtension>
    T
    getReaderExtension(Class<T> readerExtensionClass, String readerName)
    Returns the KeypleReaderExtension that is reader-specific.
    Gets the names of all connected readers.
    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 the KeyplePluginExtension 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 the KeypleReaderExtension 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

      Set<String> 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<Reader> 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

      Reader getReader(String name)
      Gets the CardReader 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