com.sun.identity.federation.message
Class FSNameRegistrationResponse

java.lang.Object
  extended bycom.sun.identity.saml.protocol.AbstractResponse
      extended bycom.sun.identity.federation.message.FSNameRegistrationResponse

public class FSNameRegistrationResponse
extends AbstractResponse

This class FSNameRegistrationRequest is used to construct and/or parse Name Identifier Registration response.


Constructor Summary
FSNameRegistrationResponse()
          Default constructor
FSNameRegistrationResponse(org.w3c.dom.Element root)
          Constructor
FSNameRegistrationResponse(java.lang.String responseID, java.lang.String inResponseTo, Status status, java.lang.String providerId, java.lang.String relayState)
          This constructor shall only be used at the server side to construct a FSNameRegistrationResponse object.
 
Method Summary
 java.lang.String getID()
          Gets id attribute.
 int getMinorVersion()
          Gets minor version
 java.lang.String getProviderId()
          Gets provider ID.
 java.lang.String getRelayState()
          Gets Relay state
 java.lang.String getSignatureString()
          Get the Signature Element as string
 java.lang.String getSignedXMLString()
          Get Signed XML String
 Status getStatus()
          Get status
static FSNameRegistrationResponse parseBASE64EncodedString(java.lang.String encodedRes)
          Creates the FSNameRegistrationResponse from base 64 encoded string
static FSNameRegistrationResponse parseURLEncodedRequest(javax.servlet.http.HttpServletRequest request)
          Gets the FSNameRegistrationResponse from the query parameters.
static FSNameRegistrationResponse parseXML(java.lang.String xml)
          Creates FSNameRegistrationResponse from XML string
 void setID(java.lang.String id)
          Sets id attribute.
 void setMinorVersion(int version)
          Sets minor version
 void setProviderId(java.lang.String providerId)
          Sets provider ID.
 void setRelayState(java.lang.String relayState)
          Sets RelayState parameter
 boolean setSignature(org.w3c.dom.Element elem)
          Sets the signature element
 void setStatus(Status status)
          Sets status
 void signXML()
          Signs the FSNameRegistrationResponse.
 void signXML(java.lang.String certAlias)
          Signs the FSNameRegistrationResponse.
 java.lang.String toBASE64EncodedString()
          Gets the base 64 encoded string representation of the object
 java.lang.String toURLEncodedQueryString()
          Gets the URL encoded string format of the response
 java.lang.String toXMLString()
          Gets a String representation of the FSNameRegistrationResponse object
 java.lang.String toXMLString(boolean includeNS, boolean declareNS)
          Gets a String representation of the
 java.lang.String toXMLString(boolean includeNS, boolean declareNS, boolean includeHeader)
          Gets a String representation of the FSNameRegistrationResponse object
 
Methods inherited from class com.sun.identity.saml.protocol.AbstractResponse
getInResponseTo, getIssueInstant, getMajorVersion, getRecipient, getResponseID, getSignature, isSignatureValid, isSigned, setInResponseTo, setIssueInstant, setMajorVersion, setRecipient, setResponseID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FSNameRegistrationResponse

public FSNameRegistrationResponse()
Default constructor


FSNameRegistrationResponse

public FSNameRegistrationResponse(java.lang.String responseID,
                                  java.lang.String inResponseTo,
                                  Status status,
                                  java.lang.String providerId,
                                  java.lang.String relayState)
                           throws FSMsgException
This constructor shall only be used at the server side to construct a FSNameRegistrationResponse object.

Parameters:
responseID - If it's null, the constructor will create one.
inResponseTo - the FSNameRegistrationResponse that this response is corresponding. It could be null or empty string "".
status - The status of the response.
providerId - provider ID.
relayState - relay state.
Throws:
FSMsgException - if error occurs.

FSNameRegistrationResponse

public FSNameRegistrationResponse(org.w3c.dom.Element root)
                           throws FSMsgException,
                                  SAMLException
Constructor

Parameters:
root - DOM Element representing the FSNameRegistrationResponse
Throws:
FSMsgException - if error occurs
SAMLException - if error occurs
Method Detail

getRelayState

public java.lang.String getRelayState()
Gets Relay state

Returns:
Relay state

setRelayState

public void setRelayState(java.lang.String relayState)
Sets RelayState parameter

Parameters:
relayState - RelayState parameter to be set

getID

public java.lang.String getID()
Gets id attribute. This is for ID-FF 1.1 only.

Returns:
id attribute.

setID

public void setID(java.lang.String id)
Sets id attribute. This is for ID-FF 1.1 only.

Parameters:
id - id to be set.

getProviderId

public java.lang.String getProviderId()
Gets provider ID.

Returns:
provider ID.

setProviderId

public void setProviderId(java.lang.String providerId)
Sets provider ID.

Parameters:
providerId - provider ID to be set

getSignedXMLString

public java.lang.String getSignedXMLString()
Get Signed XML String

Returns:
signed XML String, return null if FSNameRegistrationResponse is not signed.

getSignatureString

public java.lang.String getSignatureString()
Get the Signature Element as string

Returns:
Signature string, return null if FSNameRegistrationResponse is not signed.

getMinorVersion

public int getMinorVersion()
Gets minor version

Overrides:
getMinorVersion in class AbstractResponse
Returns:
minor version

setMinorVersion

public void setMinorVersion(int version)
Sets minor version

Overrides:
setMinorVersion in class AbstractResponse
Parameters:
version - minor version to be set

getStatus

public Status getStatus()
Get status

Returns:
status object

setStatus

public void setStatus(Status status)
Sets status

Parameters:
status - status to be set

parseXML

public static FSNameRegistrationResponse parseXML(java.lang.String xml)
                                           throws FSMsgException
Creates FSNameRegistrationResponse from XML string

Parameters:
xml - XML string representing the FSNameRegistrationResponse object
Returns:
FSNameRegistrationResponse object
Throws:
FSMsgException - if unable to construct the object

toXMLString

public java.lang.String toXMLString()
                             throws FSMsgException
Gets a String representation of the FSNameRegistrationResponse object

Returns:
An XML String representing the response.
Throws:
FSMsgException - if unable to get the XML string

toXMLString

public java.lang.String toXMLString(boolean includeNS,
                                    boolean declareNS)
                             throws FSMsgException
Gets a String representation of the

Parameters:
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.
Returns:
A string containing the valid XML for this element
Throws:
FSMsgException - if unable to get the XML string

toXMLString

public java.lang.String toXMLString(boolean includeNS,
                                    boolean declareNS,
                                    boolean includeHeader)
                             throws FSMsgException
Gets a String representation of the FSNameRegistrationResponse object

Parameters:
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.
Returns:
A string containing the valid XML for this element
Throws:
FSMsgException - if unable to get the XML string

parseBASE64EncodedString

public static FSNameRegistrationResponse parseBASE64EncodedString(java.lang.String encodedRes)
                                                           throws FSMsgException,
                                                                  SAMLException
Creates the FSNameRegistrationResponse from base 64 encoded string

Parameters:
encodedRes - base 64 encoded string representing the FSNameRegistrationResponse object.
Returns:
the FSNameRegistrationResponse object.
Throws:
FSMsgException - if unable to create the object
SAMLException - if unable to create the object

toBASE64EncodedString

public java.lang.String toBASE64EncodedString()
                                       throws FSMsgException
Gets the base 64 encoded string representation of the object

Returns:
base 64 encoded string representation of the object.
Throws:
FSMsgException - if unable to get the string

signXML

public void signXML(java.lang.String certAlias)
             throws SAMLException
Signs the FSNameRegistrationResponse.

Parameters:
certAlias - certificate alias which will be used for signing.
Throws:
SAMLException - if could not sign the FSAuthnResponse

signXML

public void signXML()
             throws SAMLException
Signs the FSNameRegistrationResponse.

Specified by:
signXML in class AbstractResponse
Throws:
SAMLException - if could not sign the FSAuthnResponse

setSignature

public boolean setSignature(org.w3c.dom.Element elem)
Sets the signature element

Overrides:
setSignature in class AbstractResponse
Parameters:
elem - DOM Signature element to be set
Returns:
true if setting successful, false otherwise.

toURLEncodedQueryString

public java.lang.String toURLEncodedQueryString()
                                         throws FSMsgException
Gets the URL encoded string format of the response

Returns:
URL encoded string format of the response
Throws:
FSMsgException - if unable to convert the response

parseURLEncodedRequest

public static FSNameRegistrationResponse parseURLEncodedRequest(javax.servlet.http.HttpServletRequest request)
                                                         throws FSMsgException,
                                                                SAMLException
Gets the FSNameRegistrationResponse from the query parameters.

Parameters:
request - HttpServletRequest to retrieve query parameters
Returns:
FSNameRegistrationResponse object
Throws:
SAMLException - if unable to construct the object.
FSMsgException - if unable to construct the object.


Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.