Class JiraAuthorityConnector
- java.lang.Object
-
- org.apache.manifoldcf.core.connector.BaseConnector
-
- org.apache.manifoldcf.authorities.authorities.BaseAuthorityConnector
-
- org.apache.manifoldcf.authorities.authorities.jira.JiraAuthorityConnector
-
- All Implemented Interfaces:
org.apache.manifoldcf.authorities.interfaces.IAuthorityConnector,org.apache.manifoldcf.core.interfaces.IConnector
public class JiraAuthorityConnector extends org.apache.manifoldcf.authorities.authorities.BaseAuthorityConnectorJira Authority Connector. This connector verifies user existence against Jira.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classJiraAuthorityConnector.CheckConnectionThreadprotected static classJiraAuthorityConnector.CheckUserExistsThread
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringclientidprotected java.lang.Stringclientsecretprotected java.lang.Stringjirahostprotected java.lang.Stringjirapathprotected java.lang.Stringjiraportprotected java.lang.Stringjiraprotocolprotected java.lang.Stringjiraproxydomainprotected java.lang.Stringjiraproxyhostprotected java.lang.Stringjiraproxypasswordprotected java.lang.Stringjiraproxyportprotected java.lang.Stringjiraproxyusernameprotected longlastSessionFetchprotected JiraSessionsessionprotected static longtimeToRelease-
Fields inherited from class org.apache.manifoldcf.authorities.authorities.BaseAuthorityConnector
_rcsid, RESPONSE_UNREACHABLE, RESPONSE_UNREACHABLE_ADDITIVE, RESPONSE_USERNOTFOUND, RESPONSE_USERNOTFOUND_ADDITIVE, RESPONSE_USERUNAUTHORIZED, RESPONSE_USERUNAUTHORIZED_ADDITIVE
-
-
Constructor Summary
Constructors Constructor Description JiraAuthorityConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringcheck()Test the connection.protected voidcheckConnection()protected booleancheckUserExists(java.lang.String userName)voidconnect(org.apache.manifoldcf.core.interfaces.ConfigParams configParams)This method create a new JIRA session for a JIRA repository, if the repositoryId is not provided in the configuration, the connector will retrieve all the repositories exposed for this endpoint the it will start to use the first one.voiddisconnect()Close the connection.org.apache.manifoldcf.authorities.interfaces.AuthorizationResponsegetAuthorizationResponse(java.lang.String userName)Obtain the access tokens for a given Active Directory user name.org.apache.manifoldcf.authorities.interfaces.AuthorizationResponsegetDefaultAuthorizationResponse(java.lang.String userName)Obtain the default access tokens for a given user name.protected JiraSessiongetSession()Set up a sessionbooleanisConnected()This method is called to assess whether to count this connector instance should actually be counted as being connected.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)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.voidpoll()java.lang.StringprocessConfigurationPost(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IPostParameters variableContext, org.apache.manifoldcf.core.interfaces.ConfigParams parameters)Process a configuration post.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
clearThreadContext, deinstall, getConfiguration, install, outputConfigurationBody, outputConfigurationHeader, outputConfigurationHeader, pack, packFixedList, packList, packList, processConfigurationPost, setThreadContext, unpack, unpackFixedList, unpackList, viewConfiguration
-
-
-
-
Field Detail
-
session
protected JiraSession session
-
lastSessionFetch
protected long lastSessionFetch
-
timeToRelease
protected static final long timeToRelease
- See Also:
- Constant Field Values
-
jiraprotocol
protected java.lang.String jiraprotocol
-
jirahost
protected java.lang.String jirahost
-
jiraport
protected java.lang.String jiraport
-
jirapath
protected java.lang.String jirapath
-
clientid
protected java.lang.String clientid
-
clientsecret
protected java.lang.String clientsecret
-
jiraproxyhost
protected java.lang.String jiraproxyhost
-
jiraproxyport
protected java.lang.String jiraproxyport
-
jiraproxydomain
protected java.lang.String jiraproxydomain
-
jiraproxyusername
protected java.lang.String jiraproxyusername
-
jiraproxypassword
protected java.lang.String jiraproxypassword
-
-
Method Detail
-
disconnect
public void disconnect() throws org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionClose the connection. Call this before discarding the connection.- Specified by:
disconnectin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
disconnectin classorg.apache.manifoldcf.core.connector.BaseConnector- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
connect
public void connect(org.apache.manifoldcf.core.interfaces.ConfigParams configParams)
This method create a new JIRA session for a JIRA repository, if the repositoryId is not provided in the configuration, the connector will retrieve all the repositories exposed for this endpoint the it will start to use the first one.- Specified by:
connectin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
connectin classorg.apache.manifoldcf.core.connector.BaseConnector- Parameters:
configParams- is the set of configuration parameters, which in this case describe the target appliance, basic auth configuration, etc. (This formerly came out of the ini file.)
-
check
public java.lang.String check() throws org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionTest the connection. Returns a string describing the connection integrity.- Specified by:
checkin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
checkin classorg.apache.manifoldcf.core.connector.BaseConnector- Returns:
- the connection's status as a displayable string.
- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
getSession
protected JiraSession getSession() throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
Set up a session- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
isConnected
public boolean isConnected()
This method is called to assess whether to count this connector instance should actually be counted as being connected.- Specified by:
isConnectedin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
isConnectedin classorg.apache.manifoldcf.core.connector.BaseConnector- Returns:
- true if the connector instance is actually connected.
-
poll
public void poll() throws org.apache.manifoldcf.core.interfaces.ManifoldCFException- Specified by:
pollin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
pollin classorg.apache.manifoldcf.core.connector.BaseConnector- 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
-
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
-
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.IOException- Specified by:
outputConfigurationBodyin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
outputConfigurationBodyin classorg.apache.manifoldcf.core.connector.BaseConnector- 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, 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".- 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
-
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 Active Directory 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
-
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.
-
checkUserExists
protected boolean checkUserExists(java.lang.String userName) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
checkConnection
protected void checkConnection() throws org.apache.manifoldcf.core.interfaces.ManifoldCFException- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
-