Interface PoolPluginSpi


public interface PoolPluginSpi
Plugin able to manage a dynamic list of readers based on an allocation/de-allocation mechanism (for example HSM).
Since:
2.0.0
  • Method Details

    • getName

      String getName()
      Gets the name of the pool plugin.
      Returns:
      A not empty string.
      Since:
      2.0.0
    • getReaderGroupReferences

      SortedSet<String> getReaderGroupReferences() throws PluginIOException
      Gets a list of group references that will be used as an argument to allocateReader(String).

      A group reference can represent a family of Reader with all the same characteristics (for example SAM with identical key sets).

      Returns:
      An empty Set if there is no group reference
      Throws:
      PluginIOException - If an error occurs
      Since:
      2.0.0
    • allocateReader

      PoolReaderSpi allocateReader(String readerGroupReference) throws PluginIOException
      Obtains an available reader resource and makes it exclusive to the caller until the releaseReader method is invoked.

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

      Parameters:
      readerGroupReference - The reader group reference (optional).
      Returns:
      A not null reference.
      Throws:
      PluginIOException - If an error occurs.
      Since:
      2.0.0
    • releaseReader

      void releaseReader(ReaderSpi readerSpi) throws PluginIOException
      Releases the reader previously allocated with allocateReader(String) and whose reference is provided.

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

      Parameters:
      readerSpi - The reader to deallocate
      Throws:
      PluginIOException - If an error occurs
      Since:
      2.0.0
    • onUnregister

      void onUnregister()
      Invoked when unregistering the plugin.
      Since:
      2.0.0