com.ecebs.rtd.enabler
Class ITSOFramework

java.lang.Object
  extended by com.ecebs.rtd.enabler.ITSOFramework
All Implemented Interfaces:
IITSOFramework

public class ITSOFramework
extends Object
implements IITSOFramework

Provides a means of detecting and reading CMDs

Author:
kyleb

Field Summary
 
Fields inherited from interface com.ecebs.rtd.enabler.IITSOFramework
READ_ALL
 
Method Summary
 CardInformation detectCard(boolean isWhiteList, String... readers)
          The DETECT CARD function will return the ITSO Shell Environment Data Group and ITSO Directory Data Group, read and parsed, from a CM if one is present.
 void detectCard(IDetectCardCallback callback, boolean isWhiteList, String... readers)
          Registers the callback to be notified when a CM is presented.
static IITSOFramework getInstance()
          Get an instance of IITSOFramework.
 List<Product> getProducts(DirEntry... entries)
          The GET PRODUCT function will read and parse a single product from the CM.
 void getProducts(IITSOFrameworkCallback cb, DirEntry... entries)
          The GET PRODUCT function will read and parse a single product from the CM.
 void searchProducts(IITSOFrameworkCallback cb, int[] oids, int[] typs, int[] ptyps)
          The SEARCH PRODUCTS function will search for, read and parse any products on the CM that match the specified search parameters.
 List<Product> searchProducts(int[] oids, int[] typs, int[] ptyps)
          The SEARCH PRODUCTS function will search for, read and parse any products on the CM that match the specified search parameters.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static IITSOFramework getInstance()
Get an instance of IITSOFramework. The instance returned will be appropriate for the platform associated with the initialised ConfigManager. Note that the instance is a singleton.

Returns:
Singleton instance of IITSOFramework

detectCard

public void detectCard(IDetectCardCallback callback,
                       boolean isWhiteList,
                       String... readers)
Description copied from interface: IITSOFramework
Registers the callback to be notified when a CM is presented. Upon detection of the CM, the ITSO Shell Environment Data Group and ITSO Directory Data Group are read, parsed and passed back using the provided callback instance.

to detect any presented card, call this method with the arguments detectCard(callback,false).

Specified by:
detectCard in interface IITSOFramework
Parameters:
callback - Used to notify the caller when a card is detected, or if an error occurred while reading from a card
isWhiteList - If true, the provided list of readers are those that are of interest. Otherwise, it is a list of those that should be ignored
readers - A platform-specific list of readers

getProducts

public void getProducts(IITSOFrameworkCallback cb,
                        DirEntry... entries)
Description copied from interface: IITSOFramework
The GET PRODUCT function will read and parse a single product from the CM.

A card must have been detected before calling this method

Specified by:
getProducts in interface IITSOFramework
Parameters:
cb - Used to notify the caller when the product has been read, or if an error occurred
entries - Directory entries for the products to be read

searchProducts

public void searchProducts(IITSOFrameworkCallback cb,
                           int[] oids,
                           int[] typs,
                           int[] ptyps)
Description copied from interface: IITSOFramework
The SEARCH PRODUCTS function will search for, read and parse any products on the CM that match the specified search parameters. Wildcards are supported to ignore each particular search parameter.

A card must have been detected before calling this method

Specified by:
searchProducts in interface IITSOFramework
Parameters:
cb - Used to notify the caller when any matching products have been read, or if an error occurred
oids - The OIDs of interest. Only products with one of the specified OIDs will be read (unless IITSOFramework.READ_ALL is passed in)
typs - The TYPs of interest. Only products with one of the specified TYPs will be read (unless IITSOFramework.READ_ALL is passed in)
ptyps - The PTYPs of interest. Only products with one of the specified PTYPs will be read (unless IITSOFramework.READ_ALL is passed in)

detectCard

public CardInformation detectCard(boolean isWhiteList,
                                  String... readers)
                           throws RTDEException
Description copied from interface: IITSOFramework
The DETECT CARD function will return the ITSO Shell Environment Data Group and ITSO Directory Data Group, read and parsed, from a CM if one is present.

to detect any presented card, call this method with the arguments detectCard(false).

Specified by:
detectCard in interface IITSOFramework
Parameters:
isWhiteList - If true, the provided list of readers are those that are of interest. Otherwise, it is a list of those that should be ignored
readers - A platform-specific list of readers
Returns:
If a CM is present, the method will read, parse and return details about the CM. Otherwise, it will return null.
Throws:
RTDEException - Thrown if there was an issue while connecting with the card

getProducts

public List<Product> getProducts(DirEntry... entries)
                          throws RTDEException
Description copied from interface: IITSOFramework
The GET PRODUCT function will read and parse a single product from the CM.

A card must have been detected before calling this method

Specified by:
getProducts in interface IITSOFramework
Parameters:
entries - The directory entry for the product to be read
Returns:
The IPE read from the CM
Throws:
RTDEException - Thrown if there was a problem communicating with the card

searchProducts

public List<Product> searchProducts(int[] oids,
                                    int[] typs,
                                    int[] ptyps)
                             throws RTDEException
Description copied from interface: IITSOFramework
The SEARCH PRODUCTS function will search for, read and parse any products on the CM that match the specified search parameters. Wildcards are supported to ignore each particular search parameter.

A card must have been detected before calling this method

Specified by:
searchProducts in interface IITSOFramework
Parameters:
oids - The OIDs of interest. Only products with one of the specified OIDs will be read (unless IITSOFramework.READ_ALL is passed in)
typs - The TYPs of interest. Only products with one of the specified TYPs will be read (unless IITSOFramework.READ_ALL is passed in)
ptyps - The PTYPs of interest. Only products with one of the specified PTYPs will be read (unless IITSOFramework.READ_ALL is passed in)
Returns:
A list of all the IPEs read from the smartcard that matched the search parameters
Throws:
RTDEException - Thrown if there was a problem communicating with the card


Copyright © 2013 Ecebs Ltd. All Rights Reserved.