Revision 6267
Added by ben leinfelder over 12 years ago
CNResourceHandler.java | ||
---|---|---|
114 | 114 |
* @author leinfelder |
115 | 115 |
* |
116 | 116 |
*/ |
117 |
public class CNResourceHandler extends ResourceHandler { |
|
117 |
public class CNResourceHandler extends D1ResourceHandler {
|
|
118 | 118 |
|
119 | 119 |
/** CN-specific operations **/ |
120 | 120 |
protected static final String RESOURCE_RESERVE = "reserve"; |
... | ... | |
515 | 515 |
"Here's the error: " + e.getClass() + ": " + e.getMessage()); |
516 | 516 |
e.printStackTrace(); |
517 | 517 |
ServiceFailure sf = new ServiceFailure("1030", |
518 |
"IO Error in ResourceHandler.getObject: " + e.getClass() + ": " + e.getMessage()); |
|
518 |
"IO Error in D1ResourceHandler.getObject: " + e.getClass() + ": " + e.getMessage());
|
|
519 | 519 |
serializeException(sf, out); |
520 | 520 |
} |
521 | 521 |
} |
... | ... | |
524 | 524 |
e.printStackTrace(); |
525 | 525 |
response.setStatus(500); |
526 | 526 |
ServiceFailure sf = new ServiceFailure("1030", |
527 |
"IO Error in ResourceHandler.getObject: " + e.getMessage()); |
|
527 |
"IO Error in D1ResourceHandler.getObject: " + e.getMessage());
|
|
528 | 528 |
serializeException(sf, out); |
529 | 529 |
} catch(NumberFormatException ne) { |
530 | 530 |
response.setStatus(500); |
... | ... | |
572 | 572 |
} catch (IOException e) { |
573 | 573 |
response.setStatus(500); |
574 | 574 |
ServiceFailure sf = new ServiceFailure("1030", |
575 |
"IO Error in ResourceHandler.getSystemMetadataObject: " + e.getMessage()); |
|
575 |
"IO Error in D1ResourceHandler.getSystemMetadataObject: " + e.getMessage());
|
|
576 | 576 |
serializeException(sf, out); |
577 | 577 |
} finally { |
578 | 578 |
IOUtils.closeQuietly(out); |
... | ... | |
587 | 587 |
* @throws IOException |
588 | 588 |
*/ |
589 | 589 |
protected void putObject(String pid, String action) { |
590 |
logMetacat.debug("ResourceHandler: putObject with pid " + pid);
|
|
590 |
logMetacat.debug("putObject with pid " + pid); |
|
591 | 591 |
logMetacat.debug("Entering putObject: " + pid + "/" + action); |
592 | 592 |
OutputStream out = null; |
593 | 593 |
try { |
... | ... | |
782 | 782 |
|
783 | 783 |
} catch (IOException ioe) { |
784 | 784 |
logMetacat.error("Could not get the output stream for writing" + |
785 |
"in ResourceHandler.listFormats()"); |
|
785 |
"in D1ResourceHandler.listFormats()");
|
|
786 | 786 |
|
787 | 787 |
} |
788 | 788 |
|
... | ... | |
839 | 839 |
|
840 | 840 |
} catch (IOException ioe) { |
841 | 841 |
logMetacat.error("Could not get the output stream for writing" + |
842 |
"in ResourceHandler.listFormats()"); |
|
842 |
"in D1ResourceHandler.listFormats()");
|
|
843 | 843 |
|
844 | 844 |
} |
845 | 845 |
|
Also available in: Unified diff
refactor to use D1RestServlet and D1ResourceHandler for the D1 rest interface