Interface CardResourceServiceConfigurator


public interface CardResourceServiceConfigurator
Configurator of the card resource service.

The configuration consists in a sequence of steps including:

  • Assignment of plugins to be used with or without automatic refresh.
  • Selection of strategies and parameters of card allocation.
  • Creation of card profiles.
Since:
2.0.0
  • Method Details

    • withPlugins

      CardResourceServiceConfigurator withPlugins(PluginsConfigurator pluginsConfigurator)
      Configures the card resource service with one or more Plugin or ObservablePlugin.
      Parameters:
      pluginsConfigurator - The plugins configurator to use.
      Returns:
      The current configurator instance.
      Throws:
      IllegalArgumentException - If the provided plugins configurator is null.
      IllegalStateException - If this step has already been performed.
      Since:
      2.0.0
    • withPoolPlugins

      CardResourceServiceConfigurator withPoolPlugins(PoolPluginsConfigurator poolPluginsConfigurator)
      Configures the card resource service with one or more PoolPlugin.
      Parameters:
      poolPluginsConfigurator - The pool plugins configurator to use.
      Returns:
      The current configurator instance.
      Throws:
      IllegalArgumentException - If the provided pool plugins configurator is null.
      IllegalStateException - If this step has already been performed.
      Since:
      2.0.0
    • withCardResourceProfiles

      CardResourceServiceConfigurator withCardResourceProfiles(CardResourceProfileConfigurator... cardResourceProfileConfigurators)
      Configures the card resource service with one or more card resource profiles.
      Parameters:
      cardResourceProfileConfigurators - The collection of card resources profiles to use.
      Returns:
      The current configurator instance.
      Throws:
      IllegalArgumentException - If the provided configurators are null.
      IllegalStateException - If this step has already been performed.
      Since:
      2.0.0
    • withBlockingAllocationMode

      CardResourceServiceConfigurator withBlockingAllocationMode(int cycleDurationMillis, int timeoutMillis)
      Configures the card resource service to use a blocking allocation mode with the provided timing parameters used during the allocation process.

      By default, the card resource service is configured with a non-blocking allocation mode.

      Parameters:
      cycleDurationMillis - The cycle duration (in milliseconds) is the time between two attempts to find an available card.
      timeoutMillis - The timeout (in milliseconds) is the maximum amount of time the allocation method will attempt to find an available card.
      Returns:
      The current configurator instance.
      Throws:
      IllegalArgumentException - If one of the provided values is less or equal to 0.
      IllegalStateException - If this step has already been performed.
      Since:
      2.0.0
    • configure

      void configure()
      Finalizes the configuration of the card resource service.

      If the service is already started, the new configuration is applied immediately.
      Any previous configuration will be overwritten.

      If some global configured plugins are not used by any card resource profile, then they are automatically removed from the configuration.

      Throws:
      IllegalStateException -
      • If no "plugin" or "pool plugin" is configured.
      • If no card resource profile is configured.
      • If some card resource profiles are configured with the same profile name.
      • If some card resource profiles specify plugins which are not configured in the global list.
      Since:
      2.0.0