Class CmisAuthorityConnector
- java.lang.Object
-
- org.apache.manifoldcf.core.connector.BaseConnector
-
- org.apache.manifoldcf.authorities.authorities.BaseAuthorityConnector
-
- org.apache.manifoldcf.authorities.authorities.cmis.CmisAuthorityConnector
-
- All Implemented Interfaces:
org.apache.manifoldcf.authorities.interfaces.IAuthorityConnector,org.apache.manifoldcf.core.interfaces.IConnector
public class CmisAuthorityConnector extends org.apache.manifoldcf.authorities.authorities.BaseAuthorityConnectorThe CMIS Authority Connector is based only on a regular expression checker, because the CMIS specification (and the Apache Chemistry implementation) doesn't have any exposed method to get info about users. For the configuration we can assume that we could have different users for any CMIS repository that could have the same endpoint. That's why for this connector is required the Repository ID.- Author:
- Piergiorgio Lucidi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classCmisAuthorityConnector.AuthorizationResponseDescriptionThis is the cache object descriptor for cached access tokens from this connector.
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.manifoldcf.core.interfaces.ICacheManagercacheManagerThe cache manager.static java.lang.StringCONFIG_PARAM_ENDPOINTstatic java.lang.StringCONFIG_PARAM_PASSWORDstatic java.lang.StringCONFIG_PARAM_REPOSITORY_IDprotected static java.lang.StringCONFIG_PARAM_USER_TRANSLATIONstatic java.lang.StringCONFIG_PARAM_USERNAMEprotected static java.lang.StringCONFIG_PARAM_USERNAME_REGEXPprotected static org.apache.manifoldcf.core.interfaces.StringSetemptyStringSetprotected java.lang.Stringendpointstatic java.lang.StringGLOBAL_DENY_TOKENThis is the active directory global deny token.protected static intLRUsizeprotected java.util.Map<java.lang.String,java.lang.String>parametersprotected java.lang.StringrepositoryIdprotected static longresponseLifetime
-
Constructor Summary
Constructors Constructor Description CmisAuthorityConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearThreadContext()Clear thread context.org.apache.manifoldcf.authorities.interfaces.AuthorizationResponsegetAuthorizationResponse(java.lang.String userName)Obtain the access tokens for a given user name.protected org.apache.manifoldcf.authorities.interfaces.AuthorizationResponsegetAuthorizationResponseUncached(java.lang.String userName)Uncached version of the getAuthorizationResponse method.org.apache.manifoldcf.authorities.interfaces.AuthorizationResponsegetDefaultAuthorizationResponse(java.lang.String userName)Obtain the default access tokens for a given user name.voidoutputConfigurationBody(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IHTTPOutput out, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.ConfigParams parameters, java.lang.String tabName)Output the configuration body section.voidoutputConfigurationHeader(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IHTTPOutput out, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.ConfigParams parameters, java.util.List<java.lang.String> tabsArray)Output the configuration header section.java.lang.StringprocessConfigurationPost(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IPostParameters variableContext, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.ConfigParams parameters)Process a configuration post.voidsetThreadContext(org.apache.manifoldcf.core.interfaces.IThreadContext tc)Set thread context.voidviewConfiguration(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IHTTPOutput out, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.ConfigParams parameters)View configuration.-
Methods inherited from class org.apache.manifoldcf.authorities.authorities.BaseAuthorityConnector
getAccessTokens, getDefaultAccessTokens
-
Methods inherited from class org.apache.manifoldcf.core.connector.BaseConnector
check, connect, deinstall, disconnect, getConfiguration, install, isConnected, outputConfigurationBody, outputConfigurationHeader, outputConfigurationHeader, pack, packFixedList, packList, packList, poll, processConfigurationPost, unpack, unpackFixedList, unpackList, viewConfiguration
-
-
-
-
Field Detail
-
CONFIG_PARAM_USERNAME
public static final java.lang.String CONFIG_PARAM_USERNAME
- See Also:
- Constant Field Values
-
CONFIG_PARAM_PASSWORD
public static final java.lang.String CONFIG_PARAM_PASSWORD
- See Also:
- Constant Field Values
-
CONFIG_PARAM_ENDPOINT
public static final java.lang.String CONFIG_PARAM_ENDPOINT
- See Also:
- Constant Field Values
-
CONFIG_PARAM_REPOSITORY_ID
public static final java.lang.String CONFIG_PARAM_REPOSITORY_ID
- See Also:
- Constant Field Values
-
CONFIG_PARAM_USERNAME_REGEXP
protected static final java.lang.String CONFIG_PARAM_USERNAME_REGEXP
- See Also:
- Constant Field Values
-
CONFIG_PARAM_USER_TRANSLATION
protected static final java.lang.String CONFIG_PARAM_USER_TRANSLATION
- See Also:
- Constant Field Values
-
endpoint
protected java.lang.String endpoint
-
repositoryId
protected java.lang.String repositoryId
-
parameters
protected java.util.Map<java.lang.String,java.lang.String> parameters
-
cacheManager
protected org.apache.manifoldcf.core.interfaces.ICacheManager cacheManager
The cache manager.
-
responseLifetime
protected static long responseLifetime
-
LRUsize
protected static int LRUsize
-
emptyStringSet
protected static org.apache.manifoldcf.core.interfaces.StringSet emptyStringSet
-
GLOBAL_DENY_TOKEN
public static final java.lang.String GLOBAL_DENY_TOKEN
This is the active directory global deny token. This should be ingested with all documents.- See Also:
- Constant Field Values
-
-
Method Detail
-
setThreadContext
public void setThreadContext(org.apache.manifoldcf.core.interfaces.IThreadContext tc) throws org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionSet thread context.- Specified by:
setThreadContextin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
setThreadContextin classorg.apache.manifoldcf.core.connector.BaseConnector- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
clearThreadContext
public void clearThreadContext()
Clear thread context.- Specified by:
clearThreadContextin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
clearThreadContextin classorg.apache.manifoldcf.core.connector.BaseConnector
-
outputConfigurationBody
public void outputConfigurationBody(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IHTTPOutput out, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.ConfigParams parameters, java.lang.String tabName) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, java.io.IOExceptionOutput the configuration body section. This method is called in the body section of the authority connector's configuration page. Its purpose is to present the required form elements for editing. The coder can presume that the HTML that is output from this configuration will be within appropriate <html>, <body>, and <form> tags. The name of the form is "editconnection".- Specified by:
outputConfigurationBodyin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
outputConfigurationBodyin classorg.apache.manifoldcf.core.connector.BaseConnector- Parameters:
threadContext- is the local thread context.out- is the output to which any HTML should be sent.parameters- are the configuration parameters, as they currently exist, for this connection being configured.tabName- is the current tab name.- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionjava.io.IOException
-
outputConfigurationHeader
public void outputConfigurationHeader(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IHTTPOutput out, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.ConfigParams parameters, java.util.List<java.lang.String> tabsArray) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, java.io.IOExceptionOutput the configuration header section. This method is called in the head section of the connector's configuration page. Its purpose is to add the required tabs to the list, and to output any javascript methods that might be needed by the configuration editing HTML.- Specified by:
outputConfigurationHeaderin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
outputConfigurationHeaderin classorg.apache.manifoldcf.core.connector.BaseConnector- Parameters:
threadContext- is the local thread context.out- is the output to which any HTML should be sent.parameters- are the configuration parameters, as they currently exist, for this connection being configured.tabsArray- is an array of tab names. Add to this array any tab names that are specific to the connector.- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionjava.io.IOException
-
processConfigurationPost
public java.lang.String processConfigurationPost(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IPostParameters variableContext, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.ConfigParams parameters) throws org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionProcess a configuration post. This method is called at the start of the connector's configuration page, whenever there is a possibility that form data for a connection has been posted. Its purpose is to gather form information and modify the configuration parameters accordingly. The name of the posted form is "editconnection".- Specified by:
processConfigurationPostin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
processConfigurationPostin classorg.apache.manifoldcf.core.connector.BaseConnector- Parameters:
threadContext- is the local thread context.variableContext- is the set of variables available from the post, including binary file post information.parameters- are the configuration parameters, as they currently exist, for this connection being configured.- Returns:
- null if all is well, or a string error message if there is an error that should prevent saving of the connection (and cause a redirection to an error page).
- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
viewConfiguration
public void viewConfiguration(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IHTTPOutput out, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.ConfigParams parameters) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, java.io.IOExceptionView configuration. This method is called in the body section of the connector's view configuration page. Its purpose is to present the connection information to the user. The coder can presume that the HTML that is output from this configuration will be within appropriate <html> and <body> tags.- Specified by:
viewConfigurationin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
viewConfigurationin classorg.apache.manifoldcf.core.connector.BaseConnector- Parameters:
threadContext- is the local thread context.out- is the output to which any HTML should be sent.parameters- are the configuration parameters, as they currently exist, for this connection being configured.- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionjava.io.IOException
-
getDefaultAuthorizationResponse
public org.apache.manifoldcf.authorities.interfaces.AuthorizationResponse getDefaultAuthorizationResponse(java.lang.String userName)
Obtain the default access tokens for a given user name.- Specified by:
getDefaultAuthorizationResponsein interfaceorg.apache.manifoldcf.authorities.interfaces.IAuthorityConnector- Overrides:
getDefaultAuthorizationResponsein classorg.apache.manifoldcf.authorities.authorities.BaseAuthorityConnector- Parameters:
userName- is the user name or identifier.- Returns:
- the default response tokens, presuming that the connect method fails.
-
getAuthorizationResponseUncached
protected org.apache.manifoldcf.authorities.interfaces.AuthorizationResponse getAuthorizationResponseUncached(java.lang.String userName) throws org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionUncached version of the getAuthorizationResponse method.- Parameters:
userName- is the user name or identifier.- Returns:
- the response tokens (according to the current authority). (Should throws an exception only when a condition cannot be properly described within the authorization response object.)
- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
getAuthorizationResponse
public org.apache.manifoldcf.authorities.interfaces.AuthorizationResponse getAuthorizationResponse(java.lang.String userName) throws org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionObtain the access tokens for a given user name.- Specified by:
getAuthorizationResponsein interfaceorg.apache.manifoldcf.authorities.interfaces.IAuthorityConnector- Overrides:
getAuthorizationResponsein classorg.apache.manifoldcf.authorities.authorities.BaseAuthorityConnector- Parameters:
userName- is the user name or identifier.- Returns:
- the response tokens (according to the current authority). (Should throws an exception only when a condition cannot be properly described within the authorization response object.)
- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
-