manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1629193 - /manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/AlfrescoConnector.java
Date Fri, 03 Oct 2014 12:37:30 GMT
Author: kwright
Date: Fri Oct  3 12:37:30 2014
New Revision: 1629193

URL: http://svn.apache.org/r1629193
Log:
Get tests working, by checking for null connector logger

Modified:
    manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/AlfrescoConnector.java

Modified: manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/AlfrescoConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/AlfrescoConnector.java?rev=1629193&r1=1629192&r2=1629193&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/AlfrescoConnector.java
(original)
+++ manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/AlfrescoConnector.java
Fri Oct  3 12:37:30 2014
@@ -130,7 +130,8 @@ public class AlfrescoConnector extends B
         }
       }
       
-      Logging.connectors.debug(MessageFormat.format("Starting from transaction id: {0} and
acl changeset id: {1}", new Object[]{lastTransactionId, lastAclChangesetId}));
+      if (Logging.connectors != null && Logging.connectors.isDebugEnabled())
+        Logging.connectors.debug(MessageFormat.format("Starting from transaction id: {0}
and acl changeset id: {1}", new Object[]{lastTransactionId, lastAclChangesetId}));
       
       long transactionIdsProcessed;
       long aclChangesetsProcessed;
@@ -147,7 +148,8 @@ public class AlfrescoConnector extends B
           activities.addSeedDocument(uuid);
           count++;
         }
-        Logging.connectors.debug(MessageFormat.format("Fetched and added {0} seed documents",
new Object[]{new Integer(count)}));
+        if (Logging.connectors != null && Logging.connectors.isDebugEnabled())
+          Logging.connectors.debug(MessageFormat.format("Fetched and added {0} seed documents",
new Object[]{new Integer(count)}));
 
         transactionIdsProcessed = response.getLastTransactionId() - lastTransactionId;
         aclChangesetsProcessed = response.getLastAclChangesetId() - lastAclChangesetId;
@@ -155,10 +157,12 @@ public class AlfrescoConnector extends B
         lastTransactionId = response.getLastTransactionId();
         lastAclChangesetId = response.getLastAclChangesetId();
 
-        Logging.connectors.debug(MessageFormat.format("transaction_id={0}, acl_changeset_id={1}",
new Object[]{lastTransactionId, lastAclChangesetId}));
+        if (Logging.connectors != null && Logging.connectors.isDebugEnabled())
+          Logging.connectors.debug(MessageFormat.format("transaction_id={0}, acl_changeset_id={1}",
new Object[]{lastTransactionId, lastAclChangesetId}));
       } while (transactionIdsProcessed > 0 || aclChangesetsProcessed > 0);
 
-      Logging.connectors.debug(MessageFormat.format("Recording {0} as last transaction id
and {1} as last changeset id", new Object[]{lastTransactionId, lastAclChangesetId}));
+      if (Logging.connectors != null && Logging.connectors.isDebugEnabled())
+        Logging.connectors.debug(MessageFormat.format("Recording {0} as last transaction
id and {1} as last changeset id", new Object[]{lastTransactionId, lastAclChangesetId}));
       return lastTransactionId + "|" + lastAclChangesetId;
     } catch (AlfrescoDownException e) {
       throw new ManifoldCFException(e);
@@ -176,7 +180,8 @@ public class AlfrescoConnector extends B
       // Calling again Alfresco API because Document's actions are lost from seeding method
       AlfrescoResponse response = alfrescoClient.fetchNode(doc);
       if(response.getDocumentList().isEmpty()){ // Not found seeded document. Could reflect
an error in Alfresco
-        Logging.connectors.warn(MessageFormat.format("Invalid Seeded Document from Alfresco
with ID {0}", new Object[]{doc}));
+        if (Logging.connectors != null)
+          Logging.connectors.warn(MessageFormat.format("Invalid Seeded Document from Alfresco
with ID {0}", new Object[]{doc}));
         activities.noDocument(doc, nextVersion);
         continue;
       }
@@ -197,7 +202,8 @@ public class AlfrescoConnector extends B
           try{
             processMetaData(rd,uuid);
           }catch(AlfrescoDownException e){
-            Logging.connectors.warn(MessageFormat.format("Invalid Document from Alfresco
with ID {0}", new Object[]{uuid}), e);
+            if (Logging.connectors != null)
+              Logging.connectors.warn(MessageFormat.format("Invalid Document from Alfresco
with ID {0}", new Object[]{uuid}), e);
             activities.noDocument(doc, nextVersion);
             continue; // No Metadata, No Content....skip document
           }
@@ -207,7 +213,8 @@ public class AlfrescoConnector extends B
             byte[] empty = new byte[0];
             rd.setBinary(new ByteArrayInputStream(empty), 0L);
           }
-          Logging.connectors.debug(MessageFormat.format("Ingesting with id: {0}, URI {1}
and rd {2}", new Object[]{uuid, nodeRef, rd.getFileName()}));
+          if (Logging.connectors != null && Logging.connectors.isDebugEnabled())
+            Logging.connectors.debug(MessageFormat.format("Ingesting with id: {0}, URI {1}
and rd {2}", new Object[]{uuid, nodeRef, rd.getFileName()}));
           activities.ingestDocumentWithException(uuid, "", uuid, rd);
         } catch (IOException e) {
           throw new ManifoldCFException(



Mime
View raw message