use of org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType in project ddf by codice.
the class CswExceptionMapper method createServiceException.
private ExceptionReport createServiceException(CswException cswException) {
ExceptionReport exceptionReport = new ExceptionReport();
exceptionReport.setVersion(SERVICE_EXCEPTION_REPORT_VERSION);
ExceptionType exception = new ExceptionType();
exception.setExceptionCode(cswException.getExceptionCode());
exception.setLocator(cswException.getLocator());
exception.getExceptionText().add(cswException.getMessage());
exceptionReport.getException().add(exception);
return exceptionReport;
}
use of org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType in project ddf by codice.
the class WfsResponseExceptionMapper method convertToWfsException.
private WfsException convertToWfsException(ExceptionReport report) {
WfsException wfsException = null;
List<ExceptionType> list = report.getException();
if (!list.isEmpty()) {
Collections.reverse(list);
for (ExceptionType exceptionType : list) {
String exceptionCode = exceptionType.getExceptionCode();
String locator = exceptionType.getLocator();
List<String> exceptionText = exceptionType.getExceptionText();
StringBuilder exceptionMsg = new StringBuilder();
// Exception code is required per CSW schema, but check it anyway
if (StringUtils.isNotBlank(exceptionCode)) {
exceptionMsg.append("exceptionCode = " + exceptionCode + "\n");
} else {
exceptionMsg.append("exceptionCode = UNSPECIFIED");
}
// Locator and exception text(s) are both optional
if (StringUtils.isNotBlank(locator)) {
exceptionMsg.append("locator = " + locator + "\n");
}
if (!CollectionUtils.isEmpty(exceptionText)) {
for (String text : exceptionText) {
exceptionMsg.append(text);
}
}
wfsException = new WfsException(exceptionMsg.toString());
}
if (null == wfsException) {
wfsException = new WfsException("Empty Service Exception Report (version = " + report.getVersion() + ")");
}
} else {
wfsException = new WfsException("Empty Service Exception Report (version = " + report.getVersion() + ")");
}
return wfsException;
}
use of org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType in project tesb-rt-se by Talend.
the class LibraryServerImpl method prepareException.
private SeekBookError prepareException(String message) {
ExceptionType exception = new ExceptionType();
exception.setOperation("seekBook");
exception.setServiceName("LibraryService");
exception.setExceptionText(message);
ExceptionFrame frame = new ExceptionFrame();
frame.getException().add(exception);
return new SeekBookError("Book not found", frame);
}
use of org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType in project tesb-rt-se by Talend.
the class LibraryServerImpl method prepareException.
private SeekBookError prepareException(String message) {
ExceptionType exception = new ExceptionType();
exception.setOperation("seekBook");
exception.setServiceName("LibraryService");
exception.setExceptionText(message);
ExceptionFrame frame = new ExceptionFrame();
frame.getException().add(exception);
return new SeekBookError("Book not found", frame);
}
use of org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType in project tesb-rt-se by Talend.
the class LibraryServerImpl method prepareException.
private SeekBookError prepareException(String message) {
ExceptionType exception = new ExceptionType();
exception.setOperation("seekBook");
exception.setServiceName("LibraryService");
exception.setExceptionText(message);
ExceptionFrame frame = new ExceptionFrame();
frame.getException().add(exception);
return new SeekBookError("Book not found", frame);
}
Aggregations