/** * Marshall the response type to the output stream * * @param responseType * @param os * @throws ProcessingException */ public void marshall(ResponseType responseType, OutputStream os) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(os)); samlWriter.write(responseType); }
/** * Write a {@code StatusResponseType} * * @param response * @param qname QName of the starting element * @param out * @throws ProcessingException */ public void write(StatusResponseType response, QName qname) throws ProcessingException { if (qname == null) { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_RESPONSE_TYPE.get(), PROTOCOL_NSURI.get()); } else { StaxUtil.writeStartElement(writer, qname.getPrefix(), qname.getLocalPart(), qname.getNamespaceURI()); } StaxUtil.writeNameSpace(writer, PROTOCOL_PREFIX, PROTOCOL_NSURI.get()); StaxUtil.writeDefaultNameSpace(writer, ASSERTION_NSURI.get()); writeBaseAttributes(response); NameIDType issuer = response.getIssuer(); write(issuer, new QName(ASSERTION_NSURI.get(), JBossSAMLConstants.ISSUER.get(), ASSERTION_PREFIX)); StatusType status = response.getStatus(); write(status); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Write a {@code StatusCodeType} to stream * * @param statusCodeType * @param out * * @throws ProcessingException */ public void write(StatusCodeType statusCodeType) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_CODE.get(), PROTOCOL_NSURI.get()); URI value = statusCodeType.getValue(); if (value != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.VALUE.get(), value.toASCIIString()); } StatusCodeType subStatusCode = statusCodeType.getStatusCode(); if (subStatusCode != null) write(subStatusCode); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Write a {@code StatusResponseType} * * @param response * @param qname QName of the starting element * @param out * * @throws ProcessingException */ public void write(StatusResponseType response, QName qname) throws ProcessingException { if (qname == null) { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_RESPONSE_TYPE.get(), PROTOCOL_NSURI.get()); } else { StaxUtil.writeStartElement(writer, qname.getPrefix(), qname.getLocalPart(), qname.getNamespaceURI()); } StaxUtil.writeNameSpace(writer, PROTOCOL_PREFIX, PROTOCOL_NSURI.get()); StaxUtil.writeDefaultNameSpace(writer, ASSERTION_NSURI.get()); writeBaseAttributes(response); NameIDType issuer = response.getIssuer(); write(issuer, new QName(ASSERTION_NSURI.get(), JBossSAMLConstants.ISSUER.get(), ASSERTION_PREFIX)); StatusType status = response.getStatus(); write(status); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Write a {@code StatusCodeType} to stream * @param statusCodeType * @param out * @throws ProcessingException */ public void write(StatusCodeType statusCodeType) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_CODE.get(), PROTOCOL_NSURI.get()); URI value = statusCodeType.getValue(); if (value != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.VALUE.get(), value.toASCIIString()); } StatusCodeType subStatusCode = statusCodeType.getStatusCode(); if (subStatusCode != null) write(subStatusCode); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Marshall the response type to the output stream * * @param responseType * @param os * * @throws ProcessingException */ public void marshall(ResponseType responseType, OutputStream os) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(os)); samlWriter.write(responseType); }
/** * Write a {@code StatusResponseType} * @param response * @param qname QName of the starting element * @param out * @throws ProcessingException */ public void write(StatusResponseType response, QName qname) throws ProcessingException { if (qname == null) { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_RESPONSE_TYPE.get(), PROTOCOL_NSURI.get()); } else { StaxUtil.writeStartElement(writer, qname.getPrefix(), qname.getLocalPart(), qname.getNamespaceURI()); } StaxUtil.writeNameSpace(writer, PROTOCOL_PREFIX, PROTOCOL_NSURI.get()); StaxUtil.writeDefaultNameSpace(writer, ASSERTION_NSURI.get()); writeBaseAttributes(response); NameIDType issuer = response.getIssuer(); write(issuer, new QName(ASSERTION_NSURI.get(), JBossSAMLConstants.ISSUER.get(), ASSERTION_PREFIX)); StatusType status = response.getStatus(); write(status); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Write a {@code StatusCodeType} to stream * * @param statusCodeType * @param out * @throws ProcessingException */ public void write(StatusCodeType statusCodeType) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_CODE.get(), PROTOCOL_NSURI.get()); URI value = statusCodeType.getValue(); if (value != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.VALUE.get(), value.toASCIIString()); } StatusCodeType subStatusCode = statusCodeType.getStatusCode(); if (subStatusCode != null) write(subStatusCode); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Marshall the response type to the output stream * * @param responseType * @param os * * @throws ProcessingException */ public void marshall(ResponseType responseType, OutputStream os) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(os)); samlWriter.write(responseType); }
/** * Write a {@code StatusResponseType} * * @param response * @param qname QName of the starting element * @param out * * @throws ProcessingException */ public void write(StatusResponseType response, QName qname) throws ProcessingException { if (qname == null) { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_RESPONSE_TYPE.get(), PROTOCOL_NSURI.get()); } else { StaxUtil.writeStartElement(writer, qname.getPrefix(), qname.getLocalPart(), qname.getNamespaceURI()); } StaxUtil.writeNameSpace(writer, PROTOCOL_PREFIX, PROTOCOL_NSURI.get()); StaxUtil.writeDefaultNameSpace(writer, ASSERTION_NSURI.get()); writeBaseAttributes(response); NameIDType issuer = response.getIssuer(); write(issuer, new QName(ASSERTION_NSURI.get(), JBossSAMLConstants.ISSUER.get(), ASSERTION_PREFIX)); StatusType status = response.getStatus(); write(status); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Write a {@code StatusCodeType} to stream * @param statusCodeType * @param out * @throws ProcessingException */ public void write(StatusCodeType statusCodeType) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_CODE.get(), PROTOCOL_NSURI.get()); URI value = statusCodeType.getValue(); if (value != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.VALUE.get(), value.toASCIIString()); } StatusCodeType subStatusCode = statusCodeType.getStatusCode(); if (subStatusCode != null) write(subStatusCode); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Marshall the ResponseType into a writer * @param responseType * @param writer * @throws ProcessingException */ public void marshall(ResponseType responseType, Writer writer) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(writer)); samlWriter.write(responseType); } }
/** * Write a {@code StatusResponseType} * @param response * @param qname QName of the starting element * @param out * @throws ProcessingException */ public void write(StatusResponseType response, QName qname) throws ProcessingException { if (qname == null) { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_RESPONSE_TYPE.get(), PROTOCOL_NSURI.get()); } else { StaxUtil.writeStartElement(writer, qname.getPrefix(), qname.getLocalPart(), qname.getNamespaceURI()); } StaxUtil.writeNameSpace(writer, PROTOCOL_PREFIX, PROTOCOL_NSURI.get()); StaxUtil.writeDefaultNameSpace(writer, ASSERTION_NSURI.get()); writeBaseAttributes(response); NameIDType issuer = response.getIssuer(); write(issuer, new QName(ASSERTION_NSURI.get(), JBossSAMLConstants.ISSUER.get(), ASSERTION_PREFIX)); StatusType status = response.getStatus(); write(status); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Write a {@code StatusCodeType} to stream * * @param statusCodeType * @param out * * @throws ProcessingException */ public void write(StatusCodeType statusCodeType) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_CODE.get(), PROTOCOL_NSURI.get()); URI value = statusCodeType.getValue(); if (value != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.VALUE.get(), value.toASCIIString()); } StatusCodeType subStatusCode = statusCodeType.getStatusCode(); if (subStatusCode != null) write(subStatusCode); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Marshall the response type to the output stream * @param responseType * @param os * @throws ProcessingException */ public void marshall(ResponseType responseType, OutputStream os) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(os)); samlWriter.write(responseType); }
public void write(ArtifactResponseType response) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.ARTIFACT_RESPONSE.get(), PROTOCOL_NSURI.get()); StaxUtil.writeNameSpace(writer, PROTOCOL_PREFIX, PROTOCOL_NSURI.get()); StaxUtil.writeNameSpace(writer, ASSERTION_PREFIX, ASSERTION_NSURI.get()); StaxUtil.writeDefaultNameSpace(writer, ASSERTION_NSURI.get()); writeBaseAttributes(response); NameIDType issuer = response.getIssuer(); if (issuer != null) { write(issuer, new QName(ASSERTION_NSURI.get(), JBossSAMLConstants.ISSUER.get(), ASSERTION_PREFIX)); } Element sig = response.getSignature(); if (sig != null) { StaxUtil.writeDOMElement(writer, sig); } StatusType status = response.getStatus(); if (status != null) { write(status); } Object anyObj = response.getAny(); if (anyObj instanceof AuthnRequestType) { AuthnRequestType authn = (AuthnRequestType) anyObj; SAMLRequestWriter requestWriter = new SAMLRequestWriter(writer); requestWriter.write(authn); } else if (anyObj instanceof ResponseType) { ResponseType rt = (ResponseType) anyObj; write(rt); } StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Write a {@code StatusType} to stream * * @param status * @param out * @throws ProcessingException */ public void write(StatusType status) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS.get(), PROTOCOL_NSURI.get()); StatusCodeType statusCodeType = status.getStatusCode(); write(statusCodeType); String statusMessage = status.getStatusMessage(); if (StringUtil.isNotNull(statusMessage)) { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_MESSAGE.get(), PROTOCOL_NSURI.get()); StaxUtil.writeEndElement(writer); } StatusDetailType statusDetail = status.getStatusDetail(); if (statusDetail != null) write(statusDetail); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Marshall the ResponseType into a writer * * @param responseType * @param writer * @throws ProcessingException */ public void marshall(ResponseType responseType, Writer writer) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(writer)); samlWriter.write(responseType); } }
public void write(ArtifactResponseType response) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.ARTIFACT_RESPONSE.get(), PROTOCOL_NSURI.get()); StaxUtil.writeNameSpace(writer, PROTOCOL_PREFIX, PROTOCOL_NSURI.get()); StaxUtil.writeNameSpace(writer, ASSERTION_PREFIX, ASSERTION_NSURI.get()); StaxUtil.writeDefaultNameSpace(writer, ASSERTION_NSURI.get()); writeBaseAttributes(response); NameIDType issuer = response.getIssuer(); if (issuer != null) { write(issuer, new QName(ASSERTION_NSURI.get(), JBossSAMLConstants.ISSUER.get(), ASSERTION_PREFIX)); } Element sig = response.getSignature(); if (sig != null) { StaxUtil.writeDOMElement(writer, sig); } StatusType status = response.getStatus(); if (status != null) { write(status); } Object anyObj = response.getAny(); if (anyObj instanceof AuthnRequestType) { AuthnRequestType authn = (AuthnRequestType) anyObj; SAMLRequestWriter requestWriter = new SAMLRequestWriter(writer); requestWriter.write(authn); } else if (anyObj instanceof ResponseType) { ResponseType rt = (ResponseType) anyObj; write(rt); } StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Write a {@code StatusType} to stream * @param status * @param out * @throws ProcessingException */ public void write(StatusType status) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS.get(), PROTOCOL_NSURI.get()); StatusCodeType statusCodeType = status.getStatusCode(); write(statusCodeType); String statusMessage = status.getStatusMessage(); if (StringUtil.isNotNull(statusMessage)) { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_MESSAGE.get(), PROTOCOL_NSURI.get()); StaxUtil.writeEndElement(writer); } StatusDetailType statusDetail = status.getStatusDetail(); if (statusDetail != null) write(statusDetail); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }