Revision: 17427
          http://sourceforge.net/p/gate/code/17427
Author:   valyt
Date:     2014-02-26 13:38:20 +0000 (Wed, 26 Feb 2014)
Log Message:
-----------
- updated to latest mimir-client;
- added connectionInterval parameter to mimir output handler.

Modified Paths:
--------------
    gcp/trunk/.classpath
    gcp/trunk/src/gate/cloud/io/mimir/MimirOutputHandler.java

Added Paths:
-----------
    gcp/trunk/lib/mimir-client-5.0.jar

Modified: gcp/trunk/.classpath
===================================================================
--- gcp/trunk/.classpath        2014-02-26 12:15:19 UTC (rev 17426)
+++ gcp/trunk/.classpath        2014-02-26 13:38:20 UTC (rev 17427)
@@ -4,7 +4,7 @@
        <classpathentry kind="src" output="cli/classes" path="cli/src"/>
        <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
        <classpathentry kind="lib" path="conf"/>
-       <classpathentry kind="lib" path="lib/mimir-client-4.0.jar"/>
+       <classpathentry kind="lib" path="lib/mimir-client-5.0.jar"/>
        <classpathentry kind="con" 
path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=gcp&amp;ivyXmlPath=build%2Fivy.xml&amp;confs=*&amp;ivySettingsPath=%24%7Bworkspace_loc%3Agcp%2Fbuild%2Fivysettings.xml%7D&amp;loadSettingsOnDemand=false&amp;propertyFiles="/>
        <classpathentry kind="output" path="classes"/>
 </classpath>

Added: gcp/trunk/lib/mimir-client-5.0.jar
===================================================================
(Binary files differ)

Index: gcp/trunk/lib/mimir-client-5.0.jar
===================================================================
--- gcp/trunk/lib/mimir-client-5.0.jar  2014-02-26 12:15:19 UTC (rev 17426)
+++ gcp/trunk/lib/mimir-client-5.0.jar  2014-02-26 13:38:20 UTC (rev 17427)

Property changes on: gcp/trunk/lib/mimir-client-5.0.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: gcp/trunk/src/gate/cloud/io/mimir/MimirOutputHandler.java
===================================================================
--- gcp/trunk/src/gate/cloud/io/mimir/MimirOutputHandler.java   2014-02-26 
12:15:19 UTC (rev 17426)
+++ gcp/trunk/src/gate/cloud/io/mimir/MimirOutputHandler.java   2014-02-26 
13:38:20 UTC (rev 17427)
@@ -60,7 +60,14 @@
    */
   public static final String PARAM_INDEX_URL = "indexUrl";
   
+  
   /**
+   * Parameter name for the connection interval parameter of the M&iacute;mir
+   * connector. If non-negative, then connections to the remote server are only
+   * made at intervals of the number of milliseconds specified by the value.
+   */
+  public static final String PARAM_CONNECTION_INTERVAL = "connectionInterval";
+  /**
    * Namespace parameter name. The namespace value is a string that is 
    * prepended to the document name to obtain a document URI.
    */
@@ -92,6 +99,7 @@
    */
   public static final String PARAM_PASSWORD = "password";
 
+  @Override
   protected void configImpl(Map<String, String> configData) throws IOException,
           GateException {
     String indexUrlStr = configData.get(PARAM_INDEX_URL);
@@ -120,7 +128,16 @@
           configData.get(PARAM_PASSWORD));
     }
 
-    mimirConnector = new MimirConnector(webUtils);
+    mimirConnector = new MimirConnector(indexUrl, webUtils);
+    String connIntervalStr = configData.get(PARAM_CONNECTION_INTERVAL);
+    if(connIntervalStr != null && connIntervalStr.length() > 0) {
+      try {
+        
mimirConnector.setConnectionInterval(Integer.parseInt(connIntervalStr));
+      } catch(NumberFormatException e) {
+        throw new GateException("Invalid " + PARAM_CONNECTION_INTERVAL + 
+            " value (not an integer number).", e);
+      }
+    }
   }
 
   protected void outputDocumentImpl(Document document, DocumentID documentId)
@@ -136,6 +153,23 @@
     else {
       uri = namespace + document.getName();
     }
-    mimirConnector.sendToMimir(document, uri, indexUrl);
+    try {
+      mimirConnector.sendToMimir(document, uri);
+    } catch(InterruptedException e) {
+      throw new GateException("Interrupted while witing to submit document", 
e);
+    }
   }
+
+  @Override
+  public void close() throws IOException, GateException {
+    super.close();
+    try {
+      mimirConnector.close();
+    } catch(InterruptedException e) {
+      throw new GateException(
+          "Interrupted while waiting for the Mímir conenctor to close.", e);
+    }
+  }
+  
+  
 }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to