/** * * @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 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; } }
/** * 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; }
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(); } }
@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; } }
dr.getResult().add(res); return dr;
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()); } } } }
dr.getResult().add(res);
dr.getResult().add(res);
dr.getResult().add(res);
dr.getResult().add(res);
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; }
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; }
List<Result> resultList = bd.getResult(); keyResultArr = new Result[resultList.size()]; resultList.toArray(keyResultArr);
public static final DispositionReport buildDispositionReport(int errNo) { DispositionReport dr = new DispositionReport(); Result res = new Result(); res.setErrno(errNo); ErrInfo ei = new ErrInfo(); ei.setErrCode(lookupErrCode(errNo)); ei.setValue(lookupErrText(errNo)); res.setErrInfo(ei); dr.getResult().add(res); return dr; } }
public static final DispositionReport buildDispositionReport(int errNo) { DispositionReport dr = new DispositionReport(); Result res = new Result(); res.setErrno(errNo); ErrInfo ei = new ErrInfo(); ei.setErrCode(lookupErrCode(errNo)); ei.setValue(lookupErrText(errNo)); res.setErrInfo(ei); dr.getResult().add(res); 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; }
dr.getResult().add(res); return dr;
dr.getResult().add(res); return dr;
/** * Adds a result instance to this Exception. Multiple result objects * may exist within a DispositionReport */ public void addResult(Result result) { if (this.dispReport==null) { this.dispReport = this.objectFactory.createDispositionReport(); } Result jaxbResult = this.objectFactory.createResult(); this.dispReport.getResult().add(jaxbResult); if (result.getErrInfo() != null) jaxbResult.setErrInfo(result.getErrInfo()); if (result.getKeyType() != null) jaxbResult.setKeyType(result.getKeyType()); jaxbResult.setErrno(result.getErrno()); }