Class RequestImpl
java.lang.Object
com.sun.identity.xacml.context.impl.RequestImpl
- All Implemented Interfaces:
XmlSerializable
,Request
The
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
ConstructorDescriptionDefault constructorRequestImpl
(String xml) This constructor is used to buildRequest
object from a XML string.RequestImpl
(Element element) This constructor is used to buildRequest
object from a block of existing XML that has already been built into a DOM. -
Method Summary
Modifier and TypeMethodDescriptionReturns the instance ofAction
elementReturns the instance ofEnvironment
element.Returns the one to manyResource
elements of this objectReturns the one to manySubject
elements of this objectboolean
Checks if the object is mutablevoid
Makes the object immutablevoid
Sets the instance ofAction
void
setEnvironment
(Environment argEnv) Sets the instance of theEnvironment
void
setResources
(List resources) Sets the one to manyResource
elements of this objectvoid
setSubjects
(List subjects) Sets the one to manySubject
elements of this objecttoDocumentFragment
(Document document, boolean includeNSPrefix, boolean declareNS) Serializes the element into an XMLDocumentFragment
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sun.identity.xacml.context.Request
toXMLString, toXMLString
-
Constructor Details
-
RequestImpl
public RequestImpl()Default constructor -
RequestImpl
This constructor is used to buildRequest
object from a XML string.- Parameters:
xml
- Ajava.lang.String
representing aRequest
object- Throws:
XACMLException
- if it could not process the XML string
-
RequestImpl
This constructor is used to buildRequest
object from a block of existing XML that has already been built into a DOM.- Parameters:
element
- Aorg.w3c.dom.Element
representing DOM tree forRequest
object- Throws:
XACMLException
- if it could not process the Element
-
-
Method Details
-
getSubjects
Returns the one to manySubject
elements of this object- Specified by:
getSubjects
in interfaceRequest
- Returns:
- the
Subject
elements of this object
-
setSubjects
Sets the one to manySubject
elements of this object- Specified by:
setSubjects
in interfaceRequest
- Parameters:
subjects
- the one to manySubject
elements of this object- Throws:
XACMLException
- if the object is immutable An object is consideredimmutable
ifmakeImmutable()
has been invoked on it. It can be determined by callingisMutable
on the object.
-
getResources
Returns the one to manyResource
elements of this object- Specified by:
getResources
in interfaceRequest
- Returns:
- the
Resource
elements of this object
-
setResources
Sets the one to manyResource
elements of this object- Specified by:
setResources
in interfaceRequest
- Parameters:
resources
- the one to manyResource
elements of this object- Throws:
XACMLException
- if the object is immutable An object is consideredimmutable
ifmakeImmutable()
has been invoked on it. It can be determined by callingisMutable
on the object.
-
getAction
Returns the instance ofAction
element -
setAction
Sets the instance ofAction
- Specified by:
setAction
in interfaceRequest
- Parameters:
argAction
- instance ofAction
.- Throws:
XACMLException
- if the object is immutable An object is consideredimmutable
ifmakeImmutable()
has been invoked on it. It can be determined by callingisMutable
on the object.
-
getEnvironment
Returns the instance ofEnvironment
element.- Specified by:
getEnvironment
in interfaceRequest
- Returns:
- the instance of
Environment
.
-
setEnvironment
Sets the instance of theEnvironment
- Specified by:
setEnvironment
in interfaceRequest
- Parameters:
argEnv
- instance ofEnvironment
.- Throws:
XACMLException
- if the object is immutable An object is consideredimmutable
ifmakeImmutable()
has been invoked on it. It can be determined by callingisMutable
on the object.
-
toDocumentFragment
public DocumentFragment toDocumentFragment(Document document, boolean includeNSPrefix, boolean declareNS) throws com.sun.identity.saml2.common.SAML2Exception Description copied from interface:XmlSerializable
Serializes the element into an XMLDocumentFragment
. A default implementation is provided for compatibility with legacy code that implementsXmlSerializable.toXMLString()
, but it is highly recommended to override this method.- Specified by:
toDocumentFragment
in interfaceXmlSerializable
- Parameters:
document
- the parentDocument
to create the document fragment from.includeNSPrefix
- whether to include a namespace prefix in the document elements.declareNS
- whether to declare any namespaces or assume that they are already declared.- Returns:
- the XML document fragment representing this SAML2 element.
- Throws:
com.sun.identity.saml2.common.SAML2Exception
- if the element cannot be serialized for any reason.
-
makeImmutable
public void makeImmutable()Makes the object immutable- Specified by:
makeImmutable
in interfaceRequest
-
isMutable
public boolean isMutable()Checks if the object is mutable
-