Interface RemoteAlfrescoTicketService
-
- All Known Implementing Classes:
RemoteAlfrescoTicketServiceImpl
public interface RemoteAlfrescoTicketServiceService for working with a Remote Alfresco instance, which holds user credentials for the remote system via theRemoteCredentialsService, and handles ticket negotiation for you. Currently only Username+Password credentials, exchanged for a regular alf_ticket Alfresco Ticket are supported, but things like OAuth should be supportable too later. All Remote Systems must be registered with this service before use, supplying details of where to find the remote Alfresco for a given Remote System ID. The Remote System names should follow the system naming convention fromRemoteCredentialsServiceTODO OAuth support- Since:
- 4.0.2
- Author:
- Nick Burch
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleandeleteRemoteCredentials(java.lang.String remoteSystemId)Deletes the remote credentials (if any) for the current userRemoteAlfrescoTicketInfogetAlfrescoTicket(java.lang.String remoteSystemId)Returns the current Alfresco Ticket for the current user on the remote system, fetching if it isn't already cached.BaseCredentialsInfogetRemoteCredentials(java.lang.String remoteSystemId)Retrieves the remote credentials (if any) for the current userRemoteAlfrescoTicketInforefetchAlfrescoTicket(java.lang.String remoteSystemId)Forces a re-fetch of the Alfresco Ticket for the current user, if possible, and marks the credentials as failing if not.voidregisterRemoteSystem(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.BaseCredentialsInfostoreRemoteCredentials(java.lang.String remoteSystemId, java.lang.String username, java.lang.String password)Validates and stores the remote credentials for the current user
-
-
-
Method Detail
-
storeRemoteCredentials
BaseCredentialsInfo storeRemoteCredentials(java.lang.String remoteSystemId, java.lang.String username, java.lang.String password) throws org.alfresco.repo.security.authentication.AuthenticationException, RemoteSystemUnavailableException, NoSuchSystemException
Validates and stores the remote credentials for the current user- Parameters:
remoteSystemId- The ID of the remote system, as registered with the service- Throws:
org.alfresco.repo.security.authentication.AuthenticationException- If the credentials are invalidRemoteSystemUnavailableException- If the remote system is unavailableNoSuchSystemException- If no system has been registered with the given ID
-
getRemoteCredentials
BaseCredentialsInfo getRemoteCredentials(java.lang.String remoteSystemId) throws NoSuchSystemException
Retrieves the remote credentials (if any) for the current user- Parameters:
remoteSystemId- The ID of the remote system, as registered with the service- Returns:
- The current user's remote credentials, or null if they don't have any
- Throws:
NoSuchSystemException- If no system has been registered with the given ID
-
deleteRemoteCredentials
boolean deleteRemoteCredentials(java.lang.String remoteSystemId) throws NoSuchSystemExceptionDeletes the remote credentials (if any) for the current user- 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
-
getAlfrescoTicket
RemoteAlfrescoTicketInfo getAlfrescoTicket(java.lang.String remoteSystemId) throws org.alfresco.repo.security.authentication.AuthenticationException, NoCredentialsFoundException, NoSuchSystemException, RemoteSystemUnavailableException
Returns the current Alfresco Ticket for the current user on the remote system, fetching if it isn't already cached. Note that because tickets are cached, it is possible that a ticket has become invalid (due to timeout or server restart). If the ticket is rejected by the remote server, you should callrefetchAlfrescoTicket(String)to ensure you have the latest ticket, and re-try the request.- Parameters:
remoteSystemId- The ID of the remote system, as registered with the service- Returns:
- The Alfresco Ticket for the current user on the remote system
- Throws:
org.alfresco.repo.security.authentication.AuthenticationException- If the stored remote credentials are now invalidNoCredentialsFoundException- If the user has no stored credentials for the remote systemNoSuchSystemException- If no system has been registered with the given IDRemoteSystemUnavailableException- If it was not possible to talk to the remote system
-
refetchAlfrescoTicket
RemoteAlfrescoTicketInfo refetchAlfrescoTicket(java.lang.String remoteSystemId) throws org.alfresco.repo.security.authentication.AuthenticationException, NoCredentialsFoundException, NoSuchSystemException, RemoteSystemUnavailableException
Forces a re-fetch of the Alfresco Ticket for the current user, if possible, and marks the credentials as failing if not. NormallygetAlfrescoTicket(String)should be used initially, with this only used if the ticket received is rejected by the remote server.- Parameters:
remoteSystemId- The ID of the remote system, as registered with the service- Returns:
- The Alfresco Ticket for the current user on the remote system
- Throws:
org.alfresco.repo.security.authentication.AuthenticationException- If the stored remote credentials are now invalidNoCredentialsFoundException- If the user has no stored credentials for the remote systemNoSuchSystemException- If no system has been registered with the given IDRemoteSystemUnavailableException- If it was not possible to talk to the remote system
-
registerRemoteSystem
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.- Parameters:
remoteSystemId- The ID to be used to identify the systembaseUrl- 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
-
-