Interface PoolPlugin

All Superinterfaces:
Plugin

public interface PoolPlugin extends Plugin
Plugin able to handle the access to an undefined number of CardReader.

It is typically used to define a plugin built on top of an HSM interface that can allocate a large number of virtual reader slots.

A PoolPlugin can't be observable.

Since:
2.0.0
  • Method Details

    • getReaderGroupReferences

      SortedSet<String> getReaderGroupReferences()
      Gets a list of group references that identify a group of readers.

      A group reference can represent a family of readers that all have the same characteristics (for example, containing a SAM with identical key sets).

      Returns:
      a list of String
      Since:
      2.0.0
    • allocateReader

      org.eclipse.keypop.reader.CardReader allocateReader(String readerGroupReference)
      Gets a CardReader and makes it exclusive to the caller until the releaseReader(CardReader) method is invoked.

      The allocated reader belongs to the group targeted with provided reference.

      Parameters:
      readerGroupReference - The reference of the group to which the reader belongs (may be null depending on the implementation made).
      Returns:
      A not null reference.
      Throws:
      KeyplePluginException - If the allocation failed due to lack of available reader.
      Since:
      2.0.0
    • getSelectedSmartCard

      org.eclipse.keypop.reader.selection.spi.SmartCard getSelectedSmartCard(org.eclipse.keypop.reader.CardReader reader)
      Returns the selected SmartCard from a CardReader.

      This method is used to retrieve the selected card from a reader that has been allocated with the allocateReader(String) method.

      Parameters:
      reader - The reader from which to get the selected card.
      Returns:
      null if no smart card is selected by default, the selected smart card otherwise.
      Throws:
      IllegalArgumentException - If the provided reader is null.
      Since:
      2.2.0
    • releaseReader

      void releaseReader(org.eclipse.keypop.reader.CardReader reader)
      Releases a Reader previously allocated with allocateReader.

      This method must be invoked as soon as the reader is no longer needed by the caller of allocateReader in order to free the resource.

      Parameters:
      reader - The Reader to be released.
      Since:
      2.0.0