Index: lib/dataone-service-api-0.3.0.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java	(revision 5355)
+++ src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java	(revision 5356)
@@ -499,7 +499,7 @@
         } catch (BaseException e) {
                 serializeException(e, out);
         } catch (IOException e) {
-            ServiceFailure sf = new ServiceFailure(1030, e.getMessage());
+            ServiceFailure sf = new ServiceFailure("1030", e.getMessage());
             serializeException(sf, out);
         }
     }
@@ -525,12 +525,12 @@
                 IMarshallingContext mctx = bfact.createMarshallingContext();
                 mctx.marshalDocument(sysmeta, "UTF-8", null, out);
             } catch (JiBXException e) {
-                throw new ServiceFailure(1190, "Failed to serialize SystemMetadata: " + e.getMessage());
+                throw new ServiceFailure("1190", "Failed to serialize SystemMetadata: " + e.getMessage());
             }
         } catch (BaseException e) {
                 serializeException(e, out);
         } catch (IOException e) {
-            ServiceFailure sf = new ServiceFailure(1030, e.getMessage());
+            ServiceFailure sf = new ServiceFailure("1030", e.getMessage());
             serializeException(sf, out);
         } finally {
             IOUtils.closeQuietly(out);
@@ -646,7 +646,7 @@
                     sysmeta = part.getInputStream();
                     logMetacat.debug("Found sysmeta part, size is: " + part.getSize());
                 } else {
-                    throw new InvalidRequest(1000, "Request had malformed MIME part with name: " + name);
+                    throw new InvalidRequest("1000", "Request had malformed MIME part with name: " + name);
                 }
             }
             
@@ -655,7 +655,7 @@
                 // Check if the objectId exists
                 IdentifierManager im = IdentifierManager.getInstance();
                 if (im.identifierExists(guid)) {
-                    throw new IdentifierNotUnique(1000, "Identifier is already in use: " + guid);
+                    throw new IdentifierNotUnique("1000", "Identifier is already in use: " + guid);
                 }
 
                 // TODO: access control -- should be in CrudService et al. I think
@@ -676,7 +676,7 @@
 
                 } else {
                     logMetacat.debug("Unauthorized to create.");
-                    throw new NotAuthorized(1000, "Permission denied for user " + username);
+                    throw new NotAuthorized("1000", "Permission denied for user " + username);
                 }
             } else if (action.equals(FUNCTION_NAME_UPDATE)) { //handle updates
                 IdentifierManager im = IdentifierManager.getInstance();
@@ -689,7 +689,7 @@
                 //do some checks
                 if(params.get("obsoletedGuid") == null)
                 {
-                    throw new InvalidRequest(1202, "obsoletedGuid must be contained in the request parameters.");
+                    throw new InvalidRequest("1202", "obsoletedGuid must be contained in the request parameters.");
                 }
                 //get the obsoletedGuid
                 String[] obsGuidS = params.get("obsoletedGuid");
@@ -697,7 +697,7 @@
                 
                 if (!im.identifierExists(obsoletedGuid.getValue())) 
                 {
-                    throw new InvalidRequest(1202, "The guid you are trying to update does not exist.");
+                    throw new InvalidRequest("1202", "The guid you are trying to update does not exist.");
                 }
                 
                 
@@ -717,11 +717,11 @@
                 }
                 catch(NotFound e)
                 {
-                    throw new InvalidRequest(1202, "The guid you are trying to update does not exist.");
+                    throw new InvalidRequest("1202", "The guid you are trying to update does not exist.");
                 }
                 
             } else {
-                throw new InvalidRequest(1000, "Operation must be create or update.");
+                throw new InvalidRequest("1000", "Operation must be create or update.");
             }
         } catch (NotAuthorized e) {
             serializeException(e, out);
@@ -742,14 +742,14 @@
         } catch (InvalidRequest e) {
             serializeException(e, out);
         } catch (MessagingException e) {
-            ServiceFailure sf = new ServiceFailure(1000, e.getMessage());
+            ServiceFailure sf = new ServiceFailure("1000", e.getMessage());
             serializeException(sf, out);
         } catch (IOException e) {
-            ServiceFailure sf = new ServiceFailure(1000, e.getMessage());
+            ServiceFailure sf = new ServiceFailure("1000", e.getMessage());
             serializeException(sf, out);
         } catch (JiBXException e) {
             e.printStackTrace(System.out);
-            InvalidSystemMetadata ism = new InvalidSystemMetadata(1080, e.getMessage());
+            InvalidSystemMetadata ism = new InvalidSystemMetadata("1080", e.getMessage());
             serializeException(ism, out);
         }
     }
Index: src/edu/ucsb/nceas/metacat/dataone/CrudService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/dataone/CrudService.java	(revision 5355)
+++ src/edu/ucsb/nceas/metacat/dataone/CrudService.java	(revision 5356)
@@ -194,7 +194,7 @@
         // verify that guid == SystemMetadata.getIdentifier()
         logMetacat.debug("Comparing guid|sysmeta_guid: " + guid.getValue() + "|" + sysmeta.getIdentifier().getValue());
         if (!guid.getValue().equals(sysmeta.getIdentifier().getValue())) {
-            throw new InvalidSystemMetadata(1180, 
+            throw new InvalidSystemMetadata("1180", 
                 "GUID in method call does not match GUID in system metadata.");
         }
 
@@ -202,7 +202,7 @@
         // Check that the identifier does not already exist
         IdentifierManager im = IdentifierManager.getInstance();
         if (im.identifierExists(guid.getValue())) {
-            throw new IdentifierNotUnique(1120, 
+            throw new IdentifierNotUnique("1120", 
                 "GUID is already in use by an existing object.");
         }
 
@@ -217,7 +217,7 @@
                 String msg = "Could not create string from XML stream: " +
                     " " + e.getMessage();
                 logMetacat.debug(msg);
-                throw new ServiceFailure(1190, msg);
+                throw new ServiceFailure("1190", msg);
             }
 
         } else {
@@ -275,7 +275,7 @@
         }
         catch(Exception e)
         {
-            throw new ServiceFailure(1030, "Error updating document in CrudService: " + e.getMessage());
+            throw new ServiceFailure("1030", "Error updating document in CrudService: " + e.getMessage());
         }
     }
 
@@ -282,13 +282,13 @@
     public Identifier delete(AuthToken token, Identifier guid)
             throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, 
             NotImplemented {
-        throw new NotImplemented(1000, "This method not yet implemented.");
+        throw new NotImplemented("1000", "This method not yet implemented.");
     }
 
     public DescribeResponse describe(AuthToken token, Identifier guid)
             throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, 
             NotImplemented {
-        throw new NotImplemented(1000, "This method not yet implemented.");
+        throw new NotImplemented("1000", "This method not yet implemented.");
     }
     
     public InputStream get(AuthToken token, Identifier guid)
@@ -316,19 +316,19 @@
                                 sessionData.getUserName(), 
                                 sessionData.getGroupNames(), true, params);
                     } catch (PropertyNotFoundException e) {
-                        throw new ServiceFailure(1030, e.getMessage());
+                        throw new ServiceFailure("1030", e.getMessage());
                     } catch (ClassNotFoundException e) {
-                        throw new ServiceFailure(1030, e.getMessage());
+                        throw new ServiceFailure("1030", e.getMessage());
                     } catch (IOException e) {
-                        throw new ServiceFailure(1030, e.getMessage());
+                        throw new ServiceFailure("1030", e.getMessage());
                     } catch (SQLException e) {
-                        throw new ServiceFailure(1030, e.getMessage());
+                        throw new ServiceFailure("1030", e.getMessage());
                     } catch (McdbException e) {
-                        throw new ServiceFailure(1030, e.getMessage());
+                        throw new ServiceFailure("1030", e.getMessage());
                     } catch (ParseLSIDException e) {
-                        throw new NotFound(1020, e.getMessage());
+                        throw new NotFound("1020", e.getMessage());
                     } catch (InsufficientKarmaException e) {
-                        throw new NotAuthorized(1000, "Not authorized for get().");
+                        throw new NotAuthorized("1000", "Not authorized for get().");
                     }
 
                     return "Completed";
@@ -337,7 +337,7 @@
             return objectStream;
 
         } catch (McdbDocNotFoundException e) {
-            throw new NotFound(1020, e.getMessage());
+            throw new NotFound("1020", e.getMessage());
         }
     }
 
@@ -344,19 +344,19 @@
     public Checksum getChecksum(AuthToken token, Identifier guid)
             throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, 
             InvalidRequest, NotImplemented {
-        throw new NotImplemented(1000, "This method not yet implemented.");
+        throw new NotImplemented("1000", "This method not yet implemented.");
     }
 
     public Checksum getChecksum(AuthToken token, Identifier guid, 
             String checksumAlgorithm) throws InvalidToken, ServiceFailure, 
             NotAuthorized, NotFound, InvalidRequest, NotImplemented {
-        throw new NotImplemented(1000, "This method not yet implemented.");
+        throw new NotImplemented("1000", "This method not yet implemented.");
     }
 
     public LogRecordSet getLogRecords(AuthToken token, Date fromDate, Date toDate)
             throws InvalidToken, ServiceFailure, NotAuthorized, InvalidRequest, 
             NotImplemented {
-        throw new NotImplemented(1000, "This method not yet implemented.");
+        throw new NotImplemented("1000", "This method not yet implemented.");
     }
 
     public SystemMetadata getSystemMetadata(AuthToken token, Identifier guid)
@@ -387,19 +387,19 @@
                                 sessionData.getUserName(), 
                                 sessionData.getGroupNames(), true, params);
                     } catch (PropertyNotFoundException e) {
-                        throw new ServiceFailure(1030, e.getMessage());
+                        throw new ServiceFailure("1030", e.getMessage());
                     } catch (ClassNotFoundException e) {
-                        throw new ServiceFailure(1030, e.getMessage());
+                        throw new ServiceFailure("1030", e.getMessage());
                     } catch (IOException e) {
-                        throw new ServiceFailure(1030, e.getMessage());
+                        throw new ServiceFailure("1030", e.getMessage());
                     } catch (SQLException e) {
-                        throw new ServiceFailure(1030, e.getMessage());
+                        throw new ServiceFailure("1030", e.getMessage());
                     } catch (McdbException e) {
-                        throw new ServiceFailure(1030, e.getMessage());
+                        throw new ServiceFailure("1030", e.getMessage());
                     } catch (ParseLSIDException e) {
-                        throw new NotFound(1020, e.getMessage());
+                        throw new NotFound("1020", e.getMessage());
                     } catch (InsufficientKarmaException e) {
-                        throw new NotAuthorized(1000, "Not authorized for get().");
+                        throw new NotAuthorized("1000", "Not authorized for get().");
                     }
 
                     return "Completed";
@@ -412,7 +412,7 @@
             
         } catch (McdbDocNotFoundException e) {
             //e.printStackTrace();
-            throw new NotFound(1000, e.getMessage());
+            throw new NotFound("1000", e.getMessage());
         }                
     }
 
@@ -505,17 +505,17 @@
                         //newFile.delete();
                         logMetacat.debug("SQLE: " + e.getMessage());
                         e.printStackTrace(System.out);
-                        throw new ServiceFailure(1190, "Registration failed: " + e.getMessage());
+                        throw new ServiceFailure("1190", "Registration failed: " + e.getMessage());
                     } catch (AccessionNumberException e) {
                         //newFile.delete();
                         logMetacat.debug("ANE: " + e.getMessage());
                         e.printStackTrace(System.out);
-                        throw new ServiceFailure(1190, "Registration failed: " + e.getMessage());
+                        throw new ServiceFailure("1190", "Registration failed: " + e.getMessage());
                     } catch (Exception e) {
                         //newFile.delete();
                         logMetacat.debug("Exception: " + e.getMessage());
                         e.printStackTrace(System.out);
-                        throw new ServiceFailure(1190, "Registration failed: " + e.getMessage());
+                        throw new ServiceFailure("1190", "Registration failed: " + e.getMessage());
                     }
     
                     logMetacat.debug("Logging the creation event.");
@@ -528,13 +528,13 @@
                             localId, "insert", false, null);
     
                 } catch (PropertyNotFoundException e) {
-                    throw new ServiceFailure(1190, "Could not lock file for writing:" + e.getMessage());
+                    throw new ServiceFailure("1190", "Could not lock file for writing:" + e.getMessage());
                 }
     
             }
         } catch (Exception e) {
             // Could not get a lock on the document, so we can not update the file now
-            throw new ServiceFailure(1190, "Failed to lock file: " + e.getMessage());
+            throw new ServiceFailure("1190", "Failed to lock file: " + e.getMessage());
         }
     }
 
@@ -553,15 +553,15 @@
                 os.close();
             } else {
                 logMetacat.debug("File creation failed, or file already exists.");
-                throw new ServiceFailure(1190, "File already exists: " + fileName);
+                throw new ServiceFailure("1190", "File already exists: " + fileName);
             }
         } catch (FileNotFoundException e) {
             logMetacat.debug("FNF: " + e.getMessage());
-            throw new ServiceFailure(1190, "File not found: " + fileName + " " 
+            throw new ServiceFailure("1190", "File not found: " + fileName + " " 
                     + e.getMessage());
         } catch (IOException e) {
             logMetacat.debug("IOE: " + e.getMessage());
-            throw new ServiceFailure(1190, "File was not written: " + fileName 
+            throw new ServiceFailure("1190", "File was not written: " + fileName 
                     + " " + e.getMessage());
         }
 
@@ -605,7 +605,7 @@
         }
         catch(Exception e)
         {
-            throw new ServiceFailure(1030, "Error updating system metadata: " + e.getMessage());
+            throw new ServiceFailure("1030", "Error updating system metadata: " + e.getMessage());
         }
     }
     
@@ -689,7 +689,7 @@
             }
             catch(McdbDocNotFoundException e)
             {
-                throw new ServiceFailure(1030, "CrudService.insertOrUpdateDocument(): " +
+                throw new ServiceFailure("1030", "CrudService.insertOrUpdateDocument(): " +
                     "guid " + guid.getValue() + " should have been in the identifier table, but it wasn't: " + e.getMessage());
             }
         }
@@ -733,7 +733,7 @@
             sysmetaOut = new ByteArrayOutputStream();
             mctx.marshalDocument(sysmeta, "UTF-8", null, sysmetaOut);
         } catch (JiBXException e) {
-            throw new ServiceFailure(1190, "Failed to serialize and insert SystemMetadata: " + e.getMessage());
+            throw new ServiceFailure("1190", "Failed to serialize and insert SystemMetadata: " + e.getMessage());
         }
         
         return sysmetaOut;
@@ -747,7 +747,7 @@
             SystemMetadata sysmeta = (SystemMetadata) uctx.unmarshalDocument(xml, null);
             return sysmeta;
         } catch (JiBXException e) {
-            throw new ServiceFailure(1190, "Failed to serialize and insert SystemMetadata: " + e.getMessage());
+            throw new ServiceFailure("1190", "Failed to serialize and insert SystemMetadata: " + e.getMessage());
         }    
     }
 }
