Search in sources :

Example 1 with RegistryError

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;
}
Also used : RegistryError(oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryError) SafeThreadData(org.nhindirect.xd.soap.SafeThreadData) RegistryErrorList(oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryErrorList) RegistryErrorList(oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryErrorList) List(java.util.List) RegistryResponseType(oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType)

Aggregations

List (java.util.List)1 RegistryError (oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryError)1 RegistryErrorList (oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryErrorList)1 RegistryResponseType (oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType)1 SafeThreadData (org.nhindirect.xd.soap.SafeThreadData)1