Class AuthorityConnector

  • All Implemented Interfaces:
    org.apache.manifoldcf.authorities.interfaces.IAuthorityConnector, org.apache.manifoldcf.core.interfaces.IConnector

    public class AuthorityConnector
    extends org.apache.manifoldcf.authorities.authorities.BaseAuthorityConnector
    Autheticator.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String check()
      Test the connection.
      protected void checkConnection()
      Check connection, with appropriate retries
      void clearThreadContext()
      Clear thread context.
      void connect​(org.apache.manifoldcf.core.interfaces.ConfigParams configParams)  
      void disconnect()
      Disconnect from Documentum.
      org.apache.manifoldcf.authorities.interfaces.AuthorizationResponse getAuthorizationResponse​(java.lang.String strUserNamePassedIn)
      Obtain the access tokens for a given user name.
      protected org.apache.manifoldcf.authorities.interfaces.AuthorizationResponse getAuthorizationResponseUncached​(java.lang.String strUserNamePassedIn)
      Uncached get response method.
      org.apache.manifoldcf.authorities.interfaces.AuthorizationResponse getDefaultAuthorizationResponse​(java.lang.String userName)
      Obtain the default access tokens for a given user name.
      protected IDocumentumObject getObjectByQualification​(java.lang.String qualification)
      Perform getObjectByQualification, with appropriate reset
      protected java.lang.String getServerVersion()
      Get server version, with appropriate retries
      protected void getSession()
      Get a DFC session.
      protected void getSessionParameters()
      Get session parameters.
      protected static java.lang.String insensitiveMatch​(boolean insensitive, java.lang.String field, java.lang.String value)  
      boolean isConnected()
      This method is called to assess whether to count this connector instance should actually be counted as being connected.
      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)
      Output the configuration body section.
      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)
      Output the configuration header section.
      protected IDocumentumResult performDQLQuery​(java.lang.String query)
      Perform a DQL query, with appropriate reset on a remote exception
      void poll()
      This method is periodically called for all connectors that are connected but not in active use.
      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)
      Process a configuration post.
      protected static java.lang.String quoteDQLString​(java.lang.String value)  
      protected void releaseCheck()
      Release the session, if it's time.
      void setThreadContext​(org.apache.manifoldcf.core.interfaces.IThreadContext tc)
      Set thread context.
      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)
      View configuration.
      • Methods inherited from class org.apache.manifoldcf.authorities.authorities.BaseAuthorityConnector

        getAccessTokens, getDefaultAccessTokens
      • Methods inherited from class org.apache.manifoldcf.core.connector.BaseConnector

        deinstall, getConfiguration, install, outputConfigurationBody, outputConfigurationHeader, outputConfigurationHeader, pack, packFixedList, packList, packList, processConfigurationPost, unpack, unpackFixedList, unpackList, viewConfiguration
      • 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

        deinstall, getConfiguration, install
    • Field Detail

      • CONFIG_PARAM_DOCBASE

        public static final java.lang.String CONFIG_PARAM_DOCBASE
        See Also:
        Constant Field Values
      • 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_DOMAIN

        public static final java.lang.String CONFIG_PARAM_DOMAIN
        See Also:
        Constant Field Values
      • CONFIG_PARAM_CASEINSENSITIVE

        public static final java.lang.String CONFIG_PARAM_CASEINSENSITIVE
        See Also:
        Constant Field Values
      • CONFIG_PARAM_USESYSTEMACLS

        public static final java.lang.String CONFIG_PARAM_USESYSTEMACLS
        See Also:
        Constant Field Values
      • CONFIG_PARAM_CACHELIFETIME

        public static final java.lang.String CONFIG_PARAM_CACHELIFETIME
        See Also:
        Constant Field Values
      • CONFIG_PARAM_CACHELRUSIZE

        public static final java.lang.String CONFIG_PARAM_CACHELRUSIZE
        See Also:
        Constant Field Values
      • docbaseName

        protected java.lang.String docbaseName
      • userName

        protected java.lang.String userName
      • password

        protected java.lang.String password
      • domain

        protected java.lang.String domain
      • caseInsensitive

        protected boolean caseInsensitive
      • useSystemAcls

        protected boolean useSystemAcls
      • cacheManager

        protected org.apache.manifoldcf.core.interfaces.ICacheManager cacheManager
        Cache manager.
      • hasSessionParameters

        protected boolean hasSessionParameters
      • lastSessionFetch

        protected long lastSessionFetch
      • emptyStringSet

        protected static org.apache.manifoldcf.core.interfaces.StringSet emptyStringSet
    • Constructor Detail

      • AuthorityConnector

        public AuthorityConnector()
    • Method Detail

      • setThreadContext

        public void setThreadContext​(org.apache.manifoldcf.core.interfaces.IThreadContext tc)
                              throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
        Set thread context.
        Specified by:
        setThreadContext in interface org.apache.manifoldcf.core.interfaces.IConnector
        Overrides:
        setThreadContext in class org.apache.manifoldcf.core.connector.BaseConnector
        Throws:
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
      • clearThreadContext

        public void clearThreadContext()
        Clear thread context.
        Specified by:
        clearThreadContext in interface org.apache.manifoldcf.core.interfaces.IConnector
        Overrides:
        clearThreadContext in class org.apache.manifoldcf.core.connector.BaseConnector
      • getSessionParameters

        protected void getSessionParameters()
                                     throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
        Get session parameters.
        Throws:
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
      • getSession

        protected void getSession()
                           throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
        Get a DFC session. This will be done every time it is needed.
        Throws:
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
      • performDQLQuery

        protected IDocumentumResult performDQLQuery​(java.lang.String query)
                                             throws DocumentumException,
                                                    org.apache.manifoldcf.core.interfaces.ManifoldCFException
        Perform a DQL query, with appropriate reset on a remote exception
        Throws:
        DocumentumException
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
      • checkConnection

        protected void checkConnection()
                                throws DocumentumException,
                                       org.apache.manifoldcf.core.interfaces.ManifoldCFException
        Check connection, with appropriate retries
        Throws:
        DocumentumException
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
      • getObjectByQualification

        protected IDocumentumObject getObjectByQualification​(java.lang.String qualification)
                                                      throws DocumentumException,
                                                             org.apache.manifoldcf.core.interfaces.ManifoldCFException
        Perform getObjectByQualification, with appropriate reset
        Throws:
        DocumentumException
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
      • getServerVersion

        protected java.lang.String getServerVersion()
                                             throws DocumentumException,
                                                    org.apache.manifoldcf.core.interfaces.ManifoldCFException
        Get server version, with appropriate retries
        Throws:
        DocumentumException
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
      • releaseCheck

        protected void releaseCheck()
                             throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
        Release the session, if it's time.
        Throws:
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
      • getAuthorizationResponse

        public org.apache.manifoldcf.authorities.interfaces.AuthorizationResponse getAuthorizationResponse​(java.lang.String strUserNamePassedIn)
                                                                                                    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:
        strUserNamePassedIn - 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
      • getAuthorizationResponseUncached

        protected org.apache.manifoldcf.authorities.interfaces.AuthorizationResponse getAuthorizationResponseUncached​(java.lang.String strUserNamePassedIn)
                                                                                                               throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
        Uncached get response method.
        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.
      • insensitiveMatch

        protected static java.lang.String insensitiveMatch​(boolean insensitive,
                                                           java.lang.String field,
                                                           java.lang.String value)
      • quoteDQLString

        protected static java.lang.String quoteDQLString​(java.lang.String value)
      • check

        public java.lang.String check()
                               throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
        Test the connection. Returns a string describing the connection integrity.
        Specified by:
        check in interface org.apache.manifoldcf.core.interfaces.IConnector
        Overrides:
        check in class org.apache.manifoldcf.core.connector.BaseConnector
        Returns:
        the connection's status as a displayable string.
        Throws:
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
      • connect

        public void connect​(org.apache.manifoldcf.core.interfaces.ConfigParams configParams)
        Specified by:
        connect in interface org.apache.manifoldcf.core.interfaces.IConnector
        Overrides:
        connect in class org.apache.manifoldcf.core.connector.BaseConnector
      • 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:
        isConnected in interface org.apache.manifoldcf.core.interfaces.IConnector
        Overrides:
        isConnected in class org.apache.manifoldcf.core.connector.BaseConnector
        Returns:
        true if the connector instance is actually connected.
      • disconnect

        public void disconnect()
                        throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
        Disconnect from Documentum.
        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
      • poll

        public void poll()
                  throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
        This method is periodically called for all connectors that are connected but not in active use.
        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
      • 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.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,
                                            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
        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 <html>, <body>, and <form> 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,
                                                         java.util.Locale locale,
                                                         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,
                                      java.util.Locale locale,
                                      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 <html> and <body>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