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); } } }
/** * Create an instance of {@link RegistryError } * */ public RegistryError createRegistryError() { return new RegistryError(); }
private AdhocQueryResponse addHomeCommunityId(AdhocQueryResponse rsp) { String home = XdsDevice.getXCARespondingGW().getHomeCommunityID(); IdentifiableType obj; if (rsp.getRegistryObjectList() != null) { List<JAXBElement<? extends IdentifiableType>> objList = rsp.getRegistryObjectList().getIdentifiable(); for (int i = 0, len = objList.size() ; i < len ; i++ ) { obj = objList.get(i).getValue(); if (obj.getHome() == null && ((obj instanceof ExtrinsicObjectType) || (obj instanceof RegistryPackageType) || obj instanceof ObjectRefType)) { obj.setHome(home); } } } if (rsp.getRegistryErrorList() != null) { for ( RegistryError err : rsp.getRegistryErrorList().getRegistryError()) { if (err.getLocation() == null) err.setLocation(home); } } return rsp; }
if (!XDSException.XDS_ERR_UNKNOWN_PATID.equals(err.getErrorCode())) errors.add(err);
private AdhocQueryResponse addHomeCommunityId(AdhocQueryResponse rsp) { String home = XdsDevice.getXCARespondingGW().getHomeCommunityID(); IdentifiableType obj; if (rsp.getRegistryObjectList() != null) { List<JAXBElement<? extends IdentifiableType>> objList = rsp.getRegistryObjectList().getIdentifiable(); for (int i = 0, len = objList.size() ; i < len ; i++ ) { obj = objList.get(i).getValue(); if ((obj instanceof ExtrinsicObjectType) || (obj instanceof RegistryPackageType) || obj instanceof ObjectRefType) { obj.setHome(home); } } } if (rsp.getRegistryErrorList() != null) { for ( RegistryError err : rsp.getRegistryErrorList().getRegistryError()) { err.setLocation(home); } } return rsp; }
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; }
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; }