org.wso2.balana.ctx
Class RequestCtxFactory

java.lang.Object
  extended by org.wso2.balana.ctx.RequestCtxFactory

public class RequestCtxFactory
extends Object

Factory that creates the AbstractRequestCtx


Constructor Summary
RequestCtxFactory()
           
 
Method Summary
static RequestCtxFactory getFactory()
          Returns an instance of this factory.
 AbstractRequestCtx getRequestCtx(InputStream input)
          Returns instance of AbstractRequestCtx based one the XACML version.
 AbstractRequestCtx getRequestCtx(Node root)
          Returns instance of AbstractRequestCtx based one the XACML version.
 AbstractRequestCtx getRequestCtx(String request)
          Returns instance of AbstractRequestCtx based one the XACML version.
 Element getXacmlRequest(String request)
          Creates DOM representation of the XACML request
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestCtxFactory

public RequestCtxFactory()
Method Detail

getRequestCtx

public AbstractRequestCtx getRequestCtx(Node root)
                                 throws ParsingException
Returns instance of AbstractRequestCtx based one the XACML version.

Parameters:
root - the node to parse for the AbstractRequestCtx
Returns:
AbstractRequestCtx object
Throws:
ParsingException - if the DOM node is invalid

getRequestCtx

public AbstractRequestCtx getRequestCtx(String request)
                                 throws ParsingException
Returns instance of AbstractRequestCtx based one the XACML version.

Parameters:
request - the String to parse for the AbstractRequestCtx
Returns:
AbstractRequestCtx object
Throws:
ParsingException - if the request is invalid

getRequestCtx

public AbstractRequestCtx getRequestCtx(InputStream input)
                                 throws ParsingException
Returns instance of AbstractRequestCtx based one the XACML version. Creates a new RequestCtx by parsing XML from an input stream. Note that this a convenience method, and it will not do schema validation by default. You should be parsing the data yourself, and then providing the root node to the other getInstance method. If you use this convenience method, you probably want to turn on validation by setting the context schema file (see the programmer guide for more information on this).

Parameters:
input - input a stream providing the XML data
Returns:
AbstractRequestCtx object
Throws:
ParsingException - if the DOM node is invalid

getFactory

public static RequestCtxFactory getFactory()
Returns an instance of this factory. This method enforces a singleton model, meaning that this always returns the same instance, creating the factory if it hasn't been requested before.

Returns:
the factory instance

getXacmlRequest

public Element getXacmlRequest(String request)
                        throws ParsingException
Creates DOM representation of the XACML request

Parameters:
request - XACML request as a String object
Returns:
XACML request as a DOM element
Throws:
ParsingException - throws, if fails


Copyright © 2015 WSO2. All rights reserved.