public class RemoteAlfrescoTicketServiceImpl extends Object implements RemoteAlfrescoTicketService
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 supportConstructor and Description |
---|
RemoteAlfrescoTicketServiceImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
deleteRemoteCredentials(String remoteSystemId)
Deletes the remote credentials (if any) for the current user
|
protected PasswordCredentialsInfo |
ensureCredentialsFound(String remoteSystemId,
BaseCredentialsInfo credentails) |
protected void |
ensureRemoteSystemKnown(String remoteSystemId) |
RemoteAlfrescoTicketInfo |
getAlfrescoTicket(String remoteSystemId)
Returns the current Alfresco Ticket for the current user on
the remote system, fetching if it isn't already cached.
|
BaseCredentialsInfo |
getRemoteCredentials(String remoteSystemId)
Retrieves the remote credentials (if any) for the current user
|
RemoteAlfrescoTicketInfo |
refetchAlfrescoTicket(String remoteSystemId)
Forces a re-fetch of the Alfresco Ticket for the current user,
if possible, and marks the credentials as failing if not.
|
protected RemoteAlfrescoTicketInfo |
refreshTicket(String remoteSystemId,
PasswordCredentialsInfo credentials)
Fetches a new ticket for the given user, and caches it
|
void |
registerRemoteSystem(String remoteSystemId,
String baseUrl,
Map<String,String> requestHeaders)
Registers the details of a new Remote System with the service.
|
void |
setRemoteConnectorService(RemoteConnectorService remoteConnectorService)
Sets the Remote Connector Service to use to talk to remote systems with
|
void |
setRemoteCredentialsService(RemoteCredentialsService remoteCredentialsService)
Sets the Remote Credentials Service to use to store and retrieve credentials
|
void |
setRetryingTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
Sets the Retrying Transaction Helper, used to write changes to
Credentials which turn out to be invalid
|
void |
setTicketsCache(org.alfresco.repo.cache.SimpleCache<String,String> ticketsCache)
Sets the SimpleCache to be used to cache remote tickets in
|
BaseCredentialsInfo |
storeRemoteCredentials(String remoteSystemId,
String username,
String password)
Validates and stores the remote credentials for the current user
|
protected String |
toCacheKey(String remoteSystemId,
BaseCredentialsInfo credentials) |
public void setRemoteCredentialsService(RemoteCredentialsService remoteCredentialsService)
public void setRemoteConnectorService(RemoteConnectorService remoteConnectorService)
public void setTicketsCache(org.alfresco.repo.cache.SimpleCache<String,String> ticketsCache)
public void setRetryingTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
public void registerRemoteSystem(String remoteSystemId, String baseUrl, Map<String,String> requestHeaders)
registerRemoteSystem
in interface RemoteAlfrescoTicketService
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 serverprotected void ensureRemoteSystemKnown(String remoteSystemId) throws NoSuchSystemException
NoSuchSystemException
protected PasswordCredentialsInfo ensureCredentialsFound(String remoteSystemId, BaseCredentialsInfo credentails)
protected String toCacheKey(String remoteSystemId, BaseCredentialsInfo credentials)
public BaseCredentialsInfo storeRemoteCredentials(String remoteSystemId, String username, String password) throws org.alfresco.repo.security.authentication.AuthenticationException, RemoteSystemUnavailableException, NoSuchSystemException
storeRemoteCredentials
in interface RemoteAlfrescoTicketService
remoteSystemId
- The ID of the remote system, as registered with the serviceorg.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 IDpublic BaseCredentialsInfo getRemoteCredentials(String remoteSystemId) throws NoSuchSystemException
getRemoteCredentials
in interface RemoteAlfrescoTicketService
remoteSystemId
- The ID of the remote system, as registered with the serviceNoSuchSystemException
- If no system has been registered with the given IDpublic boolean deleteRemoteCredentials(String remoteSystemId) throws NoSuchSystemException
deleteRemoteCredentials
in interface RemoteAlfrescoTicketService
remoteSystemId
- The ID of the remote system, as registered with the serviceNoSuchSystemException
- If no system has been registered with the given IDpublic RemoteAlfrescoTicketInfo getAlfrescoTicket(String remoteSystemId) throws org.alfresco.repo.security.authentication.AuthenticationException, NoCredentialsFoundException, NoSuchSystemException, RemoteSystemUnavailableException
getAlfrescoTicket
in interface RemoteAlfrescoTicketService
remoteSystemId
- The ID of the remote system, as registered with the serviceorg.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 systempublic RemoteAlfrescoTicketInfo refetchAlfrescoTicket(String remoteSystemId) throws org.alfresco.repo.security.authentication.AuthenticationException, NoCredentialsFoundException, NoSuchSystemException, RemoteSystemUnavailableException
refetchAlfrescoTicket
in interface RemoteAlfrescoTicketService
remoteSystemId
- The ID of the remote system, as registered with the serviceorg.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 systemprotected RemoteAlfrescoTicketInfo refreshTicket(String remoteSystemId, PasswordCredentialsInfo credentials) throws org.alfresco.repo.security.authentication.AuthenticationException, NoSuchSystemException, RemoteSystemUnavailableException
org.alfresco.repo.security.authentication.AuthenticationException
NoSuchSystemException
RemoteSystemUnavailableException
Copyright © 2005–2017 Alfresco Software. All rights reserved.