org.eclipse.higgins.rpps.core.impl
Class RppsService

java.lang.Object
  extended byorg.eclipse.higgins.rpps.core.impl.RppsService
All Implemented Interfaces:
IRppsService

public class RppsService
extends Object
implements IRppsService

The object used for executing Higgins API and returning the results it produces.

Author:
Sergei Yakovlev, Artem Verkhovets

Nested Class Summary
static class RppsService.DummyTrustManagerFactory
           
 
Field Summary
 
Fields inherited from interface org.eclipse.higgins.rpps.core.IRppsService
IPasswordCredential, IPinCodeCredential, ITSKerberosV5Credential, ITSSelfIssuedCredential, ITSSelfIssuedNonPinCredential, ITSUsernamePasswordCredential, ITSX509V3Credential, IUsernamePasswordCredential
 
Constructor Summary
RppsService()
           
RppsService(String userId, String password)
           
 
Method Summary
 void addCardHistory(org.eclipse.higgins.icard.CUID cuid, URI site)
           
 CategoryTO addCategory(CategoryTO categoryTO)
           
 void addClaimValuesMRU(String claimType, String claimValue)
           
 ResponseMessage addUserProfile(UserProfileTO userProfile)
          Creates new user profile
 void addUserProfileFromHBX(String userId, String password)
          Creates new user profile
static void AllowSelfSignedSSL()
          Other methods **************
 void authenticate(String userId, String password)
           
 FormatDescriptorTO checkImportStream(byte[] crd)
           
 ICardTO clearCardCredential(String cuid)
           
 boolean clearCardHistory(String cuid)
           
static void ConfigureCache(String configurationBase, String configurationFile)
           
 ICardTO createDuplicateICard(String cardName, String cuid, String pinCode)
          Creates the duplicate card with new card's name
 ICardTO createICard(ICardTemplateTO template)
          Creates a new card by template
 ICardTO createICard(String id, String[] properties)
          Creates a new card
 String createICardFromHBX(String cardname)
          Creates new card
 void deleteAllICard()
          Deletes all user's card.
 void deleteCategory(String categoryId)
           
 ICardUpdateResponseTO deleteICard(String cuid)
          Deletes specified card.
 boolean deleteUrlCardRelation(String cuid, String url)
           
 ResponseMessage deleteUserProfile()
          Deletes user profile
 ICardTO editPinCode(String cuid, String oldPinCode, String newPinCode)
           
 byte[] exportICards(String formatID, String[] cards, UITokenServiceCredentialTO credential)
           
 CardUsageTO[] getCardHistory(String cuid, int startFrom, int size, String orderBy, String orderDirection)
           
 CardUsageTO[] getCardHistoryLog(String cuid, int startFrom, int size, String orderBy, String orderDirection)
           
 CardInformationTO getCardInformation(String cuid, int size)
           
 CategoryTO[] getCategory()
           
 MapTO[] getClaimValuesMRU()
           
 CallbackHandler getHandler()
           
 String getHigginsServiceGlobalIName()
          Gets the global i-name registered to the Higgins service (e.g.
 ICardTO getICardByCUID(String cuid)
          Gets a card by CUID.
 ICardTO getICardByCUIDAndTokenServiceCredential(String cuid, UITokenServiceCredentialTO tokenCredential)
          Gets a card by CUID and Credential.
 UIResponseCardTO getICardClaims(String cuid, String policy, String typeofCredential, String[] credentialKey, String[] credentialValue)
           
 ICardTemplateTO[] getICardCreationTemplate()
          Return templates for creating cards
 org.eclipse.higgins.icard.ICardTemplate[] getICardCreationTemplateByProvider(String extID)
           
 ICardTemplateTO getICardCreationTemplateByTUID(String tuid)
          Return templates for creating cards
 org.eclipse.higgins.icard.ICardTemplate getICardCreationTemplateByTUID(org.eclipse.higgins.icard.TUID tuid)
          Return templates for creating cards
 ICardsAndCategoryTO getICardsAndCategoriesByUser()
          Gets the card and category lists of the specified user.
 ICardTO[] getICardsByFormat(String formatID)
           
 ICardResponseTO getICardsByUser()
          Gets the card list of the specified user.
static IRppsService getInstance()
          Creates an RppsService object.
static IRppsService getInstance(String userId, String password)
          Creates an RppsService object.
 FormatDescriptorTO[] getOutputFormats()
           
 TokenResponseTO getTokenByClaims(String sslCert, String[] claimName, String[] claimValue)
          Web service operation.
 TokenResponseTO getTokenByUrl(String policy, String policytype, String sslCert, String url)
          Web service operation.
 ExtraTokenResponseTO getTokenExtraByUrl(String policy, String policytype, String sslCert, String url)
          Web service operation.
 TokenResponseTO getTokenObject(String policy, String policytype, String sslCert, String[] cuids, String typeofCredential, String[] credentialKey, String[] credentialValue)
          Web service operation.
 UIResponseTO getUserInterface(String url, String target, String sslCert, String policytype, String policy)
          This method takes as input a policy---for example, one that has been retrieved from the Relying Party Agent (called here the 'Requester')---as well as a description of the Requester.
 UserProfileTO getUserProfile()
           
 ICardResponseTO importICards(byte[] crd)
          Imports card from a file.
 ICardResponseTO importICards(byte[] crd, String formatID, UITokenServiceCredentialTO credential)
          Imports card from a file.
 ResponseMessage modifyCategories(CategoryTO[] categoriesTO)
           
 CategoryTO modifyCategory(CategoryTO categoryTO)
           
 UserProfileTO modifyUserProfile(UserProfileTO userProfile)
          Update user profile
 void removeClaimValuesMRU(String claimType, String claimValue)
           
 ICardTO resetPinCode(String cuid, String oldPinCode)
           
static String resolveUserIdentifier(String privateSelectorINumber)
           
 boolean setCardCredential(String cuid, UITokenServiceCredentialTO tokenCredential)
           
 void setHandler(CallbackHandler handler)
           
 ICardTO setPinCode(String cuid, String pinCode)
          Get a icard template for creating personal card
 ICardUpdateResponseTO[] updateClaimAcrossCards(String claimType, String claimValue, ICardUpdateTO[] cardUpdate)
          Update claim across cards.
 ICardTO updateICard(ICardTO icardTO)
          Update card.
 boolean userIdentifierExists(String userIdentifier)
          Checks availability of user profile by userIdentifier
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RppsService

public RppsService()

RppsService

public RppsService(String userId,
                   String password)
            throws AccessException
Method Detail

getInstance

public static IRppsService getInstance()
Creates an RppsService object.

Returns:
the RppsService object

getInstance

public static IRppsService getInstance(String userId,
                                       String password)
                                throws AccessException
Creates an RppsService object.

Returns:
the RppsService object
Throws:
AccessException

getHandler

public CallbackHandler getHandler()

setHandler

public void setHandler(CallbackHandler handler)

resolveUserIdentifier

public static String resolveUserIdentifier(String privateSelectorINumber)
Parameters:
privateSelectorINumber -
Returns:
userIdentifer

authenticate

public void authenticate(String userId,
                         String password)
                  throws AccessException
Throws:
AccessException

createICard

public ICardTO createICard(String id,
                           String[] properties)
                    throws RppsException
Creates a new card

Specified by:
createICard in interface IRppsService
Parameters:
id - the i-card id
properties - the i-card properties
Returns:
a new card id
Throws:
RppsException

createICard

public ICardTO createICard(ICardTemplateTO template)
                    throws RppsException
Creates a new card by template

Specified by:
createICard in interface IRppsService
Returns:
a new card id
Throws:
RppsException

createDuplicateICard

public ICardTO createDuplicateICard(String cardName,
                                    String cuid,
                                    String pinCode)
                             throws RppsException
Creates the duplicate card with new card's name

Specified by:
createDuplicateICard in interface IRppsService
Parameters:
cardName - new card's name
cuid - cuid of old card
pinCode - pincode if it needs
Returns:
card trasfer object
Throws:
RppsException

createICardFromHBX

public String createICardFromHBX(String cardname)
                          throws RppsException
Creates new card

Specified by:
createICardFromHBX in interface IRppsService
Parameters:
cardname - name of card
Returns:
cuid of new card
Throws:
RppsException

getICardByCUID

public ICardTO getICardByCUID(String cuid)
                       throws RppsException
Gets a card by CUID.

Specified by:
getICardByCUID in interface IRppsService
Parameters:
cuid - the card CUID.
Returns:
the card transfer object.
Throws:
RppsException

getICardByCUIDAndTokenServiceCredential

public ICardTO getICardByCUIDAndTokenServiceCredential(String cuid,
                                                       UITokenServiceCredentialTO tokenCredential)
                                                throws RppsException
Gets a card by CUID and Credential.

Specified by:
getICardByCUIDAndTokenServiceCredential in interface IRppsService
Parameters:
cuid - the card CUID.
tokenCredential - the tokenCredential transfer object
Returns:
the card transfer object.
Throws:
RppsException

getICardClaims

public UIResponseCardTO getICardClaims(String cuid,
                                       String policy,
                                       String typeofCredential,
                                       String[] credentialKey,
                                       String[] credentialValue)
                                throws RppsException
Specified by:
getICardClaims in interface IRppsService
Throws:
RppsException

getICardsByUser

public ICardResponseTO getICardsByUser()
Gets the card list of the specified user.

Specified by:
getICardsByUser in interface IRppsService
Returns:
the card list

getICardsAndCategoriesByUser

public ICardsAndCategoryTO getICardsAndCategoriesByUser()
                                                 throws RppsException
Gets the card and category lists of the specified user.

Specified by:
getICardsAndCategoriesByUser in interface IRppsService
Returns:
the card list
Throws:
RppsException

updateICard

public ICardTO updateICard(ICardTO icardTO)
                    throws RppsException
Update card.

Specified by:
updateICard in interface IRppsService
Parameters:
icardTO - the card transfer object.
Returns:
the card transfer object.
Throws:
RppsException

updateClaimAcrossCards

public ICardUpdateResponseTO[] updateClaimAcrossCards(String claimType,
                                                      String claimValue,
                                                      ICardUpdateTO[] cardUpdate)
                                               throws RppsException
Update claim across cards.

Specified by:
updateClaimAcrossCards in interface IRppsService
Throws:
RppsException

getClaimValuesMRU

public MapTO[] getClaimValuesMRU()
                          throws RppsException
Specified by:
getClaimValuesMRU in interface IRppsService
Throws:
RppsException

addClaimValuesMRU

public void addClaimValuesMRU(String claimType,
                              String claimValue)
                       throws RppsException
Specified by:
addClaimValuesMRU in interface IRppsService
Throws:
RppsException

removeClaimValuesMRU

public void removeClaimValuesMRU(String claimType,
                                 String claimValue)
                          throws RppsException
Specified by:
removeClaimValuesMRU in interface IRppsService
Throws:
RppsException

importICards

public ICardResponseTO importICards(byte[] crd)
                             throws RppsException
Imports card from a file.

Specified by:
importICards in interface IRppsService
Parameters:
crd - the card as a byte array.
Throws:
RppsException

importICards

public ICardResponseTO importICards(byte[] crd,
                                    String formatID,
                                    UITokenServiceCredentialTO credential)
                             throws RppsException
Imports card from a file.

Specified by:
importICards in interface IRppsService
Parameters:
crd - the card as a byte array.
formatID - the data format of the input stream if available. If null is used all available data formats will be checked in order to import.
credential - the authentication data to proccess the input stream if required
Throws:
RppsException

checkImportStream

public FormatDescriptorTO checkImportStream(byte[] crd)
                                     throws RppsException
Specified by:
checkImportStream in interface IRppsService
Throws:
RppsException

exportICards

public byte[] exportICards(String formatID,
                           String[] cards,
                           UITokenServiceCredentialTO credential)
                    throws RppsException
Specified by:
exportICards in interface IRppsService
Throws:
RppsException

getICardsByFormat

public ICardTO[] getICardsByFormat(String formatID)
                            throws RppsException
Specified by:
getICardsByFormat in interface IRppsService
Throws:
RppsException

getOutputFormats

public FormatDescriptorTO[] getOutputFormats()
                                      throws RppsException
Specified by:
getOutputFormats in interface IRppsService
Throws:
RppsException

deleteICard

public ICardUpdateResponseTO deleteICard(String cuid)
                                  throws RppsException
Deletes specified card.

Specified by:
deleteICard in interface IRppsService
Parameters:
cuid - the i-card CUID
Throws:
RppsException

deleteAllICard

public void deleteAllICard()
                    throws RppsException
Deletes all user's card.

Specified by:
deleteAllICard in interface IRppsService
Throws:
RppsException

getUserInterface

public UIResponseTO getUserInterface(String url,
                                     String target,
                                     String sslCert,
                                     String policytype,
                                     String policy)
                              throws RppsException
This method takes as input a policy---for example, one that has been retrieved from the Relying Party Agent (called here the 'Requester')---as well as a description of the Requester. The UserInterfaceResponse object should contain all information necessary to display both (a) a user interface which shares the same card metaphor, sequences of experiences and decision points (the ceremony) of CardSpace and (b) other interface paradigms to be developed in the future

Specified by:
getUserInterface in interface IRppsService
Parameters:
url - the URL to the html page with tag
target -
sslCert - the SSL certificate
policy - the RP Agent's Relying Party Security Policy
Returns:
the UIResponseTO transfer object.
Throws:
RemoteException
RppsException

getTokenByClaims

public TokenResponseTO getTokenByClaims(String sslCert,
                                        String[] claimName,
                                        String[] claimValue)
                                 throws RppsException
Web service operation. Makes xmlToken usage claim list.

Specified by:
getTokenByClaims in interface IRppsService
Parameters:
sslCert - the SSL certificate
Returns:
the security token transfer object
Throws:
RppsException

getTokenObject

public TokenResponseTO getTokenObject(String policy,
                                      String policytype,
                                      String sslCert,
                                      String[] cuids,
                                      String typeofCredential,
                                      String[] credentialKey,
                                      String[] credentialValue)
                               throws RppsException
Web service operation. Given the Relying Party Agent (aka 'Requester')'s policy, identity information about the requester, and the set of one or more selections that the user has just made in the ISS Web UI (see userInterfaceRequest), AND presuming that the protocol involved in interacting with the RPA requires a security token, request the token that corresponds to the user's selection(s).

Specified by:
getTokenObject in interface IRppsService
Parameters:
policy - the RP Agent's Relying Party Security Policy
policytype - the RP Security Policy type
sslCert - the SSL certificate
cuids - the user-selected subset of the UIDs (handles) contained in the UserInterfaceResponse object returned from an earlier invocation of 'userInterfaceRequest'
typeofCredential - the type of selected credential
credentialKey - the names of fields of selected credential
credentialValue - the value of fields of selected credential
Returns:
the security token transfer object
Throws:
RemoteException
RppsException

getTokenByUrl

public TokenResponseTO getTokenByUrl(String policy,
                                     String policytype,
                                     String sslCert,
                                     String url)
                              throws RppsException
Web service operation. Makes security token usage saved users information

Specified by:
getTokenByUrl in interface IRppsService
Parameters:
policy - the RP Agent's Relying Party Security Policy
policytype - the RP Security Policy type
sslCert - the SSL certificate
url - the url of site which needs token
Returns:
the security token transfer object
Throws:
RemoteException
RppsException

getTokenExtraByUrl

public ExtraTokenResponseTO getTokenExtraByUrl(String policy,
                                               String policytype,
                                               String sslCert,
                                               String url)
                                        throws RppsException
Web service operation. Makes security token usage saved users information

Specified by:
getTokenExtraByUrl in interface IRppsService
Parameters:
policy - the RP Agent's Relying Party Security Policy
policytype - the RP Security Policy type
sslCert - the SSL certificate
url - the url of site which needs token
Returns:
the security token transfer object
Throws:
RemoteException
RppsException

getICardCreationTemplate

public ICardTemplateTO[] getICardCreationTemplate()
Return templates for creating cards

Specified by:
getICardCreationTemplate in interface IRppsService
Returns:
a template list

getICardCreationTemplateByTUID

public ICardTemplateTO getICardCreationTemplateByTUID(String tuid)
                                               throws RppsException
Return templates for creating cards

Returns:
a template list
Throws:
RppsException

getICardCreationTemplateByTUID

public org.eclipse.higgins.icard.ICardTemplate getICardCreationTemplateByTUID(org.eclipse.higgins.icard.TUID tuid)
                                                                       throws org.eclipse.higgins.icard.CardException
Return templates for creating cards

Returns:
a template list
Throws:
org.eclipse.higgins.icard.CardException

getICardCreationTemplateByProvider

public org.eclipse.higgins.icard.ICardTemplate[] getICardCreationTemplateByProvider(String extID)
                                                                             throws RppsException
Specified by:
getICardCreationTemplateByProvider in interface IRppsService
Throws:
RppsException

setPinCode

public ICardTO setPinCode(String cuid,
                          String pinCode)
                   throws RppsException
Get a icard template for creating personal card

Specified by:
setPinCode in interface IRppsService
Returns:
a template
Throws:
RppsException

resetPinCode

public ICardTO resetPinCode(String cuid,
                            String oldPinCode)
                     throws RppsException
Specified by:
resetPinCode in interface IRppsService
Throws:
RppsException

editPinCode

public ICardTO editPinCode(String cuid,
                           String oldPinCode,
                           String newPinCode)
                    throws RppsException
Specified by:
editPinCode in interface IRppsService
Throws:
RppsException

addCardHistory

public void addCardHistory(org.eclipse.higgins.icard.CUID cuid,
                           URI site)
                    throws org.eclipse.higgins.icard.userprofile.UserProfileException
Throws:
org.eclipse.higgins.icard.userprofile.UserProfileException

clearCardHistory

public boolean clearCardHistory(String cuid)
Specified by:
clearCardHistory in interface IRppsService

getCardHistoryLog

public CardUsageTO[] getCardHistoryLog(String cuid,
                                       int startFrom,
                                       int size,
                                       String orderBy,
                                       String orderDirection)

getCardHistory

public CardUsageTO[] getCardHistory(String cuid,
                                    int startFrom,
                                    int size,
                                    String orderBy,
                                    String orderDirection)
Specified by:
getCardHistory in interface IRppsService

getCategory

public CategoryTO[] getCategory()
                         throws RppsException
Specified by:
getCategory in interface IRppsService
Returns:
Throws:
RppsException

addCategory

public CategoryTO addCategory(CategoryTO categoryTO)
                       throws RppsException
Specified by:
addCategory in interface IRppsService
Throws:
RppsException

deleteCategory

public void deleteCategory(String categoryId)
                    throws RppsException
Specified by:
deleteCategory in interface IRppsService
Throws:
RppsException

modifyCategory

public CategoryTO modifyCategory(CategoryTO categoryTO)
                          throws RppsException
Specified by:
modifyCategory in interface IRppsService
Throws:
RppsException

modifyCategories

public ResponseMessage modifyCategories(CategoryTO[] categoriesTO)
                                 throws RppsException
Specified by:
modifyCategories in interface IRppsService
Throws:
RppsException

getUserProfile

public UserProfileTO getUserProfile()
                             throws RppsException,
                                    AccessException
Specified by:
getUserProfile in interface IRppsService
Throws:
RppsException
AccessException

addUserProfileFromHBX

public void addUserProfileFromHBX(String userId,
                                  String password)
                           throws RppsException
Creates new user profile

Specified by:
addUserProfileFromHBX in interface IRppsService
Parameters:
userId - the id to identify the user.
password - the password to identify the user.
Throws:
RppsException

addUserProfile

public ResponseMessage addUserProfile(UserProfileTO userProfile)
                               throws RppsException
Creates new user profile

Specified by:
addUserProfile in interface IRppsService
Parameters:
userProfile - user profile trasfer object
Throws:
RppsException

deleteUserProfile

public ResponseMessage deleteUserProfile()
                                  throws RppsException
Deletes user profile

Specified by:
deleteUserProfile in interface IRppsService
Throws:
RppsException

userIdentifierExists

public boolean userIdentifierExists(String userIdentifier)
Checks availability of user profile by userIdentifier

Specified by:
userIdentifierExists in interface IRppsService
Parameters:
userIdentifier -
Returns:
true if user profile exists otherwise false
Throws:
RppsException

modifyUserProfile

public UserProfileTO modifyUserProfile(UserProfileTO userProfile)
                                throws RppsException
Update user profile

Specified by:
modifyUserProfile in interface IRppsService
Parameters:
userProfile - user profile transfer object
Returns:
user profile transfer object
Throws:
RppsException

getCardInformation

public CardInformationTO getCardInformation(String cuid,
                                            int size)
                                     throws RppsException
Specified by:
getCardInformation in interface IRppsService
Parameters:
cuid -
Returns:
Throws:
RppsException

clearCardCredential

public ICardTO clearCardCredential(String cuid)
                            throws RppsException
Specified by:
clearCardCredential in interface IRppsService
Throws:
RppsException

setCardCredential

public boolean setCardCredential(String cuid,
                                 UITokenServiceCredentialTO tokenCredential)
                          throws RppsException
Specified by:
setCardCredential in interface IRppsService
Throws:
RppsException

deleteUrlCardRelation

public boolean deleteUrlCardRelation(String cuid,
                                     String url)
                              throws RppsException
Specified by:
deleteUrlCardRelation in interface IRppsService
Throws:
RppsException

AllowSelfSignedSSL

public static void AllowSelfSignedSSL()
Other methods **************


getHigginsServiceGlobalIName

public String getHigginsServiceGlobalIName()
Gets the global i-name registered to the Higgins service (e.g. "=parity").

Specified by:
getHigginsServiceGlobalIName in interface IRppsService
Returns:
the global i-name.

ConfigureCache

public static void ConfigureCache(String configurationBase,
                                  String configurationFile)