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
 String acquireICard(String subscribeURL)
          Acquires the i-card from RP site.
 void addCardHistory(org.eclipse.higgins.icard.CUID cuid, URI site)
           
 CategoryTO addCategory(CategoryTO categoryTO)
           
 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)
           
 void connectionNotify(String host, String username, boolean success)
          Locate the URIICard-type I-Card whose URI matches 'cref'.
 boolean connectionVerify(String host, String username)
          The RP site invokes this method to verify that user really has an account on the specified site.
 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)
           
 void 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()
           
 String getFormFillingScript(URL page, String username, String form)
          Gets a form filling script for the specified site&user
 CallbackHandler getHandler()
           
 String getHigginsServiceGlobalIName()
          Gets the global i-name registered to the Higgins service (e.g.
 String getHtmlScrapingScript(String page)
          Gets an HTML scraping script for the specified site
 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)
           
 ICardsAndCategoryTO getICardsAndCategoriesByUser()
          Gets the card and category lists of the specified user.
 ICardTO[] getICardsByFormat(String formatID)
           
 ICardTO[] 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()
           
 ICardTemplateTO getPersonalICardCreationTemplate()
          Get a icard template for creating personal card
 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()
           
 ICardTO[] importICards(byte[] crd)
          Imports card from a file.
 ICardTO[] importICards(byte[] crd, String formatID, UITokenServiceCredentialTO credential)
           
 ResponseMessage modifyCategories(CategoryTO[] categoriesTO)
           
 CategoryTO modifyCategory(CategoryTO categoryTO)
           
 UserProfileTO modifyUserProfile(UserProfileTO userProfile)
          Update user profile
 ICardTO resetPinCode(String cuid, String oldPinCode)
           
 boolean setCardCredential(String cuid, UITokenServiceCredentialTO tokenCredential)
           
 void setHandler(CallbackHandler handler)
           
 void setHtmlScrapingScript(String page, String script)
          Sets an HTML scraping script for the specified site
 ICardTO setPinCode(String cuid, String pinCode)
           
 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)

authenticate

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

acquireICard

public String acquireICard(String subscribeURL)
                    throws MalformedURLException
Acquires the i-card from RP site.

Specified by:
acquireICard in interface IRppsService
Parameters:
subscribeURL - the URL of the site from where i-card will be acquired
Returns:
a new card id
Throws:
MalformedURLException

connectionNotify

public void connectionNotify(String host,
                             String username,
                             boolean success)
                      throws MalformedURLException
Locate the URIICard-type I-Card whose URI matches 'cref'. If no such card exists, create it. Find the Node whose unique identifier is 'cuid'. On the uniqueIdentifier attribute value itself: (1) if 'success' is true, add/update to "now" the the lastVerifiedFromSource metadata property's timestamp and (2) add/update the lastVerifiedAttempt metadata property's timestamp to "now".

Specified by:
connectionNotify in interface IRppsService
Parameters:
host - the host name of the RP site where user is verified
username - the user name to login to the RP site
success - the verifying result
Throws:
MalformedURLException

connectionVerify

public boolean connectionVerify(String host,
                                String username)
                         throws MalformedURLException
The RP site invokes this method to verify that user really has an account on the specified site.

Specified by:
connectionVerify in interface IRppsService
Parameters:
host - The verified site url.
username - The username to login onto verified site.
Returns:
The result of verification process.
Throws:
MalformedURLException

getFormFillingScript

public String getFormFillingScript(URL page,
                                   String username,
                                   String form)
Gets a form filling script for the specified site&user

Specified by:
getFormFillingScript in interface IRppsService
Parameters:
page - the page url where user lands on
username - the user name
form - the HTML form name
Returns:
a form filling script

getHtmlScrapingScript

public String getHtmlScrapingScript(String page)
                             throws MalformedURLException,
                                    RppsException
Gets an HTML scraping script for the specified site

Specified by:
getHtmlScrapingScript in interface IRppsService
Parameters:
page - the page url
Returns:
an HTML scraping script
Throws:
MalformedURLException
RppsException

setHtmlScrapingScript

public void setHtmlScrapingScript(String page,
                                  String script)
                           throws MalformedURLException,
                                  RppsException
Sets an HTML scraping script for the specified site

Specified by:
setHtmlScrapingScript in interface IRppsService
Parameters:
page - the page url
script - the script body
Throws:
MalformedURLException
RppsException

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 ICardTO[] 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

importICards

public ICardTO[] 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 ICardTO[] importICards(byte[] crd,
                              String formatID,
                              UITokenServiceCredentialTO credential)
                       throws RppsException
Specified by:
importICards in interface IRppsService
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 void 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

getICardCreationTemplateByProvider

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

getPersonalICardCreationTemplate

public ICardTemplateTO getPersonalICardCreationTemplate()
Get a icard template for creating personal card

Specified by:
getPersonalICardCreationTemplate in interface IRppsService
Returns:
a template

setPinCode

public ICardTO setPinCode(String cuid,
                          String pinCode)
                   throws RppsException
Specified by:
setPinCode in interface IRppsService
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)