public class RequestImpl extends Object implements Request
Request
element is the top-level element in the XACML
context schema. Its an abstraction layer used by the policy language.
It contains Subject
, Resource
, Action
and Environment elements.
<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 and Description
RequestImpl()
Default constructor
RequestImpl(Element element)
This constructor is used to build Request
object from a
block of existing XML that has already been built into a DOM.
RequestImpl(String xml)
This constructor is used to build Request
object from a
XML string.
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
Action
getAction()
Returns the instance of Action
element
Environment
getEnvironment()
Returns the instance of Environment
element.
List
getResources()
Returns the one to many Resource
elements of this object
List
getSubjects()
Returns the one to many Subject
elements of this object
boolean
isMutable()
Checks if the object is mutable
void
makeImmutable()
Makes the object immutable
void
setAction(Action argAction)
Sets the instance of Action
void
setEnvironment(Environment argEnv)
Sets the instance of the Environment
void
setResources(List resources)
Sets the one to many Resource
elements of this object
void
setSubjects(List subjects)
Sets the one to many Subject
elements of this object
String
toXMLString()
Returns a string representation of this object
String
toXMLString(boolean includeNSPrefix,
boolean declareNS)
Returns a String
representation of this object
-
-
Constructor Detail
-
RequestImpl
public RequestImpl()
Default constructor
-
RequestImpl
public RequestImpl(String xml)
throws XACMLException
This constructor is used to build Request
object from a
XML string.
- Parameters:
xml
- A java.lang.String
representing
a Request
object
- Throws:
XACMLException
- if it could not process the XML string
-
RequestImpl
public RequestImpl(Element element)
throws XACMLException
This constructor is used to build Request
object from a
block of existing XML that has already been built into a DOM.
- Parameters:
element
- A org.w3c.dom.Element
representing
DOM tree for Request
object
- Throws:
XACMLException
- if it could not process the Element
-
Method Detail
-
getSubjects
public List getSubjects()
Returns the one to many Subject
elements of this object
- Specified by:
getSubjects
in interface Request
- Returns:
- the
Subject
elements of this object
-
setSubjects
public void setSubjects(List subjects)
throws XACMLException
Sets the one to many Subject
elements of this object
- Specified by:
setSubjects
in interface Request
- Parameters:
subjects
- the one to many Subject
elements of this
object
- Throws:
XACMLException
- if the object is immutable
An object is considered immutable
if
makeImmutable()
has been invoked on it. It can
be determined by calling isMutable
on the object.
-
getResources
public List getResources()
Returns the one to many Resource
elements of this object
- Specified by:
getResources
in interface Request
- Returns:
- the
Resource
elements of this object
-
setResources
public void setResources(List resources)
throws XACMLException
Sets the one to many Resource
elements of this object
- Specified by:
setResources
in interface Request
- Parameters:
resources
- the one to many Resource
elements of this
object
- Throws:
XACMLException
- if the object is immutable
An object is considered immutable
if
makeImmutable()
has been invoked on it. It can
be determined by calling isMutable
on the object.
-
getAction
public Action getAction()
Returns the instance of Action
element
-
setAction
public void setAction(Action argAction)
throws XACMLException
Sets the instance of Action
- Specified by:
setAction
in interface Request
- Parameters:
argAction
- instance of Action
.
- Throws:
XACMLException
- if the object is immutable
An object is considered immutable
if
makeImmutable()
has been invoked on it. It can
be determined by calling isMutable
on the object.
-
getEnvironment
public Environment getEnvironment()
Returns the instance of Environment
element.
- Specified by:
getEnvironment
in interface Request
- Returns:
- the instance of
Environment
.
-
setEnvironment
public void setEnvironment(Environment argEnv)
throws XACMLException
Sets the instance of the Environment
- Specified by:
setEnvironment
in interface Request
- Parameters:
argEnv
- instance of Environment
.
- Throws:
XACMLException
- if the object is immutable
An object is considered immutable
if
makeImmutable()
has been invoked on it. It can
be determined by calling isMutable
on the object.
-
toXMLString
public String toXMLString(boolean includeNSPrefix,
boolean declareNS)
throws XACMLException
Returns a String
representation of this object
- Specified by:
toXMLString
in interface Request
- Parameters:
includeNSPrefix
- Determines whether or not the namespace qualifier
is prepended to the Element when converted
declareNS
- 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:
toXMLString
in interface Request
- 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:
makeImmutable
in interface Request
Copyright © 2010-2018, ForgeRock All Rights Reserved.