public boolean hasError() { for (RegistryError e : errors) { if (e.isError()) return true; } return false; }
public void validate(ErrorRecorder er, ValidationContext vc) { for (RegistryError re : errors) { re.validate(er, vc); } } }
public AdhocQueryRequest getAdhocQueryRequest() throws Exception { parse(); return request; }
boolean passOnErrors(MessageValidatorEngine mvc, OMElement result) throws XdsInternalException { AdhocQueryResponseParser aqrp = new AdhocQueryResponseParser(result); gov.nist.toolkit.registrymsg.registry.AdhocQueryResponse aqr = aqrp.getResponse(); if (!aqr.isSuccess()) { RegistryErrorListGenerator relg = new RegistryErrorListGenerator(); relg.addRegistryErrorList(aqr.getRegistryErrorListEle(), null); dsSimCommon.setRegistryErrorListGenerator(relg); mvc.addMessageValidator("Send RegistryResponse with errors", new RegistryResponseSendingSim(common, dsSimCommon), er); mvc.run(); return true; } return false; }
void parse() throws XdsInternalException { response = new RegistryResponse(); response.success = is_error(); response.topElement = response_element; OMElement registry_error_list = null; if (response_element.getLocalName().equals("RegistryErrorList")) registry_error_list = response_element; else registry_error_list = XmlUtil.firstChildWithLocalName(response_element, "RegistryErrorList") ; if (registry_error_list == null) return; response.registryErrorList = new RegistryErrorListParser(registry_error_list).getRegistryErrorList(); }
protected boolean scanResponseForErrors() throws XdsInternalException { if (s_ctx.getExpectedStatus().size()==1 && s_ctx.getExpectedStatus().get(0).isSuccess()) { RegistryResponseParser registry_response = new RegistryResponseParser(getSoapResult()); List<String> errs = registry_response.get_regrep_error_msgs(); if (errs.size() > 0) { logger.info("Received errors in response"); for (String err : errs) s_ctx.set_error(err); failed(); return false; } } return true; }
public boolean is_error() throws XdsInternalException { String status = get_registry_response_status(); return ! status.endsWith("Success"); }
public String get_regrep_error_msg() { List<String> msgs = get_regrep_error_msgs(); StringBuilder buf = new StringBuilder(); for (String x : msgs) buf.append(x); return buf.toString(); }
public RegistryErrorListParser(OMElement registryErrorListEle) { if (registryErrorListEle == null) return; if (!registryErrorListEle.getLocalName().equals("RegistryErrorList")) { registryErrorListEle = XmlUtil.firstDecendentWithLocalName(registryErrorListEle, "RegistryErrorList"); if (registryErrorListEle == null) return; } for (OMElement registry_error : XmlUtil.childrenWithLocalName(registryErrorListEle, "RegistryError")) { RegistryError registryError = new RegistryError(); registryErrorList.add(registryError); String severity = get_att(registry_error, "severity"); if (severity == null) registryError.isWarning = false; else if (severity.endsWith("Warning")) registryError.isWarning = true; else registryError.isWarning = false; registryError.codeContext = get_att(registry_error, "codeContext"); registryError.errorCode = get_att(registry_error, "errorCode"); registryError.location = get_att(registry_error, "location"); } }
public AdhocQueryResponseParser(OMElement ele) throws XdsInternalException { this.ele = ele; response.ele = ele; response.status = ele.getAttributeValue(MetadataSupport.status_qname); response.registryErrorList = new RegistryErrorListParser(ele).getRegistryErrorList(); response.registryObjectListEle = XmlUtil.firstDecendentWithLocalName(ele, "RegistryObjectList"); response.registryErrorListEle = XmlUtil.firstDecendentWithLocalName(ele, "RegistryErrorList"); }
setLocationForXCA(); return getRoot();
public Response(RegistryErrorListGenerator rel) throws XdsInternalException { init(version_3, rel); }
public RegistryResponse getRegistryResponse(List<ValidationStepResult> results) throws XdsInternalException { RegistryErrorListGenerator rel = getRegistryErrorList(results); RegistryResponse rr = new RegistryResponse(Response.version_3, rel); return rr; }
public RegistryResponse getRegistryResponse() throws XdsInternalException { parse(); return response; }
public RegistryErrorList(OMElement xml) { if (xml == null || !"RegistryErrorList".equals(xml.getLocalName())) return; for (OMElement re : XmlUtil.childrenWithLocalName(xml, "RegistryError")) { errors.add(new RegistryError(re)); } }
private void returnRetrieveError() { mvc.run(); Response response = null; try { response = dsSimCommon.getRegistryResponse(); er.detail("Wrapping response in RetrieveDocumentSetResponse and then SOAP Message"); OMElement rdsr = dsSimCommon.wrapResponseInRetrieveDocumentSetResponse(response.getResponse()); OMElement env = dsSimCommon.wrapResponseInSoapEnvelope(rdsr); dsSimCommon.sendHttpResponse(env, er); } catch (Exception e) { } }
public Response(short version, RegistryErrorListGenerator rel) throws XdsInternalException { init(version, rel); }
public UnknownSim(SimCommon common) { super(common, null); // build response try { response = new RegistryResponse(Response.version_3); } catch (Exception e) { System.out.println(ExceptionUtil.exception_details(e)); startUpException = e; return; } }
public Response() throws XdsInternalException { init(version_3, new RegistryErrorListGenerator(version_3, true /* log */)); }
public Response(short version) throws XdsInternalException { init(version, new RegistryErrorListGenerator(version, true /* log */)); }