Class RemoteCredentialsServiceImpl
java.lang.Object
org.alfresco.repo.remotecredentials.RemoteCredentialsServiceImpl
- All Implemented Interfaces:
RemoteCredentialsService
An Implementation of the
RemoteCredentialsService- Since:
- Odin
- Author:
- Nick Burch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreatePersonCredentials(String remoteSystem, BaseCredentialsInfo credentials) Stores a newBaseCredentialsInfofor the current usercreateSharedCredentials(String remoteSystem, BaseCredentialsInfo credentials) Stores a newBaseCredentialsInfofor shared use.voiddeleteCredentials(BaseCredentialsInfo credentialsInfo) Deletes an existingBaseCredentialsInfofrom the repositoryprotected Map<QName,RemoteCredentialsInfoFactory> Provides a read only copy of the credentials factories, useful in unit testsgetPersonCredentials(String remoteSystem) Fetches the credentials for the current user for the specified System.protected NodeRefgetSharedContainerNodeRef(boolean required) Gets the NodeRef of the holder of shared credentials remote systems.protected static StringUnit testing use only!protected static QNameorg.alfresco.query.PagingResults<? extends BaseCredentialsInfo>listAllCredentials(String remoteSystem, QName credentialsType, org.alfresco.query.PagingRequest paging) Lists all Credentials that the user has access to for the given Remote Systemorg.alfresco.query.PagingResults<String>listAllRemoteSystems(org.alfresco.query.PagingRequest paging) Lists all the Remote Systems for which the user has credentials, either personal ones or shared onesorg.alfresco.query.PagingResults<? extends BaseCredentialsInfo>listPersonCredentials(String remoteSystem, QName credentialsType, org.alfresco.query.PagingRequest paging) Lists all Credentials for the current user for the given Remote Systemorg.alfresco.query.PagingResults<String>listPersonRemoteSystems(org.alfresco.query.PagingRequest paging) Lists all Remote Systems for which credentials are stored for the current userorg.alfresco.query.PagingResults<? extends BaseCredentialsInfo>listSharedCredentials(String remoteSystem, QName credentialsType, org.alfresco.query.PagingRequest paging) Lists all Credentials that are shared with the current user for the given Remote Systemorg.alfresco.query.PagingResults<String>listSharedRemoteSystems(org.alfresco.query.PagingRequest paging) Lists all Remote Systems for which the user has access to shared credentialsvoidregisterCredentialsFactory(QName credentialsType, RemoteCredentialsInfoFactory factory) Registers a new Factory to produceBaseCredentialsInfoobjects for a given data type.voidsetCredentialsFactories(Map<String, RemoteCredentialsInfoFactory> factories) Registers a number of new factoriesvoidsetDictionaryService(DictionaryService dictionaryService) voidsetNamespaceService(NamespaceService namespaceService) voidsetNodeService(NodeService nodeService) voidsetPermissionService(PermissionService permissionService) voidsetRepositoryHelper(Repository repositoryHelper) protected static voidsetSharedCredentialsSystemContainerName(String container) Unit testing use only! Used to avoid tests affecting the real system containerupdateCredentials(BaseCredentialsInfo credentials) Updates an existingBaseCredentialsInfo.updateCredentialsAuthenticationSucceeded(boolean succeeded, BaseCredentialsInfo credentials) Records if the most recent Authentication attempt with a given set of credentials worked or not.
-
Constructor Details
-
RemoteCredentialsServiceImpl
public RemoteCredentialsServiceImpl()
-
-
Method Details
-
setNodeService
-
setNamespaceService
-
setPermissionService
-
setDictionaryService
-
setRepositoryHelper
-
setCredentialsFactories
Registers a number of new factories -
registerCredentialsFactory
Registers a new Factory to produceBaseCredentialsInfoobjects for a given data type. This provides an alternative tosetCredentialsFactories(Map)to allow the registering of a new type without overriding all of them.- Parameters:
credentialsType- The object typefactory- The Factory to use to create this type with
-
getCredentialsFactories
Provides a read only copy of the credentials factories, useful in unit tests -
deleteCredentials
Description copied from interface:RemoteCredentialsServiceDeletes an existingBaseCredentialsInfofrom the repository- Specified by:
deleteCredentialsin interfaceRemoteCredentialsService
-
createPersonCredentials
public BaseCredentialsInfo createPersonCredentials(String remoteSystem, BaseCredentialsInfo credentials) Description copied from interface:RemoteCredentialsServiceStores a newBaseCredentialsInfofor the current user- Specified by:
createPersonCredentialsin interfaceRemoteCredentialsService
-
getPersonCredentials
Description copied from interface:RemoteCredentialsServiceFetches the credentials for the current user for the specified System. If multiple credentials exist, the first is returned, so this should only be used for systems where a user is restricted to only one set of credentials per system.- Specified by:
getPersonCredentialsin interfaceRemoteCredentialsService- Returns:
- The Credentials, or Null if none exist for the current user
-
updateCredentials
Description copied from interface:RemoteCredentialsServiceUpdates an existingBaseCredentialsInfo. The type must not change.- Specified by:
updateCredentialsin interfaceRemoteCredentialsService
-
updateCredentialsAuthenticationSucceeded
public BaseCredentialsInfo updateCredentialsAuthenticationSucceeded(boolean succeeded, BaseCredentialsInfo credentials) Description copied from interface:RemoteCredentialsServiceRecords if the most recent Authentication attempt with a given set of credentials worked or not.- Specified by:
updateCredentialsAuthenticationSucceededin interfaceRemoteCredentialsService
-
listAllRemoteSystems
public org.alfresco.query.PagingResults<String> listAllRemoteSystems(org.alfresco.query.PagingRequest paging) Description copied from interface:RemoteCredentialsServiceLists all the Remote Systems for which the user has credentials, either personal ones or shared ones- Specified by:
listAllRemoteSystemsin interfaceRemoteCredentialsService
-
listPersonRemoteSystems
public org.alfresco.query.PagingResults<String> listPersonRemoteSystems(org.alfresco.query.PagingRequest paging) Description copied from interface:RemoteCredentialsServiceLists all Remote Systems for which credentials are stored for the current user- Specified by:
listPersonRemoteSystemsin interfaceRemoteCredentialsService
-
listPersonCredentials
public org.alfresco.query.PagingResults<? extends BaseCredentialsInfo> listPersonCredentials(String remoteSystem, QName credentialsType, org.alfresco.query.PagingRequest paging) Description copied from interface:RemoteCredentialsServiceLists all Credentials for the current user for the given Remote System- Specified by:
listPersonCredentialsin interfaceRemoteCredentialsService- Parameters:
remoteSystem- The Remote System to return credentials forcredentialsType- Optional type (including child subtypes) of the credentials to filter by
-
listAllCredentials
public org.alfresco.query.PagingResults<? extends BaseCredentialsInfo> listAllCredentials(String remoteSystem, QName credentialsType, org.alfresco.query.PagingRequest paging) Description copied from interface:RemoteCredentialsServiceLists all Credentials that the user has access to for the given Remote System- Specified by:
listAllCredentialsin interfaceRemoteCredentialsService- Parameters:
remoteSystem- The Remote System to return credentials forcredentialsType- Optional type (including child subtypes) of the credentials to filter by
-