Return-Path: X-Original-To: apmail-manifoldcf-commits-archive@www.apache.org Delivered-To: apmail-manifoldcf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3D5FB10DEE for ; Mon, 10 Feb 2014 13:22:57 +0000 (UTC) Received: (qmail 31813 invoked by uid 500); 10 Feb 2014 13:22:56 -0000 Delivered-To: apmail-manifoldcf-commits-archive@manifoldcf.apache.org Received: (qmail 31759 invoked by uid 500); 10 Feb 2014 13:22:56 -0000 Mailing-List: contact commits-help@manifoldcf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@manifoldcf.apache.org Delivered-To: mailing list commits@manifoldcf.apache.org Received: (qmail 31750 invoked by uid 99); 10 Feb 2014 13:22:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Feb 2014 13:22:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Feb 2014 13:22:50 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C9878238883D; Mon, 10 Feb 2014 13:22:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1566616 - in /manifoldcf/branches/release-1.5-branch: ./ CHANGES.txt connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java Date: Mon, 10 Feb 2014 13:22:28 -0000 To: commits@manifoldcf.apache.org From: kwright@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140210132228.C9878238883D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kwright Date: Mon Feb 10 13:22:28 2014 New Revision: 1566616 URL: http://svn.apache.org/r1566616 Log: Pull up fix for CONNECTORS-875 from trunk. Modified: manifoldcf/branches/release-1.5-branch/ (props changed) manifoldcf/branches/release-1.5-branch/CHANGES.txt manifoldcf/branches/release-1.5-branch/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java Propchange: manifoldcf/branches/release-1.5-branch/ ------------------------------------------------------------------------------ Merged /manifoldcf/trunk:r1563147,1563151 Modified: manifoldcf/branches/release-1.5-branch/CHANGES.txt URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-1.5-branch/CHANGES.txt?rev=1566616&r1=1566615&r2=1566616&view=diff ============================================================================== --- manifoldcf/branches/release-1.5-branch/CHANGES.txt (original) +++ manifoldcf/branches/release-1.5-branch/CHANGES.txt Mon Feb 10 13:22:28 2014 @@ -4,6 +4,10 @@ $Id$ ======================= Release 1.5.1 ===================== +CONNECTORS-875: Handle ArrayIndexOutOfBounds and NumberFormatException +from LAPI as Livelink runtime errors. +(David Morana, Karl Wright) + CONNECTORS-884: Log successful index/delete in Solr connector. (Erlend Garåsen, Karl Wright) Modified: manifoldcf/branches/release-1.5-branch/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-1.5-branch/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java?rev=1566616&r1=1566615&r2=1566616&view=diff ============================================================================== --- manifoldcf/branches/release-1.5-branch/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java (original) +++ manifoldcf/branches/release-1.5-branch/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java Mon Feb 10 13:22:28 2014 @@ -279,10 +279,24 @@ public class LivelinkConnector extends o } } - public Throwable getException() + public void finishUp() + throws ManifoldCFException, InterruptedException { - return exception; + join(); + Throwable thr = exception; + if (thr != null) + { + if (thr instanceof RuntimeException) + throw (RuntimeException)thr; + else if (thr instanceof ManifoldCFException) + throw (ManifoldCFException)thr; + else if (thr instanceof Error) + throw (Error)thr; + else + throw new RuntimeException("Unrecognized exception type: "+thr.getClass().getName()+": "+thr.getMessage(),thr); + } } + } /** Get the bin name string for a document identifier. The bin name describes the queue to which the @@ -533,17 +547,7 @@ public class LivelinkConnector extends o try { t.start(); - t.join(); - Throwable thr = t.getException(); - if (thr != null) - { - if (thr instanceof RuntimeException) - throw (RuntimeException)thr; - else if (thr instanceof ManifoldCFException) - throw (ManifoldCFException)thr; - else - throw (Error)thr; - } + t.finishUp(); hasConnected = true; break; } @@ -1001,22 +1005,16 @@ public class LivelinkConnector extends o try { t.start(); - t.join(); - Throwable thr = t.getException(); - if (thr != null) - { - if (thr instanceof RuntimeException) - throw (RuntimeException)thr; - else if (thr instanceof ManifoldCFException) - { - sanityRetryCount = assessRetry(sanityRetryCount,(ManifoldCFException)thr); - continue; - } - else - throw (Error)thr; - } - - LLValue childrenDocs = t.getResponse(); + LLValue childrenDocs; + try + { + childrenDocs = t.finishUp(); + } + catch (ManifoldCFException e) + { + sanityRetryCount = assessRetry(sanityRetryCount,e); + continue; + } int size = 0; @@ -1357,9 +1355,9 @@ public class LivelinkConnector extends o protected class ListObjectsThread extends Thread { - protected int vol; - protected int objID; - protected String filterString; + protected final int vol; + protected final int objID; + protected final String filterString; protected Throwable exception = null; protected LLValue rval = null; @@ -1390,13 +1388,22 @@ public class LivelinkConnector extends o } } - public Throwable getException() - { - return exception; - } - - public LLValue getResponse() + public LLValue finishUp() + throws ManifoldCFException, InterruptedException { + join(); + Throwable thr = exception; + if (thr != null) + { + if (thr instanceof RuntimeException) + throw (RuntimeException)thr; + else if (thr instanceof ManifoldCFException) + throw (ManifoldCFException)thr; + else if (thr instanceof Error) + throw (Error)thr; + else + throw new RuntimeException("Unrecognized exception type: "+thr.getClass().getName()+": "+thr.getMessage(),thr); + } return rval; } } @@ -1466,22 +1473,16 @@ public class LivelinkConnector extends o try { t.start(); - t.join(); - Throwable thr = t.getException(); - if (thr != null) - { - if (thr instanceof RuntimeException) - throw (RuntimeException)thr; - else if (thr instanceof ManifoldCFException) - { - sanityRetryCount = assessRetry(sanityRetryCount,(ManifoldCFException)thr); - continue; - } - else - throw (Error)thr; - } - - LLValue childrenDocs = t.getResponse(); + LLValue childrenDocs; + try + { + childrenDocs = t.finishUp(); + } + catch (ManifoldCFException e) + { + sanityRetryCount = assessRetry(sanityRetryCount,e); + continue; + } int size = 0; @@ -4876,22 +4877,16 @@ public class LivelinkConnector extends o try { t.start(); - t.join(); - Throwable thr = t.getException(); - if (thr != null) - { - if (thr instanceof RuntimeException) - throw (RuntimeException)thr; - else if (thr instanceof ManifoldCFException) - { - sanityRetryCount = assessRetry(sanityRetryCount,(ManifoldCFException)thr); - continue; - } - else - throw (Error)thr; - } - - LLValue children = t.getResponse(); + LLValue children; + try + { + children = t.finishUp(); + } + catch (ManifoldCFException e) + { + sanityRetryCount = assessRetry(sanityRetryCount,e); + continue; + } String[] rval = new String[children.size()]; int j = 0; @@ -4941,23 +4936,17 @@ public class LivelinkConnector extends o try { t.start(); - t.join(); - Throwable thr = t.getException(); - if (thr != null) - { - if (thr instanceof RuntimeException) - throw (RuntimeException)thr; - else if (thr instanceof ManifoldCFException) - { - sanityRetryCount = assessRetry(sanityRetryCount,(ManifoldCFException)thr); - continue; - } - else - throw (Error)thr; + LLValue children; + try + { + children = t.finishUp(); + } + catch (ManifoldCFException e) + { + sanityRetryCount = assessRetry(sanityRetryCount,e); + continue; } - LLValue children = t.getResponse(); - String[] rval = new String[children.size()]; int j = 0; while (j < children.size()) @@ -4982,7 +4971,7 @@ public class LivelinkConnector extends o protected class GetCategoryAttributesThread extends Thread { - protected int catObjectID; + protected final int catObjectID; protected Throwable exception = null; protected LLValue rval = null; @@ -5025,13 +5014,22 @@ public class LivelinkConnector extends o } } - public Throwable getException() - { - return exception; - } - - public LLValue getResponse() + public LLValue finishUp() + throws ManifoldCFException, InterruptedException { + join(); + Throwable thr = exception; + if (thr != null) + { + if (thr instanceof RuntimeException) + throw (RuntimeException)thr; + else if (thr instanceof ManifoldCFException) + throw (ManifoldCFException)thr; + else if (thr instanceof Error) + throw (Error)thr; + else + throw new RuntimeException("Unrecognized exception type: "+thr.getClass().getName()+": "+thr.getMessage(),thr); + } return rval; } } @@ -5051,22 +5049,17 @@ public class LivelinkConnector extends o try { t.start(); - t.join(); - Throwable thr = t.getException(); - if (thr != null) - { - if (thr instanceof RuntimeException) - throw (RuntimeException)thr; - else if (thr instanceof ManifoldCFException) - { - sanityRetryCount = assessRetry(sanityRetryCount,(ManifoldCFException)thr); - continue; - } - else - throw (Error)thr; + LLValue children; + try + { + children = t.finishUp(); + } + catch (ManifoldCFException e) + { + sanityRetryCount = assessRetry(sanityRetryCount,e); + continue; } - LLValue children = t.getResponse(); if (children == null) return null; @@ -5097,8 +5090,8 @@ public class LivelinkConnector extends o protected class GetCategoryVersionThread extends Thread { - protected int objID; - protected int catID; + protected final int objID; + protected final int catID; protected Throwable exception = null; protected LLValue rval = null; @@ -5147,15 +5140,25 @@ public class LivelinkConnector extends o } } - public Throwable getException() - { - return exception; - } - - public LLValue getResponse() + public LLValue finishUp() + throws ManifoldCFException, InterruptedException { + join(); + Throwable thr = exception; + if (thr != null) + { + if (thr instanceof RuntimeException) + throw (RuntimeException)thr; + else if (thr instanceof ManifoldCFException) + throw (ManifoldCFException)thr; + else if (thr instanceof Error) + throw (Error)thr; + else + throw new RuntimeException("Unrecognized exception type: "+thr.getClass().getName()+": "+thr.getMessage(),thr); + } return rval; } + } /** Get a category version for document. @@ -5170,21 +5173,15 @@ public class LivelinkConnector extends o try { t.start(); - t.join(); - Throwable thr = t.getException(); - if (thr != null) - { - if (thr instanceof RuntimeException) - throw (RuntimeException)thr; - else if (thr instanceof ManifoldCFException) - { - sanityRetryCount = assessRetry(sanityRetryCount,(ManifoldCFException)thr); - continue; - } - else - throw (Error)thr; + try + { + return t.finishUp(); + } + catch (ManifoldCFException e) + { + sanityRetryCount = assessRetry(sanityRetryCount,e); + continue; } - return t.getResponse(); } catch (InterruptedException e) { @@ -5211,8 +5208,8 @@ public class LivelinkConnector extends o protected class GetAttributeValueThread extends Thread { - protected LLValue categoryVersion; - protected String attributeName; + protected final LLValue categoryVersion; + protected final String attributeName; protected Throwable exception = null; protected LLValue rval = null; @@ -5251,15 +5248,25 @@ public class LivelinkConnector extends o } } - public Throwable getException() - { - return exception; - } - - public LLValue getResponse() + public LLValue finishUp() + throws ManifoldCFException, InterruptedException { + join(); + Throwable thr = exception; + if (thr != null) + { + if (thr instanceof RuntimeException) + throw (RuntimeException)thr; + else if (thr instanceof ManifoldCFException) + throw (ManifoldCFException)thr; + else if (thr instanceof Error) + throw (Error)thr; + else + throw new RuntimeException("Unrecognized exception type: "+thr.getClass().getName()+": "+thr.getMessage(),thr); + } return rval; } + } /** Get an attribute value from a category version. @@ -5274,21 +5281,17 @@ public class LivelinkConnector extends o try { t.start(); - t.join(); - Throwable thr = t.getException(); - if (thr != null) - { - if (thr instanceof RuntimeException) - throw (RuntimeException)thr; - else if (thr instanceof ManifoldCFException) - { - sanityRetryCount = assessRetry(sanityRetryCount,(ManifoldCFException)thr); - continue; - } - else - throw (Error)thr; + LLValue children; + try + { + children = t.finishUp(); + } + catch (ManifoldCFException e) + { + sanityRetryCount = assessRetry(sanityRetryCount,e); + continue; } - LLValue children = t.getResponse(); + if (children == null) return null; String[] rval = new String[children.size()]; @@ -5318,8 +5321,8 @@ public class LivelinkConnector extends o protected class GetObjectRightsThread extends Thread { - protected int vol; - protected int objID; + protected final int vol; + protected final int objID; protected Throwable exception = null; protected LLValue rval = null; @@ -5354,15 +5357,25 @@ public class LivelinkConnector extends o } } - public Throwable getException() - { - return exception; - } - - public LLValue getResponse() + public LLValue finishUp() + throws ManifoldCFException, InterruptedException { + join(); + Throwable thr = exception; + if (thr != null) + { + if (thr instanceof RuntimeException) + throw (RuntimeException)thr; + else if (thr instanceof ManifoldCFException) + throw (ManifoldCFException)thr; + else if (thr instanceof Error) + throw (Error)thr; + else + throw new RuntimeException("Unrecognized exception type: "+thr.getClass().getName()+": "+thr.getMessage(),thr); + } return rval; } + } /** Get an object's rights. This will be an array of right id's, including the special @@ -5381,22 +5394,17 @@ public class LivelinkConnector extends o try { t.start(); - t.join(); - Throwable thr = t.getException(); - if (thr != null) - { - if (thr instanceof RuntimeException) - throw (RuntimeException)thr; - else if (thr instanceof ManifoldCFException) - { - sanityRetryCount = assessRetry(sanityRetryCount,(ManifoldCFException)thr); - continue; - } - else - throw (Error)thr; + LLValue childrenObjects; + try + { + childrenObjects = t.finishUp(); + } + catch (ManifoldCFException e) + { + sanityRetryCount = assessRetry(sanityRetryCount,e); + continue; } - LLValue childrenObjects = t.getResponse(); if (childrenObjects == null) return null; @@ -5545,23 +5553,15 @@ public class LivelinkConnector extends o try { t.start(); - t.join(); - Throwable thr = t.getException(); - if (thr != null) - { - if (thr instanceof RuntimeException) - throw (RuntimeException)thr; - else if (thr instanceof ServiceInterruption) - throw (ServiceInterruption)thr; - else if (thr instanceof ManifoldCFException) - { - sanityRetryCount = assessRetry(sanityRetryCount,(ManifoldCFException)thr); - continue; - } - else - throw (Error)thr; - } - userValue = t.getResponse(); + try + { + userValue = t.finishUp(); + } + catch (ManifoldCFException e) + { + sanityRetryCount = assessRetry(sanityRetryCount,e); + continue; + } break; } catch (InterruptedException e) @@ -5695,23 +5695,15 @@ public class LivelinkConnector extends o try { t.start(); - t.join(); - Throwable thr = t.getException(); - if (thr != null) - { - if (thr instanceof RuntimeException) - throw (RuntimeException)thr; - else if (thr instanceof ServiceInterruption) - throw (ServiceInterruption)thr; - else if (thr instanceof ManifoldCFException) - { - sanityRetryCount = assessRetry(sanityRetryCount,(ManifoldCFException)thr); - continue; - } - else - throw (Error)thr; + try + { + versionValue = t.finishUp(); + } + catch (ManifoldCFException e) + { + sanityRetryCount = assessRetry(sanityRetryCount,e); + continue; } - versionValue = t.getResponse(); break; } catch (InterruptedException e) @@ -5841,22 +5833,17 @@ public class LivelinkConnector extends o try { t.start(); - t.join(); - Throwable thr = t.getException(); - if (thr != null) - { - if (thr instanceof RuntimeException) - throw (RuntimeException)thr; - else if (thr instanceof ManifoldCFException) - { - sanityRetryCount = assessRetry(sanityRetryCount,(ManifoldCFException)thr); - continue; - } - else - throw (Error)thr; + LLValue children; + try + { + children = t.finishUp(); + } + catch (ManifoldCFException e) + { + sanityRetryCount = assessRetry(sanityRetryCount,e); + continue; } - LLValue children = t.getResponse(); if (children == null) return null; @@ -5953,22 +5940,17 @@ public class LivelinkConnector extends o try { t.start(); - t.join(); - Throwable thr = t.getException(); - if (thr != null) - { - if (thr instanceof RuntimeException) - throw (RuntimeException)thr; - else if (thr instanceof ManifoldCFException) - { - sanityRetryCount = assessRetry(sanityRetryCount,(ManifoldCFException)thr); - continue; - } - else - throw (Error)thr; + LLValue children; + try + { + children = t.finishUp(); + } + catch (ManifoldCFException e) + { + sanityRetryCount = assessRetry(sanityRetryCount,e); + continue; } - LLValue children = t.getResponse(); if (children == null) return -1; @@ -6120,23 +6102,15 @@ public class LivelinkConnector extends o try { t.start(); - t.join(); - Throwable thr = t.getException(); - if (thr != null) - { - if (thr instanceof RuntimeException) - throw (RuntimeException)thr; - else if (thr instanceof ServiceInterruption) - throw (ServiceInterruption)thr; - else if (thr instanceof ManifoldCFException) - { - sanityRetryCount = assessRetry(sanityRetryCount,(ManifoldCFException)thr); - continue; - } - else - throw (Error)thr; + try + { + objectValue = t.finishUp(); + } + catch (ManifoldCFException e) + { + sanityRetryCount = assessRetry(sanityRetryCount,e); + continue; } - objectValue = t.getResponse(); break; } catch (InterruptedException e) @@ -6214,15 +6188,25 @@ public class LivelinkConnector extends o } } - public Throwable getException() - { - return exception; - } - - public LLValue getResponse() + public LLValue finishUp() + throws ManifoldCFException, InterruptedException { + join(); + Throwable thr = exception; + if (thr != null) + { + if (thr instanceof RuntimeException) + throw (RuntimeException)thr; + else if (thr instanceof ManifoldCFException) + throw (ManifoldCFException)thr; + else if (thr instanceof Error) + throw (Error)thr; + else + throw new RuntimeException("Unrecognized exception type: "+thr.getClass().getName()+": "+thr.getMessage(),thr); + } return rval; } + } /** Thread we can abandon that gets user information for a userID. @@ -6277,13 +6261,22 @@ public class LivelinkConnector extends o } } - public Throwable getException() - { - return exception; - } - - public LLValue getResponse() + public LLValue finishUp() + throws ManifoldCFException, InterruptedException { + join(); + Throwable thr = exception; + if (thr != null) + { + if (thr instanceof RuntimeException) + throw (RuntimeException)thr; + else if (thr instanceof ManifoldCFException) + throw (ManifoldCFException)thr; + else if (thr instanceof Error) + throw (Error)thr; + else + throw new RuntimeException("Unrecognized exception type: "+thr.getClass().getName()+": "+thr.getMessage(),thr); + } return rval; } } @@ -6344,13 +6337,22 @@ public class LivelinkConnector extends o } } - public Throwable getException() - { - return exception; - } - - public LLValue getResponse() + public LLValue finishUp() + throws ManifoldCFException, InterruptedException { + join(); + Throwable thr = exception; + if (thr != null) + { + if (thr instanceof RuntimeException) + throw (RuntimeException)thr; + else if (thr instanceof ManifoldCFException) + throw (ManifoldCFException)thr; + else if (thr instanceof Error) + throw (Error)thr; + else + throw new RuntimeException("Unrecognized exception type: "+thr.getClass().getName()+": "+thr.getMessage(),thr); + } return rval; } } @@ -6409,13 +6411,22 @@ public class LivelinkConnector extends o } } - public Throwable getException() - { - return exception; - } - - public LLValue getResponse() + public LLValue finishUp() + throws ManifoldCFException, InterruptedException { + join(); + Throwable thr = exception; + if (thr != null) + { + if (thr instanceof RuntimeException) + throw (RuntimeException)thr; + else if (thr instanceof ManifoldCFException) + throw (ManifoldCFException)thr; + else if (thr instanceof Error) + throw (Error)thr; + else + throw new RuntimeException("Unrecognized exception type: "+thr.getClass().getName()+": "+thr.getMessage(),thr); + } return rval; } } @@ -6523,13 +6534,22 @@ public class LivelinkConnector extends o } } - public Throwable getException() - { - return exception; - } - - public LLValue getResponse() + public LLValue finishUp() + throws ManifoldCFException, InterruptedException { + join(); + Throwable thr = exception; + if (thr != null) + { + if (thr instanceof RuntimeException) + throw (RuntimeException)thr; + else if (thr instanceof ManifoldCFException) + throw (ManifoldCFException)thr; + else if (thr instanceof Error) + throw (Error)thr; + else + throw new RuntimeException("Unrecognized exception type: "+thr.getClass().getName()+": "+thr.getMessage(),thr); + } return rval; } } @@ -6549,22 +6569,17 @@ public class LivelinkConnector extends o try { t.start(); - t.join(); - Throwable thr = t.getException(); - if (thr != null) - { - if (thr instanceof RuntimeException) - throw (RuntimeException)thr; - else if (thr instanceof ManifoldCFException) - { - sanityRetryCount = assessRetry(sanityRetryCount,(ManifoldCFException)thr); - continue; - } - else - throw (Error)thr; + LLValue catIDList; + try + { + catIDList = t.finishUp(); + } + catch (ManifoldCFException e) + { + sanityRetryCount = assessRetry(sanityRetryCount,e); + continue; } - LLValue catIDList = t.getResponse(); if (catIDList == null) return null; @@ -7398,7 +7413,9 @@ public class LivelinkConnector extends o e instanceof com.opentext.api.LLNoFieldSpecifiedException || e instanceof com.opentext.api.LLNoValueSpecifiedException || e instanceof com.opentext.api.LLSecurityProviderException || - e instanceof com.opentext.api.LLUnknownFieldException + e instanceof com.opentext.api.LLUnknownFieldException || + e instanceof NumberFormatException || + e instanceof ArrayIndexOutOfBoundsException ) { String details = llServer.getErrors();