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
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 objectDocumentFragmenttoDocumentFragment(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 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:
XACMLException- if it could not process the Element
-
-
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.
-
toDocumentFragment
public DocumentFragment toDocumentFragment(Document document, boolean includeNSPrefix, boolean declareNS) throws SAML2Exception
Description copied from interface:XmlSerializableSerializes 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:
toDocumentFragmentin interfaceXmlSerializable- Parameters:
document- the parentDocumentto 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:
makeImmutablein interfaceRequest
-
-