public static void initializeRegistry(List<String> filenames, boolean defaultInit, DocumentRegistryPortType docRegistry) { for (String fn : filenames) { SubmitObjectsRequest req; try { req = getSubmitObjectsRequest(fn, defaultInit); } catch (FileNotFoundException | JAXBException e) { throw new RuntimeException(e); } RegistryResponseType rsp = docRegistry.documentRegistryRegisterDocumentSetB(req); if (!"urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Success".equals(rsp.getStatus())){ String errorMsg = ""; int i = 1; for (RegistryError err : rsp.getRegistryErrorList().getRegistryError()) { errorMsg += (i++)+") "+err.getErrorCode()+" : "+err.getCodeContext()+"\n"; } throw new RuntimeException(errorMsg); } } }
private RetrieveDocumentSetResponseType addHomeCommunityID(RetrieveDocumentSetResponseType rsp) { String home = XdsDevice.getXCARespondingGW().getHomeCommunityID(); if (rsp.getDocumentResponse() != null) { for (DocumentResponse docRsp : rsp.getDocumentResponse()) { docRsp.setHomeCommunityId(home); } } RegistryResponseType regRsp = rsp.getRegistryResponse(); if (regRsp != null && regRsp.getRegistryErrorList() != null) { for ( RegistryError err : regRsp.getRegistryErrorList().getRegistryError()) { err.setLocation(home); } } return rsp; }
private RetrieveDocumentSetResponseType addResponse(RetrieveDocumentSetResponseType rsp, RetrieveDocumentSetResponseType tmpRsp) { if (tmpRsp == null) { return rsp; } if (rsp == null) { return tmpRsp; } else { if (tmpRsp.getDocumentResponse() != null) rsp.getDocumentResponse().addAll(tmpRsp.getDocumentResponse()); if (tmpRsp.getRegistryResponse() != null) { RegistryErrorList errs = tmpRsp.getRegistryResponse().getRegistryErrorList(); if (errs != null && errs.getRegistryError().size() > 0) { RegistryErrorList rspErr = rsp.getRegistryResponse().getRegistryErrorList(); if (rspErr == null) { rsp.getRegistryResponse().setRegistryErrorList(errs); } else { rspErr.getRegistryError().addAll(errs.getRegistryError()); } } } } return rsp; }
rsp.getDocumentResponse().addAll(tmpRsp.getDocumentResponse()); if (tmpRsp.getRegistryResponse() != null) { RegistryErrorList errs = tmpRsp.getRegistryResponse().getRegistryErrorList(); if (errs != null && errs.getRegistryError().size() > 0) { RegistryErrorList rspErr = rsp.getRegistryResponse().getRegistryErrorList(); if (rspErr == null) { rsp.getRegistryResponse().setRegistryErrorList(errs);
private RetrieveDocumentSetResponseType addHomeCommunityID(RetrieveDocumentSetResponseType rsp) { String home = XdsDevice.getXCARespondingGW().getHomeCommunityID(); if (rsp.getDocumentResponse() != null) { for (DocumentResponse docRsp : rsp.getDocumentResponse()) { if (docRsp.getHomeCommunityId() == null) docRsp.setHomeCommunityId(home); } } RegistryResponseType regRsp = rsp.getRegistryResponse(); if (regRsp != null && regRsp.getRegistryErrorList() != null) { for ( RegistryError err : regRsp.getRegistryErrorList().getRegistryError()) { if (err.getLocation() == null) err.setLocation(home); } } return rsp; }
rsp.setRegistryResponse(regRsp); if (regRsp.getRegistryErrorList() == null || regRsp.getRegistryErrorList().getRegistryError().isEmpty()) { regRsp.setStatus(XDSConstants.XDS_B_STATUS_SUCCESS); } else if (rsp.getDocumentResponse() == null || rsp.getDocumentResponse().isEmpty()) {