@Override public DispositionReport notifySubscriptionListener(NotifySubscriptionListener body) throws DispositionReportFaultMessage, RemoteException { for (int i = 0; i < callbacks.size(); i++) { try { callbacks.get(i).handleCallback(body.getSubscriptionResultsList()); } catch (Exception ex) { log.warn("Your implementation on ISubscriptionCallback is faulty and threw an error, contact the developer", ex); } } DispositionReport r = new DispositionReport(); r.getResult().add(new Result()); return r; } }
private void checkForErrorInDispositionReport(DispositionReport report, String Error, String entityKey) { if (entityKey != null && report != null && report.countainsErrorCode(DispositionReport.E_INVALID_KEY_PASSED)) { log.info("entityKey " + entityKey + " was not found in the registry"); } else { if (report == null) { log.info("Missing DispositionReport"); } else { for (Result result : report.getResult()) { log.error(result.getErrInfo().getErrCode() + " " + result.getErrInfo().getValue()); } } } }
public static DispositionReportFaultMessage MapException(SOAPFaultException ex) { org.uddi.api_v3.DispositionReport r = new org.uddi.api_v3.DispositionReport(); r.setTruncated(false); r.getResult().addAll(MapFault(ex.getFault())); DispositionReportFaultMessage x = new DispositionReportFaultMessage(ex.getMessage(), r); return x; }
/** * Create an instance of {@link DispositionReport } * */ public DispositionReport createDispositionReport() { return new DispositionReport(); }
/** * * @param node * @throws JAXBException */ public DispositionReport(Node node) throws JAXBException { super(); JAXBContextUtil.getContext(this.getClass().getPackage().getName()); Unmarshaller u = JAXBContextUtil.getContext( this.getClass().getPackage().getName()).createUnmarshaller(); JAXBElement<DispositionReport> element = u.unmarshal(node, DispositionReport.class); this.result = element.getValue().getResult(); this.truncated = element.getValue().truncated; }
public void getNonExitingBusiness() { String nonExistingKey = "nonexistingKey"; try { GetBusinessDetail body = new GetBusinessDetail(); body.getBusinessKey().add(nonExistingKey); BusinessDetail result = inquiry.getBusinessDetail(body); Assert.fail("No business should be found"); System.out.println(result.getBusinessEntity().size()); } catch (Exception e) { try { System.out.println("(Expected) Error message = " + e.getMessage()); DispositionReport report = DispositionReportFaultMessage.getDispositionReport(e); assertNotNull(report); assertTrue(report.countainsErrorCode(DispositionReport.E_INVALID_KEY_PASSED)); } catch (Exception e1) { Assert.fail("We only expect DispositionReportFaultMessage, not " + e1.getClass()); logger.error(e.getMessage(), e1); } } }
/** * @exception RegistryV3Exception; */ public DispositionReport deletePublisherAssertions(String authInfo, PublisherAssertion[] assertionArray) throws RegistryV3Exception { DeletePublisherAssertions request = this.objectFactory.createDeletePublisherAssertions(); if (authInfo != null) { request.setAuthInfo(authInfo); } if (assertionArray != null) { request.getPublisherAssertion().addAll(Arrays.asList(assertionArray)); } DispositionReport dr = new DispositionReport(); JAXBElement<?> o = execute(this.objectFactory.createDeletePublisherAssertions(request), this.getPublishURI()); if (o!=null) { dr = (DispositionReport) o.getValue(); } return dr; }
/** * Determines if one of the Results in the this DispositionReport has a Error Code * that matches the errCodeKey passed in. The errCodeKey should be one * of the * * @param errCodeKey * @return true if the errCodeKey matches with a code in the Results. */ public boolean countainsErrorCode(final String errCodeKey) { boolean isKeyMatch = false; for (Result result : getResult()) { String errCode = result.getErrInfo().getErrCode(); if (errCodeKey.equals(errCode)) { isKeyMatch = true; break; } } return isKeyMatch; }
public DispositionReport notifySubscriptionListener( NotifySubscriptionListener body) throws DispositionReportFaultMessage { try { JAXBContext context = JAXBContext.newInstance(body.getClass()); Marshaller marshaller = context.createMarshaller(); StringWriter sw = new StringWriter(); marshaller.marshal(body, sw); if (TckCommon.isDebug()) { logger.info("Notification received by UDDISubscriptionListenerService : " + sw.toString()); } else { logger.info("Notification received by UDDISubscriptionListenerService"); } //Adding the received subscription XML to a Map. notifcationMap.put(notificationCount++, sw.toString()); } catch (Exception e) { e.printStackTrace(); } DispositionReport dr = new DispositionReport(); Result res = new Result(); dr.getResult().add(res); return dr; } }
/** * "Used to delete registered businessEntity information from the registry." * * @exception RegistryV3Exception; */ public DispositionReport deleteBusiness(String authInfo, String[] businessKeyArray) throws RegistryV3Exception { DeleteBusiness request = this.objectFactory.createDeleteBusiness(); if (authInfo != null) { request.setAuthInfo(authInfo); } if (businessKeyArray != null) { request.getBusinessKey().addAll(Arrays.asList(businessKeyArray)); } DispositionReport dr = new DispositionReport(); JAXBElement<?> o = execute(this.objectFactory.createDeleteBusiness(request), this.getPublishURI()); if (o!=null){ dr = (DispositionReport) o.getValue(); } return dr; }
public static DispositionReportFaultMessage MapException(DispositionReport ex) { org.uddi.api_v3.DispositionReport r = new org.uddi.api_v3.DispositionReport(); r.setTruncated(ex.getFaultInfo().getTruncated() == Truncated.TRUE); r.getResult().addAll(MapResult(ex.getFaultInfo().getResult())); DispositionReportFaultMessage x = new DispositionReportFaultMessage(ex.getMessage(), r); return x; }
private static String dispositionReportFaultMessageToString(DispositionReportFaultMessage f) { StringBuilder err = new StringBuilder(); if (f != null && f.getFaultInfo() != null) { for (int i = 0; i < f.getFaultInfo().getResult().size(); i++) { err.append("Error number" + f.getFaultInfo().getResult().get(i).getErrno()); if (f.getFaultInfo().getResult().get(i).getKeyType() != null) { err.append(" keytype " + f.getFaultInfo().getResult().get(i).getKeyType().value()); } if (f.getFaultInfo().getResult().get(i).getErrInfo() != null) { err.append( " errocode " + f.getFaultInfo().getResult().get(i).getErrInfo().getErrCode() + " msg " + f.getFaultInfo().getResult().get(i).getErrInfo().getValue()); } } } return err.toString(); } }
DispositionReport dr = new DispositionReport(); Result res = new Result(); dr.getResult().add(res); return dr;
/** * "Used to remove an existing bindingTemplate from the bindingTemplates * collection that is part of a specified businessService structure." * * @exception RegistryV3Exception; */ public DispositionReport deleteBinding(String authInfo, String[] bindingKeyArray) throws RegistryV3Exception { DeleteBinding request = this.objectFactory.createDeleteBinding(); if (authInfo != null) { request.setAuthInfo(authInfo); } if (bindingKeyArray != null) { request.getBindingKey().addAll(Arrays.asList(bindingKeyArray)); } DispositionReport dr = new DispositionReport(); JAXBElement<?> o = execute(this.objectFactory.createDeleteBinding(request), this.getPublishURI()); if (o!=null) { dr = (DispositionReport) o.getValue(); } return dr; }
private static org.uddi.api_v2.DispositionReport MapDispositionReport(org.uddi.api_v3.DispositionReport faultInfo, String operator) { if (faultInfo == null) { return null; } org.uddi.api_v2.DispositionReport r = new org.uddi.api_v2.DispositionReport(); r.setGeneric(VERSION); r.setOperator(operator); r.setTruncated(Truncated.FALSE); r.getResult().addAll(MapResults(faultInfo.getResult())); return r; }
DispositionReport dr = new DispositionReport(); Result res = new Result(); dr.getResult().add(res);
/** * "Used to delete an existing businessService from the businessServices * collection that is part of a specified businessEntity." * * @exception RegistryV3Exception; */ public DispositionReport deleteService(String authInfo, String[] serviceKeyArray) throws RegistryV3Exception { DeleteService request = this.objectFactory.createDeleteService(); if (authInfo != null) { request.setAuthInfo(authInfo); } if (serviceKeyArray != null) { request.getServiceKey().addAll(Arrays.asList(serviceKeyArray)); } DispositionReport dr = new DispositionReport(); JAXBElement<?> o = execute(this.objectFactory.createDeleteService(request), this.getPublishURI()); if (o!=null) { dr = (DispositionReport) o.getValue(); } return dr; }
List<Result> resultList = bd.getResult(); keyResultArr = new Result[resultList.size()]; resultList.toArray(keyResultArr);
DispositionReport dr = new DispositionReport(); Result res = new Result(); dr.getResult().add(res);
/** * "Used to delete registered information about a tModel. If there are any * references to a tModel when this call is made, the tModel will be marked * deleted instead of being physically removed." * * @exception RegistryV3Exception; */ public DispositionReport deleteTModel(String authInfo, String[] tModelKeyArray) throws RegistryV3Exception { DeleteTModel request = this.objectFactory.createDeleteTModel(); if (authInfo != null) { request.setAuthInfo(authInfo); } if (tModelKeyArray != null) { request.getTModelKey().addAll(Arrays.asList(tModelKeyArray)); } DispositionReport dr = new DispositionReport(); JAXBElement<?> o = execute(this.objectFactory.createDeleteTModel(request), this.getPublishURI()); if (o!=null) { dr = (DispositionReport) o.getValue(); } return dr; }