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
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 Details

    • 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 Details

    • 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
      Specified by:
      getAction in interface Request
      Returns:
      the instance of Action.
    • 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.
    • 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 XML DocumentFragment. A default implementation is provided for compatibility with legacy code that implements XmlSerializable.toXMLString(), but it is highly recommended to override this method.
      Specified by:
      toDocumentFragment in interface XmlSerializable
      Parameters:
      document - the parent Document 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 interface Request
    • isMutable

      public boolean isMutable()
      Checks if the object is mutable
      Specified by:
      isMutable in interface Request
      Returns:
      true if the object is mutable, false otherwise