Loading src/main/java/net/ivoa/xml/uws/v1/ErrorSummaryFactory.java 0 → 100644 +58 −0 Original line number Diff line number Diff line package net.ivoa.xml.uws.v1; public class ErrorSummaryFactory { public static ErrorSummary newErrorSummary(VOSpaceFault error) { ErrorSummary result = new ErrorSummary(); result.setMessage(error.getFaultRepresentation()); result.setType(error.getType()); // Set to false since /error endpoint is not supported yet result.setHasDetail(false); return result; } // NFC: ErrorType usage is not covered in documentation, as far as I can see // these are tentative default values. public enum VOSpaceFault { // pushto OPERATION_NOT_SUPPORTED("OperationNotSupported", ErrorType.FATAL), INTERNAL_FAULT("InternalFault", ErrorType.TRANSIENT), PERMISSION_DENIED("PermissionDenied", ErrorType.FATAL), VIEW_NOT_SUPPORTED("ViewNotSupported", ErrorType.FATAL), PROTOCOL_NOT_SUPPORTED("ProtocolNotSupported", ErrorType.FATAL), INVALID_ARGUMENT("InvalidArgument", ErrorType.FATAL), NODE_BUSY("NodeBusy", ErrorType.TRANSIENT), // additional for pullto INVALID_URI("InvalidURI", ErrorType.FATAL), INVALID_DATA("InvalidData", ErrorType.FATAL), // additional for pullfrom NODE_NOT_FOUND("NodeNotFound", ErrorType.FATAL), // additional for pushfrom TRANSFER_FAILED("TransferFailed", ErrorType.FATAL), // additional for movenode/copynode DUPLICATE_NODE("DuplicateNode", ErrorType.FATAL); private final String faultRepresentation; private final ErrorType type; private VOSpaceFault(String faultRepresentation, ErrorType type) { this.faultRepresentation = faultRepresentation; this.type = type; } public String getFaultRepresentation() { return this.faultRepresentation; } public ErrorType getType() { return this.type; } } } Loading
src/main/java/net/ivoa/xml/uws/v1/ErrorSummaryFactory.java 0 → 100644 +58 −0 Original line number Diff line number Diff line package net.ivoa.xml.uws.v1; public class ErrorSummaryFactory { public static ErrorSummary newErrorSummary(VOSpaceFault error) { ErrorSummary result = new ErrorSummary(); result.setMessage(error.getFaultRepresentation()); result.setType(error.getType()); // Set to false since /error endpoint is not supported yet result.setHasDetail(false); return result; } // NFC: ErrorType usage is not covered in documentation, as far as I can see // these are tentative default values. public enum VOSpaceFault { // pushto OPERATION_NOT_SUPPORTED("OperationNotSupported", ErrorType.FATAL), INTERNAL_FAULT("InternalFault", ErrorType.TRANSIENT), PERMISSION_DENIED("PermissionDenied", ErrorType.FATAL), VIEW_NOT_SUPPORTED("ViewNotSupported", ErrorType.FATAL), PROTOCOL_NOT_SUPPORTED("ProtocolNotSupported", ErrorType.FATAL), INVALID_ARGUMENT("InvalidArgument", ErrorType.FATAL), NODE_BUSY("NodeBusy", ErrorType.TRANSIENT), // additional for pullto INVALID_URI("InvalidURI", ErrorType.FATAL), INVALID_DATA("InvalidData", ErrorType.FATAL), // additional for pullfrom NODE_NOT_FOUND("NodeNotFound", ErrorType.FATAL), // additional for pushfrom TRANSFER_FAILED("TransferFailed", ErrorType.FATAL), // additional for movenode/copynode DUPLICATE_NODE("DuplicateNode", ErrorType.FATAL); private final String faultRepresentation; private final ErrorType type; private VOSpaceFault(String faultRepresentation, ErrorType type) { this.faultRepresentation = faultRepresentation; this.type = type; } public String getFaultRepresentation() { return this.faultRepresentation; } public ErrorType getType() { return this.type; } } }