Revision 6267
Added by ben leinfelder over 12 years ago
MNResourceHandler.java | ||
---|---|---|
121 | 121 |
* @author leinfelder |
122 | 122 |
* |
123 | 123 |
*/ |
124 |
public class MNResourceHandler extends ResourceHandler{ |
|
124 |
public class MNResourceHandler extends D1ResourceHandler{
|
|
125 | 125 |
|
126 | 126 |
// MN-specific API Resources |
127 | 127 |
protected static final String RESOURCE_MONITOR = "monitor"; |
... | ... | |
301 | 301 |
serializeException(be, out); |
302 | 302 |
} catch (Exception e) { |
303 | 303 |
logMetacat.error(e.getClass() + ": " + e.getMessage()); |
304 |
System.out.println("Error in ResourceHandler.handle(): " + e.getClass() + ": " + e.getMessage());
|
|
304 |
System.out.println("Error handle(): " + e.getClass() + ": " + e.getMessage()); |
|
305 | 305 |
e.printStackTrace(); |
306 | 306 |
} |
307 | 307 |
} |
... | ... | |
545 | 545 |
} |
546 | 546 |
catch(Exception e) |
547 | 547 |
{ |
548 |
logMetacat.error("Error getting output stream in ResourceHandler.describeObject: " + e.getClass() + ": " + e.getMessage());
|
|
548 |
logMetacat.error("Error getting output stream in describeObject: " + e.getClass() + ": " + e.getMessage()); |
|
549 | 549 |
return; |
550 | 550 |
} |
551 | 551 |
response.setStatus(200); |
... | ... | |
738 | 738 |
"Here's the error: " + e.getClass() + ": " + e.getMessage()); |
739 | 739 |
e.printStackTrace(); |
740 | 740 |
ServiceFailure sf = new ServiceFailure("1030", |
741 |
"IO Error in ResourceHandler.getObject: " + e.getClass() + ": " + e.getMessage());
|
|
741 |
"IO Error in getObject: " + e.getClass() + ": " + e.getMessage()); |
|
742 | 742 |
serializeException(sf, out); |
743 | 743 |
} |
744 | 744 |
} |
... | ... | |
836 | 836 |
e.printStackTrace(); |
837 | 837 |
response.setStatus(500); |
838 | 838 |
ServiceFailure sf = new ServiceFailure("1030", |
839 |
"IO Error in ResourceHandler.getObject: " + e.getMessage());
|
|
839 |
"IO Error in getObject: " + e.getMessage()); |
|
840 | 840 |
serializeException(sf, out); |
841 | 841 |
} catch(NumberFormatException ne) { |
842 | 842 |
response.setStatus(500); |
... | ... | |
879 | 879 |
} catch (IOException e) { |
880 | 880 |
response.setStatus(500); |
881 | 881 |
ServiceFailure sf = new ServiceFailure("1030", |
882 |
"IO Error in ResourceHandler.getSystemMetadataObject: " + e.getMessage());
|
|
882 |
"IO Error in getSystemMetadataObject: " + e.getMessage()); |
|
883 | 883 |
serializeException(sf, out); |
884 | 884 |
} finally { |
885 | 885 |
IOUtils.closeQuietly(out); |
... | ... | |
983 | 983 |
*/ |
984 | 984 |
@Override |
985 | 985 |
protected void putObject(String pid, String action) { |
986 |
System.out.println("ResourceHandler: putObject with pid " + pid);
|
|
986 |
System.out.println("putObject with pid " + pid); |
|
987 | 987 |
logMetacat.debug("Entering putObject: " + pid + "/" + action); |
988 | 988 |
OutputStream out = null; |
989 | 989 |
try { |
... | ... | |
1218 | 1218 |
catch(Exception e) |
1219 | 1219 |
{ |
1220 | 1220 |
response.setStatus(500); |
1221 |
printError("Error setting access in ResourceHandler: " + e.getClass() + ": " + e.getMessage(), response);
|
|
1221 |
printError("Error setting access: " + e.getClass() + ": " + e.getMessage(), response); |
|
1222 | 1222 |
throw e; |
1223 | 1223 |
} |
1224 | 1224 |
} |
Also available in: Unified diff
refactor to use D1RestServlet and D1ResourceHandler for the D1 rest interface