public static Document getXACMLRequest(RequestType requestType) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); // Marshaller marshaller = getMarshaller(); JAXBElement<?> jaxb = (new ObjectFactory()).createRequest(requestType); StreamResult result = new StreamResult(baos); try { TransformerUtil.transform(getJAXBContext(), jaxb, result); return DocumentUtil.getDocument(new String(baos.toByteArray())); } catch (Exception e) { throw logger.processingError(e); } } }
public void write(XACMLAuthzDecisionStatementType xacmlStat) throws ProcessingException { StaxUtil.writeStartElement(writer, ASSERTION_PREFIX, JBossSAMLConstants.STATEMENT.get(), ASSERTION_NSURI.get()); StaxUtil.writeNameSpace(writer, ASSERTION_PREFIX, ASSERTION_NSURI.get()); StaxUtil.writeNameSpace(writer, XACML_SAML_PREFIX, JBossSAMLURIConstants.XACML_SAML_NSURI.get()); StaxUtil.writeNameSpace(writer, XACML_SAML_PROTO_PREFIX, JBossSAMLURIConstants.XACML_SAML_PROTO_NSURI.get()); StaxUtil.writeNameSpace(writer, XSI_PREFIX, JBossSAMLURIConstants.XSI_NSURI.get()); StaxUtil.writeAttribute(writer, new QName(JBossSAMLURIConstants.XSI_NSURI.get(), JBossSAMLConstants.TYPE.get(), XSI_PREFIX), XACMLAuthzDecisionStatementType.XSI_TYPE); ResponseType responseType = xacmlStat.getResponse(); if (responseType == null) throw new RuntimeException(ErrorCodes.WRITER_NULL_VALUE + "XACML response"); Document doc = SAMLXACMLUtil.getXACMLResponse(responseType); StaxUtil.writeDOMElement(writer, doc.getDocumentElement()); RequestType requestType = xacmlStat.getRequest(); if (requestType != null) { StaxUtil.writeDOMNode(writer, SAMLXACMLUtil.getXACMLRequest(requestType).getDocumentElement()); } StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
public void write(XACMLAuthzDecisionStatementType xacmlStat) throws ProcessingException { StaxUtil.writeStartElement(writer, ASSERTION_PREFIX, JBossSAMLConstants.STATEMENT.get(), ASSERTION_NSURI.get()); StaxUtil.writeNameSpace(writer, ASSERTION_PREFIX, ASSERTION_NSURI.get()); StaxUtil.writeNameSpace(writer, XACML_SAML_PREFIX, JBossSAMLURIConstants.XACML_SAML_NSURI.get()); StaxUtil.writeNameSpace(writer, XACML_SAML_PROTO_PREFIX, JBossSAMLURIConstants.XACML_SAML_PROTO_NSURI.get()); StaxUtil.writeNameSpace(writer, XSI_PREFIX, JBossSAMLURIConstants.XSI_NSURI.get()); StaxUtil.writeAttribute(writer, new QName(JBossSAMLURIConstants.XSI_NSURI.get(), JBossSAMLConstants.TYPE.get(), XSI_PREFIX), XACMLAuthzDecisionStatementType.XSI_TYPE); ResponseType responseType = xacmlStat.getResponse(); if (responseType == null) throw new RuntimeException(ErrorCodes.WRITER_NULL_VALUE + "XACML response"); Document doc = SAMLXACMLUtil.getXACMLResponse(responseType); StaxUtil.writeDOMElement(writer, doc.getDocumentElement()); RequestType requestType = xacmlStat.getRequest(); if (requestType != null) { StaxUtil.writeDOMNode(writer, SAMLXACMLUtil.getXACMLRequest(requestType).getDocumentElement()); } StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
public void write(XACMLAuthzDecisionStatementType xacmlStat) throws ProcessingException { StaxUtil.writeStartElement(writer, ASSERTION_PREFIX, JBossSAMLConstants.STATEMENT.get(), ASSERTION_NSURI.get()); StaxUtil.writeNameSpace(writer, ASSERTION_PREFIX, ASSERTION_NSURI.get()); StaxUtil.writeNameSpace(writer, XACML_SAML_PREFIX, JBossSAMLURIConstants.XACML_SAML_NSURI.get()); StaxUtil.writeNameSpace(writer, XACML_SAML_PROTO_PREFIX, JBossSAMLURIConstants.XACML_SAML_PROTO_NSURI.get()); StaxUtil.writeNameSpace(writer, XSI_PREFIX, JBossSAMLURIConstants.XSI_NSURI.get()); StaxUtil.writeAttribute(writer, new QName(JBossSAMLURIConstants.XSI_NSURI.get(), JBossSAMLConstants.TYPE.get(), XSI_PREFIX), XACMLAuthzDecisionStatementType.XSI_TYPE); ResponseType responseType = xacmlStat.getResponse(); if (responseType == null) throw logger.writerNullValueError("XACML response"); Document doc = SAMLXACMLUtil.getXACMLResponse(responseType); StaxUtil.writeDOMElement(writer, doc.getDocumentElement()); RequestType requestType = xacmlStat.getRequest(); if (requestType != null) { StaxUtil.writeDOMNode(writer, SAMLXACMLUtil.getXACMLRequest(requestType).getDocumentElement()); } StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
public static Document getXACMLResponse(ResponseType responseType) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); JAXBElement<?> jaxb = (new ObjectFactory()).createResponse(responseType); StreamResult result = new StreamResult(baos); try { TransformerUtil.transform(SAMLXACMLUtil.getJAXBContext(), jaxb, result); return DocumentUtil.getDocument(new String(baos.toByteArray())); } catch (Exception e) { throw logger.processingError(e); } }
public void write(XACMLAuthzDecisionStatementType xacmlStat) throws ProcessingException { StaxUtil.writeStartElement(writer, ASSERTION_PREFIX, JBossSAMLConstants.STATEMENT.get(), ASSERTION_NSURI.get()); StaxUtil.writeNameSpace(writer, ASSERTION_PREFIX, ASSERTION_NSURI.get()); StaxUtil.writeNameSpace(writer, XACML_SAML_PREFIX, JBossSAMLURIConstants.XACML_SAML_NSURI.get()); StaxUtil.writeNameSpace(writer, XACML_SAML_PROTO_PREFIX, JBossSAMLURIConstants.XACML_SAML_PROTO_NSURI.get()); StaxUtil.writeNameSpace(writer, XSI_PREFIX, JBossSAMLURIConstants.XSI_NSURI.get()); StaxUtil.writeAttribute(writer, new QName(JBossSAMLURIConstants.XSI_NSURI.get(), JBossSAMLConstants.TYPE.get(), XSI_PREFIX), XACMLAuthzDecisionStatementType.XSI_TYPE); ResponseType responseType = xacmlStat.getResponse(); if (responseType == null) throw logger.writerNullValueError("XACML response"); Document doc = SAMLXACMLUtil.getXACMLResponse(responseType); StaxUtil.writeDOMElement(writer, doc.getDocumentElement()); RequestType requestType = xacmlStat.getRequest(); if (requestType != null) { StaxUtil.writeDOMNode(writer, SAMLXACMLUtil.getXACMLRequest(requestType).getDocumentElement()); } StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
public static Document getXACMLResponse(ResponseType responseType) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); JAXBElement<?> jaxb = (new ObjectFactory()).createResponse(responseType); StreamResult result = new StreamResult(baos); try { TransformerUtil.transform(SAMLXACMLUtil.getJAXBContext(), jaxb, result); return DocumentUtil.getDocument(new String(baos.toByteArray())); } catch (Exception e) { throw logger.processingError(e); } }
public void write(XACMLAuthzDecisionStatementType xacmlStat) throws ProcessingException { StaxUtil.writeStartElement(writer, ASSERTION_PREFIX, JBossSAMLConstants.STATEMENT.get(), ASSERTION_NSURI.get()); StaxUtil.writeNameSpace(writer, ASSERTION_PREFIX, ASSERTION_NSURI.get()); StaxUtil.writeNameSpace(writer, XACML_SAML_PREFIX, JBossSAMLURIConstants.XACML_SAML_NSURI.get()); StaxUtil.writeNameSpace(writer, XACML_SAML_PROTO_PREFIX, JBossSAMLURIConstants.XACML_SAML_PROTO_NSURI.get()); StaxUtil.writeNameSpace(writer, XSI_PREFIX, JBossSAMLURIConstants.XSI_NSURI.get()); StaxUtil.writeAttribute(writer, new QName(JBossSAMLURIConstants.XSI_NSURI.get(), JBossSAMLConstants.TYPE.get(), XSI_PREFIX), XACMLAuthzDecisionStatementType.XSI_TYPE); ResponseType responseType = xacmlStat.getResponse(); if (responseType == null) throw logger.writerNullValueError("XACML response"); Document doc = SAMLXACMLUtil.getXACMLResponse(responseType); StaxUtil.writeDOMElement(writer, doc.getDocumentElement()); RequestType requestType = xacmlStat.getRequest(); if (requestType != null) { StaxUtil.writeDOMNode(writer, SAMLXACMLUtil.getXACMLRequest(requestType).getDocumentElement()); } StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
public static Document getXACMLResponse(ResponseType responseType) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); JAXBElement<?> jaxb = (new ObjectFactory()).createResponse(responseType); StreamResult result = new StreamResult(baos); try { TransformerUtil.transform(SAMLXACMLUtil.getJAXBContext(), jaxb, result); return DocumentUtil.getDocument(new String(baos.toByteArray())); } catch (Exception e) { throw logger.processingError(e); } }
public static Document getXACMLRequest(RequestType requestType) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); // Marshaller marshaller = getMarshaller(); JAXBElement<?> jaxb = (new ObjectFactory()).createRequest(requestType); StreamResult result = new StreamResult(baos); try { TransformerUtil.transform(getJAXBContext(), jaxb, result); return DocumentUtil.getDocument(new String(baos.toByteArray())); } catch (Exception e) { throw logger.processingError(e); } } }
public static Document getXACMLRequest(RequestType requestType) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); // Marshaller marshaller = getMarshaller(); JAXBElement<?> jaxb = (new ObjectFactory()).createRequest(requestType); StreamResult result = new StreamResult(baos); try { TransformerUtil.transform(getJAXBContext(), jaxb, result); return DocumentUtil.getDocument(new String(baos.toByteArray())); } catch (Exception e) { throw logger.processingError(e); } } }
public static Document getXACMLRequest( RequestType requestType ) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); //Marshaller marshaller = getMarshaller(); JAXBElement<?> jaxb = (new ObjectFactory()).createRequest( requestType ); StreamResult result = new StreamResult( baos ); try { TransformerUtil.transform( getJAXBContext(), jaxb, result); return DocumentUtil.getDocument( new String( baos.toByteArray() )); } catch ( Exception e ) { throw new ProcessingException( e ); } } }
public static Document getXACMLResponse( ResponseType responseType ) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); JAXBElement<?> jaxb = (new ObjectFactory()).createResponse( responseType ); StreamResult result = new StreamResult( baos ); try { TransformerUtil.transform( SAMLXACMLUtil.getJAXBContext(), jaxb, result); return DocumentUtil.getDocument( new String( baos.toByteArray() )); } catch ( Exception e ) { throw new ProcessingException( e ); } }
public static Document getXACMLResponse( ResponseType responseType ) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); JAXBElement<?> jaxb = (new ObjectFactory()).createResponse( responseType ); StreamResult result = new StreamResult( baos ); try { TransformerUtil.transform( SAMLXACMLUtil.getJAXBContext(), jaxb, result); return DocumentUtil.getDocument( new String( baos.toByteArray() )); } catch ( Exception e ) { throw new ProcessingException( e ); } }
public static Document getXACMLRequest( RequestType requestType ) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); //Marshaller marshaller = getMarshaller(); JAXBElement<?> jaxb = (new ObjectFactory()).createRequest( requestType ); StreamResult result = new StreamResult( baos ); try { TransformerUtil.transform( getJAXBContext(), jaxb, result); return DocumentUtil.getDocument( new String( baos.toByteArray() )); } catch ( Exception e ) { throw new ProcessingException( e ); } } }