use of oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryError in project nhin-d by DirectProject.
the class XDR method documentRepositoryProvideAndRegisterDocumentSetB.
/*
* (non-Javadoc)
*
* @see org.nhind.xdr.DocumentRepositoryAbstract#documentRepositoryProvideAndRegisterDocumentSetB(ihe.iti.xds_b._2007.ProvideAndRegisterDocumentSetRequestType)
*/
public RegistryResponseType documentRepositoryProvideAndRegisterDocumentSetB(ProvideAndRegisterDocumentSetRequestType body) {
RegistryResponseType resp = null;
/**
* Get thread data
*/
Long threadID = Thread.currentThread().getId();
SafeThreadData threadData = SafeThreadData.GetThreadInstance(threadID);
try {
resp = provideAndRegisterDocumentSet(body, threadData);
} catch (Exception x) {
threadData.setRelatesTo(threadData.getMessageId());
threadData.setAction("urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-bResponse");
threadData.setMessageId(UUID.randomUUID().toString());
threadData.setTo(threadData.getEndpoint());
threadData.save();
resp = new RegistryResponseType();
resp.setStatus("urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Failure");
RegistryErrorList rel = new RegistryErrorList();
String error = x.getMessage();
if (error == null) {
error = x.toString();
}
rel.setHighestSeverity(error);
List<RegistryError> rl = rel.getRegistryError();
RegistryError re = new RegistryError();
String[] mess;
if (error.contains(":"))
mess = error.split(":");
else
mess = error.split(" ");
String errorCode = mess[0];
re.setErrorCode(errorCode);
re.setSeverity("Error");
re.setCodeContext(error);
re.setLocation("XDR.java");
re.setValue(error);
rl.add(re);
resp.setRegistryErrorList(rel);
}
return resp;
}
Aggregations