Index: src/edu/ucsb/nceas/metacat/MetacatHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/MetacatHandler.java	(revision 6047)
+++ src/edu/ucsb/nceas/metacat/MetacatHandler.java	(revision 6048)
@@ -274,7 +274,7 @@
             String username, String[] groupnames,
             String sess_id) throws PropertyNotFoundException, HandlerException {
         
-        Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+        Logger logMetacat = Logger.getLogger(MetacatHandler.class);
         
         if ( !PropertyService.getProperty("spatial.runSpatialOption").equals("true") ) {
             response.setContentType("text/html");
@@ -326,7 +326,7 @@
         } catch (java.lang.NullPointerException e) {
             // should be "default" but keep this for backwards compatibility
             // with knp site
-            logMetacat.warn("MetaCatServlet.handleSpatialQuery - No SKIN specified for metacat actions=spatial_query... defaulting to 'knp' skin !\n");
+            logMetacat.warn("MetacatHandler.handleSpatialQuery - No SKIN specified for metacat actions=spatial_query... defaulting to 'knp' skin !\n");
             qformatArray[0] = "knp";
         }
         params.put("qformat", qformatArray);
@@ -357,7 +357,7 @@
      */
     public void handleLoginAction(PrintWriter out, Hashtable<String, String[]> params,
             HttpServletRequest request, HttpServletResponse response) {
-        Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+        Logger logMetacat = Logger.getLogger(MetacatHandler.class);
         AuthSession sess = null;
         
         if(params.get("username") == null){
@@ -381,7 +381,7 @@
         }
         
         String un = (params.get("username"))[0];
-        logMetacat.info("MetaCatServlet.handleLoginAction - user " + un + " is trying to login");
+        logMetacat.info("MetacatHandler.handleLoginAction - user " + un + " is trying to login");
         String pw = (params.get("password"))[0];
         
         String qformat = "xml";
@@ -406,7 +406,7 @@
             HttpSession session = sess.getSessions();
             String id = session.getId();
             
-            logMetacat.debug("MetaCatServlet.handleLoginAction - Store session id " + id
+            logMetacat.debug("MetacatHandler.handleLoginAction - Store session id " + id
                     + " which has username" + session.getAttribute("username")
                     + " into hash in login method");
             try {
@@ -422,7 +422,7 @@
             } catch (ServiceException se) {
                 String errorMsg = "MetacatServlet.handleLoginAction - service problem registering session: "
                         + se.getMessage();
-                logMetacat.error("MetaCatServlet.handleLoginAction - " + errorMsg);
+                logMetacat.error("MetacatHandler.handleLoginAction - " + errorMsg);
                 out.println(errorMsg);
                 se.printStackTrace(System.out);
                 return;
@@ -441,7 +441,7 @@
                         "-//NCEAS//login//EN", "-//W3C//HTML//EN", qformat,
                         out, null, null);
             } catch (Exception e) {               
-                logMetacat.error("MetaCatServlet.handleLoginAction - General error"
+                logMetacat.error("MetacatHandler.handleLoginAction - General error"
                         + e.getMessage());
                 e.printStackTrace(System.out);
             }
@@ -453,7 +453,7 @@
      */
     public void handleLogoutAction(PrintWriter out, Hashtable<String, String[]> params,
             HttpServletRequest request, HttpServletResponse response) {
-        Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+        Logger logMetacat = Logger.getLogger(MetacatHandler.class);
         String qformat = "xml";
         if(params.get("qformat") != null){
             qformat = params.get("qformat")[0];
@@ -461,11 +461,11 @@
         
         // close the connection
         HttpSession sess = request.getSession(false);
-        logMetacat.info("MetaCatServlet.handleLogoutAction - After get session in logout request");
+        logMetacat.info("MetacatHandler.handleLogoutAction - After get session in logout request");
         if (sess != null) {
-            logMetacat.info("MetaCatServlet.handleLogoutAction - The session id " + sess.getId()
+            logMetacat.info("MetacatHandler.handleLogoutAction - The session id " + sess.getId()
             + " will be invalidate in logout action");
-            logMetacat.info("MetaCatServlet.handleLogoutAction - The session contains user "
+            logMetacat.info("MetacatHandler.handleLogoutAction - The session contains user "
                     + sess.getAttribute("username")
                     + " will be invalidate in logout action");
             sess.invalidate();
@@ -492,7 +492,7 @@
                         out, null, null);
             } catch (Exception e) {
                 logMetacat.error(
-                        "MetaCatServlet.handleLogoutAction - General error: "
+                        "MetacatHandler.handleLogoutAction - General error: "
                         + e.getMessage());
                 e.printStackTrace(System.out);
             }
@@ -514,7 +514,7 @@
     protected void handleSQuery(Writer out, Hashtable<String, String[]> params,
             HttpServletResponse response, String user, String[] groups,
             String sessionid) throws PropertyNotFoundException {
-        Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+        Logger logMetacat = Logger.getLogger(MetacatHandler.class);
         long squeryWarnLimit = Long.parseLong(PropertyService.getProperty("database.squeryTimeWarnLimit"));
         
         long startTime = System.currentTimeMillis();
@@ -524,10 +524,10 @@
         long runTime = outPutTime - startTime;
 
         if (runTime > squeryWarnLimit) {
-            logMetacat.warn("MetaCatServlet.handleSQuery - Long running squery.  Total time: " + runTime + 
+            logMetacat.warn("MetacatHandler.handleSQuery - Long running squery.  Total time: " + runTime + 
                     " ms, squery: " + ((String[])params.get("query"))[0]);
         }
-        logMetacat.debug("MetaCatServlet.handleSQuery - squery: " + ((String[])params.get("query"))[0] + 
+        logMetacat.debug("MetacatHandler.handleSQuery - squery: " + ((String[])params.get("query"))[0] + 
                 " ran in " + runTime + " ms");
     }
     
@@ -544,7 +544,7 @@
     protected void handleQuery(Writer out, Hashtable<String, String[]> params,
             HttpServletResponse response, String user, String[] groups,
             String sessionid) throws PropertyNotFoundException, UnsupportedEncodingException, IOException {
-        Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+        Logger logMetacat = Logger.getLogger(MetacatHandler.class);
         long queryWarnLimit = Long.parseLong(PropertyService.getProperty("database.queryTimeWarnLimit"));
         
         //create the query and run it
@@ -559,10 +559,10 @@
         long runTime = outPutTime -startTime;
 
         if (runTime > queryWarnLimit) {
-            logMetacat.warn("MetaCatServlet.handleQuery - Long running squery.  Total time: " + runTime + 
+            logMetacat.warn("MetacatHandler.handleQuery - Long running squery.  Total time: " + runTime + 
                     " ms, squery: " + ((String[])params.get("query"))[0]);
         }
-        logMetacat.debug("MetaCatServlet.handleQuery - query: " + ((String[])params.get("query"))[0] + 
+        logMetacat.debug("MetacatHandler.handleQuery - query: " + ((String[])params.get("query"))[0] + 
                 " ran in " + runTime + " ms");
     }
     
@@ -580,7 +580,7 @@
     protected void handleExportAction(Hashtable<String, String[]> params,
             HttpServletResponse response,
             String user, String[] groups, String passWord) {
-        Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+        Logger logMetacat = Logger.getLogger(MetacatHandler.class);
         // Output stream
         ServletOutputStream out = null;
         // Zip output stream
@@ -646,12 +646,12 @@
                     zOut.close();
                 }
             } catch (IOException ioe) {
-                logMetacat.error("MetaCatServlet.handleExportAction - Problem with the servlet output: "
+                logMetacat.error("MetacatHandler.handleExportAction - Problem with the servlet output: "
                         + ioe.getMessage());
                 e.printStackTrace(System.out);
             }
             
-            logMetacat.error("MetaCatServlet.handleExportAction - General error: "
+            logMetacat.error("MetacatHandler.handleExportAction - General error: "
                     + e.getMessage());
             e.printStackTrace(System.out);
             
@@ -672,7 +672,7 @@
     protected void handleReadInlineDataAction(Hashtable<String, String[]> params,
             HttpServletRequest request, HttpServletResponse response,
             String user, String passWord, String[] groups) {
-        Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+        Logger logMetacat = Logger.getLogger(MetacatHandler.class);
         String[] docs = new String[10];
         String inlineDataId = null;
         String docId = "";
@@ -754,11 +754,11 @@
                     out.close();
                 }
             } catch (IOException ioe) {
-                logMetacat.error("MetaCatServlet.handleReadInlineDataAction - Problem with the servlet output: "
+                logMetacat.error("MetacatHandler.handleReadInlineDataAction - Problem with the servlet output: "
                         + ioe.getMessage());
                 e.printStackTrace(System.out);
             }
-            logMetacat.error("MetaCatServlet.handleReadInlineDataAction - General error: "
+            logMetacat.error("MetacatHandler.handleReadInlineDataAction - General error: "
                     + e.getMessage());
             e.printStackTrace(System.out);
         }
@@ -778,7 +778,7 @@
     public void handleReadAction(Hashtable<String, String[]> params, HttpServletRequest request,
             HttpServletResponse response, String user, String passWord,
             String[] groups) {
-        Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+        Logger logMetacat = Logger.getLogger(MetacatHandler.class);
         ServletOutputStream out = null;
         ZipOutputStream zout = null;
         PrintWriter pw = null;
@@ -869,8 +869,8 @@
             // the docid which didn't be found
             String notFoundDocId = notFoundE.getUnfoundDocId();
             String notFoundRevision = notFoundE.getUnfoundRevision();
-            logMetacat.warn("MetaCatServlet.handleReadAction - Missed id: " + notFoundDocId);
-            logMetacat.warn("MetaCatServlet.handleReadAction - Missed rev: " + notFoundRevision);
+            logMetacat.warn("MetacatHandler.handleReadAction - Missed id: " + notFoundDocId);
+            logMetacat.warn("MetacatHandler.handleReadAction - Missed rev: " + notFoundRevision);
             try {
                 // read docid from remote server
                 readFromRemoteMetaCat(response, notFoundDocId,
@@ -885,7 +885,7 @@
                 }
                 
             } catch (Exception exc) {
-                logMetacat.error("MetaCatServlet.handleReadAction - General error: "
+                logMetacat.error("MetacatHandler.handleReadAction - General error: "
                         + exc.getMessage());
                 exc.printStackTrace(System.out);
                 try {
@@ -918,7 +918,7 @@
                         zout.close();
                     }
                 } catch (IOException ie) {
-                    logMetacat.error("MetaCatServlet.handleReadAction - Problem with the servlet output: "
+                    logMetacat.error("MetacatHandler.handleReadAction - Problem with the servlet output: "
                             + ie.getMessage());
                     ie.printStackTrace(System.out);
                 }
@@ -954,13 +954,14 @@
                 }
                 
             } catch (Exception e2) {
-                logMetacat.error("MetaCatServlet.handleReadAction - Problem with the servlet output: "
-                        + e2.getMessage());
+                logMetacat.error("MetacatHandler.handleReadAction - " + 
+                		         "Problem with the servlet output: "+ 
+                		         e2.getMessage());
                 e2.printStackTrace(System.out);
                 
             }
             
-            logMetacat.error("MetaCatServlet.handleReadAction - General error: "
+            logMetacat.error("MetacatHandler.handleReadAction - General error: "
                     + e.getMessage());
             e.printStackTrace(System.out);
         }
@@ -1000,7 +1001,8 @@
         params.put("permOrder", new String[] {permissionOrder});
         params.put("docid", new String[]{docid});
         
-        //System.out.println("permission in MetacatHandler.setAccess: " + params.get("permission")[0]);
+        //System.out.println("permission in MetacatHandler.setAccess: " + 
+        //                   params.get("permission")[0]);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         PrintWriter out = new PrintWriter(baos);
         handleSetAccessAction(out, params, username, null, null);
@@ -1104,7 +1106,7 @@
           } catch (McdbException e) {
               // any exceptions in reading the xml from disc, and we go back to the
               // old way of creating the xml directly.
-              logMetacat.error("MetaCatServlet.readFromMetacat() " +
+              logMetacat.error("MetacatHandler.readFromMetacat() " +
                 "- could not read from document file " + 
                 docid + ": " + e.getMessage());
               e.printStackTrace(System.out);
@@ -1189,7 +1191,7 @@
         out.println(this.SUCCESS);
         out.println("Document deleted.");
         out.println(this.SUCCESSCLOSE);
-        logMetacat.info("MetaCatServlet.handleDeleteAction - " +
+        logMetacat.info("MetacatHandler.handleDeleteAction - " +
           "Document deleted.");
         
         try {
@@ -1293,7 +1295,8 @@
             //check the permission for read
             if (!DocumentImpl.hasReadPermission(user, groups, docid)) {
                 
-                InsufficientKarmaException e = new InsufficientKarmaException("User " + user
+                InsufficientKarmaException e = 
+                	new InsufficientKarmaException("User " + user
                         + " does not have permission"
                         + " to read the document with the docid " + docid);
                 throw e;
@@ -1317,7 +1320,7 @@
                         ContentTypeProvider provider = new ContentTypeProvider(
                                 docid);
                         contentType = provider.getContentType();
-                        logMetacat.info("MetaCatServlet.readFromMetacat - Final contenttype is: "
+                        logMetacat.info("MetacatHandler.readFromMetacat - Final contenttype is: "
                                 + contentType);
                     }
                     response.setContentType(contentType);
@@ -1360,8 +1363,11 @@
                     } catch (McdbException e) {
                         // any exceptions in reading the xml from disc, and we go back to the
                         // old way of creating the xml directly.
-                        logMetacat.error("MetaCatServlet.readFromMetacat - could not read from document file " + docid 
-                                + ": " + e.getMessage());
+                        logMetacat.error("MetacatHandler.readFromMetacat - "  + 
+                        		         "could not read from document file " + 
+                        		         docid + 
+                        		         ": " + 
+                        		         e.getMessage());
                         e.printStackTrace(System.out);
                         doc.toXmlFromDb(out, user, groups, withInlineData);
                     }
@@ -1383,7 +1389,8 @@
                     
                     // detect actual encoding
                     String docString = doc.toString(user, groups, withInlineData);
-                    XmlStreamReader xsr = new XmlStreamReader(new ByteArrayInputStream(doc.getBytes()));
+                    XmlStreamReader xsr = 
+                    	new XmlStreamReader(new ByteArrayInputStream(doc.getBytes()));
         			String encoding = xsr.getEncoding();
                     Writer w = null;
         			if (encoding != null) {
@@ -1694,12 +1701,16 @@
                   out.println(msg);
                 }
                 
-                logMetacat.error("MetaCatServlet.handleInsertOrUpdateAction - User '" + user + "' not allowed to insert and update");
+                logMetacat.error("MetacatHandler.handleInsertOrUpdateAction - " + 
+                		         "User '" + 
+                		         user + 
+                		         "' not allowed to insert and update");
                 return msg;
             }
         } catch (MetacatUtilException ue) {
-            logMetacat.error("MetaCatServlet.handleInsertOrUpdateAction - Could not determine if user could insert or update: "
-                    + ue.getMessage());
+            logMetacat.error("MetacatHandler.handleInsertOrUpdateAction - " + 
+            		         "Could not determine if user could insert or update: " + 
+            		         ue.getMessage());
             ue.printStackTrace(System.out);
             // TODO: This is a bug, as it allows one to bypass the access check -- need to throw an exception
         }
@@ -1706,7 +1717,8 @@
         
         try {
           // Get the document indicated
-          logMetacat.debug("MetacatHandler.handleInsertOrUpdateAction - params: " + params.toString());
+          logMetacat.debug("MetacatHandler.handleInsertOrUpdateAction - params: " + 
+        		           params.toString());
           
           String[] doctext = params.get("doctext");
           String pub = null;
@@ -1739,7 +1751,9 @@
               return msg;
           }
           
-          logMetacat.debug("MetacatHandler.handleInsertOrUpdateAction - the xml document in metacat servlet (before parsing):\n" + doctext[0]);
+          logMetacat.debug("MetacatHandler.handleInsertOrUpdateAction - " + 
+        		           "the xml document in metacat servlet (before parsing):\n" + 
+        		           doctext[0]);
           StringReader xmlReader = new StringReader(doctext[0]);
           boolean validate = false;
           DocumentImplWrapper documentWrapper = null;
@@ -1808,11 +1822,12 @@
               
               // write the document to the database and disk
               String accNumber = docid[0];
-              logMetacat.debug("MetaCatServlet.handleInsertOrUpdateAction - " + 
+              logMetacat.debug("MetacatHandler.handleInsertOrUpdateAction - " + 
                 doAction + " " + accNumber + "...");
               
               if (accNumber == null || accNumber.equals("")) {
-                  logMetacat.warn("MetacatHandler.handleInsertOrUpdateAction - writing with null acnumber");
+                  logMetacat.warn("MetacatHandler.handleInsertOrUpdateAction - " +
+                		          "writing with null acnumber");
                   newdocid = documentWrapper.write(dbConn, doctext[0], pub, dtd,
                           doAction, null, user, groups);
                   EventLog.getInstance().log(ipAddress, user, "", action[0]);
@@ -1906,7 +1921,10 @@
               output += this.ERROR;
               output += npe.getMessage();
               output += this.ERRORCLOSE;
-              logMetacat.warn("MetaCatServlet.handleInsertOrUpdateAction - Null pointer error when writing eml document to the database: " + npe.getMessage());
+              logMetacat.warn("MetacatHandler.handleInsertOrUpdateAction - " +
+            		          "Null pointer error when writing eml " +
+            		          "document to the database: " + 
+            		          npe.getMessage());
               npe.printStackTrace();
           }
         } catch (Exception e) {
@@ -1915,7 +1933,10 @@
             output += this.ERROR;
             output += e.getMessage();
             output += this.ERRORCLOSE;
-            logMetacat.warn("MetaCatServlet.handleInsertOrUpdateAction - General error when writing eml document to the database: " + e.getMessage());
+            logMetacat.warn("MetacatHandler.handleInsertOrUpdateAction - " +
+            		        "General error when writing eml " +
+            		        "document to the database: " + 
+            		        e.getMessage());
             e.printStackTrace();
         }
         
@@ -1935,8 +1956,9 @@
                         out, null, null);
             } catch (Exception e) {
                 
-                logMetacat.error("MetaCatServlet.handleInsertOrUpdateAction - General error: "
-                        + e.getMessage());
+                logMetacat.error("MetacatHandler.handleInsertOrUpdateAction - " +
+                		         "General error: " + 
+                		         e.getMessage());
                 e.printStackTrace(System.out);
             }
         }
@@ -1949,7 +1971,7 @@
      */
     private static boolean needDTDValidation(StringReader xmlreader)
     throws IOException {
-        Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+        Logger logMetacat = Logger.getLogger(MetacatHandler.class);
         StringBuffer cbuff = new StringBuffer();
         java.util.Stack<String> st = new java.util.Stack<String>();
         boolean validate = false;
@@ -2002,7 +2024,8 @@
             }
         }
         
-        logMetacat.info("MetaCatServlet.needDTDValidation - Validation for dtd is " + validate);
+        logMetacat.info("MetacatHandler.needDTDValidation - Validation for dtd is " + 
+        		        validate);
         return validate;
     }
     
@@ -2016,7 +2039,7 @@
       HttpServletRequest request, HttpServletResponse response,
       String user, String[] groups) {
       
-      Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+      Logger logMetacat = Logger.getLogger(MetacatHandler.class);
       String[] docid = params.get("docid");
       
       if(docid == null){
@@ -2025,7 +2048,7 @@
         out.println(this.ERROR);
         out.println("Docid not specified.");
         out.println(this.ERRORCLOSE);
-        logMetacat.error("MetaCatServlet.handleDeleteAction - " +
+        logMetacat.error("MetacatHandler.handleDeleteAction - " +
           "Docid not specified for the document to be deleted.");
       
       } else {
@@ -2056,7 +2079,7 @@
             //out.println("Error deleting document!!!");
             out.println(dnfe.getMessage());
             out.println(this.ERRORCLOSE);
-            logMetacat.error("MetaCatServlet.handleDeleteAction - " +
+            logMetacat.error("MetacatHandler.handleDeleteAction - " +
               "Document could not be deleted: "
                     + dnfe.getMessage());
             dnfe.printStackTrace(System.out);
@@ -2116,7 +2139,7 @@
         try {
             // get a connection from the pool
             dbConn = DBConnectionPool
-                    .getDBConnection("MetaCatServlet.handleValidateAction");
+                    .getDBConnection("MetacatHandler.handleValidateAction");
             serialNumber = dbConn.getCheckOutSerialNumber();
             DBValidate valobj = new DBValidate(dbConn);
 //            boolean valid = valobj.validateString(valtext);
@@ -2186,7 +2209,7 @@
             Hashtable<String,String[]> params, HttpServletResponse response, String username,
             String[] groupnames) {
         
-        Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+        Logger logMetacat = Logger.getLogger(MetacatHandler.class);
 
         String docid = params.get("docid")[0];
         if (docid.startsWith("urn:")) {
@@ -2194,8 +2217,9 @@
                 String actualDocId = LSIDUtil.getDocId(docid, false);
                 docid = actualDocId;
             } catch (ParseLSIDException ple) {
-                logMetacat.error("MetaCatServlet.handleGetAccessControlAction - MetaCatServlet.handleGetAccessControlAction - " +
-                        "could not parse lsid: " + docid + " : " + ple.getMessage());  
+                logMetacat.error("MetacatHandler.handleGetAccessControlAction - " +
+                                 "could not parse lsid: " + 
+                                 docid + " : " + ple.getMessage());  
                 ple.printStackTrace(System.out);
             }
         }
@@ -2252,8 +2276,8 @@
      * Handle "getdoctypes" action. Read all doctypes from db connection in XML
      * format
      */
-    protected void handleGetDoctypesAction(PrintWriter out, Hashtable<String, String[]> params,
-            HttpServletResponse response) {
+    protected void handleGetDoctypesAction(PrintWriter out, Hashtable<String, 
+    		String[]> params, HttpServletResponse response) {
         try {
             DBUtil dbutil = new DBUtil();
             String doctypes = dbutil.readDoctypes();
@@ -2270,8 +2294,8 @@
      * Handle the "getdtdschema" action. Read DTD or Schema file for a given
      * doctype from Metacat catalog system
      */
-    protected void handleGetDTDSchemaAction(PrintWriter out, Hashtable<String, String[]> params,
-            HttpServletResponse response) {
+    protected void handleGetDTDSchemaAction(PrintWriter out, Hashtable<String, 
+    		String[]> params, HttpServletResponse response) {
         
         String doctype = null;
         String[] doctypeArr = params.get("doctype");
@@ -2302,8 +2326,8 @@
      * @param params request parameters
      * @param response the http servlet response
      */
-    public void handleIdIsRegisteredAction(PrintWriter out, Hashtable<String, String[]> params,
-            HttpServletResponse response) {
+    public void handleIdIsRegisteredAction(PrintWriter out, Hashtable<String, 
+    		String[]> params, HttpServletResponse response) {
         String id = null;
         boolean exists = false;
         if(params.get("docid") != null) {
@@ -2331,8 +2355,8 @@
      * Handle the "getalldocids" action. return a list of all docids registered
      * in the system
      */
-    public void handleGetAllDocidsAction(PrintWriter out, Hashtable<String, String[]> params,
-            HttpServletResponse response) {
+    public void handleGetAllDocidsAction(PrintWriter out, Hashtable<String, 
+    		String[]> params, HttpServletResponse response) {
         String scope = null;
         if(params.get("scope") != null) {
             scope = params.get("scope")[0];
@@ -2362,8 +2386,8 @@
      * Handle the "getlastdocid" action. Get the latest docid with rev number
      * from db connection in XML format
      */
-    public void handleGetMaxDocidAction(PrintWriter out, Hashtable<String, String[]> params,
-            HttpServletResponse response) {
+    public void handleGetMaxDocidAction(PrintWriter out, Hashtable<String, 
+    		String[]> params, HttpServletResponse response) {
         
         String scope = params.get("scope")[0];
         if (scope == null) {
@@ -2396,9 +2420,10 @@
      * @param request the http request object for getting request details
      * @param response the http response object for writing output
      */
-    protected void handleGetLogAction(Hashtable<String, String[]> params, HttpServletRequest request,
-            HttpServletResponse response, String username, String[] groups) {
-        Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+    protected void handleGetLogAction(Hashtable<String, String[]> params, 
+    		HttpServletRequest request, HttpServletResponse response, 
+    		String username, String[] groups) {
+        Logger logMetacat = Logger.getLogger(MetacatHandler.class);
         try {
         	// figure out the output as part of the action
             PrintWriter out = null;
@@ -2435,7 +2460,8 @@
                     endDate = new Timestamp((format.parse(end)).getTime());
                 }
             } catch (ParseException e) {
-                logMetacat.error("MetaCatServlet.handleGetLogAction - Failed to created Timestamp from input.");
+                logMetacat.error("MetacatHandler.handleGetLogAction - " +
+                		         "Failed to created Timestamp from input.");
                 e.printStackTrace(System.out);
             }
             
@@ -2481,7 +2507,7 @@
 	                        null, 
 	                        null);
 	            } catch (Exception e) {               
-	                logMetacat.error("MetaCatServlet.handleGetLogAction - General error"
+	                logMetacat.error("MetacatHandler.handleGetLogAction - General error"
 	                        + e.getMessage());
 	                e.printStackTrace(System.out);
 	            }
@@ -2494,12 +2520,14 @@
             }
             
         } catch (IOException e) {
-            logMetacat.error("MetaCatServlet.handleGetLogAction - Could not open http response for writing: "
-                    + e.getMessage());
+            logMetacat.error("MetacatHandler.handleGetLogAction - " +
+            		         "Could not open http response for writing: " + 
+            		         e.getMessage());
             e.printStackTrace(System.out);
         } catch (MetacatUtilException ue) {
-            logMetacat.error("MetaCatServlet.handleGetLogAction - Could not determine if user is administrator: "
-                    + ue.getMessage());
+            logMetacat.error("MetacatHandler.handleGetLogAction - " +
+            		         "Could not determine if user is administrator: " + 
+            		         ue.getMessage());
             ue.printStackTrace(System.out);
         }
     }
@@ -2521,7 +2549,7 @@
     protected void handleBuildIndexAction(Hashtable<String, String[]> params,
             HttpServletRequest request, HttpServletResponse response,
             String username, String[] groups) {
-        Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+        Logger logMetacat = Logger.getLogger(MetacatHandler.class);
         
         // Get all of the parameters in the correct formats
         String[] docid = params.get("docid");
@@ -2569,12 +2597,14 @@
             out.println("</success>");
             out.close();
         } catch (IOException e) {
-            logMetacat.error("MetaCatServlet.handleBuildIndexAction - Could not open http response for writing: "
-                    + e.getMessage());
+            logMetacat.error("MetacatHandler.handleBuildIndexAction - " +
+            		         "Could not open http response for writing: " + 
+            		         e.getMessage());
             e.printStackTrace(System.out);
         } catch (MetacatUtilException ue) {
-            logMetacat.error("MetaCatServlet.handleBuildIndexAction - Could not determine if user is administrator: "
-                    + ue.getMessage());
+            logMetacat.error("MetacatHandler.handleBuildIndexAction - " +
+            		         "Could not determine if user is administrator: " + 
+            		         ue.getMessage());
             ue.printStackTrace(System.out);
         }
     }
@@ -2606,7 +2636,7 @@
      */
     protected void handleMultipartForm(HttpServletRequest request,
             HttpServletResponse response) {
-        Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+        Logger logMetacat = Logger.getLogger(MetacatHandler.class);
         PrintWriter out = null;
         String action = null;
         
@@ -2620,11 +2650,14 @@
             sizeLimit = 
                 (new Integer(PropertyService.getProperty("replication.datafilesizelimit"))).intValue();
         } catch (PropertyNotFoundException pnfe) {
-            logMetacat.error("MetaCatServlet.handleMultipartForm - Could not determine data file size limit.  Using 1000. " 
-                    + pnfe.getMessage());
+            logMetacat.error("MetacatHandler.handleMultipartForm - " +
+            		         "Could not determine data file size limit.  Using 1000. " + 
+            		         pnfe.getMessage());
             pnfe.printStackTrace(System.out);
         }
-        logMetacat.debug("MetaCatServlet.handleMultipartForm - The size limit of uploaded data files is: " + sizeLimit);
+        logMetacat.debug("MetacatHandler.handleMultipartForm - " +
+        		         "The size limit of uploaded data files is: " + 
+        		         sizeLimit);
         
         try {
             MultipartParser mp = new MultipartParser(request,
@@ -2655,7 +2688,8 @@
                     fileList.put("filename", fileName);
                     fileList.put("name", fileTempLocation);
                 } else {
-                    logMetacat.info("MetaCatServlet.handleMultipartForm - Upload name '" + name + "' was empty.");
+                    logMetacat.info("MetacatHandler.handleMultipartForm - " +
+                    		        "Upload name '" + name + "' was empty.");
                 }
             }
         } catch (IOException ioe) {
@@ -2662,7 +2696,8 @@
             try {
                 out = response.getWriter();
             } catch (IOException ioe2) {
-                logMetacat.fatal("MetaCatServlet.handleMultipartForm - Fatal Error: couldn't get response output stream.");
+                logMetacat.fatal("MetacatHandler.handleMultipartForm - " +
+                		         "Fatal Error: couldn't get response output stream.");
             }
             out.println("<?xml version=\"1.0\"?>");
             out.println("<error>");
@@ -2702,8 +2737,9 @@
         try {
             out = response.getWriter();
         } catch (IOException ioe2) {
-            logMetacat.error("MetaCatServlet.handleMultipartForm - Fatal Error: couldn't get response "
-                    + "output stream.");
+            logMetacat.error("MetacatHandler.handleMultipartForm - " +
+            		         "Fatal Error: couldn't get response " + 
+            		         "output stream.");
             ioe2.printStackTrace(System.out);
         }
         
@@ -2719,7 +2755,7 @@
             }
         } else if(action.equals("insertmultipart")) {
           if (username != null && !username.equals("public")) {
-            logMetacat.debug("MetaCatServlet.handleMultipartForm - handling multipart insert");
+            logMetacat.debug("MetacatHandler.handleMultipartForm - handling multipart insert");
               handleInsertMultipartAction(request, response,
                             out, params, fileList, username, groupnames);
           } else {
@@ -2751,7 +2787,7 @@
             PrintWriter out, Hashtable<String,String[]> params, Hashtable<String,String> fileList,
             String username, String[] groupnames)
     {
-      Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+      Logger logMetacat = Logger.getLogger(MetacatHandler.class);
       String action = null;
       String docid = null;
       String qformat = null;
@@ -2777,11 +2813,13 @@
       // Make sure we have a docid and datafile
       if (docid != null && fileList.containsKey("datafile")) 
       {
-        logMetacat.info("MetaCatServlet.handleInsertMultipartAction - Uploading data docid: " + docid);
+        logMetacat.info("MetacatHandler.handleInsertMultipartAction - " +
+        		        "Uploading data docid: " + docid);
         // Get a reference to the file part of the form
         //FilePart filePart = (FilePart) fileList.get("datafile");
         String fileName = fileList.get("filename");
-        logMetacat.debug("MetaCatServlet.handleInsertMultipartAction - Uploading filename: " + fileName);
+        logMetacat.debug("MetacatHandler.handleInsertMultipartAction - " +
+        		         "Uploading filename: " + fileName);
         // Check if the right file existed in the uploaded data
         if (fileName != null) 
         {
@@ -2808,7 +2846,8 @@
               {
                 newFile = new File(newFileName);
                 fileExists = newFile.exists();
-                logMetacat.info("MetaCatServlet.handleInsertMultipartAction - new file status is: " + fileExists);
+                logMetacat.info("MetacatHandler.handleInsertMultipartAction - " +
+                		        "new file status is: " + fileExists);
                 if(fileExists)
                 {
                   newFile.delete();
@@ -2825,19 +2864,22 @@
                     } 
                     catch (IOException ioe) 
                     {
-                        logMetacat.error("MetaCatServlet.handleInsertMultipartAction - IO Exception copying file: " +
-                                ioe.getMessage());
+                        logMetacat.error("MetacatHandler.handleInsertMultipartAction - " +
+                        		         "IO Exception copying file: " +
+                                         ioe.getMessage());
                         ioe.printStackTrace(System.out);
                     }
                     size = newFile.length();
                     if (size == 0) 
                     {
-                        throw new IOException("MetaCatServlet.handleInsertMultipartAction - Uploaded file is 0 bytes!");
+                        throw new IOException("MetacatHandler.handleInsertMultipartAction - " +
+                        		              "Uploaded file is 0 bytes!");
                     }
                 }
-                logMetacat.info("MetaCatServlet.handleInsertMultipartAction - Uploading the following to Metacat:" +
-                        fileName + ", " + docid + ", " +
-                        username + ", " + groupnames);
+                logMetacat.info("MetacatHandler.handleInsertMultipartAction - " +
+                		        "Uploading the following to Metacat:" +
+                                fileName + ", " + docid + ", " +
+                                username + ", " + groupnames);
                 
                 // Read the file with appropriate encoding
                 XmlStreamReader xsr = new XmlStreamReader(new FileInputStream(newFile));
@@ -2879,7 +2921,9 @@
           }
           catch(Exception e)
           {
-              logMetacat.error("MetaCatServlet.handleInsertMultipartAction - error uploading text file via multipart: " + e.getMessage());
+              logMetacat.error("MetacatHandler.handleInsertMultipartAction - " +
+            		           "error uploading text file via multipart: " + 
+            		           e.getMessage());
               e.printStackTrace(System.out);;
           }
         }
@@ -2891,9 +2935,10 @@
      * registering it in the Metacat db
      */
     private void handleUploadAction(HttpServletRequest request,
-            PrintWriter out, Hashtable<String, String[]> params, Hashtable<String,String> fileList,
-            String username, String[] groupnames, HttpServletResponse response) {
-        Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+            PrintWriter out, Hashtable<String, String[]> params, 
+            Hashtable<String,String> fileList, String username, String[] groupnames, 
+            HttpServletResponse response) {
+        Logger logMetacat = Logger.getLogger(MetacatHandler.class);
         //PrintWriter out = null;
         //Connection conn = null;
         //        String action = null;
@@ -2918,11 +2963,13 @@
 
         // Make sure we have a docid and datafile
         if (docid != null && fileList.containsKey("datafile")) {
-            logMetacat.info("MetaCatServlet.handleUploadAction - Uploading data docid: " + docid);
+            logMetacat.info("MetacatHandler.handleUploadAction - " +
+            		        "Uploading data docid: " + docid);
             // Get a reference to the file part of the form
             //FilePart filePart = (FilePart) fileList.get("datafile");
             String fileName = fileList.get("filename");
-            logMetacat.info("MetaCatServlet.handleUploadAction - Uploading filename: " + fileName);
+            logMetacat.info("MetacatHandler.handleUploadAction - " +
+            		        "Uploading filename: " + fileName);
             // Check if the right file existed in the uploaded data
             if (fileName != null) {
 
@@ -2945,7 +2992,8 @@
                         try {
                             newFile = new File(newFileName);
                             fileExists = newFile.exists();
-                            logMetacat.info("MetaCatServlet.handleUploadAction - new file status is: " + fileExists);
+                            logMetacat.info("MetacatHandler.handleUploadAction - " +
+                            		        "new file status is: " + fileExists);
                             if ( fileExists == false ) {
                                 // copy file to desired output location
                                 try {
@@ -2962,9 +3010,10 @@
                             } // Latent bug here if the file already exists, then the
                               // conditional fails but the document is still registered.
                               // maybe this never happens because we already requested a lock?
-                            logMetacat.info("MetaCatServlet.handleUploadAction - Uploading the following to Metacat:" +
-                                    fileName + ", " + docid + ", " +
-                                    username + ", " + groupnames);
+                            logMetacat.info("MetacatHandler.handleUploadAction - " +
+                            		        "Uploading the following to Metacat:" +
+                                            fileName + ", " + docid + ", " +
+                                            username + ", " + groupnames);
                             //register the file in the database (which generates
                             // an exception
                             //if the docid is not acceptable or other untoward
@@ -2984,8 +3033,10 @@
                                 newFile.delete();
                             }
                             
-                            logMetacat.info("MetaCatServlet.handleUploadAction - in Exception: fileExists is " + fileExists);
-                            logMetacat.error("MetaCatServlet.handleUploadAction - Upload Error: " + ee.getMessage());
+                            logMetacat.info("MetacatHandler.handleUploadAction - " +
+                            		        "in Exception: fileExists is " + fileExists);
+                            logMetacat.error("MetacatHandler.handleUploadAction - " +
+                            		         "Upload Error: " + ee.getMessage());
                             throw ee;
                         }
 
@@ -3000,7 +3051,9 @@
                         // not get force replication info from another metacat
                         ForceReplicationHandler frh = new ForceReplicationHandler(
                                 docid, "insert", false, null);
-                        logMetacat.debug("MetaCatServlet.handleUploadAction - ForceReplicationHandler created: " + frh.toString());
+                        logMetacat.debug("MetacatHandler.handleUploadAction - " +
+                        		         "ForceReplicationHandler created: " + 
+                        		         frh.toString());
 
                         // set content type and other response header fields
                         // first
@@ -3046,7 +3099,7 @@
                         out, null, null);
             } catch (Exception e) {
 
-                logMetacat.error("MetaCatServlet.handleUploadAction - General error: "
+                logMetacat.error("MetacatHandler.handleUploadAction - General error: "
                         + e.getMessage());
                 e.printStackTrace(System.out);
             }
@@ -3077,8 +3130,10 @@
         String[] accessBlock = params.get("accessBlock");
         if(accessBlock != null) {
             if (docList == null) {
-                errorList.addElement("MetaCatServlet.handleSetAccessAction - Doc id missing.  Please check your parameter list, it should look like: "
-                    + "?action=setaccess&docid=<doc_id>&accessBlock=<access_section>");
+                errorList.addElement("MetacatHandler.handleSetAccessAction - " +
+                		             "Doc id missing.  Please check your " +
+                		             "parameter list, it should look like: " + 
+                		             "?action=setaccess&docid=<doc_id>&accessBlock=<access_section>");
                 outputResponse(successList, errorList, out);
                 return;
             }
@@ -3086,10 +3141,13 @@
                 AccessControlForSingleFile accessControl = 
                     new AccessControlForSingleFile(docList[0]);
                 accessControl.insertPermissions(accessBlock[0]);
-                successList.addElement("MetaCatServlet.handleSetAccessAction - successfully replaced access block for doc id: " + docList[0]);
+                successList.addElement("MetacatHandler.handleSetAccessAction - " +
+                		               "successfully replaced access block for doc id: " + 
+                		               docList[0]);
             } catch(AccessControlException ace) {
-                errorList.addElement("MetaCatServlet.handleSetAccessAction - access control error when setting " + 
-                    "access block: " + ace.getMessage());
+                errorList.addElement("MetacatHandler.handleSetAccessAction - " +
+                		             "access control error when setting " + 
+                                     "access block: " + ace.getMessage());
             }
             outputResponse(successList, errorList, out);
             return;
@@ -3098,7 +3156,8 @@
         // Make sure the parameter is not null
         if (docList == null || principalList == null || permTypeList == null
                 || permissionList == null) {
-            error = "MetaCatServlet.handleSetAccessAction - Please check your parameter list, it should look like: "
+            error = "MetacatHandler.handleSetAccessAction - Please check " +
+                    "your parameter list, it should look like: "
                     + "?action=setaccess&docid=pipeline.1.1&principal=public"
                     + "&permission=read&permType=allow&permOrder=allowFirst";
             errorList.addElement(error);
@@ -3121,14 +3180,16 @@
             packageSet = 
                 MetacatUtil.getOptionList(PropertyService.getProperty("xml.packagedoctypeset"));
         } catch (PropertyNotFoundException pnfe) {
-            logMetacat.error("MetaCatServlet.handleSetAccessAction - Could not find package doctype set.  Setting to null: " 
+            logMetacat.error("MetacatHandler.handleSetAccessAction - " +
+            		         "Could not find package doctype set.  Setting to null: " 
                     + pnfe.getMessage());
         }
         //debug
         if (packageSet != null) {
             for (int i = 0; i < packageSet.size(); i++) {
-                logMetacat.debug("MetaCatServlet.handleSetAccessAction - doctype in package set: "
-                        + packageSet.elementAt(i));
+                logMetacat.debug("MetacatHandler.handleSetAccessAction - " +
+                		         "doctype in package set: " + 
+                		         packageSet.elementAt(i));
             }
         }
         
@@ -3140,7 +3201,7 @@
                     String actualDocId = LSIDUtil.getDocId(docid, false);
                     docid = actualDocId;
                 } catch (ParseLSIDException ple) {
-                    logMetacat.error("MetaCatServlet.handleSetAccessAction - " +
+                    logMetacat.error("MetacatHandler.handleSetAccessAction - " +
                             "could not parse lsid: " + docid + " : " + ple.getMessage()); 
                     ple.printStackTrace(System.out);
                 }
@@ -3153,10 +3214,12 @@
                 owner = getFieldValueForDoc(accessionNumber, "user_owner");
                 publicId = getFieldValueForDoc(accessionNumber, "doctype");
             } catch (Exception e) {
-                logMetacat.error("MetaCatServlet.handleSetAccessAction - Error in handleSetAccessAction: "
-                        + e.getMessage());
+                logMetacat.error("MetacatHandler.handleSetAccessAction - " +
+                		         "Error in handleSetAccessAction: " + 
+                		         e.getMessage());
                 e.printStackTrace(System.out);
-                error = "Error in set access control for document - " + accessionNumber + e.getMessage();
+                error = "Error in set access control for document - " + 
+                        accessionNumber + e.getMessage();
                 errorList.addElement(error);
                 continue;
             }
@@ -3194,12 +3257,17 @@
                     //insert permission
                     AccessControlForSingleFile accessControl = 
                         new AccessControlForSingleFile(accessionNumber);
-                    //System.out.println("permission in MetacatHandler: " + l.longValue());
-                    //System.out.println("permission in MetacatHandler: " + Integer.valueOf(AccessControlList.intValue(permission)).longValue());
-                    accessControl.insertPermissions(principal, Integer.valueOf(AccessControlList.intValue(permission)).longValue(), permType, permOrder, null, null);
+                    //System.out.println("permission in MetacatHandler: " + 
+                    //                   l.longValue());
+                    //System.out.println("permission in MetacatHandler: " + 
+                    //                   Integer.valueOf(AccessControlList.intValue(permission)).longValue());
+                    accessControl.insertPermissions(principal, 
+                      Integer.valueOf(AccessControlList.intValue(permission)).longValue(), 
+                      permType, permOrder, null, null);
                 } catch (Exception ee) {
-                    logMetacat.error("MetaCatServlet.handleSetAccessAction - Error inserting permission: "
-                            + ee.getMessage());
+                    logMetacat.error("MetacatHandler.handleSetAccessAction - " +
+                    		         "Error inserting permission: " + 
+                    		         ee.getMessage());
                     ee.printStackTrace(System.out);
                     error = "Failed to set access control for document "
                             + accessionNumber + " because " + ee.getMessage();
@@ -3214,11 +3282,14 @@
             }
             ForceReplicationHandler frh = 
                 new ForceReplicationHandler(accessionNumber, isXml, null);
-            logMetacat.debug("MetaCatServlet.handleSetAccessAction - ForceReplicationHandler created: " + frh.toString());
+            logMetacat.debug("MetacatHandler.handleSetAccessAction - " +
+            		         "ForceReplicationHandler created: " + frh.toString());
             
         }
         if (errorList.isEmpty()) {
-        	successList.addElement("MetaCatServlet.handleSetAccessAction - successfully added individual access for doc id: " + docList[0]);
+        	successList.addElement("MetacatHandler.handleSetAccessAction - " +
+        			               "successfully added individual access for doc id: " + 
+        			               docList[0]);
         }
         if (params.get("forwardto")  != null) {
             try {
@@ -3256,7 +3327,7 @@
         try {
             //check out DBConnection
             conn = DBConnectionPool
-                    .getDBConnection("MetaCatServlet.getPublicIdForDoc");
+                    .getDBConnection("MetacatHandler.getPublicIdForDoc");
             serialNumber = conn.getCheckOutSerialNumber();
             pstmt = conn.prepareStatement("SELECT " + fieldName
                     + " FROM xml_documents " + "WHERE docid = ? ");
@@ -3273,7 +3344,7 @@
                         + accessionNumber);
             }
         } catch (Exception e) {
-            logMetacat.error("MetaCatServlet.getFieldValueForDoc - General error: "
+            logMetacat.error("MetacatHandler.getFieldValueForDoc - General error: "
                     + e.getMessage());
             throw e;
         } finally {
@@ -3295,7 +3366,7 @@
      * @ returns the array of identifiers
      */
     private Vector<String> getDocumentList() throws SQLException {
-        Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
+        Logger logMetacat = Logger.getLogger(MetacatHandler.class);
         Vector<String> docList = new Vector<String>();
         PreparedStatement pstmt = null;
         ResultSet rs = null;
@@ -3305,7 +3376,7 @@
         try {
             //check out DBConnection
             conn = DBConnectionPool
-                    .getDBConnection("MetaCatServlet.getDocumentList");
+                    .getDBConnection("MetacatHandler.getDocumentList");
             serialNumber = conn.getCheckOutSerialNumber();
             pstmt = conn.prepareStatement("SELECT docid, rev"
                     + " FROM xml_documents ");
@@ -3317,7 +3388,7 @@
                 docList.add(docid + "." + rev);
             }
         } catch (SQLException e) {
-            logMetacat.error("MetaCatServlet.getDocumentList - General exception: "
+            logMetacat.error("MetacatHandler.getDocumentList - General exception: "
                     + e.getMessage());
             throw e;
         } finally {
@@ -3326,7 +3397,7 @@
                 pstmt.close();
                 
             } catch (SQLException se) {
-                logMetacat.error("MetaCatServlet.getDocumentList - General exception: "
+                logMetacat.error("MetacatHandler.getDocumentList - General exception: "
                         + se.getMessage());
                 throw se;
             } finally {
@@ -3380,7 +3451,8 @@
      * If the given docid only have one seperter, we need
      * append rev for it. The rev come from xml_documents
      */
-    private static String appendRev(String docid) throws PropertyNotFoundException, SQLException, McdbDocNotFoundException {
+    private static String appendRev(String docid) 
+      throws PropertyNotFoundException, SQLException, McdbDocNotFoundException {
         String newAccNum = null;
         String separator = PropertyService.getProperty("document.accNumSeparator");
         int firstIndex = docid.indexOf(separator);
@@ -3421,8 +3493,9 @@
                 sitemapInterval = 
                     Integer.parseInt(PropertyService.getProperty("sitemap.interval"));
             } catch (PropertyNotFoundException pnfe) {
-                logMetacat.error("MetaCatServlet.scheduleSitemapGeneration - Could not run site map generation because property " 
-                        + "could not be found: " + pnfe.getMessage());
+                logMetacat.error("MetacatHandler.scheduleSitemapGeneration - " +
+                		         "Could not run site map generation because property " +
+                		         "could not be found: " + pnfe.getMessage());
             }
             
             File directory = new File(directoryName);
