Class RemoteCredentialsServiceImpl

    • Constructor Detail

      • RemoteCredentialsServiceImpl

        public RemoteCredentialsServiceImpl()
    • Method Detail

      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
      • setNamespaceService

        public void setNamespaceService​(org.alfresco.service.namespace.NamespaceService namespaceService)
      • setPermissionService

        public void setPermissionService​(org.alfresco.service.cmr.security.PermissionService permissionService)
      • setDictionaryService

        public void setDictionaryService​(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
      • setRepositoryHelper

        public void setRepositoryHelper​(Repository repositoryHelper)
      • setCredentialsFactories

        public void setCredentialsFactories​(java.util.Map<java.lang.String,​RemoteCredentialsInfoFactory> factories)
        Registers a number of new factories
      • registerCredentialsFactory

        public void registerCredentialsFactory​(org.alfresco.service.namespace.QName credentialsType,
                                               RemoteCredentialsInfoFactory factory)
        Registers a new Factory to produce BaseCredentialsInfo objects for a given data type. This provides an alternative to setCredentialsFactories(Map) to allow the registering of a new type without overriding all of them.
        Parameters:
        credentialsType - The object type
        factory - The Factory to use to create this type with
      • getCredentialsFactories

        protected java.util.Map<org.alfresco.service.namespace.QName,​RemoteCredentialsInfoFactory> getCredentialsFactories()
        Provides a read only copy of the credentials factories, useful in unit tests
      • getSharedContainerNodeRef

        protected org.alfresco.service.cmr.repository.NodeRef getSharedContainerNodeRef​(boolean required)
        Gets the NodeRef of the holder of shared credentials remote systems. This is stored under system Protected, so that unit tests can make use of it
      • getPersonCredentials

        public BaseCredentialsInfo getPersonCredentials​(java.lang.String remoteSystem)
        Description copied from interface: RemoteCredentialsService
        Fetches 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:
        getPersonCredentials in interface RemoteCredentialsService
        Returns:
        The Credentials, or Null if none exist for the current user
      • listAllRemoteSystems

        public org.alfresco.query.PagingResults<java.lang.String> listAllRemoteSystems​(org.alfresco.query.PagingRequest paging)
        Description copied from interface: RemoteCredentialsService
        Lists all the Remote Systems for which the user has credentials, either personal ones or shared ones
        Specified by:
        listAllRemoteSystems in interface RemoteCredentialsService
      • listPersonRemoteSystems

        public org.alfresco.query.PagingResults<java.lang.String> listPersonRemoteSystems​(org.alfresco.query.PagingRequest paging)
        Description copied from interface: RemoteCredentialsService
        Lists all Remote Systems for which credentials are stored for the current user
        Specified by:
        listPersonRemoteSystems in interface RemoteCredentialsService
      • listSharedRemoteSystems

        public org.alfresco.query.PagingResults<java.lang.String> listSharedRemoteSystems​(org.alfresco.query.PagingRequest paging)
        Description copied from interface: RemoteCredentialsService
        Lists all Remote Systems for which the user has access to shared credentials
        Specified by:
        listSharedRemoteSystems in interface RemoteCredentialsService
      • listSharedCredentials

        public org.alfresco.query.PagingResults<? extends BaseCredentialsInfo> listSharedCredentials​(java.lang.String remoteSystem,
                                                                                                     org.alfresco.service.namespace.QName credentialsType,
                                                                                                     org.alfresco.query.PagingRequest paging)
        Description copied from interface: RemoteCredentialsService
        Lists all Credentials that are shared with the current user for the given Remote System
        Specified by:
        listSharedCredentials in interface RemoteCredentialsService
        Parameters:
        remoteSystem - The Remote System to return credentials for
        credentialsType - Optional type (including child subtypes) of the credentials to filter by
      • listPersonCredentials

        public org.alfresco.query.PagingResults<? extends BaseCredentialsInfo> listPersonCredentials​(java.lang.String remoteSystem,
                                                                                                     org.alfresco.service.namespace.QName credentialsType,
                                                                                                     org.alfresco.query.PagingRequest paging)
        Description copied from interface: RemoteCredentialsService
        Lists all Credentials for the current user for the given Remote System
        Specified by:
        listPersonCredentials in interface RemoteCredentialsService
        Parameters:
        remoteSystem - The Remote System to return credentials for
        credentialsType - Optional type (including child subtypes) of the credentials to filter by
      • listAllCredentials

        public org.alfresco.query.PagingResults<? extends BaseCredentialsInfo> listAllCredentials​(java.lang.String remoteSystem,
                                                                                                  org.alfresco.service.namespace.QName credentialsType,
                                                                                                  org.alfresco.query.PagingRequest paging)
        Description copied from interface: RemoteCredentialsService
        Lists all Credentials that the user has access to for the given Remote System
        Specified by:
        listAllCredentials in interface RemoteCredentialsService
        Parameters:
        remoteSystem - The Remote System to return credentials for
        credentialsType - Optional type (including child subtypes) of the credentials to filter by
      • getSharedCredentialsSystemContainerName

        protected static java.lang.String getSharedCredentialsSystemContainerName()
        Unit testing use only!
      • getSharedCredentialsSystemContainerQName

        protected static org.alfresco.service.namespace.QName getSharedCredentialsSystemContainerQName()
      • setSharedCredentialsSystemContainerName

        protected static void setSharedCredentialsSystemContainerName​(java.lang.String container)
        Unit testing use only! Used to avoid tests affecting the real system container