org.eclipse.higgins.icard
Interface ICardProvider

All Superinterfaces:
org.eclipse.higgins.registry.IServiceProvider

public interface ICardProvider
extends org.eclipse.higgins.registry.IServiceProvider


Field Summary
static String CONTEXT_REF_PROP_NAME
           
static String CONTEXT_SCHEMA_FILE_PROP_NAME
           
static String CONTEXT_SCHEMA_URL_PROP_NAME
           
static String IMAGE_URL_PROP_NAME
           
 
Method Summary
 boolean canCreateCard(CallbackHandler authHandler, String id, Properties props)
           
 boolean canImportICard(CallbackHandler authHandler, IElement card)
          Tests whether this provider can import i-card represented by card parameter.
 ICard createCard(CallbackHandler authHandler, ICardTemplate template)
           
 ICard createCard(CallbackHandler authHandler, String id, Properties props)
           
 void deleteCard(CallbackHandler authHandler, ICard card)
           
 IElement[] exportICards(CallbackHandler authHandler, IElementFormat format, CUID[] cards)
          Performs export of cards into array of IElements.
 ICardTemplate[] getCardCreationTemplates(CallbackHandler authHandler)
           
 ICardTemplate getCardCreationTemplatesByID(CallbackHandler authHandler, String ID)
           
 String getDescription()
          Gets human readable description of this i-card provider.
 ICard getICardByCUID(CallbackHandler authHandler, CUID cuid)
          Gets user's ICard whose identity could be requested using spesified callback handler which have the spesified unique identifier.
 ICard getICardByCUID(CallbackHandler authHandler, CUID cuid, ICredential userCredential)
          Gets fully loaded user's ICard whose identity could be requested using spesified callback handler which have the spesified unique identifier.
 Iterator getICards(CallbackHandler authHandler)
          Gets all available user's ICards whose identity could be requested using provided callback handler.
 Iterator getICardsByFormat(CallbackHandler authHandler, IElementFormat format)
          Gets all user's ICards whose identity could be requested using provided callback handler that could be exported to IElement with the format described by format parameter.
 Iterator getICardsByPolicy(CallbackHandler authHandler, IPolicy policy)
          Checks all available user's ICards whose identity could be requested using provided callback handler against provided policy and returns all satisfied.
 String getName()
          Gets human readable name of this i-card provider.
 Class[] getSupportedTypes()
          Gets an array of ICard interfaces supported by this i-card provider (e.g.
 ICard importICard(CallbackHandler authHandler, IElement card)
          Imports i-card data into backed store used by this provider and returns i-card object representing imported i-card.
 ICard parseCardElement(CallbackHandler authHandler, IElement card)
          Tests whether this provider can import i-card represented by card parameter.
 ICard persistCard(CallbackHandler authHandler, ICard card)
          Add or update a card
 
Methods inherited from interface org.eclipse.higgins.registry.IServiceProvider
getConfiguration, getID, setID
 

Field Detail

CONTEXT_REF_PROP_NAME

static final String CONTEXT_REF_PROP_NAME
See Also:
Constant Field Values

CONTEXT_SCHEMA_URL_PROP_NAME

static final String CONTEXT_SCHEMA_URL_PROP_NAME
See Also:
Constant Field Values

CONTEXT_SCHEMA_FILE_PROP_NAME

static final String CONTEXT_SCHEMA_FILE_PROP_NAME
See Also:
Constant Field Values

IMAGE_URL_PROP_NAME

static final String IMAGE_URL_PROP_NAME
See Also:
Constant Field Values
Method Detail

getName

String getName()
Gets human readable name of this i-card provider.


getDescription

String getDescription()
Gets human readable description of this i-card provider.


getSupportedTypes

Class[] getSupportedTypes()
Gets an array of ICard interfaces supported by this i-card provider (e.g. ICard, IInformationCard, IManagedInformationCard, IPersonalInformationCard, IURICard, etc.).


getICards

Iterator getICards(CallbackHandler authHandler)
                   throws CardException
Gets all available user's ICards whose identity could be requested using provided callback handler.

Parameters:
authHandler - - the callback handler to be used to request user's identity.
Returns:
the Iterator through all user's ICards.
Throws:
CardException

getICardsByPolicy

Iterator getICardsByPolicy(CallbackHandler authHandler,
                           IPolicy policy)
                           throws CardException
Checks all available user's ICards whose identity could be requested using provided callback handler against provided policy and returns all satisfied.

Typically, when polocy parameter is not null, i-card provider uses IPolicy.isSatisfiedBy(ICard) to find matched ICards.

When policy parameter is null i-card provider returns all available ICards.

Parameters:
authHandler - - the callback handler to be used to request user's identity.
policy - - the policy to be used to select satisfied ICards only.
Returns:
the Iterator through all satisfied ICards.
Throws:
CardException

getICardsByFormat

Iterator getICardsByFormat(CallbackHandler authHandler,
                           IElementFormat format)
                           throws CardException
Gets all user's ICards whose identity could be requested using provided callback handler that could be exported to IElement with the format described by format parameter.

Parameters:
authHandler - - the callback handler to be used to request user's identity.
format - - the descriptor of the element for which export capabilities need to be checked.
Returns:
the Iterator through all satisfied ICards.
Throws:
CardException

getICardByCUID

ICard getICardByCUID(CallbackHandler authHandler,
                     CUID cuid)
                     throws CardException
Gets user's ICard whose identity could be requested using spesified callback handler which have the spesified unique identifier.

Card object returned by this method call may or may not have its claims retieved from endpoint service. When a card doesn't have its claims retieved (ICard.isClaimsRetrieved() returns false) it is necessary to make additional call to getICardByCUID(CallbackHandler, CUID, ICredential) in order to obtain fully loaded card object.

Parameters:
authHandler - - the callback handler to be used to request user's identity.
cuid - - the unique identifier of i-card which is requested.
Returns:
the ICard instance.
Throws:
CardException - if ICard with CUID couldn't be retrieved.

getICardByCUID

ICard getICardByCUID(CallbackHandler authHandler,
                     CUID cuid,
                     ICredential userCredential)
                     throws AuthenticationException,
                            CardException
Gets fully loaded user's ICard whose identity could be requested using spesified callback handler which have the spesified unique identifier.

Parameters:
authHandler - - the callback handler to be used to request user's identity.
cuid - - the unique identifier of i-card which is requested.
userCredential - - the credential object used to authenticate the user on endpoint service.
Returns:
the ICard instance.
Throws:
AuthenticationException - when an attempt to authenticate the user on endpoint service has failed
CardException - if ICard with CUID couldn't be retrieved.

canCreateCard

boolean canCreateCard(CallbackHandler authHandler,
                      String id,
                      Properties props)

canImportICard

boolean canImportICard(CallbackHandler authHandler,
                       IElement card)
                       throws CardParseException
Tests whether this provider can import i-card represented by card parameter.

Parameters:
authHandler - - the callback handler to be used to request user's identity.
card - - the element which holds i-card data
Returns:
true if card parameter holds valid i-card data and this provider could import them as i-card.
Throws:
WrongCardContentException
CardParseException

parseCardElement

ICard parseCardElement(CallbackHandler authHandler,
                       IElement card)
                       throws CardParseException
Tests whether this provider can import i-card represented by card parameter.

Parameters:
authHandler - - the callback handler to be used to request user's identity.
card - - the element which holds i-card data
Returns:
An instance of ICard if card parameter holds valid i-card data and this provider could import them as i-card, null otherwise.
Throws:
CardParseException

importICard

ICard importICard(CallbackHandler authHandler,
                  IElement card)
                  throws CardException
Imports i-card data into backed store used by this provider and returns i-card object representing imported i-card.

Card object returned by this method call may or may not have its claims retieved from endpoint service. When a card doesn't have its claims retieved (ICard.isClaimsRetrieved() returns false) it is necessary to make additional call to getICardByCUID(CallbackHandler, CUID, ICredential) in order to obtain fully loaded card object.

Parameters:
authHandler - - the callback handler to be used to request user's identity.
card - - the element which holds i-card data
Returns:
the i-card object which represents imported i-card
Throws:
CardException

exportICards

IElement[] exportICards(CallbackHandler authHandler,
                        IElementFormat format,
                        CUID[] cards)
                        throws CardException
Performs export of cards into array of IElements. Each element in returned array must conform with the requirements specified by elementDescriptor parameter.

Parameters:
authHandler - - the callback handler to be used to request user's identity.
format - - the element descriptor which defines the format of element to export
cards - - the array of CUIDs of cards to be exported
Throws:
CardException

createCard

ICard createCard(CallbackHandler authHandler,
                 String id,
                 Properties props)
                 throws CardException
Parameters:
props -
Returns:
Throws:
CardException

deleteCard

void deleteCard(CallbackHandler authHandler,
                ICard card)
                throws CardException
Throws:
CardException

getCardCreationTemplates

ICardTemplate[] getCardCreationTemplates(CallbackHandler authHandler)
Parameters:
authHandler -
Returns:
ICardTemplate which describe data required by this provider to create a card

getCardCreationTemplatesByID

ICardTemplate getCardCreationTemplatesByID(CallbackHandler authHandler,
                                           String ID)
Parameters:
authHandler -
Returns:
ICardTemplate which describe data required by this provider to create a card

createCard

ICard createCard(CallbackHandler authHandler,
                 ICardTemplate template)
                 throws CardException
Parameters:
authHandler -
template -
Returns:
Throws:
CardException

persistCard

ICard persistCard(CallbackHandler authHandler,
                  ICard card)
                  throws CardException
Add or update a card

Parameters:
authHandler -
card -
Returns:
Throws:
CardException