/** * Parse the attributes at the authnrequesttype element * * @param startElement * @return * @throws ParsingException */ private AttributeQueryType parseBaseAttributes(StartElement startElement) throws ParsingException { super.parseRequiredAttributes(startElement); AttributeQueryType authnRequest = new AttributeQueryType(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); SubjectType subject = request.getSubject(); if (subject != null) { write(subject); List<AttributeType> attributes = request.getAttribute(); for (AttributeType attr : attributes) { write(attr);
public Object parse(XMLEventReader xmlEventReader) throws ParsingException { // Get the startelement StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader); StaxParserUtil.validate(startElement, JBossSAMLConstants.ATTRIBUTE_QUERY.get()); AttributeQueryType attributeQuery = 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, attributeQuery); String elementName = StaxParserUtil.getStartElementName(startElement); if (JBossSAMLConstants.SUBJECT.get().equals(elementName)) { attributeQuery.setSubject(getSubject(xmlEventReader)); } else if (JBossSAMLConstants.ATTRIBUTE.get().equals(elementName)) { attributeQuery.add(SAMLParserUtil.parseAttribute(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 attributeQuery; }
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); SubjectType subject = request.getSubject(); if (subject != null) { write(subject); List<AttributeType> attributes = request.getAttribute(); for (AttributeType attr : attributes) { write(attr);
public Object parse(XMLEventReader xmlEventReader) throws ParsingException { // Get the startelement StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader); StaxParserUtil.validate(startElement, JBossSAMLConstants.ATTRIBUTE_QUERY.get()); AttributeQueryType attributeQuery = 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, attributeQuery); String elementName = StaxParserUtil.getStartElementName(startElement); if (JBossSAMLConstants.SUBJECT.get().equals(elementName)) { attributeQuery.setSubject(getSubject(xmlEventReader)); } else if (JBossSAMLConstants.ATTRIBUTE.get().equals(elementName)) { attributeQuery.add(SAMLParserUtil.parseAttribute(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 attributeQuery; }
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); SubjectType subject = request.getSubject(); if (subject != null) { write(subject); List<AttributeType> attributes = request.getAttribute(); for (AttributeType attr : attributes) { write(attr);
public Object parse(XMLEventReader xmlEventReader) throws ParsingException { // Get the startelement StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader); StaxParserUtil.validate(startElement, JBossSAMLConstants.ATTRIBUTE_QUERY.get()); AttributeQueryType attributeQuery = 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, attributeQuery); String elementName = StaxParserUtil.getStartElementName(startElement); if (JBossSAMLConstants.SUBJECT.get().equals(elementName)) { attributeQuery.setSubject(getSubject(xmlEventReader)); } else if (JBossSAMLConstants.ATTRIBUTE.get().equals(elementName)) { attributeQuery.add(SAMLParserUtil.parseAttribute(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 attributeQuery; }
/** * Parse the attributes at the authnrequesttype element * @param startElement * @return * @throws ParsingException */ private AttributeQueryType parseBaseAttributes(StartElement startElement) throws ParsingException { super.parseRequiredAttributes(startElement); AttributeQueryType authnRequest = new AttributeQueryType(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) Element sig = request.getSignature(); if (sig != null) SubjectType subject = request.getSubject(); if (subject != null) List<AttributeType> attributes = request.getAttribute(); for (AttributeType attr : attributes)
attributeQuery.setSubject(getSubject(xmlEventReader)); attributeQuery.add(SAMLParserUtil.parseAttribute(xmlEventReader));
/** * Parse the attributes at the authnrequesttype element * @param startElement * @return * @throws ParsingException */ private AttributeQueryType parseBaseAttributes(StartElement startElement) throws ParsingException { super.parseRequiredAttributes(startElement); AttributeQueryType authnRequest = new AttributeQueryType(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) Element sig = request.getSignature(); if (sig != null) SubjectType subject = request.getSubject(); if (subject != null) List<AttributeType> attributes = request.getAttribute(); for (AttributeType attr : attributes)
attributeQuery.setSubject(getSubject(xmlEventReader)); attributeQuery.add(SAMLParserUtil.parseAttribute(xmlEventReader));
/** * Parse the attributes at the authnrequesttype element * * @param startElement * * @return * * @throws ParsingException */ private AttributeQueryType parseBaseAttributes(StartElement startElement) throws ParsingException { super.parseRequiredAttributes(startElement); AttributeQueryType authnRequest = new AttributeQueryType(id, issueInstant); // Let us get the attributes super.parseBaseAttributes(startElement, authnRequest); return authnRequest; } }
/** * Parse the attributes at the authnrequesttype element * * @param startElement * * @return * * @throws ParsingException */ private AttributeQueryType parseBaseAttributes(StartElement startElement) throws ParsingException { super.parseRequiredAttributes(startElement); AttributeQueryType authnRequest = new AttributeQueryType(id, issueInstant); // Let us get the attributes super.parseBaseAttributes(startElement, authnRequest); return authnRequest; } }