/** * Parse the attributes at the authnrequesttype element * @param startElement * @return * @throws ParsingException */ private ArtifactResolveType parseBaseAttributes(StartElement startElement) throws ParsingException { super.parseRequiredAttributes(startElement); ArtifactResolveType authnRequest = new ArtifactResolveType(id, issueInstant); //Let us get the attributes super.parseBaseAttributes(startElement, authnRequest); return authnRequest; } }
StaxUtil.writeAttribute(writer, JBossSAMLConstants.ID.get(), request.getID()); StaxUtil.writeAttribute(writer, JBossSAMLConstants.VERSION.get(), request.getVersion()); StaxUtil.writeAttribute(writer, JBossSAMLConstants.ISSUE_INSTANT.get(), request.getIssueInstant().toString()); URI destination = request.getDestination(); if (destination != null) StaxUtil.writeAttribute(writer, JBossSAMLConstants.DESTINATION.get(), destination.toASCIIString()); String consent = request.getConsent(); if (StringUtil.isNotNull(consent)) StaxUtil.writeAttribute(writer, JBossSAMLConstants.CONSENT.get(), consent); NameIDType issuer = request.getIssuer(); if (issuer != null) { write(issuer, new QName(ASSERTION_NSURI.get(), JBossSAMLConstants.ISSUER.get(), ASSERTION_PREFIX)); Element sig = request.getSignature(); if (sig != null) { StaxUtil.writeDOMElement(writer, sig); String artifact = request.getArtifact(); if (StringUtil.isNotNull(artifact)) { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.ARTIFACT.get(), PROTOCOL_NSURI.get());
public Object parse(XMLEventReader xmlEventReader) throws ParsingException { // Get the startelement StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader); StaxParserUtil.validate(startElement, JBossSAMLConstants.ARTIFACT_RESOLVE.get()); ArtifactResolveType artifactResolve = parseBaseAttributes(startElement); while (xmlEventReader.hasNext()) { // Let us peek at the next start element startElement = StaxParserUtil.peekNextStartElement(xmlEventReader); if (startElement == null) break; super.parseCommonElements(startElement, xmlEventReader, artifactResolve); String elementName = StaxParserUtil.getStartElementName(startElement); if (JBossSAMLConstants.ARTIFACT.get().equals(elementName)) { startElement = StaxParserUtil.getNextStartElement(xmlEventReader); artifactResolve.setArtifact(StaxParserUtil.getElementText(xmlEventReader)); } else if (JBossSAMLConstants.ISSUER.get().equals(elementName)) { continue; } else if (JBossSAMLConstants.SIGNATURE.get().equals(elementName)) { continue; } else throw new RuntimeException(ErrorCodes.UNKNOWN_START_ELEMENT + elementName + "::location=" + startElement.getLocation()); } return artifactResolve; }
StaxUtil.writeAttribute(writer, JBossSAMLConstants.ID.get(), request.getID()); StaxUtil.writeAttribute(writer, JBossSAMLConstants.VERSION.get(), request.getVersion()); StaxUtil.writeAttribute(writer, JBossSAMLConstants.ISSUE_INSTANT.get(), request.getIssueInstant().toString()); URI destination = request.getDestination(); if (destination != null) StaxUtil.writeAttribute(writer, JBossSAMLConstants.DESTINATION.get(), destination.toASCIIString()); String consent = request.getConsent(); if (StringUtil.isNotNull(consent)) StaxUtil.writeAttribute(writer, JBossSAMLConstants.CONSENT.get(), consent); NameIDType issuer = request.getIssuer(); if (issuer != null) { write(issuer, new QName(ASSERTION_NSURI.get(), JBossSAMLConstants.ISSUER.get(), ASSERTION_PREFIX)); Element sig = request.getSignature(); if (sig != null) { StaxUtil.writeDOMElement(writer, sig); String artifact = request.getArtifact(); if (StringUtil.isNotNull(artifact)) { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.ARTIFACT.get(), PROTOCOL_NSURI.get());
public Object parse(XMLEventReader xmlEventReader) throws ParsingException { // Get the startelement StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader); StaxParserUtil.validate(startElement, JBossSAMLConstants.ARTIFACT_RESOLVE.get()); ArtifactResolveType artifactResolve = parseBaseAttributes(startElement); while (xmlEventReader.hasNext()) { // Let us peek at the next start element startElement = StaxParserUtil.peekNextStartElement(xmlEventReader); if (startElement == null) break; super.parseCommonElements(startElement, xmlEventReader, artifactResolve); String elementName = StaxParserUtil.getStartElementName(startElement); if (JBossSAMLConstants.ARTIFACT.get().equals(elementName)) { startElement = StaxParserUtil.getNextStartElement(xmlEventReader); artifactResolve.setArtifact(StaxParserUtil.getElementText(xmlEventReader)); } else if (JBossSAMLConstants.ISSUER.get().equals(elementName)) { continue; } else if (JBossSAMLConstants.SIGNATURE.get().equals(elementName)) { continue; } else throw new RuntimeException(ErrorCodes.UNKNOWN_START_ELEMENT + elementName + "::location=" + startElement.getLocation()); } return artifactResolve; }
StaxUtil.writeAttribute(writer, JBossSAMLConstants.ID.get(), request.getID()); StaxUtil.writeAttribute(writer, JBossSAMLConstants.VERSION.get(), request.getVersion()); StaxUtil.writeAttribute(writer, JBossSAMLConstants.ISSUE_INSTANT.get(), request.getIssueInstant().toString()); URI destination = request.getDestination(); if (destination != null) StaxUtil.writeAttribute(writer, JBossSAMLConstants.DESTINATION.get(), destination.toASCIIString()); String consent = request.getConsent(); if (StringUtil.isNotNull(consent)) StaxUtil.writeAttribute(writer, JBossSAMLConstants.CONSENT.get(), consent); NameIDType issuer = request.getIssuer(); if (issuer != null) { write(issuer, new QName(ASSERTION_NSURI.get(), JBossSAMLConstants.ISSUER.get(), ASSERTION_PREFIX)); Element sig = request.getSignature(); if (sig != null) { StaxUtil.writeDOMElement(writer, sig); String artifact = request.getArtifact(); if (StringUtil.isNotNull(artifact)) { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.ARTIFACT.get(), PROTOCOL_NSURI.get());
/** * Parse the attributes at the authnrequesttype element * @param startElement * @return * @throws ParsingException */ private ArtifactResolveType parseBaseAttributes(StartElement startElement) throws ParsingException { super.parseRequiredAttributes(startElement); ArtifactResolveType authnRequest = new ArtifactResolveType(id, issueInstant); //Let us get the attributes super.parseBaseAttributes(startElement, authnRequest); return authnRequest; } }
public Object parse(XMLEventReader xmlEventReader) throws ParsingException { // Get the startelement StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader); StaxParserUtil.validate(startElement, JBossSAMLConstants.ARTIFACT_RESOLVE.get()); ArtifactResolveType artifactResolve = parseBaseAttributes(startElement); while (xmlEventReader.hasNext()) { // Let us peek at the next start element startElement = StaxParserUtil.peekNextStartElement(xmlEventReader); if (startElement == null) break; super.parseCommonElements(startElement, xmlEventReader, artifactResolve); String elementName = StaxParserUtil.getStartElementName(startElement); if (JBossSAMLConstants.ARTIFACT.get().equals(elementName)) { startElement = StaxParserUtil.getNextStartElement(xmlEventReader); artifactResolve.setArtifact(StaxParserUtil.getElementText(xmlEventReader)); } else if (JBossSAMLConstants.ISSUER.get().equals(elementName)) { continue; } else if (JBossSAMLConstants.SIGNATURE.get().equals(elementName)) { continue; } else throw new RuntimeException(ErrorCodes.UNKNOWN_START_ELEMENT + elementName + "::location=" + startElement.getLocation()); } return artifactResolve; }
StaxUtil.writeAttribute(writer, JBossSAMLConstants.ID.get(), request.getID()); StaxUtil.writeAttribute(writer, JBossSAMLConstants.VERSION.get(), request.getVersion()); StaxUtil.writeAttribute(writer, JBossSAMLConstants.ISSUE_INSTANT.get(), request.getIssueInstant().toString()); URI destination = request.getDestination(); if (destination != null) StaxUtil.writeAttribute(writer, JBossSAMLConstants.DESTINATION.get(), destination.toASCIIString()); String consent = request.getConsent(); if (StringUtil.isNotNull(consent)) StaxUtil.writeAttribute(writer, JBossSAMLConstants.CONSENT.get(), consent); NameIDType issuer = request.getIssuer(); if (issuer != null) Element sig = request.getSignature(); if (sig != null) String artifact = request.getArtifact(); if (StringUtil.isNotNull(artifact))
/** * Parse the attributes at the authnrequesttype element * * @param startElement * @return * @throws ParsingException */ private ArtifactResolveType parseBaseAttributes(StartElement startElement) throws ParsingException { super.parseRequiredAttributes(startElement); ArtifactResolveType authnRequest = new ArtifactResolveType(id, issueInstant); // Let us get the attributes super.parseBaseAttributes(startElement, authnRequest); return authnRequest; } }
artifactResolve.setArtifact(StaxParserUtil.getElementText(xmlEventReader));
StaxUtil.writeAttribute(writer, JBossSAMLConstants.ID.get(), request.getID()); StaxUtil.writeAttribute(writer, JBossSAMLConstants.VERSION.get(), request.getVersion()); StaxUtil.writeAttribute(writer, JBossSAMLConstants.ISSUE_INSTANT.get(), request.getIssueInstant().toString()); URI destination = request.getDestination(); if (destination != null) StaxUtil.writeAttribute(writer, JBossSAMLConstants.DESTINATION.get(), destination.toASCIIString()); String consent = request.getConsent(); if (StringUtil.isNotNull(consent)) StaxUtil.writeAttribute(writer, JBossSAMLConstants.CONSENT.get(), consent); NameIDType issuer = request.getIssuer(); if (issuer != null) Element sig = request.getSignature(); if (sig != null) String artifact = request.getArtifact(); if (StringUtil.isNotNull(artifact))
/** * Parse the attributes at the authnrequesttype element * * @param startElement * * @return * * @throws ParsingException */ private ArtifactResolveType parseBaseAttributes(StartElement startElement) throws ParsingException { super.parseRequiredAttributes(startElement); ArtifactResolveType authnRequest = new ArtifactResolveType(id, issueInstant); // Let us get the attributes super.parseBaseAttributes(startElement, authnRequest); return authnRequest; } }
artifactResolve.setArtifact(StaxParserUtil.getElementText(xmlEventReader));
/** * Parse the attributes at the authnrequesttype element * * @param startElement * * @return * * @throws ParsingException */ private ArtifactResolveType parseBaseAttributes(StartElement startElement) throws ParsingException { super.parseRequiredAttributes(startElement); ArtifactResolveType authnRequest = new ArtifactResolveType(id, issueInstant); // Let us get the attributes super.parseBaseAttributes(startElement, authnRequest); return authnRequest; } }