public class Request extends AbstractRequest
Request
class represents a Request XML document.
It extends from the abstract base class AbstractRequest
.Modifier | Constructor and Description |
---|---|
protected |
Request() |
|
Request(Element root)
Constructor.
|
|
Request(List respondWiths,
String requestId,
List contents)
This constructor shall only be used at the client side to construct a
Request object.
|
|
Request(String requestId,
List contents)
This constructor shall only be used at the client side to construct a
Request object.
|
|
Request(String requestId,
Query query)
This constructor shall only be used at the client side to construct a
Request object.
|
Modifier and Type | Method and Description |
---|---|
List |
getAssertionArtifact()
Gets the
AssertionArtifact (s) of the Request. |
List |
getAssertionIDReference()
Gets the
AssertionIDReference (s) of the Request. |
int |
getContentType()
Returns the type of content this Request has.
|
Query |
getQuery()
Gets the query of the Request.
|
static Request |
parseXML(String xml)
This method shall only be used at the server side to reconstruct
a Request object based on the XML document received from client.
|
boolean |
setSignature(Element elem)
Set the signature for the Response.
|
void |
signXML()
Method to sign the Request.
|
String |
toString()
This method translates the request to an XML document String based on
the Request schema described above.
|
String |
toString(boolean includeNS,
boolean declareNS)
Returns a String representation of the
<samlp:Request> element. |
String |
toString(boolean includeNS,
boolean declareNS,
boolean includeHeader)
Returns a String representation of the
<samlp:Request> element. |
addRespondWith, getIssueInstant, getMajorVersion, getMinorVersion, getRequestID, getRespondWith, getSignature, isSignatureValid, isSigned, setIssueInstant, setMajorVersion, setMinorVersion, setRequestID
protected Request()
public Request(List respondWiths, String requestId, List contents) throws SAMLException
MajorVersion
,
MinorVersion
, etc. to form a complete Request.respondWiths
- A List of Strings representing
RespondWith
elements. It could be null when there is
no <RespondWith>
. Each string could be prefixed
by saml:
. If it is not prefixed, or prefixed by a
prefix other than saml:
, saml:
will be
used instead.requestId
- If it's null, the constructor will create one.contents
- A List of objects that are the contents of Request that
the client wants to send to the server. It could be an
AuthenticationQuery
,
AuthorizationDecisionQuery
,
AttributeQuery
, 1 or more
AssertionIDReference
, or 1 or more of
AssertionArtifact
.SAMLException
- if an error occurs.public Request(String requestId, Query query) throws SAMLException
MajorVersion
,
MinorVersion
, etc. to form a complete Request.requestId
- If it's null, the constructor will create one.query
- A Query to be included in the Request.SAMLException
- if an error occurs.public Request(String requestId, List contents) throws SAMLException
MajorVersion
,
MinorVersion
, etc. to form a complete Request.requestId
- If it's null, the constructor will create one.contents
- A List of objects that are the contents of Request that
the client wants to send to the server. It could be an
AuthenticationQuery
,
AuthorizationDecisionQuery
,
AttributeQuery
, 1 or more
AssertionIDReference
, or 1 or more of
AssertionArtifact
.SAMLException
- if an error occurs.public Request(Element root) throws SAMLException
root
- Request
element. May not be null.SAMLException
- If there was an error while parsing the XML.public void signXML() throws SAMLException
signXML
in class AbstractRequest
SAMLException
- if could not sign the Request.public static Request parseXML(String xml) throws SAMLException
xml
- The Request XML String.
NOTE: this is a complete SAML request XML string with
RequestID
, MajorVersion
, etc.SAMLException
- if an error occurs.public Query getQuery()
contentType
of the request is not
AUTHENTICATION_QUERY
,
AUTHORIZATION_DECISION_QUERY
, or
ATTRIBUTE_QUERY
.public List getAssertionIDReference()
AssertionIDReference
(s) of the Request.AssertionIDReference
s included in the
request; or Collections.EMPTY_LIST
if the
contentType
of the request is not
ASSERTION_ID_REFERENCE
.public List getAssertionArtifact()
AssertionArtifact
(s) of the Request.AssertionArtifact
s included in the
request; or Collections.EMPTY_LIST
if the
contentType
of the request is not
ASSERTION_ARTIFACT
.public int getContentType()
public boolean setSignature(Element elem)
setSignature
in class AbstractRequest
elem
- ds:Signature
elementpublic String toString()
RequestID
, MajorVersion
, etc.public String toString(boolean includeNS, boolean declareNS)
<samlp:Request>
element.includeNS
- Determines whether or not the namespace qualifier
is prepended to the Element when converteddeclareNS
- Determines whether or not the namespace is declared
within the Element.public String toString(boolean includeNS, boolean declareNS, boolean includeHeader)
<samlp:Request>
element.includeNS
- Determines whether or not the namespace qualifier
is prepended to the Element when converteddeclareNS
- Determines whether or not the namespace is declared
within the Element.includeHeader
- Determines whether the output include the XML
declaration header.Copyright © 2010-2018, ForgeRock All Rights Reserved.