org.eclipse.higgins.sync.bean
Class CardSyncFacadeBean

java.lang.Object
  extended by org.eclipse.higgins.sync.bean.CardSyncFacadeBean

public class CardSyncFacadeBean
extends Object

CardSync Bean Facade.

Author:
Alexander Yuhimenko

Field Summary
static ThreadLocal<org.eclipse.higgins.sync.auth.IAuthenticateService> authenticateService
           
static ThreadLocal<Map<String,IResourceCommand>> commandMap
           
static ThreadLocal<org.eclipse.higgins.user.login.LoginService> loginService
          Instance of LoginService..
static ThreadLocal<org.eclipse.higgins.sync.meta.IResourceMetaDataService> metaDataService
           
static ThreadLocal<org.eclipse.higgins.user.account.IUserAccountService> userAccountService
          Instance of IUserAccountService.
static ThreadLocal<org.eclipse.higgins.user.profile.IUserProfileService> userProfileService
          Instance of IUserProfileService .
 
Constructor Summary
CardSyncFacadeBean()
           
 
Method Summary
 org.eclipse.higgins.user.login.UserAccount authenticate(AuthCredentialTO authCredentialTO)
          Authenticate user by AuthCredentialTO.
 AccessTokenTO createAccessToken(AuthCredentialTO authCredentialTO)
          Authenticate user and build AccessTokenEntity.
 UserProfileTO createUserProfile(UserProfileTO userProfileTO)
          Create new UserProfile.
 void deleteAccessToken(String id)
           
 void deleteCard(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity, String id)
           
 void deleteUserProfile(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity)
          Delete UserProfile.
 CmdExecStatusesTO execCommands(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity, CommandsTO commandsTO, List<String> resourceTypeList)
          Retrieve changes between client RootRevisionTO and server RootRevisionTO.
 org.eclipse.higgins.sync.auth.entity.AccessTokenEntity getAccessToken(String accessTokenId)
          Return AccessTokenEntity by Access Token Id.
 CardTO getCard(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity, String id)
          Returns Card by Id.
 List<CardTO> getCards(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity)
           
 CommandsTO getCommandLog(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity, RevisionTO clientRootRevisionTO, List<String> resourceTypeList)
          Retrieve changes between client RootRevisionTO and server RootRevisionTO.
 RevisionTO getRootRevision(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessToken, List<String> resourceTypeList)
          Return Root resource revision.
 UserProfileTO getUserProfile(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity)
          Return UserProfile by user identifier.
 List<CardTO> importFromCrd(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity, FileTO fileTO)
          Import crd or crds file.
 CardTO persistCard(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity, CardTO cardTO)
          Create new P/M Card.
 UserProfileTO updateUserProfile(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity, UserProfileTO userProfileTO)
          Update UserProfile.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

userProfileService

public static final ThreadLocal<org.eclipse.higgins.user.profile.IUserProfileService> userProfileService
Instance of IUserProfileService .


loginService

public static final ThreadLocal<org.eclipse.higgins.user.login.LoginService> loginService
Instance of LoginService..


metaDataService

public static final ThreadLocal<org.eclipse.higgins.sync.meta.IResourceMetaDataService> metaDataService

userAccountService

public static final ThreadLocal<org.eclipse.higgins.user.account.IUserAccountService> userAccountService
Instance of IUserAccountService.


authenticateService

public static final ThreadLocal<org.eclipse.higgins.sync.auth.IAuthenticateService> authenticateService

commandMap

public static final ThreadLocal<Map<String,IResourceCommand>> commandMap
Constructor Detail

CardSyncFacadeBean

public CardSyncFacadeBean()
Method Detail

createUserProfile

public UserProfileTO createUserProfile(UserProfileTO userProfileTO)
                                throws org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException,
                                       org.eclipse.higgins.user.profile.exception.UserProfileException,
                                       NoSuchAlgorithmException,
                                       UnsupportedEncodingException,
                                       org.eclipse.higgins.user.account.exception.UserAccountException
Create new UserProfile.

Parameters:
userProfileTO -
authCredentialTO -
Returns:
Throws:
org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException
org.eclipse.higgins.user.profile.exception.UserProfileException
org.eclipse.higgins.user.account.exception.UserAccountException
UnsupportedEncodingException
NoSuchAlgorithmException

deleteAccessToken

public void deleteAccessToken(String id)
Parameters:
id -
See Also:
IAuthenticateService.deleteAccessToken(java.lang.String)

authenticate

public org.eclipse.higgins.user.login.UserAccount authenticate(AuthCredentialTO authCredentialTO)
                                                        throws org.eclipse.higgins.user.login.exception.ConfigurationException,
                                                               org.eclipse.higgins.user.login.exception.LoginException,
                                                               org.eclipse.higgins.sync.auth.exceptions.AuthenticationException,
                                                               org.eclipse.higgins.user.profile.exception.UserProfileException
Authenticate user by AuthCredentialTO.

Returns:
Throws:
org.eclipse.higgins.user.login.exception.ConfigurationException
org.eclipse.higgins.user.login.exception.LoginException
org.eclipse.higgins.sync.auth.exceptions.AuthenticationException
org.eclipse.higgins.user.profile.exception.UserProfileException

createAccessToken

public AccessTokenTO createAccessToken(AuthCredentialTO authCredentialTO)
                                throws org.eclipse.higgins.sync.auth.exceptions.AuthenticationException,
                                       org.eclipse.higgins.user.login.exception.ConfigurationException,
                                       org.eclipse.higgins.user.login.exception.LoginException,
                                       org.eclipse.higgins.user.profile.exception.UserProfileException
Authenticate user and build AccessTokenEntity.

Parameters:
authCredentialTO -
Returns:
AccessTokenTO
Throws:
org.eclipse.higgins.sync.auth.exceptions.AuthenticationException
org.eclipse.higgins.user.profile.exception.UserProfileException
org.eclipse.higgins.user.login.exception.LoginException
org.eclipse.higgins.user.login.exception.ConfigurationException

getAccessToken

public org.eclipse.higgins.sync.auth.entity.AccessTokenEntity getAccessToken(String accessTokenId)
                                                                      throws org.eclipse.higgins.sync.auth.exceptions.AuthenticationException
Return AccessTokenEntity by Access Token Id.

Parameters:
accessTokenId -
Returns:
Throws:
org.eclipse.higgins.sync.auth.exceptions.AuthenticationException
See Also:
IAuthenticateService.getAccessToken(java.lang.String)

getRootRevision

public RevisionTO getRootRevision(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessToken,
                                  List<String> resourceTypeList)
                           throws org.eclipse.higgins.sync.auth.exceptions.AuthenticationException,
                                  org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException
Return Root resource revision.

Parameters:
accessToken -
resourceTypeList -
Returns:
Throws:
org.eclipse.higgins.sync.auth.exceptions.AuthenticationException
org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException

getUserProfile

public UserProfileTO getUserProfile(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity)
                             throws org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException,
                                    org.eclipse.higgins.user.profile.exception.UserProfileException,
                                    org.eclipse.higgins.user.account.exception.UserAccountException
Return UserProfile by user identifier.

Parameters:
accessTokenEntity -
Returns:
Throws:
org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException
org.eclipse.higgins.user.profile.exception.UserProfileException
org.eclipse.higgins.user.account.exception.UserAccountException

deleteUserProfile

public void deleteUserProfile(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity)
                       throws org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException,
                              org.eclipse.higgins.user.profile.exception.UserProfileException,
                              org.eclipse.higgins.user.account.exception.UserAccountException
Delete UserProfile.

Parameters:
accessTokenEntity -
Throws:
org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException
org.eclipse.higgins.user.profile.exception.UserProfileException
org.eclipse.higgins.user.account.exception.UserAccountException

updateUserProfile

public UserProfileTO updateUserProfile(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity,
                                       UserProfileTO userProfileTO)
                                throws org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException,
                                       org.eclipse.higgins.user.profile.exception.UserProfileException,
                                       org.eclipse.higgins.user.account.exception.UserAccountException
Update UserProfile.

Parameters:
accessTokenEntity -
userProfileTO -
Returns:
Throws:
org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException
org.eclipse.higgins.user.profile.exception.UserProfileException
org.eclipse.higgins.user.account.exception.UserAccountException

getCards

public List<CardTO> getCards(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity)
                      throws org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException,
                             org.eclipse.higgins.icard.CardException
Throws:
org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException
org.eclipse.higgins.icard.CardException

getCard

public CardTO getCard(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity,
                      String id)
               throws org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException,
                      org.eclipse.higgins.icard.CardException
Returns Card by Id.

Parameters:
accessTokenEntity -
id -
Returns:
Throws:
org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException
org.eclipse.higgins.icard.CardException

persistCard

public CardTO persistCard(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity,
                          CardTO cardTO)
                   throws org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException,
                          org.eclipse.higgins.icard.CardException
Create new P/M Card.

Parameters:
accessTokenEntity -
cardTO -
Returns:
Throws:
org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException
org.eclipse.higgins.icard.CardException

deleteCard

public void deleteCard(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity,
                       String id)
Parameters:
accessToken -
id -

importFromCrd

public List<CardTO> importFromCrd(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity,
                                  FileTO fileTO)
                           throws org.eclipse.higgins.icard.CardException,
                                  org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException
Import crd or crds file.

Parameters:
accessTokenEntity -
crd - - binary file.
password - for crds file.
Returns:
CardsTO
Throws:
org.eclipse.higgins.icard.CardException
org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException

getCommandLog

public CommandsTO getCommandLog(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity,
                                RevisionTO clientRootRevisionTO,
                                List<String> resourceTypeList)
                         throws org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException,
                                org.eclipse.higgins.sync.auth.exceptions.AuthenticationException
Retrieve changes between client RootRevisionTO and server RootRevisionTO.

Parameters:
accessTokenEntity -
clientRootRevisionTO -
resourceTypeList - if null return for all resources.
Returns:
Throws:
org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException
org.eclipse.higgins.sync.auth.exceptions.AuthenticationException

execCommands

public CmdExecStatusesTO execCommands(org.eclipse.higgins.sync.auth.entity.AccessTokenEntity accessTokenEntity,
                                      CommandsTO commandsTO,
                                      List<String> resourceTypeList)
                               throws org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException,
                                      org.eclipse.higgins.sync.auth.exceptions.AuthenticationException
Retrieve changes between client RootRevisionTO and server RootRevisionTO.

Parameters:
accessTokenEntity -
clientRootRevisionTO -
Returns:
list of CommandTO
Throws:
org.eclipse.higgins.sync.meta.exceptions.ResourceMetaDataException
org.eclipse.higgins.sync.auth.exceptions.AuthenticationException