From b6a392076f6cae23014baebd1945f9496cd48e1a Mon Sep 17 00:00:00 2001
From: ?? ? <ulysseskao@ximple.com.tw>
Date: Wed, 03 Sep 2008 10:11:17 +0800
Subject: [PATCH] update for EOFM-161

---
 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleElementLogger.java |   41 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleElementLogger.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleElementLogger.java
index 49e2b19..8615537 100644
--- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleElementLogger.java
+++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleElementLogger.java
@@ -54,6 +54,7 @@
     private boolean useElementCount = true;
     private ArrayList<byte[]> dgnFileHeader = null;
     private String elmOutPath;
+    private String prefix = null;
 
     public OracleElementLogger(Connection connection)
     {
@@ -67,6 +68,20 @@
         this.elmOutPath = elmOutPath;
     }
 
+    public OracleElementLogger(Connection connection, int maxCount)
+    {
+        this.connection = connection;
+        elmOutPath = DEFAULT_ELMOUTPATH;
+        this.maxElmCount = maxCount;
+    }
+
+    public OracleElementLogger(Connection connection, String elmOutPath, int maxCount)
+    {
+        this.connection = connection;
+        this.elmOutPath = elmOutPath;
+        this.maxElmCount = maxCount;
+    }
+    
     public String getDataOutPath()
     {
         if (dataOut == null)
@@ -284,11 +299,21 @@
             fch = null;
         }
 
-        File logFile = new File(getDataOutPath(), this.currentSchema + ".dgn");
+        String outLogName = currentSchema + ".dgn";
+        if (prefix != null)
+        {
+            outLogName = prefix + outLogName;
+        }
+        File logFile = new File(getDataOutPath(), outLogName);
         while (logFile.exists())
         {
-            logFile = new File(getDataOutPath(), this.currentSchema + "-"
-                    + (++logCount) + ".dgn");
+            outLogName = this.currentSchema + "-" + (++logCount) + ".dgn";
+            if (prefix != null)
+            {
+                outLogName = prefix + outLogName;
+            }
+
+            logFile = new File(getDataOutPath(), outLogName);
         }
 
         logger.warn("Create Dgn Logging File:" + logFile.toString());
@@ -453,4 +478,14 @@
     {
         this.maxElmCount = maxElmCount;
     }
+
+    public String getLogPrefix()
+    {
+        return prefix;
+    }
+
+    public void setLogPrefix(String prefix)
+    {
+        this.prefix = prefix;
+    }
 }

--
Gitblit v0.0.0-SNAPSHOT