Author: molgun
Date: Tue Oct 21 07:27:37 2014
New Revision: 1633295

URL: http://svn.apache.org/r1633295
Log:
CONNECTORS-1077: Recording rejection activity

Modified:
    
manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java

Modified: 
manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java?rev=1633295&r1=1633294&r2=1633295&view=diff
==============================================================================
--- 
manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
 (original)
+++ 
manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
 Tue Oct 21 07:27:37 2014
@@ -529,8 +529,11 @@ public class HttpPoster
       Logging.ingest.debug("indexPost(): '" + documentURI + "'");
 
     // If the document is too long, reject it.
-    if (maxDocumentLength != null && document.getBinaryLength() > 
maxDocumentLength.longValue())
+    if (maxDocumentLength != null && document.getBinaryLength() > 
maxDocumentLength.longValue()){
+      
activities.recordActivity(null,SolrConnector.INGEST_ACTIVITY,null,documentURI,activities.EXCLUDED_LENGTH,"Solr
 connector rejected document due to its big size. 
('"+document.getBinaryLength()+"')");
       return false;
+    }
+
     
     // Convert the incoming acls that we know about to qualified forms, and 
reject the document if
     // we don't know how to deal with its acls
@@ -547,8 +550,11 @@ public class HttpPoster
       // Reject documents that have security we don't know how to deal with in 
the Solr plugin!!  Only safe thing to do.
       if (!aclType.equals(RepositoryDocument.SECURITY_TYPE_DOCUMENT) &&
         !aclType.equals(RepositoryDocument.SECURITY_TYPE_SHARE) &&
-        !aclType.startsWith(RepositoryDocument.SECURITY_TYPE_PARENT))
-        return false;
+        !aclType.startsWith(RepositoryDocument.SECURITY_TYPE_PARENT)){
+          
activities.recordActivity(null,SolrConnector.INGEST_ACTIVITY,null,documentURI,activities.UNKNOWN_SECURITY,"Solr
 connector rejected document that has security info which is unknown.");
+          return false;
+      }
+
     }
 
     try


Reply via email to