/** * Marshall the AuthnRequestType to an output stream * @param requestType * @param os * @throws SAXException */ public void marshall(RequestAbstractType requestType, OutputStream os) throws ProcessingException { SAMLRequestWriter samlRequestWriter = new SAMLRequestWriter(StaxUtil.getXMLStreamWriter(os)); if (requestType instanceof AuthnRequestType) { samlRequestWriter.write((AuthnRequestType) requestType); } else if (requestType instanceof LogoutRequestType) { samlRequestWriter.write((LogoutRequestType) requestType); } else throw new RuntimeException(ErrorCodes.UNSUPPORTED_TYPE + requestType.getClass().getName()); }
/** * Marshall the AuthnRequestType to an output stream * * @param requestType * @param os * * @throws SAXException */ public void marshall(RequestAbstractType requestType, OutputStream os) throws ProcessingException { SAMLRequestWriter samlRequestWriter = new SAMLRequestWriter(StaxUtil.getXMLStreamWriter(os)); if (requestType instanceof AuthnRequestType) { samlRequestWriter.write((AuthnRequestType) requestType); } else if (requestType instanceof LogoutRequestType) { samlRequestWriter.write((LogoutRequestType) requestType); } else throw logger.unsupportedType(requestType.getClass().getName()); }
/** * Marshall the AuthnRequestType to an output stream * * @param requestType * @param os * @throws SAXException */ public void marshall(RequestAbstractType requestType, OutputStream os) throws ProcessingException { SAMLRequestWriter samlRequestWriter = new SAMLRequestWriter(StaxUtil.getXMLStreamWriter(os)); if (requestType instanceof AuthnRequestType) { samlRequestWriter.write((AuthnRequestType) requestType); } else if (requestType instanceof LogoutRequestType) { samlRequestWriter.write((LogoutRequestType) requestType); } else throw logger.unsupportedType(requestType.getClass().getName()); }
/** * Marshall the AuthnRequestType to a writer * @param requestType * @param writer * @throws SAXException */ public void marshall(RequestAbstractType requestType, Writer writer) throws ProcessingException { SAMLRequestWriter samlRequestWriter = new SAMLRequestWriter(StaxUtil.getXMLStreamWriter(writer)); if (requestType instanceof AuthnRequestType) { samlRequestWriter.write((AuthnRequestType) requestType); } else if (requestType instanceof LogoutRequestType) { samlRequestWriter.write((LogoutRequestType) requestType); } else throw new RuntimeException(ErrorCodes.UNSUPPORTED_TYPE + requestType.getClass().getName()); } }
/** * Marshall the AuthnRequestType to a writer * * @param requestType * @param writer * @throws SAXException */ public void marshall(RequestAbstractType requestType, Writer writer) throws ProcessingException { SAMLRequestWriter samlRequestWriter = new SAMLRequestWriter(StaxUtil.getXMLStreamWriter(writer)); if (requestType instanceof AuthnRequestType) { samlRequestWriter.write((AuthnRequestType) requestType); } else if (requestType instanceof LogoutRequestType) { samlRequestWriter.write((LogoutRequestType) requestType); } else throw logger.unsupportedType(requestType.getClass().getName()); } }
/** * Marshall the AuthnRequestType to a writer * * @param requestType * @param writer * * @throws SAXException */ public void marshall(RequestAbstractType requestType, Writer writer) throws ProcessingException { SAMLRequestWriter samlRequestWriter = new SAMLRequestWriter(StaxUtil.getXMLStreamWriter(writer)); if (requestType instanceof AuthnRequestType) { samlRequestWriter.write((AuthnRequestType) requestType); } else if (requestType instanceof LogoutRequestType) { samlRequestWriter.write((LogoutRequestType) requestType); } else throw logger.unsupportedType(requestType.getClass().getName()); } }
/** * Marshall the AuthnRequestType to an output stream * * @param requestType * @param os * * @throws SAXException */ public void marshall(RequestAbstractType requestType, OutputStream os) throws ProcessingException { SAMLRequestWriter samlRequestWriter = new SAMLRequestWriter(StaxUtil.getXMLStreamWriter(os)); if (requestType instanceof AuthnRequestType) { samlRequestWriter.write((AuthnRequestType) requestType); } else if (requestType instanceof LogoutRequestType) { samlRequestWriter.write((LogoutRequestType) requestType); } else throw logger.unsupportedType(requestType.getClass().getName()); }
/** * Marshall the AuthnRequestType to a writer * * @param requestType * @param writer * * @throws SAXException */ public void marshall(RequestAbstractType requestType, Writer writer) throws ProcessingException { SAMLRequestWriter samlRequestWriter = new SAMLRequestWriter(StaxUtil.getXMLStreamWriter(writer)); if (requestType instanceof AuthnRequestType) { samlRequestWriter.write((AuthnRequestType) requestType); } else if (requestType instanceof LogoutRequestType) { samlRequestWriter.write((LogoutRequestType) requestType); } else throw logger.unsupportedType(requestType.getClass().getName()); } }
/** * Return the DOM object * * @param rat * @return * @throws ProcessingException * @throws ParsingException * @throws ConfigurationException */ public Document convert(RequestAbstractType rat) throws ProcessingException, ConfigurationException, ParsingException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); SAMLRequestWriter writer = new SAMLRequestWriter(StaxUtil.getXMLStreamWriter(bos)); if (rat instanceof AuthnRequestType) { writer.write((AuthnRequestType) rat); } else if (rat instanceof LogoutRequestType) { writer.write((LogoutRequestType) rat); } return DocumentUtil.getDocument(new String(bos.toByteArray())); }
/** * Return the DOM object * * @param rat * * @return * * @throws ProcessingException * @throws ParsingException * @throws ConfigurationException */ public Document convert(RequestAbstractType rat) throws ProcessingException, ConfigurationException, ParsingException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); SAMLRequestWriter writer = new SAMLRequestWriter(StaxUtil.getXMLStreamWriter(bos)); if (rat instanceof AuthnRequestType) { writer.write((AuthnRequestType) rat); } else if (rat instanceof LogoutRequestType) { writer.write((LogoutRequestType) rat); } return DocumentUtil.getDocument(new String(bos.toByteArray())); }