com.sun.identity.saml.protocol
クラス Response

java.lang.Object
  上位を拡張 com.sun.identity.saml.protocol.AbstractResponse
      上位を拡張 com.sun.identity.saml.protocol.Response
直系の既知のサブクラス:
FSAuthnResponse, FSResponse

public class Response
extends AbstractResponse

This Response class represents a Response XML document. The schema of Response is defined as the following:


フィールドの概要
protected  List assertions
           
protected  String issuer
           
protected  String signatureString
           
protected  Status status
           
protected  String xmlString
           
 
クラス com.sun.identity.saml.protocol.AbstractResponse から継承されたフィールド
inResponseTo, issueInstant, majorVersion, minorVersion, recipient, responseID, signature, signed, valid, validationDone
 
コンストラクタの概要
protected Response()
          default constructor
  Response(Element root)
          Constructor.
  Response(String responseID, Status status, List contents)
          This constructor shall only be used at the server side to construct a Response object.
  Response(String responseID, Status status, String recipient, List contents)
          This constructor shall only be used at the server side to construct a Response object.
  Response(String responseID, String inResponseTo, Status status, List contents)
          This constructor shall only be used at the server side to construct a Response object.
  Response(String responseID, String inResponseTo, Status status, String recipient, List contents)
          This constructor shall only be used at the server side to construct a Response object.
 
メソッドの概要
 boolean addAssertion(Assertion assertion)
          Add an assertion to the Response.
 List getAssertion()
          This method returns the set of Assertions that is the content of the response.
 Status getStatus()
          Gets the Status of the Response.
 boolean isSignatureValid()
          Return whether the signature on the object is valid or not.
static Response parseXML(InputStream is)
          Returns Response object based on the XML document received from server.
static Response parseXML(String xml)
          Returns Response object based on the XML document received from server.
 boolean setSignature(Element elem)
          Set the signature for the Response.
 boolean setStatus(Status status)
          Set the Status of the Response.
 void signXML()
          Method that signs the Response.
 String toString()
          This method translates the response to an XML document String based on the Response schema described above.
 String toString(boolean includeNS, boolean declareNS)
          Creates a String representation of the <samlp:Response> element.
 String toString(boolean includeNS, boolean declareNS, boolean includeHeader)
          Creates a String representation of the <samlp:Response> element.
 
クラス com.sun.identity.saml.protocol.AbstractResponse から継承されたメソッド
getInResponseTo, getIssueInstant, getMajorVersion, getMinorVersion, getRecipient, getResponseID, getSignature, isSigned, setInResponseTo, setIssueInstant, setMajorVersion, setMinorVersion, setRecipient, setResponseID
 

フィールドの詳細

status

protected Status status

assertions

protected List assertions

xmlString

protected String xmlString

signatureString

protected String signatureString

issuer

protected String issuer
コンストラクタの詳細

Response

protected Response()
default constructor


Response

public Response(String responseID,
                String inResponseTo,
                Status status,
                List contents)
         throws SAMLException
This constructor shall only be used at the server side to construct a Response object. NOTE: The content here is just the body for the Response. The constructor will add the unique ResponseID, MajorVersion, etc. to form a complete Response object.

パラメータ:
responseID - If it's null, the constructor will create one.
inResponseTo - the RequestID that this response is corresponding. It could be null or empty string "".
status - The status of the response.
contents - A List of Assertions that are the content of the Response. It could be null when there is no Assertion.
例外:
SAMLException - if error occurs.

Response

public Response(String responseID,
                String inResponseTo,
                Status status,
                String recipient,
                List contents)
         throws SAMLException
This constructor shall only be used at the server side to construct a Response object. NOTE: The content here is just the body for the Response. The constructor will add the unique ResponseID, MajorVersion, etc. to form a complete Response object.

パラメータ:
responseID - If it's null, the constructor will create one.
inResponseTo - the RequestID that this response is corresponding. It could be null or empty string "".
status - The status of the response.
recipient - The intended recipient of the response. It could be null or empty string since it's optional.
contents - A List of Assertions that are the content of the Response. It could be null when there is no Assertion.
例外:
SAMLException - if error occurs.

Response

public Response(String responseID,
                Status status,
                String recipient,
                List contents)
         throws SAMLException
This constructor shall only be used at the server side to construct a Response object. NOTE: The content here is just the body for the Response. The constructor will add the unique ResponseID, MajorVersion, etc. to form a complete Response object.

パラメータ:
responseID - If it's null, the constructor will create one.
status - The status of the response.
recipient - The intended recipient of the response. It could be null or empty string since it's optional.
contents - A List of Assertions that are the content of the Response. It could be null when there is no Assertion.
例外:
SAMLException - if error occurs.

Response

public Response(String responseID,
                Status status,
                List contents)
         throws SAMLException
This constructor shall only be used at the server side to construct a Response object. NOTE: The content here is just the body for the Response. The constructor will add the unique ResponseID, MajorVersion, etc. to form a complete Response object.

パラメータ:
responseID - If it's null, the constructor will create one.
status - The status of the response.
contents - A List of Assertions that are the content of the Response. It could be null when there is no Assertion.
例外:
SAMLException - if error occurs.

Response

public Response(Element root)
         throws SAMLException
Constructor.

パラメータ:
root - Response element
例外:
SAMLException - if error occurs.
メソッドの詳細

isSignatureValid

public boolean isSignatureValid()
Return whether the signature on the object is valid or not.

オーバーライド:
クラス AbstractResponse 内の isSignatureValid
戻り値:
true if the signature on the object is valid; false otherwise.

signXML

public void signXML()
             throws SAMLException
Method that signs the Response.

定義:
クラス AbstractResponse 内の signXML
例外:
SAMLException - if could not sign the Response.

parseXML

public static Response parseXML(String xml)
                         throws SAMLException
Returns Response object based on the XML document received from server. This method is used primarily at the client side. The schema of the XML document is describe above.

パラメータ:
xml - The Response XML document String. NOTE: this is a complete SAML response XML string with ResponseID, MajorVersion, etc.
戻り値:
Response object based on the XML document received from server.
例外:
SAMLException - if XML parsing failed

parseXML

public static Response parseXML(InputStream is)
                         throws SAMLException
Returns Response object based on the XML document received from server. This method is used primarily at the client side. The schema of the XML document is describe above.

パラメータ:
is - The Response XML InputStream. NOTE: The InputStream contains a complete SAML response with ResponseID, MajorVersion, etc.
戻り値:
Response object based on the XML document received from server.
例外:
SAMLException - if XML parsing failed

getAssertion

public List getAssertion()
This method returns the set of Assertions that is the content of the response.

戻り値:
The set of Assertions that is the content of the response. It could be Collections.EMPTY_LIST when there is no Assertion in the response.

addAssertion

public boolean addAssertion(Assertion assertion)
Add an assertion to the Response.

パラメータ:
assertion - The assertion to be added.
戻り値:
A boolean value: true if the operation is successful; false otherwise.

getStatus

public Status getStatus()
Gets the Status of the Response.

戻り値:
The Status of the response.

setStatus

public boolean setStatus(Status status)
Set the Status of the Response.

パラメータ:
status - The Status of the Response to be set.
戻り値:
true if the operation is successful.

setSignature

public boolean setSignature(Element elem)
Set the signature for the Response.

オーバーライド:
クラス AbstractResponse 内の setSignature
パラメータ:
elem - ds:Signature element
戻り値:
A boolean value: true if the operation succeeds; false otherwise.

toString

public String toString()
This method translates the response to an XML document String based on the Response schema described above.

オーバーライド:
クラス Object 内の toString
戻り値:
An XML String representing the response. NOTE: this is a complete SAML response XML string with ResponseID, MajorVersion, etc.

toString

public String toString(boolean includeNS,
                       boolean declareNS)
Creates a String representation of the <samlp:Response> element.

パラメータ:
includeNS - Determines whether or not the namespace qualifier is prepended to the Element when converted
declareNS - Determines whether or not the namespace is declared within the Element.
戻り値:
A string containing the valid XML for this element

toString

public String toString(boolean includeNS,
                       boolean declareNS,
                       boolean includeHeader)
Creates a String representation of the <samlp:Response> element.

パラメータ:
includeNS - Determines whether or not the namespace qualifier is prepended to the Element when converted
declareNS - Determines whether or not the namespace is declared within the Element.
includeHeader - Determines whether the output include the XML declaration header.
戻り値:
A string containing the valid XML for this element