Package org.jboss.security.xacml.core.model.context

Examples of org.jboss.security.xacml.core.model.context.ObjectFactory


   /**
    * @see RequestContext#setRequest(RequestType)
    */
   public void setRequest(RequestType requestType) throws IOException
   {
      JAXBElement<RequestType> requestJAXB = new ObjectFactory().createRequest(requestType);
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      JAXB.marshal(requestJAXB, baos);
      ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
      readRequest(bis)
   }
View Full Code Here


   /**
    * @see RequestContext#setRequest(RequestType)
    */
   public void setRequest(RequestType requestType) throws IOException
   {
      JAXBElement<RequestType> requestJAXB = new ObjectFactory().createRequest(requestType);
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      JAXB.marshal(requestJAXB, baos);
      ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
      readRequest(bis);
   }
View Full Code Here

    * @see ResponseContext#getResult()
    */
   @SuppressWarnings("unchecked")
   public ResultType getResult()
   {
      ObjectFactory objectFactory = new ObjectFactory();
      ResultType resultType = objectFactory.createResultType();
      ResponseCtx response = (ResponseCtx) map.get(XACMLConstants.RESPONSE_CTX);
      if (response != null)
      {
         //Resource ID
         Result result = (Result) response.getResults().iterator().next();
         resultType.setResourceId(result.getResource());
        
         //Decision
         int decision = result.getDecision();
         switch(decision)
         {
            case 0:
               resultType.setDecision(DecisionType.PERMIT);
               break;
            case 1:
               resultType.setDecision(DecisionType.DENY);
               break;
            case 2:
               resultType.setDecision(DecisionType.INDETERMINATE);
               break;
            case 3:
               resultType.setDecision(DecisionType.NOT_APPLICABLE);
               break;
            default:
               throw new IllegalStateException("Unknown code");
         }
         //Status
         Status status = result.getStatus();
         StatusType statusType = objectFactory.createStatusType();
         StatusCodeType statusCodeType = objectFactory.createStatusCodeType();
         List statusList = status.getCode();
         if(statusList != null && statusList.size() > 0)
         {
            statusCodeType.setValue((String) statusList.get(0));
         }
View Full Code Here

   /**
    * @see RequestContext#setRequest(RequestType)
    */
   public void setRequest(RequestType requestType) throws IOException
   {
      JAXBElement<RequestType> requestJAXB = new ObjectFactory().createRequest(requestType);
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      JAXB.marshal(requestJAXB, baos);
      ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
      readRequest(bis)
   }
View Full Code Here

            write(issuer, new QName(ASSERTION_NSURI.get(), JBossSAMLConstants.ISSUER.get(), ASSERTION_PREFIX));
        }

        RequestType xacmlRequest = xacmlQuery.getRequest();

        ObjectFactory of = new ObjectFactory();

        StringWriter sw = new StringWriter();
        try {
            Marshaller m = JAXBUtil.getMarshaller(RequestType.class.getPackage().getName());
            m.marshal(of.createRequest(xacmlRequest), sw);
        } catch (JAXBException e) {
            throw logger.processingError(e);
        }

        try {
View Full Code Here

        return JAXBContext.newInstance(XACML_PKG_PATH);
    }

    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);
View Full Code Here

    }

    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);
View Full Code Here

TOP

Related Classes of org.jboss.security.xacml.core.model.context.ObjectFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.