Revision 9833
Added by Jing Tao almost 8 years ago
MNResourceHandler.java | ||
---|---|---|
45 | 45 |
import org.apache.log4j.Logger; |
46 | 46 |
import org.dataone.client.v2.formats.ObjectFormatCache; |
47 | 47 |
import org.dataone.client.v2.formats.ObjectFormatInfo; |
48 |
import org.dataone.exceptions.MarshallingException; |
|
48 | 49 |
import org.dataone.mimemultipart.MultipartRequest; |
49 | 50 |
import org.dataone.mimemultipart.MultipartRequestResolver; |
50 | 51 |
import org.dataone.portal.TokenGenerator; |
... | ... | |
83 | 84 |
import org.dataone.service.util.DateTimeMarshaller; |
84 | 85 |
import org.dataone.service.util.ExceptionHandler; |
85 | 86 |
import org.dataone.service.util.TypeMarshaller; |
86 |
import org.jibx.runtime.JiBXException; |
|
87 | 87 |
import org.xml.sax.SAXException; |
88 | 88 |
|
89 | 89 |
import edu.ucsb.nceas.metacat.MetaCatServlet; |
... | ... | |
764 | 764 |
* @throws ServiceFailure |
765 | 765 |
* @throws InvalidToken |
766 | 766 |
* @throws IOException |
767 |
* @throws JiBXException
|
|
767 |
* @throws MarshallingException
|
|
768 | 768 |
*/ |
769 |
private void generateIdentifier() throws InvalidToken, ServiceFailure, NotAuthorized, NotImplemented, InvalidRequest, IOException, JiBXException {
|
|
769 |
private void generateIdentifier() throws InvalidToken, ServiceFailure, NotAuthorized, NotImplemented, InvalidRequest, IOException, MarshallingException {
|
|
770 | 770 |
|
771 | 771 |
// make sure we have the multipart params |
772 | 772 |
try { |
... | ... | |
896 | 896 |
* @throws ServiceFailure |
897 | 897 |
* @throws NotAuthorized |
898 | 898 |
* @throws InvalidRequest |
899 |
* @throws JiBXException
|
|
899 |
* @throws MarshallingException
|
|
900 | 900 |
* @throws IllegalAccessException |
901 | 901 |
* @throws InstantiationException |
902 | 902 |
* @throws IOException |
903 | 903 |
*/ |
904 |
private void syncError() throws NotImplemented, ServiceFailure, NotAuthorized, InvalidRequest, JiBXException, IOException, InstantiationException, IllegalAccessException {
|
|
904 |
private void syncError() throws NotImplemented, ServiceFailure, NotAuthorized, InvalidRequest, MarshallingException, IOException, InstantiationException, IllegalAccessException {
|
|
905 | 905 |
SynchronizationFailed syncFailed = null; |
906 | 906 |
try { |
907 | 907 |
syncFailed = collectSynchronizationFailed(); |
... | ... | |
917 | 917 |
/** |
918 | 918 |
* Calculate the checksum |
919 | 919 |
* @throws NotImplemented |
920 |
* @throws JiBXException
|
|
920 |
* @throws MarshallingException
|
|
921 | 921 |
* @throws IOException |
922 | 922 |
* @throws InvalidToken |
923 | 923 |
* @throws ServiceFailure |
... | ... | |
925 | 925 |
* @throws NotFound |
926 | 926 |
* @throws InvalidRequest |
927 | 927 |
*/ |
928 |
private void checksum(String pid) throws NotImplemented, JiBXException, IOException, InvalidToken, ServiceFailure, NotAuthorized, NotFound, InvalidRequest {
|
|
928 |
private void checksum(String pid) throws NotImplemented, MarshallingException, IOException, InvalidToken, ServiceFailure, NotAuthorized, NotFound, InvalidRequest {
|
|
929 | 929 |
String checksumAlgorithm = "MD5"; |
930 | 930 |
try { |
931 | 931 |
checksumAlgorithm = PropertyService.getProperty("dataone.checksumAlgorithm.default"); |
... | ... | |
954 | 954 |
|
955 | 955 |
/** |
956 | 956 |
* handle the replicate action for MN |
957 |
* @throws JiBXException
|
|
957 |
* @throws MarshallingException
|
|
958 | 958 |
* @throws FileUploadException |
959 | 959 |
* @throws IOException |
960 | 960 |
* @throws InvalidRequest |
... | ... | |
969 | 969 |
*/ |
970 | 970 |
private void replicate() |
971 | 971 |
throws ServiceFailure, InvalidRequest, IOException, FileUploadException, |
972 |
JiBXException, NotImplemented, NotAuthorized, InsufficientResources,
|
|
972 |
MarshallingException, NotImplemented, NotAuthorized, InsufficientResources,
|
|
973 | 973 |
UnsupportedType, InstantiationException, IllegalAccessException, InvalidToken { |
974 | 974 |
|
975 | 975 |
logMetacat.debug("in POST replicate()"); |
... | ... | |
1064 | 1064 |
/** |
1065 | 1065 |
* Get the Node information |
1066 | 1066 |
* |
1067 |
* @throws JiBXException
|
|
1067 |
* @throws MarshallingException
|
|
1068 | 1068 |
* @throws IOException |
1069 | 1069 |
* @throws InvalidRequest |
1070 | 1070 |
* @throws ServiceFailure |
... | ... | |
1072 | 1072 |
* @throws NotImplemented |
1073 | 1073 |
*/ |
1074 | 1074 |
private void node() |
1075 |
throws JiBXException, IOException, NotImplemented, NotAuthorized, ServiceFailure, InvalidRequest {
|
|
1075 |
throws MarshallingException, IOException, NotImplemented, NotAuthorized, ServiceFailure, InvalidRequest {
|
|
1076 | 1076 |
|
1077 | 1077 |
Node n = MNodeService.getInstance(request).getCapabilities(); |
1078 | 1078 |
|
... | ... | |
1135 | 1135 |
* @throws ServiceFailure |
1136 | 1136 |
* @throws InvalidToken |
1137 | 1137 |
* @throws IOException |
1138 |
* @throws JiBXException
|
|
1138 |
* @throws MarshallingException
|
|
1139 | 1139 |
*/ |
1140 |
private void getLog() throws InvalidToken, ServiceFailure, NotAuthorized, InvalidRequest, NotImplemented, IOException, JiBXException
|
|
1140 |
private void getLog() throws InvalidToken, ServiceFailure, NotAuthorized, InvalidRequest, NotImplemented, IOException, MarshallingException
|
|
1141 | 1141 |
{ |
1142 | 1142 |
|
1143 | 1143 |
Date fromDate = null; |
... | ... | |
1208 | 1208 |
* @throws ServiceFailure |
1209 | 1209 |
* @throws InvalidToken |
1210 | 1210 |
* @throws IOException |
1211 |
* @throws JiBXException
|
|
1211 |
* @throws MarshallingException
|
|
1212 | 1212 |
*/ |
1213 |
protected void getObject(String pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, InvalidRequest, NotImplemented, IOException, JiBXException {
|
|
1213 |
protected void getObject(String pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, InvalidRequest, NotImplemented, IOException, MarshallingException {
|
|
1214 | 1214 |
OutputStream out = null; |
1215 | 1215 |
|
1216 | 1216 |
if (pid != null) { //get a specific document |
... | ... | |
1417 | 1417 |
|
1418 | 1418 |
protected void publish(String pid) throws InvalidToken, ServiceFailure, |
1419 | 1419 |
NotAuthorized, NotFound, NotImplemented, IOException, |
1420 |
JiBXException, InvalidRequest, IdentifierNotUnique,
|
|
1420 |
MarshallingException, InvalidRequest, IdentifierNotUnique,
|
|
1421 | 1421 |
UnsupportedType, InsufficientResources, InvalidSystemMetadata { |
1422 | 1422 |
|
1423 | 1423 |
// publish the object |
... | ... | |
1443 | 1443 |
* @throws InvalidRequest |
1444 | 1444 |
* @throws NotImplemented |
1445 | 1445 |
* @throws IOException |
1446 |
* @throws JiBXException
|
|
1446 |
* @throws MarshallingException
|
|
1447 | 1447 |
*/ |
1448 |
protected void getSystemMetadataObject(String pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, InvalidRequest, NotImplemented, IOException, JiBXException {
|
|
1448 |
protected void getSystemMetadataObject(String pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, InvalidRequest, NotImplemented, IOException, MarshallingException {
|
|
1449 | 1449 |
|
1450 | 1450 |
Identifier id = new Identifier(); |
1451 | 1451 |
id.setValue(pid); |
... | ... | |
1467 | 1467 |
* is the existing pid. If insert, the pid is the new one |
1468 | 1468 |
* @throws InvalidRequest |
1469 | 1469 |
* @throws ServiceFailure |
1470 |
* @throws JiBXException
|
|
1470 |
* @throws MarshallingException
|
|
1471 | 1471 |
* @throws NotImplemented |
1472 | 1472 |
* @throws InvalidSystemMetadata |
1473 | 1473 |
* @throws InsufficientResources |
... | ... | |
1480 | 1480 |
* @throws IllegalAccessException |
1481 | 1481 |
* @throws InstantiationException |
1482 | 1482 |
*/ |
1483 |
protected void putObject(String trailingPid, String action) throws ServiceFailure, InvalidRequest, JiBXException, InvalidToken, NotAuthorized, IdentifierNotUnique, UnsupportedType, InsufficientResources, InvalidSystemMetadata, NotImplemented, NotFound, IOException, InstantiationException, IllegalAccessException {
|
|
1483 |
protected void putObject(String trailingPid, String action) throws ServiceFailure, InvalidRequest, MarshallingException, InvalidToken, NotAuthorized, IdentifierNotUnique, UnsupportedType, InsufficientResources, InvalidSystemMetadata, NotImplemented, NotFound, IOException, InstantiationException, IllegalAccessException {
|
|
1484 | 1484 |
|
1485 | 1485 |
// Read the incoming data from its Mime Multipart encoding |
1486 | 1486 |
Map<String, File> files = collectMultipartFiles(); |
... | ... | |
1570 | 1570 |
* @throws NotAuthorized |
1571 | 1571 |
* @throws ServiceFailure |
1572 | 1572 |
* @throws InvalidToken |
1573 |
* @throws JiBXException
|
|
1573 |
* @throws MarshallingException
|
|
1574 | 1574 |
*/ |
1575 |
private void deleteObject(String pid) throws IOException, InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented, InvalidRequest, JiBXException
|
|
1575 |
private void deleteObject(String pid) throws IOException, InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented, InvalidRequest, MarshallingException
|
|
1576 | 1576 |
{ |
1577 | 1577 |
|
1578 | 1578 |
OutputStream out = response.getOutputStream(); |
... | ... | |
1597 | 1597 |
* @throws NotFound |
1598 | 1598 |
* @throws NotImplemented |
1599 | 1599 |
* @throws IOException |
1600 |
* @throws JiBXException
|
|
1600 |
* @throws MarshallingException
|
|
1601 | 1601 |
*/ |
1602 |
private void archive(String pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented, IOException, JiBXException {
|
|
1602 |
private void archive(String pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented, IOException, MarshallingException {
|
|
1603 | 1603 |
|
1604 | 1604 |
OutputStream out = response.getOutputStream(); |
1605 | 1605 |
response.setStatus(200); |
... | ... | |
1615 | 1615 |
|
1616 | 1616 |
} |
1617 | 1617 |
|
1618 |
protected SynchronizationFailed collectSynchronizationFailed() throws IOException, ServiceFailure, InvalidRequest, JiBXException, InstantiationException, IllegalAccessException, ParserConfigurationException, SAXException {
|
|
1618 |
protected SynchronizationFailed collectSynchronizationFailed() throws IOException, ServiceFailure, InvalidRequest, MarshallingException, InstantiationException, IllegalAccessException, ParserConfigurationException, SAXException {
|
|
1619 | 1619 |
|
1620 | 1620 |
// Read the incoming data from its Mime Multipart encoding |
1621 | 1621 |
logMetacat.debug("Disassembling MIME multipart form"); |
... | ... | |
1662 | 1662 |
* @throws InstantiationException |
1663 | 1663 |
* @throws IllegalAccessException |
1664 | 1664 |
* @throws IOException |
1665 |
* @throws JiBXException
|
|
1665 |
* @throws MarshallingException
|
|
1666 | 1666 |
* @throws NotImplemented |
1667 | 1667 |
* @throws NotAuthorized |
1668 | 1668 |
* @throws InvalidSystemMetadata |
1669 | 1669 |
* @throws InvalidToken |
1670 | 1670 |
*/ |
1671 | 1671 |
protected void updateSystemMetadata() throws ServiceFailure, InvalidRequest, |
1672 |
InstantiationException, IllegalAccessException, IOException, JiBXException, NotImplemented,
|
|
1672 |
InstantiationException, IllegalAccessException, IOException, MarshallingException, NotImplemented,
|
|
1673 | 1673 |
NotAuthorized, InvalidSystemMetadata, InvalidToken { |
1674 | 1674 |
// Read the incoming data from its Mime Multipart encoding |
1675 | 1675 |
Map<String, File> files = collectMultipartFiles(); |
Also available in: Unified diff
Replaced the JiBXException by MarshallingException.