Class RequestImpl
- java.lang.Object
-
- com.sun.identity.xacml.context.impl.RequestImpl
-
- All Implemented Interfaces:
Request
public class RequestImpl extends Object implements Request
TheRequestelement is the top-level element in the XACML context schema. Its an abstraction layer used by the policy language. It containsSubject,Resource,ActionandEnvironmentelements.<xs:complexType name="RequestType"> <xs:sequence> <xs:element ref="xacml-context:Subject" maxOccurs="unbounded"/> <xs:element ref="xacml-context:Resource" maxOccurs="unbounded"/> <xs:element ref="xacml-context:Action"/> <xs:element ref="xacml-context:Environment"/> <xs:sequence> <xs:complexType>
-
-
Constructor Summary
Constructors Constructor Description RequestImpl()Default constructorRequestImpl(String xml)This constructor is used to buildRequestobject from a XML string.RequestImpl(Element element)This constructor is used to buildRequestobject from a block of existing XML that has already been built into a DOM.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ActiongetAction()Returns the instance ofActionelementEnvironmentgetEnvironment()Returns the instance ofEnvironmentelement.ListgetResources()Returns the one to manyResourceelements of this objectListgetSubjects()Returns the one to manySubjectelements of this objectbooleanisMutable()Checks if the object is mutablevoidmakeImmutable()Makes the object immutablevoidsetAction(Action argAction)Sets the instance ofActionvoidsetEnvironment(Environment argEnv)Sets the instance of theEnvironmentvoidsetResources(List resources)Sets the one to manyResourceelements of this objectvoidsetSubjects(List subjects)Sets the one to manySubjectelements of this objectStringtoXMLString()Returns a string representation of this objectStringtoXMLString(boolean includeNSPrefix, boolean declareNS)Returns aStringrepresentation of this object
-
-
-
Constructor Detail
-
RequestImpl
public RequestImpl()
Default constructor
-
RequestImpl
public RequestImpl(String xml) throws XACMLException
This constructor is used to buildRequestobject from a XML string.- Parameters:
xml- Ajava.lang.Stringrepresenting aRequestobject- Throws:
XACMLException- if it could not process the XML string
-
RequestImpl
public RequestImpl(Element element) throws XACMLException
This constructor is used to buildRequestobject from a block of existing XML that has already been built into a DOM.- Parameters:
element- Aorg.w3c.dom.Elementrepresenting DOM tree forRequestobject- Throws:
XACML2Exception- if it could not process the ElementXACMLException
-
-
Method Detail
-
getSubjects
public List getSubjects()
Returns the one to manySubjectelements of this object- Specified by:
getSubjectsin interfaceRequest- Returns:
- the
Subjectelements of this object
-
setSubjects
public void setSubjects(List subjects) throws XACMLException
Sets the one to manySubjectelements of this object- Specified by:
setSubjectsin interfaceRequest- Parameters:
subjects- the one to manySubjectelements of this object- Throws:
XACMLException- if the object is immutable An object is consideredimmutableifmakeImmutable()has been invoked on it. It can be determined by callingisMutableon the object.
-
getResources
public List getResources()
Returns the one to manyResourceelements of this object- Specified by:
getResourcesin interfaceRequest- Returns:
- the
Resourceelements of this object
-
setResources
public void setResources(List resources) throws XACMLException
Sets the one to manyResourceelements of this object- Specified by:
setResourcesin interfaceRequest- Parameters:
resources- the one to manyResourceelements of this object- Throws:
XACMLException- if the object is immutable An object is consideredimmutableifmakeImmutable()has been invoked on it. It can be determined by callingisMutableon the object.
-
getAction
public Action getAction()
Returns the instance ofActionelement
-
setAction
public void setAction(Action argAction) throws XACMLException
Sets the instance ofAction- Specified by:
setActionin interfaceRequest- Parameters:
argAction- instance ofAction.- Throws:
XACMLException- if the object is immutable An object is consideredimmutableifmakeImmutable()has been invoked on it. It can be determined by callingisMutableon the object.
-
getEnvironment
public Environment getEnvironment()
Returns the instance ofEnvironmentelement.- Specified by:
getEnvironmentin interfaceRequest- Returns:
- the instance of
Environment.
-
setEnvironment
public void setEnvironment(Environment argEnv) throws XACMLException
Sets the instance of theEnvironment- Specified by:
setEnvironmentin interfaceRequest- Parameters:
argEnv- instance ofEnvironment.- Throws:
XACMLException- if the object is immutable An object is consideredimmutableifmakeImmutable()has been invoked on it. It can be determined by callingisMutableon the object.
-
toXMLString
public String toXMLString(boolean includeNSPrefix, boolean declareNS) throws XACMLException
Returns aStringrepresentation of this object- Specified by:
toXMLStringin interfaceRequest- Parameters:
includeNSPrefix- Determines whether or not the namespace qualifier is prepended to the Element when converteddeclareNS- Determines whether or not the namespace is declared within the Element.- Returns:
- a string representation of this object
- Throws:
XACMLException- if conversion fails for any reason
-
toXMLString
public String toXMLString() throws XACMLException
Returns a string representation of this object- Specified by:
toXMLStringin interfaceRequest- Returns:
- a string representation of this object
- Throws:
XACMLException- if conversion fails for any reason
-
makeImmutable
public void makeImmutable()
Makes the object immutable- Specified by:
makeImmutablein interfaceRequest
-
-