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.
 
Methods inherited from interface org.eclipse.higgins.registry.IServiceProvider
getConfiguration, getID, setID
 

Field Detail

CONTEXT_REF_PROP_NAME

public static final String CONTEXT_REF_PROP_NAME
See Also:
Constant Field Values

CONTEXT_SCHEMA_URL_PROP_NAME

public static final String CONTEXT_SCHEMA_URL_PROP_NAME
See Also:
Constant Field Values

CONTEXT_SCHEMA_FILE_PROP_NAME

public static final String CONTEXT_SCHEMA_FILE_PROP_NAME
See Also:
Constant Field Values

IMAGE_URL_PROP_NAME

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

getName

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


getDescription

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


getSupportedTypes

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


getICards

public 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

public 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

public 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

public 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

public 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

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

canImportICard

public boolean canImportICard(CallbackHandler authHandler,
                              IElement card)
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.

importICard

public 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

public 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

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

deleteCard

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

getCardCreationTemplates

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

getCardCreationTemplatesByID

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

createCard

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