Class RequestImpl
- java.lang.Object
-
- com.sun.identity.xacml.context.impl.RequestImpl
-
- All Implemented Interfaces:
XmlSerializable
,Request
@SupportedAll public class RequestImpl extends Object implements Request
TheRequest
element is the top-level element in the XACML context schema. Its an abstraction layer used by the policy language. It containsSubject
,Resource
,Action
andEnvironment
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 Description RequestImpl()
Default 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Action
getAction()
Returns the instance ofAction
elementEnvironment
getEnvironment()
Returns the instance ofEnvironment
element.List
getResources()
Returns the one to manyResource
elements of this objectList
getSubjects()
Returns the one to manySubject
elements of this objectboolean
isMutable()
Checks if the object is mutablevoid
makeImmutable()
Makes the object immutablevoid
setAction(Action argAction)
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 objectDocumentFragment
toDocumentFragment(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 Detail
-
RequestImpl
public RequestImpl()
Default constructor
-
RequestImpl
public RequestImpl(String xml) throws XACMLException
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
public RequestImpl(Element element) throws XACMLException
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 Detail
-
getSubjects
public List getSubjects()
Returns the one to manySubject
elements of this object- Specified by:
getSubjects
in interfaceRequest
- Returns:
- the
Subject
elements of this object
-
setSubjects
public void setSubjects(List subjects) throws XACMLException
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
public List getResources()
Returns the one to manyResource
elements of this object- Specified by:
getResources
in interfaceRequest
- Returns:
- the
Resource
elements of this object
-
setResources
public void setResources(List resources) throws XACMLException
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
public Action getAction()
Returns the instance ofAction
element
-
setAction
public void setAction(Action argAction) throws XACMLException
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
public Environment getEnvironment()
Returns the instance ofEnvironment
element.- Specified by:
getEnvironment
in interfaceRequest
- Returns:
- the instance of
Environment
.
-
setEnvironment
public void setEnvironment(Environment argEnv) throws XACMLException
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 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:
SAML2Exception
- if the element cannot be serialized for any reason.
-
makeImmutable
public void makeImmutable()
Makes the object immutable- Specified by:
makeImmutable
in interfaceRequest
-
-