Class AmazonS3Authority

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

    public class AmazonS3Authority
    extends org.apache.manifoldcf.authorities.authorities.BaseAuthorityConnector
    Authority connector for Amazons3
    Author:
    Kuhajeyan
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected com.amazonaws.services.s3.AmazonS3 amazonS3  
      protected java.lang.String amazons3AwsAccessKey  
      protected java.lang.String amazons3AwsSecretKey  
      protected java.lang.String amazons3ProxyDomain  
      protected java.lang.String amazons3ProxyHost  
      protected java.lang.String amazons3ProxyPassword  
      protected java.lang.String amazons3ProxyPort  
      protected java.lang.String amazons3ProxyUserName  
      protected boolean connected  
      protected long lastSessionFetch  
      protected static long timeToRelease  
      • 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
      • Fields inherited from class org.apache.manifoldcf.core.connector.BaseConnector

        currentContext, params
      • Fields inherited from interface org.apache.manifoldcf.authorities.interfaces.IAuthorityConnector

        GLOBAL_DENY_TOKEN
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String check()
      Test the connection.
      void connect​(org.apache.manifoldcf.core.interfaces.ConfigParams configParams)  
      void disconnect()  
      org.apache.manifoldcf.authorities.interfaces.AuthorizationResponse getAuthorizationResponse​(java.lang.String userName)  
      protected com.amazonaws.services.s3.AmazonS3 getClient()
      Get the Amazons3 client, relevant access keys should have been posted already
      org.apache.manifoldcf.authorities.interfaces.AuthorizationResponse getDefaultAuthorizationResponse​(java.lang.String userName)
      Obtain the default access tokens for a given user name.
      boolean isConnected()  
      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)  
      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.
      void poll()  
      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.
      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

        clearThreadContext, deinstall, getConfiguration, install, outputConfigurationBody, outputConfigurationHeader, outputConfigurationHeader, pack, packFixedList, packList, packList, processConfigurationPost, setThreadContext, 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

        clearThreadContext, deinstall, getConfiguration, install, setThreadContext
    • Field Detail

      • lastSessionFetch

        protected long lastSessionFetch
      • amazonS3

        protected com.amazonaws.services.s3.AmazonS3 amazonS3
      • connected

        protected boolean connected
      • amazons3ProxyHost

        protected java.lang.String amazons3ProxyHost
      • amazons3ProxyPort

        protected java.lang.String amazons3ProxyPort
      • amazons3ProxyDomain

        protected java.lang.String amazons3ProxyDomain
      • amazons3ProxyUserName

        protected java.lang.String amazons3ProxyUserName
      • amazons3ProxyPassword

        protected java.lang.String amazons3ProxyPassword
      • amazons3AwsAccessKey

        protected java.lang.String amazons3AwsAccessKey
      • amazons3AwsSecretKey

        protected java.lang.String amazons3AwsSecretKey
    • Constructor Detail

      • AmazonS3Authority

        public AmazonS3Authority()
    • Method Detail

      • disconnect

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

        protected com.amazonaws.services.s3.AmazonS3 getClient()
        Get the Amazons3 client, relevant access keys should have been posted already
        Returns:
      • isConnected

        public boolean isConnected()
        Specified by:
        isConnected in interface org.apache.manifoldcf.core.interfaces.IConnector
        Overrides:
        isConnected in class org.apache.manifoldcf.core.connector.BaseConnector
      • poll

        public void poll()
                  throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
        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
      • 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 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
        Throws:
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
        java.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.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
        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
        Specified by:
        outputConfigurationBody in interface org.apache.manifoldcf.core.interfaces.IConnector
        Overrides:
        outputConfigurationBody in class org.apache.manifoldcf.core.connector.BaseConnector
        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 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
        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
        Specified by:
        getAuthorizationResponse in interface org.apache.manifoldcf.authorities.interfaces.IAuthorityConnector
        Overrides:
        getAuthorizationResponse in class org.apache.manifoldcf.authorities.authorities.BaseAuthorityConnector
        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.