Class ConfluenceRepositoryConnector

  • All Implemented Interfaces:
    org.apache.manifoldcf.core.interfaces.IConnector, org.apache.manifoldcf.crawler.interfaces.IRepositoryConnector

    public class ConfluenceRepositoryConnector
    extends org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector

    Confluence Repository Connector class

    ManifoldCF Repository connector to deal with Confluence documents

    Author:
    Julien Massiera & Antonio David Perez Morales
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String ACTIVITY_READ  
      protected ConfluenceClient confluenceClient  
      protected java.lang.String connectionTimeout  
      protected java.lang.String host  
      protected static long interruptionRetryTime  
      protected long lastSessionFetch  
      protected java.lang.String password  
      protected java.lang.String path  
      protected java.lang.String port  
      protected java.lang.String protocol  
      protected long retryInterval
      Retry interval
      protected java.lang.String retryIntervalString  
      protected int retryNumber
      Retry number
      protected java.lang.String retryNumberString  
      protected java.lang.String socketTimeout  
      protected static long timeToRelease  
      protected java.lang.String username  
      • Fields inherited from class org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector

        _rcsid
      • Fields inherited from class org.apache.manifoldcf.core.connector.BaseConnector

        currentContext, params
      • Fields inherited from interface org.apache.manifoldcf.crawler.interfaces.IRepositoryConnector

        GLOBAL_DENY_TOKEN, JOBMODE_CONTINUOUS, JOBMODE_ONCEONLY, MODEL_ADD, MODEL_ADD_CHANGE, MODEL_ADD_CHANGE_DELETE, MODEL_ALL, MODEL_CHAINED_ADD, MODEL_CHAINED_ADD_CHANGE, MODEL_CHAINED_ADD_CHANGE_DELETE, MODEL_PARTIAL
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String addSeedDocuments​(org.apache.manifoldcf.crawler.interfaces.ISeedingActivity activities, org.apache.manifoldcf.core.interfaces.Specification spec, java.lang.String lastSeedVersion, long seedTime, int jobMode)  
      java.lang.String check()
      Checks if connection is available
      void connect​(org.apache.manifoldcf.core.interfaces.ConfigParams configParams)
      Makes connection to server
      void disconnect()
      Close the connection.
      java.lang.String[] getActivitiesList()  
      java.lang.String[] getBinNames​(java.lang.String documentIdentifier)  
      int getMaxDocumentRequest()  
      java.lang.String[] getRelationshipTypes()
      Return the list of relationship types that this connector recognizes.
      protected static void handleConfluenceDownException​(java.lang.Exception e, java.lang.String context)  
      protected void handlePageException​(java.lang.Exception e, java.lang.String context)
      Handle page exception : retry 3rd times with a 5 minutes interval without aborting job in case of failure
      protected void initConfluenceClient()
      Initialize Confluence client using the configured parameters
      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)  
      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)  
      void outputSpecificationBody​(org.apache.manifoldcf.core.interfaces.IHTTPOutput out, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.Specification ds, int connectionSequenceNumber, int actualSequenceNumber, java.lang.String tabName)  
      void outputSpecificationHeader​(org.apache.manifoldcf.core.interfaces.IHTTPOutput out, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.Specification ds, int connectionSequenceNumber, java.util.List<java.lang.String> tabsArray)  
      void 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)  
      void processDocuments​(java.lang.String[] documentIdentifiers, org.apache.manifoldcf.crawler.interfaces.IExistingVersions statuses, org.apache.manifoldcf.core.interfaces.Specification spec, org.apache.manifoldcf.crawler.interfaces.IProcessActivity activities, int jobMode, boolean usesDefaultAuthority)  
      java.lang.String processSpecificationPost​(org.apache.manifoldcf.core.interfaces.IPostParameters variableContext, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.Specification ds, int connectionSequenceNumber)  
      void setConfluenceClient​(ConfluenceClient confluenceClient)
      Set Confluence Client (Mainly for Testing)
      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)  
      void viewSpecification​(org.apache.manifoldcf.core.interfaces.IHTTPOutput out, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.Specification ds, int connectionSequenceNumber)  
      • Methods inherited from class org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector

        getConnectorModel, getFormCheckJavascriptMethodName, getFormPresaveCheckJavascriptMethodName, requestInfo
      • 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, processConfigurationPost, setThreadContext
    • Field Detail

      • lastSessionFetch

        protected long lastSessionFetch
      • interruptionRetryTime

        protected static final long interruptionRetryTime
        See Also:
        Constant Field Values
      • protocol

        protected java.lang.String protocol
      • host

        protected java.lang.String host
      • port

        protected java.lang.String port
      • path

        protected java.lang.String path
      • username

        protected java.lang.String username
      • password

        protected java.lang.String password
      • socketTimeout

        protected java.lang.String socketTimeout
      • connectionTimeout

        protected java.lang.String connectionTimeout
      • retryIntervalString

        protected java.lang.String retryIntervalString
      • retryNumberString

        protected java.lang.String retryNumberString
      • retryInterval

        protected long retryInterval
        Retry interval
      • retryNumber

        protected int retryNumber
        Retry number
    • Constructor Detail

      • ConfluenceRepositoryConnector

        public ConfluenceRepositoryConnector()

        Default constructor

    • Method Detail

      • setConfluenceClient

        public void setConfluenceClient​(ConfluenceClient confluenceClient)
        Set Confluence Client (Mainly for Testing)
        Parameters:
        confluenceClient -
      • getActivitiesList

        public java.lang.String[] getActivitiesList()
        Specified by:
        getActivitiesList in interface org.apache.manifoldcf.crawler.interfaces.IRepositoryConnector
        Overrides:
        getActivitiesList in class org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector
      • getBinNames

        public java.lang.String[] getBinNames​(java.lang.String documentIdentifier)
        Specified by:
        getBinNames in interface org.apache.manifoldcf.crawler.interfaces.IRepositoryConnector
        Overrides:
        getBinNames in class org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector
      • disconnect

        public void disconnect()
                        throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
        Close the connection. Call this before discarding the connection.
        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)
        Makes connection to server
        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
        Checks if connection is available
        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
      • initConfluenceClient

        protected void initConfluenceClient()
                                     throws org.apache.manifoldcf.core.interfaces.ManifoldCFException

        Initialize Confluence client using the configured parameters

        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:
        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.
      • 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
      • getMaxDocumentRequest

        public int getMaxDocumentRequest()
        Specified by:
        getMaxDocumentRequest in interface org.apache.manifoldcf.crawler.interfaces.IRepositoryConnector
        Overrides:
        getMaxDocumentRequest in class org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector
      • getRelationshipTypes

        public java.lang.String[] getRelationshipTypes()
        Return the list of relationship types that this connector recognizes.
        Specified by:
        getRelationshipTypes in interface org.apache.manifoldcf.crawler.interfaces.IRepositoryConnector
        Overrides:
        getRelationshipTypes in class org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector
        Returns:
        the list.
      • 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
        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
        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,
                                                         org.apache.manifoldcf.core.interfaces.ConfigParams parameters)
                                                  throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
        Overrides:
        processConfigurationPost in class org.apache.manifoldcf.core.connector.BaseConnector
        Throws:
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
      • viewSpecification

        public void viewSpecification​(org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
                                      java.util.Locale locale,
                                      org.apache.manifoldcf.core.interfaces.Specification ds,
                                      int connectionSequenceNumber)
                               throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
                                      java.io.IOException
        Specified by:
        viewSpecification in interface org.apache.manifoldcf.crawler.interfaces.IRepositoryConnector
        Overrides:
        viewSpecification in class org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector
        Throws:
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
        java.io.IOException
      • processSpecificationPost

        public java.lang.String processSpecificationPost​(org.apache.manifoldcf.core.interfaces.IPostParameters variableContext,
                                                         java.util.Locale locale,
                                                         org.apache.manifoldcf.core.interfaces.Specification ds,
                                                         int connectionSequenceNumber)
                                                  throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
        Specified by:
        processSpecificationPost in interface org.apache.manifoldcf.crawler.interfaces.IRepositoryConnector
        Overrides:
        processSpecificationPost in class org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector
        Throws:
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
      • outputSpecificationBody

        public void outputSpecificationBody​(org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
                                            java.util.Locale locale,
                                            org.apache.manifoldcf.core.interfaces.Specification ds,
                                            int connectionSequenceNumber,
                                            int actualSequenceNumber,
                                            java.lang.String tabName)
                                     throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
                                            java.io.IOException
        Specified by:
        outputSpecificationBody in interface org.apache.manifoldcf.crawler.interfaces.IRepositoryConnector
        Overrides:
        outputSpecificationBody in class org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector
        Throws:
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
        java.io.IOException
      • outputSpecificationHeader

        public void outputSpecificationHeader​(org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
                                              java.util.Locale locale,
                                              org.apache.manifoldcf.core.interfaces.Specification ds,
                                              int connectionSequenceNumber,
                                              java.util.List<java.lang.String> tabsArray)
                                       throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
                                              java.io.IOException
        Specified by:
        outputSpecificationHeader in interface org.apache.manifoldcf.crawler.interfaces.IRepositoryConnector
        Overrides:
        outputSpecificationHeader in class org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector
        Throws:
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
        java.io.IOException
      • addSeedDocuments

        public java.lang.String addSeedDocuments​(org.apache.manifoldcf.crawler.interfaces.ISeedingActivity activities,
                                                 org.apache.manifoldcf.core.interfaces.Specification spec,
                                                 java.lang.String lastSeedVersion,
                                                 long seedTime,
                                                 int jobMode)
                                          throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
                                                 org.apache.manifoldcf.agents.interfaces.ServiceInterruption
        Specified by:
        addSeedDocuments in interface org.apache.manifoldcf.crawler.interfaces.IRepositoryConnector
        Overrides:
        addSeedDocuments in class org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector
        Throws:
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
        org.apache.manifoldcf.agents.interfaces.ServiceInterruption
      • handleConfluenceDownException

        protected static void handleConfluenceDownException​(java.lang.Exception e,
                                                            java.lang.String context)
                                                     throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
                                                            org.apache.manifoldcf.agents.interfaces.ServiceInterruption
        Throws:
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
        org.apache.manifoldcf.agents.interfaces.ServiceInterruption
      • handlePageException

        protected void handlePageException​(java.lang.Exception e,
                                           java.lang.String context)
                                    throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
                                           org.apache.manifoldcf.agents.interfaces.ServiceInterruption
        Handle page exception : retry 3rd times with a 5 minutes interval without aborting job in case of failure
        Parameters:
        e -
        context - The error context (ex: 'page processing')
        Throws:
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
        org.apache.manifoldcf.agents.interfaces.ServiceInterruption
      • processDocuments

        public void processDocuments​(java.lang.String[] documentIdentifiers,
                                     org.apache.manifoldcf.crawler.interfaces.IExistingVersions statuses,
                                     org.apache.manifoldcf.core.interfaces.Specification spec,
                                     org.apache.manifoldcf.crawler.interfaces.IProcessActivity activities,
                                     int jobMode,
                                     boolean usesDefaultAuthority)
                              throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
                                     org.apache.manifoldcf.agents.interfaces.ServiceInterruption
        Specified by:
        processDocuments in interface org.apache.manifoldcf.crawler.interfaces.IRepositoryConnector
        Overrides:
        processDocuments in class org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector
        Throws:
        org.apache.manifoldcf.core.interfaces.ManifoldCFException
        org.apache.manifoldcf.agents.interfaces.ServiceInterruption