Class RemoteAlfrescoTicketServiceImpl

  • All Implemented Interfaces:
    RemoteAlfrescoTicketService

    public class RemoteAlfrescoTicketServiceImpl
    extends java.lang.Object
    implements RemoteAlfrescoTicketService
    Service for working with a Remote Alfresco instance, which holds user credentials for the remote system via the RemoteCredentialsService, and handles ticket negotiation for you. Note - this service will be moved to the Repository Core once it has stabilised (likely after OAuth support is added) TODO OAuth support
    Since:
    4.0.2
    Author:
    Nick Burch
    • Constructor Detail

      • RemoteAlfrescoTicketServiceImpl

        public RemoteAlfrescoTicketServiceImpl()
    • Method Detail

      • setRemoteCredentialsService

        public void setRemoteCredentialsService​(RemoteCredentialsService remoteCredentialsService)
        Sets the Remote Credentials Service to use to store and retrieve credentials
      • setRemoteConnectorService

        public void setRemoteConnectorService​(RemoteConnectorService remoteConnectorService)
        Sets the Remote Connector Service to use to talk to remote systems with
      • setTicketsCache

        public void setTicketsCache​(org.alfresco.repo.cache.SimpleCache<java.lang.String,​java.lang.String> ticketsCache)
        Sets the SimpleCache to be used to cache remote tickets in
      • setRetryingTransactionHelper

        public void setRetryingTransactionHelper​(RetryingTransactionHelper retryingTransactionHelper)
        Sets the Retrying Transaction Helper, used to write changes to Credentials which turn out to be invalid
      • registerRemoteSystem

        public void registerRemoteSystem​(java.lang.String remoteSystemId,
                                         java.lang.String baseUrl,
                                         java.util.Map<java.lang.String,​java.lang.String> requestHeaders)
        Registers the details of a new Remote System with the service. Any previous details for the system will be overridden
        Specified by:
        registerRemoteSystem in interface RemoteAlfrescoTicketService
        Parameters:
        remoteSystemId - The ID to be used to identify the system
        baseUrl - The base URL of Alfresco Services on the remote system, eg http://localhost:8080/alfresco/service/
        requestHeaders - Any HTTP headers that must be sent with the request when talking to the server
      • toCacheKey

        protected java.lang.String toCacheKey​(java.lang.String remoteSystemId,
                                              BaseCredentialsInfo credentials)
      • deleteRemoteCredentials

        public boolean deleteRemoteCredentials​(java.lang.String remoteSystemId)
                                        throws NoSuchSystemException
        Deletes the remote credentials (if any) for the current user
        Specified by:
        deleteRemoteCredentials in interface RemoteAlfrescoTicketService
        Parameters:
        remoteSystemId - The ID of the remote system, as registered with the service
        Returns:
        Whether credentials were found to delete
        Throws:
        NoSuchSystemException - If no system has been registered with the given ID