org.apache.manifoldcf.authorities.authorities.activedirectory
Class ActiveDirectoryAuthority

java.lang.Object
  extended by org.apache.manifoldcf.core.connector.BaseConnector
      extended by org.apache.manifoldcf.authorities.authorities.BaseAuthorityConnector
          extended by org.apache.manifoldcf.authorities.authorities.activedirectory.ActiveDirectoryAuthority
All Implemented Interfaces:
org.apache.manifoldcf.authorities.interfaces.IAuthorityConnector, org.apache.manifoldcf.core.interfaces.IConnector

public class ActiveDirectoryAuthority
extends org.apache.manifoldcf.authorities.authorities.BaseAuthorityConnector

This is the Active Directory implementation of the IAuthorityConnector interface. Access tokens for this connector are simple SIDs, except for the "global deny" token, which is designed to allow the authority to shut off access to all authorized documents when the user is unrecognized or the domain controller does not respond.


Field Summary
static java.lang.String _rcsid
           
 
Fields inherited from class org.apache.manifoldcf.core.connector.BaseConnector
currentContext, params
 
Constructor Summary
ActiveDirectoryAuthority()
          Constructor.
 
Method Summary
 java.lang.String check()
          Check connection for sanity.
protected  void closeConnection()
          Close the connection handle, but leave the info around if we open it again.
 void connect(org.apache.manifoldcf.core.interfaces.ConfigParams configParams)
          Connect.
 void disconnect()
          Close the connection.
 org.apache.manifoldcf.authorities.interfaces.AuthorizationResponse getAuthorizationResponse(java.lang.String userName)
          Obtain the access tokens for a given user name.
 org.apache.manifoldcf.authorities.interfaces.AuthorizationResponse getDefaultAuthorizationResponse(java.lang.String userName)
          Obtain the default access tokens for a given user name.
 java.lang.String getJSPFolder()
          Return the path for the UI interface JSP elements.
protected  void getSession()
           
 void outputConfigurationBody(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IHTTPOutput out, org.apache.manifoldcf.core.interfaces.ConfigParams parameters, java.lang.String tabName)
          Output the configuration body section.
 void outputConfigurationHeader(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IHTTPOutput out, org.apache.manifoldcf.core.interfaces.ConfigParams parameters, java.util.ArrayList tabsArray)
          Output the configuration header section.
protected static java.lang.String parseUser(java.lang.String userName)
          Parse a user name into an ldap search base.
 void poll()
          Poll.
 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)
          Process a configuration post.
protected static java.lang.String sid2String(byte[] SID)
          Convert a binary SID to a string
 void viewConfiguration(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IHTTPOutput out, 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, setThreadContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.manifoldcf.core.interfaces.IConnector
clearThreadContext, deinstall, getConfiguration, install, setThreadContext
 

Field Detail

_rcsid

public static final java.lang.String _rcsid
See Also:
Constant Field Values
Constructor Detail

ActiveDirectoryAuthority

public ActiveDirectoryAuthority()
Constructor.

Method Detail

getJSPFolder

public java.lang.String getJSPFolder()
Return the path for the UI interface JSP elements. These JSP's must be provided to allow the connector to be configured, and to permit it to present document filtering specification information in the UI. This method should return the name of the folder, under the /connectors/ area, where the appropriate JSP's can be found. The name should NOT have a slash in it.

Returns:
the folder part

connect

public void connect(org.apache.manifoldcf.core.interfaces.ConfigParams configParams)
Connect. The configuration parameters are included.

Specified by:
connect in interface org.apache.manifoldcf.core.interfaces.IConnector
Overrides:
connect in class org.apache.manifoldcf.core.connector.BaseConnector
Parameters:
configParams - are the configuration parameters for this connection.

check

public java.lang.String check()
                       throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
Check connection for sanity.

Specified by:
check in interface org.apache.manifoldcf.core.interfaces.IConnector
Overrides:
check in class org.apache.manifoldcf.core.connector.BaseConnector
Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException

poll

public void poll()
          throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
Poll. The connection should be closed if it has been idle for too long.

Specified by:
poll in interface org.apache.manifoldcf.core.interfaces.IConnector
Overrides:
poll in class org.apache.manifoldcf.core.connector.BaseConnector
Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException

closeConnection

protected void closeConnection()
Close the connection handle, but leave the info around if we open it again.


disconnect

public void disconnect()
                throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
Close the connection. Call this before discarding the repository connector.

Specified by:
disconnect in interface org.apache.manifoldcf.core.interfaces.IConnector
Overrides:
disconnect in class org.apache.manifoldcf.core.connector.BaseConnector
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.ManifoldCFException
Obtain the access tokens for a given user name.

Specified by:
getAuthorizationResponse in interface org.apache.manifoldcf.authorities.interfaces.IAuthorityConnector
Overrides:
getAuthorizationResponse in class org.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:
getDefaultAuthorizationResponse in interface org.apache.manifoldcf.authorities.interfaces.IAuthorityConnector
Overrides:
getDefaultAuthorizationResponse in class org.apache.manifoldcf.authorities.authorities.BaseAuthorityConnector
Parameters:
userName - is the user name or identifier.
Returns:
the default response tokens, presuming that the connect method fails.

outputConfigurationHeader

public void outputConfigurationHeader(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext,
                                      org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
                                      org.apache.manifoldcf.core.interfaces.ConfigParams parameters,
                                      java.util.ArrayList tabsArray)
                               throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
                                      java.io.IOException
Output 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:
outputConfigurationHeader in interface org.apache.manifoldcf.core.interfaces.IConnector
Overrides:
outputConfigurationHeader in class org.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.ManifoldCFException
java.io.IOException

outputConfigurationBody

public void outputConfigurationBody(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext,
                                    org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
                                    org.apache.manifoldcf.core.interfaces.ConfigParams parameters,
                                    java.lang.String tabName)
                             throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
                                    java.io.IOException
Output 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 , , and
tags. The name of the form is "editconnection".

Specified by:
outputConfigurationBody in interface org.apache.manifoldcf.core.interfaces.IConnector
Overrides:
outputConfigurationBody in class org.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.ManifoldCFException
java.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.ManifoldCFException
Process a configuration post. This method is called at the start of the authority 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:
processConfigurationPost in interface org.apache.manifoldcf.core.interfaces.IConnector
Overrides:
processConfigurationPost in class org.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,
                              org.apache.manifoldcf.core.interfaces.ConfigParams parameters)
                       throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
                              java.io.IOException
View configuration. This method is called in the body section of the authority 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 and tags.

Specified by:
viewConfiguration in interface org.apache.manifoldcf.core.interfaces.IConnector
Overrides:
viewConfiguration in class org.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.ManifoldCFException
java.io.IOException

getSession

protected void getSession()
                   throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException

parseUser

protected static java.lang.String parseUser(java.lang.String userName)
                                     throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
Parse a user name into an ldap search base.

Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException

sid2String

protected static java.lang.String sid2String(byte[] SID)
Convert a binary SID to a string