Interface CardResourceService
-
public interface CardResourceServiceCard Resource Management Service.Provides the means to define and manage an arbitrary number of
CardResourcethat can be accessed later by the application using the profile names it has chosen and to which the CardResources will be associated.The creation of the
CardResourcecan be static or dynamic, with various allocation strategy options depending on the parameters specified at configuration time (seeCardResourceServiceConfigurator).The concept of dynamic creation of
CardResourcecomes in two forms:- with a dynamic allocation of readers from a
PoolPlugin, - with the internally managed observation mechanisms of
ObservablePluginandObservableCardReader.
- Since:
- 2.0.0
- with a dynamic allocation of readers from a
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CardResourcegetCardResource(java.lang.String cardResourceProfileName)Gets the first card resource available for the provided card resource profile name using the configured allocation strategy.CardResourceServiceConfiguratorgetConfigurator()Gets the configuration builder to setup the service.voidreleaseCardResource(CardResource cardResource)Releases the card resource to make it available to other users.voidremoveCardResource(CardResource cardResource)Removes the card resource and releases it if it is in use.voidstart()Starts the service using the current configuration, initializes the list of card resources, activates the required monitoring, if any.voidstop()Stops the service if it is started.
-
-
-
Method Detail
-
getConfigurator
CardResourceServiceConfigurator getConfigurator()
Gets the configuration builder to setup the service.- Returns:
- A not null reference.
- Since:
- 2.0.0
-
start
void start()
Starts the service using the current configuration, initializes the list of card resources, activates the required monitoring, if any.The service is restarted if it is already started.
- Throws:
java.lang.IllegalStateException- If no configuration was done.- Since:
- 2.0.0
-
stop
void stop()
Stops the service if it is started.All monitoring processes are stopped, all card resources are released.
- Since:
- 2.0.0
-
getCardResource
CardResource getCardResource(java.lang.String cardResourceProfileName)
Gets the first card resource available for the provided card resource profile name using the configured allocation strategy.Note : The returned resource is then no longer available to other users until the
releaseCardResource(CardResource)method is called or the service restarted.- Parameters:
cardResourceProfileName- The name of the card resource profile.- Returns:
- Null if no card resource is available.
- Throws:
java.lang.IllegalArgumentException- If the profile name is null, empty or not configured.java.lang.IllegalStateException- If the service is not started.- Since:
- 2.0.0
-
releaseCardResource
void releaseCardResource(CardResource cardResource)
Releases the card resource to make it available to other users.- Parameters:
cardResource- The card resource to release.- Throws:
java.lang.IllegalArgumentException- If the provided card resource is null.- Since:
- 2.0.0
-
removeCardResource
void removeCardResource(CardResource cardResource)
Removes the card resource and releases it if it is in use.- Parameters:
cardResource- The card resource to remove.- Throws:
java.lang.IllegalArgumentException- If the provided card resource is null.- Since:
- 2.0.0
-
-