org.eclipse.higgins.icard
Interface ICard

All Superinterfaces:
IClaimContainer, IClaimTypeContainer
All Known Subinterfaces:
IInformationCard, IManagedInformationCard, IPersonalInformationCard

public interface ICard
extends IClaimTypeContainer, IClaimContainer


Method Summary
 void applyUpdates()
          Applies an updates made to this ICard object to the backing data store.
 void beginUpdates()
          Puts this ICard object into edit mode when an update operations on card or on any contained elements are allowed.
 void cancelUpdates()
          Cancels any updates made to this ICard object or any contained elements and terminate edit mode.
 IClaim getClaimByLocalName(String typeLocalName)
           
 CUID getCUID()
          Gets the unique identifier of the i-card in the i-card registry.
 String getDescription()
           
 String getID()
          Gets the ID of the i-card.
 byte[] getImage()
          Returns byte representation of a background image of the card.
 String getImageType()
          Return the mime type of the background image (JPEG or GIF).
 String getIssuer()
          Name of the issuer of the card.
 String getIssuerName()
          Returns the human friendly name of the card issuer, originator, creator.
 String getName()
          Return the human friendly name of the card.
 ICardProvider getProvider()
          Should it be here? /
 ICredentialDescriptor[] getRequiredCredentials()
          Returns an array of credential descriptors which should be used to request protected clam's information.
 List getSupportedClaimTypesUris()
          Return a list of all possible types of claims (as String) that are supported.
 List getSupportedTokenTypes()
           
 Date getTimeExpires()
          Returns (optionally) the time after which the card should be considered expired, invalid.
 Date getTimeIssued()
          Returns when the card was first issued, created, orginated.
 Date getTimeLastUpdated()
          Set the expiration date and time
 String getType()
          Returns the type of this i-card (e.g.
 String getVersion()
          Return the version of the card.
 boolean isClaimsRetrieved()
          Checks whether this card already has claims retrieved or it is necessary to make additional call to ICardProvider.getICardByCUID(javax.security.auth.callback.CallbackHandler, CUID, org.eclipse.higgins.icard.auth.ICredential) to retrieve them.
 boolean isEditable()
          Determines whether this ICard could be edited by the user.
 boolean isEditMode()
          Determines wheter this ICard object is in edit mode.
 boolean isFormatSupported(IElementFormat format)
           
 boolean isSelfIssued()
          Indicates that this card has been issued by user (claim values can be editable)
 void setImage(byte[] newImage, String newImageType)
          Used to change the picture associated with this card
 void setIssuerName(String name)
          Sets the card's human friendly name of the card issuer
 void setName(String newName)
          Used to change the name of the card
 void setTimeExpires(Date date)
           
 IElement toElement(IElementFormat format)
           
 
Methods inherited from interface org.eclipse.higgins.icard.IClaimTypeContainer
getSupportedClaimTypes
 
Methods inherited from interface org.eclipse.higgins.icard.IClaimContainer
createClaim, getClaim, getClaims, setClaim
 

Method Detail

getType

public String getType()
Returns the type of this i-card (e.g. "uri", "cardspace", "idemix", "openid", etc.)


getID

public String getID()
Gets the ID of the i-card. Useful in subsequent import operations, so that cards can be updated or overwritten.

The ID of the i-card must be unique per i-card provider but different i-card providers could contains i-cards with the same ID however.


getCUID

public CUID getCUID()
Gets the unique identifier of the i-card in the i-card registry.

Because different i-card providers could contains i-cards with the same ID, it could be difficult to retrieve the same i-card from the i-card registry again using i-card ID.

The UUID must be unique over all i-card providers in the i-card registry to allow retrieve the same i-card from the i-card registry multiple times.

Current implementation of i-card registry assumes that ICard.UUID must equals to ICardProvider.ID + "#" + ICard.ID


getVersion

public String getVersion()
Return the version of the card. Useful in subsequent import operations, so that cards can be updated or overwritten.


getName

public String getName()
Return the human friendly name of the card. The only thing that will be possible to modify after the import.


getImage

public byte[] getImage()
Returns byte representation of a background image of the card.


getImageType

public String getImageType()
Return the mime type of the background image (JPEG or GIF).


getIssuer

public String getIssuer()
Name of the issuer of the card. Used to match the required issuer, if a relying party specifies an issuer in the policy.


getIssuerName

public String getIssuerName()
Returns the human friendly name of the card issuer, originator, creator.


getTimeIssued

public Date getTimeIssued()
Returns when the card was first issued, created, orginated.


getTimeExpires

public Date getTimeExpires()
Returns (optionally) the time after which the card should be considered expired, invalid. Otherwise returns null.


getSupportedClaimTypesUris

public List getSupportedClaimTypesUris()
Return a list of all possible types of claims (as String) that are supported.


getClaimByLocalName

public IClaim getClaimByLocalName(String typeLocalName)
                           throws AuthenticationRequiredException,
                                  InvalidTypeException,
                                  CardException
Parameters:
typeLocalName -
Returns:
Throws:
AuthenticationRequiredException - TODO
InvalidTypeException - TODO
CardException - TODO

getProvider

public ICardProvider getProvider()
Should it be here? /


getDescription

public String getDescription()

setName

public void setName(String newName)
             throws CardException
Used to change the name of the card

Parameters:
newName -
Throws:
CardException

setImage

public void setImage(byte[] newImage,
                     String newImageType)
              throws CardException
Used to change the picture associated with this card

Parameters:
newImage -
newImageType -
Throws:
CardException

setIssuerName

public void setIssuerName(String name)
                   throws CardException
Sets the card's human friendly name of the card issuer

Parameters:
name -
Throws:
CardNotOpenException
CardException

setTimeExpires

public void setTimeExpires(Date date)
                    throws CardException
Parameters:
date -
Throws:
CardNotOpenException
CardException

getSupportedTokenTypes

public List getSupportedTokenTypes()
Returns:
list of token types which can be provided for this card

isSelfIssued

public boolean isSelfIssued()
Indicates that this card has been issued by user (claim values can be editable)


getTimeLastUpdated

public Date getTimeLastUpdated()
Set the expiration date and time

Returns:
date when the card was last updated
Throws:
CardException

isEditable

public boolean isEditable()
Determines whether this ICard could be edited by the user. General idea is that managed cards (isSelfIssued() == false) can not be edited by the user but some types of managed cards could also allow the user to edit their data.


beginUpdates

public void beginUpdates()
                  throws InvalidStateException
Puts this ICard object into edit mode when an update operations on card or on any contained elements are allowed.

Note that any update operation on this ICard prior to this method call and after either applyUpdates() or cancelUpdates() throws the InvalidStateException.

Throws:
InvalidStateException - if this ICard object is in edit mode already.

cancelUpdates

public void cancelUpdates()
                   throws InvalidStateException
Cancels any updates made to this ICard object or any contained elements and terminate edit mode. Reloads card's data from backing data store.

Throws:
InvalidStateException - if this ICard object is not in edit mode.

applyUpdates

public void applyUpdates()
                  throws InvalidStateException,
                         CardException
Applies an updates made to this ICard object to the backing data store.

On success terminate edit mode of this ICard object.

On error this ICard object remains in edit mode.

Throws:
InvalidStateException - if this ICard object is not in edit mode.
CardException - if an error occurs at update backing data store.

isEditMode

public boolean isEditMode()
Determines wheter this ICard object is in edit mode.


isClaimsRetrieved

public boolean isClaimsRetrieved()
Checks whether this card already has claims retrieved or it is necessary to make additional call to ICardProvider.getICardByCUID(javax.security.auth.callback.CallbackHandler, CUID, org.eclipse.higgins.icard.auth.ICredential) to retrieve them.


getRequiredCredentials

public ICredentialDescriptor[] getRequiredCredentials()
Returns an array of credential descriptors which should be used to request protected clam's information. For some types of cards it is possible to request such information using different service endpoints each of which could requere different credentials. Each element in returned array describe all information sufficient to request such information on single endpoint. Returned array could be empty or null if authentiation is not required to request claim's information.

See Also:
ICardProvider.getICardByCUID(javax.security.auth.callback.CallbackHandler, CUID, org.eclipse.higgins.icard.auth.ICredential)

isFormatSupported

public boolean isFormatSupported(IElementFormat format)

toElement

public IElement toElement(IElementFormat format)
                   throws CardException,
                          CardIOException,
                          UnsupportedElementFormatException
Throws:
CardException
CardIOException
UnsupportedElementFormatException