public class ConnectorService extends Object implements org.springframework.context.ApplicationContextAware
This class is mounted as a Spring Bean within the Web Script Framework so that developers can access it from the application context.
| Constructor and Description |
|---|
ConnectorService() |
| Modifier and Type | Method and Description |
|---|---|
Authenticator |
getAuthenticator(String id)
Returns the implementation of an Authenticator with a given id
|
ConfigService |
getConfigService()
Gets the config service.
|
Connector |
getConnector(String endpointId)
Retrieves a Connector to a given endpoint.
|
Connector |
getConnector(String endpointId,
javax.servlet.http.HttpSession session)
Retrieves a Connector to a given endpoint.
|
Connector |
getConnector(String endpointId,
String userId,
javax.servlet.http.HttpSession session)
Retrieves a Connector for the given endpoint that is scoped
to the given user.
|
Connector |
getConnector(String endpointId,
UserContext userContext,
javax.servlet.http.HttpSession session)
Retrieves a Connector for the given endpoint that is scoped
to the given user context.
|
ConnectorSession |
getConnectorSession(javax.servlet.http.HttpSession session,
String endpointId)
Returns the ConnectorSession bound to the current HttpSession for the given endpoint
|
CredentialVault |
getCredentialVault(javax.servlet.http.HttpSession session,
String userId)
Retrieves the user-scoped CredentialVault for the given user
If a vault doesn't yet exist, a vault of the default type
will be instantiated
|
CredentialVault |
getCredentialVault(javax.servlet.http.HttpSession session,
String userId,
String vaultProviderId)
Retrieves the user-scoped CredentialVault for the given user id
and given vault id
|
RemoteConfigElement |
getRemoteConfig()
Return the RemoteConfigElement instance
|
void |
removeConnectorSession(javax.servlet.http.HttpSession session,
String endpointId)
Removes the ConnectorSession from the HttpSession for the given endpoint
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Sets the Spring application context
|
void |
setConfigService(ConfigService configService)
Sets the config service.
|
public void setConfigService(ConfigService configService)
configService - the new config servicepublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext in interface org.springframework.context.ApplicationContextAwareapplicationContext - the Spring application contextpublic ConfigService getConfigService()
public RemoteConfigElement getRemoteConfig()
public Connector getConnector(String endpointId) throws ConnectorServiceException
This Connector has no given user context and will not pass any authentication credentials. Therefore only endpoints that do not require authentication or have "declared" authentication as part of the endpoint config should be used. This Connector also will not manage connector session state. Thus, it is generally less preferred to use these connectors over those provided by getConnector(endpointId, session)
endpointId - the endpoint idConnectorServiceExceptionpublic Connector getConnector(String endpointId, javax.servlet.http.HttpSession session) throws ConnectorServiceException
This Connector has no given user context and will not pass any authentication credentials. Therefore only endpoints that do not require authentication or have "declared" authentication as part of the endpoint config should be used. Cookie and token state will be session bound and reusable on subsequent invocations.
endpointId - the endpoint idsession - the HTTP sessionConnectorServiceExceptionpublic Connector getConnector(String endpointId, String userId, javax.servlet.http.HttpSession session) throws ConnectorServiceException
If the provided endpoint is configured to use an Authenticator, then the Connector instance returned will be wrapped as an AuthenticatingConnector.
Cookie and token state will be session bound and reusable on subsequent invocations.
endpointId - the endpoint iduserId - the user id (optional)session - the sessionConnectorServiceExceptionpublic Connector getConnector(String endpointId, UserContext userContext, javax.servlet.http.HttpSession session) throws ConnectorServiceException
A user context is a means of wrapping the Credentials and ConnectorSession objects for a given user. If they are provided, then context will be drawn from them and stored back.
endpointId - the endpoint iduserContext - the user contextsession - the http session (optional, if present will persist connector session)ConnectorServiceExceptionpublic Authenticator getAuthenticator(String id) throws ConnectorServiceException
id - the idConnectorServiceExceptionpublic ConnectorSession getConnectorSession(javax.servlet.http.HttpSession session, String endpointId)
session - the sessionendpointId - the endpoint idpublic void removeConnectorSession(javax.servlet.http.HttpSession session,
String endpointId)
session - the sessionendpointId - the endpoint idpublic CredentialVault getCredentialVault(javax.servlet.http.HttpSession session, String userId) throws CredentialVaultProviderException
session - HttpSessionuserId - the user idCredentialVaultProviderException - the credential vault provider exceptionpublic CredentialVault getCredentialVault(javax.servlet.http.HttpSession session, String userId, String vaultProviderId) throws CredentialVaultProviderException
session - HttpSessionuserId - the user idvaultProviderId - the vault provider idCredentialVaultProviderException - the credential vault provider exceptionCopyright © 2005–2016 Alfresco Software. All rights reserved.