net.geant.edugain.base
Class Response

java.lang.Object
  extended by net.geant.edugain.base.Response
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AttributeResponse, AuthenticationResponse, AuthorizationResponse, FaultResponse

public abstract class Response
extends java.lang.Object
implements java.io.Serializable

Defines a generic eduGAIN class for responses. The class will be extended depending on the type of response: Authentication, Attributes, Authorization or Home Location.

Author:
Jose Manuel Macias
See Also:
Serialized Form

Field Summary
protected  java.lang.String additionalData
          Any other data the Authentication Service is willing to include.
protected  java.net.URI consumerId
          The component identifier for the consumer of the response.
static javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_ACCEPTED
          The request was accepted
static javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_CONNECT_TO
          Connect to...
static javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_DENY
          The request was denied
static javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_EXPIRED_MESSAGE
          The validity time of the content of the message has expired.
static javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_FAULT
          Fault
static javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_INCOMPATIBLE_VERSIONS
          The version of the message is incompatible with the version of the service.
static javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_INSUFFICIENT_DATA
          Not enough data to perform the authentication operation
static javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_INVALID_CREDENTIALS
          The provided credentials were invalid
static javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_MALFORMED_MESSAGE
          Error in the structure or codification of the message
static javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_REDIRECT_USER_TO
          The user must be redirected to...
static javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_TRUST_ERROR
          Error checking the authenticity of the message
static javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_UNKNOWN_HOMESITE
          The homesite provided (or guessed by the HLS) is unknown
protected  java.lang.String errorMessage
          Extra information about the error.
protected  javax.xml.namespace.QName errorReason
          One of the possible error types taken into account in the system (see below)
protected  java.lang.String inResponseTo
          A reference to the RequestID contained in the input message of the operation.
protected  java.util.ArrayList<java.net.URI> interfaces
          A list of (possible) interfaces associated with a CONNECT_TO result
protected  java.util.Date issued
          The instant this response was issued
protected  java.util.Date notBefore
          The date after this response will be valid
protected  java.util.Date notOnOrAfter
          The date after this response will no longer be valid
protected  java.net.URI producerId
          The component identifier for the producer of the response.
private static java.security.SecureRandom random
          A secure random number generator
protected  java.lang.String responseID
          A reference (internally generated by the responder) for this operation to be used in further interactions regarding the request.
protected  javax.xml.namespace.QName result
          The result of the request.
protected  java.lang.String resultMessage
          Extra information about the error.
private  java.util.Properties signingProperties
          Deprecated. 
private  int validatedTrust
          Deprecated. 
 
Constructor Summary
Response()
          Creates a new instance of Response
 
Method Summary
 boolean fromInputStream(java.io.InputStream stream)
          Imports the data from an InputStream into this response.
 void generateResponseID()
          Sets a randomly generated id for this request operation to be used in further interactions regarding this request.
 java.lang.String getAdditionalData(java.lang.String data)
          Gets additional data
 java.net.URI getConsumerId()
          Gets the component identifier for the eduGAIN component consuming this response .
 java.lang.String getInResponseTo()
          Gets the identifier of the query being responded
 java.util.ArrayList<java.net.URI> getInterfaces()
          Returns the list of interfaces associated with a ConnectTo result.
 java.util.Date getIssued()
          Returns the date this response was issued
 java.util.Date getNotBefore()
          Gets the date before this response should not be used
 java.util.Date getNotOnOrAfter()
          Gets the date after this response should not be used
 java.net.URI getProducerId()
          Gets the component identifier for the eduGAIN component producing this response .
 java.lang.String getResponseID()
          Gets the identifier for this result
 javax.xml.namespace.QName getResult()
          Gets the status code of this response
 java.lang.String getResultMessage()
          Gets the message associated with the result.
 java.util.Properties getSigningProperties()
          Deprecated.  
 int getValidatedTrust()
          Deprecated. 
 void setAdditionalData(java.lang.String data)
          Sets additional data
 void setConsumerId(java.net.URI consumerId)
          Sets the component identifier for the eduGAIN component consuming this response.
 void setInResponseTo(java.lang.String id)
          Sets the identifier of the query being responded
 void setInterfaces(java.util.ArrayList<java.net.URI> interf)
          Returns the list of interfaces associated with a ConnectTo result.
 void setIssued(java.util.Date issued)
          Sets the date this response is being issued (Issue Instant)
 void setNotBefore(java.util.Date notBefore)
          Sets the date before this response should not be used
 void setNotOnOrAfter(java.util.Date notOnOrAfter)
          Sets the date after this response should not be used
 void setProducerId(java.net.URI producerId)
          Sets the component identifier for the eduGAIN component producing this response.
 void setResponseID()
          Deprecated.  
 void setResponseID(java.lang.String id)
          Sets a reference for this request operation to be used in further interactions regarding this request.
 void setResult(javax.xml.namespace.QName code)
          Sets the result code for the response
 void setResultMessage(java.lang.String resultMessage)
          Sets the message associated with the result.
 void setSigningProperties(java.util.Properties signingProperties)
          Deprecated.  
 void setValidatedTrust(int validatedTrust)
          Deprecated. 
 java.lang.String toString()
          Creates a w3c.dom.Element from the information stored in this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

random

private static java.security.SecureRandom random
A secure random number generator


responseID

protected java.lang.String responseID
A reference (internally generated by the responder) for this operation to be used in further interactions regarding the request.


producerId

protected java.net.URI producerId
The component identifier for the producer of the response.


consumerId

protected java.net.URI consumerId
The component identifier for the consumer of the response.


inResponseTo

protected java.lang.String inResponseTo
A reference to the RequestID contained in the input message of the operation.


result

protected javax.xml.namespace.QName result

The result of the request. Possible values are:


resultMessage

protected java.lang.String resultMessage
Extra information about the error.


signingProperties

@Deprecated
private java.util.Properties signingProperties
Deprecated. 
Signing properties


validatedTrust

@Deprecated
private int validatedTrust
Deprecated. 
An integer indicating if this request has been validated.


issued

protected java.util.Date issued
The instant this response was issued


notBefore

protected java.util.Date notBefore
The date after this response will be valid


notOnOrAfter

protected java.util.Date notOnOrAfter
The date after this response will no longer be valid


EDUGAIN_NAMESPACE_RESULT_ACCEPTED

public static final javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_ACCEPTED
The request was accepted


EDUGAIN_NAMESPACE_RESULT_DENY

public static final javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_DENY
The request was denied


EDUGAIN_NAMESPACE_RESULT_CONNECT_TO

public static final javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_CONNECT_TO
Connect to... (a list of interfaces)


EDUGAIN_NAMESPACE_RESULT_REDIRECT_USER_TO

public static final javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_REDIRECT_USER_TO
The user must be redirected to...


EDUGAIN_NAMESPACE_RESULT_INSUFFICIENT_DATA

public static final javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_INSUFFICIENT_DATA
Not enough data to perform the authentication operation


EDUGAIN_NAMESPACE_RESULT_INVALID_CREDENTIALS

public static final javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_INVALID_CREDENTIALS
The provided credentials were invalid


EDUGAIN_NAMESPACE_RESULT_UNKNOWN_HOMESITE

public static final javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_UNKNOWN_HOMESITE
The homesite provided (or guessed by the HLS) is unknown


EDUGAIN_NAMESPACE_RESULT_FAULT

public static final javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_FAULT
Fault


interfaces

protected java.util.ArrayList<java.net.URI> interfaces
A list of (possible) interfaces associated with a CONNECT_TO result


additionalData

protected java.lang.String additionalData

Any other data the Authentication Service is willing to include. Possible purposes of these data are to provide additional logging and diagnostic information, or information relevant to the requesting resource, and any assumptions on their format is out of scope of this document.

This element is mapped to StatusDetail element which is unsupported in OpenSAML1, so for this version of the library, additionalData is unused.


errorReason

protected javax.xml.namespace.QName errorReason
One of the possible error types taken into account in the system (see below)


EDUGAIN_NAMESPACE_RESULT_TRUST_ERROR

public static final javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_TRUST_ERROR
Error checking the authenticity of the message


EDUGAIN_NAMESPACE_RESULT_MALFORMED_MESSAGE

public static final javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_MALFORMED_MESSAGE
Error in the structure or codification of the message


EDUGAIN_NAMESPACE_RESULT_EXPIRED_MESSAGE

public static final javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_EXPIRED_MESSAGE
The validity time of the content of the message has expired.


EDUGAIN_NAMESPACE_RESULT_INCOMPATIBLE_VERSIONS

public static final javax.xml.namespace.QName EDUGAIN_NAMESPACE_RESULT_INCOMPATIBLE_VERSIONS
The version of the message is incompatible with the version of the service.


errorMessage

protected java.lang.String errorMessage
Extra information about the error.

Constructor Detail

Response

public Response()
Creates a new instance of Response

Method Detail

setResponseID

public void setResponseID(java.lang.String id)
Sets a reference for this request operation to be used in further interactions regarding this request.


setResponseID

@Deprecated
public void setResponseID()
Deprecated. 

Sets a randomly generated id for this request operation to be used in further interactions regarding this request.


generateResponseID

public void generateResponseID()
Sets a randomly generated id for this request operation to be used in further interactions regarding this request.


getResponseID

public java.lang.String getResponseID()
Gets the identifier for this result

Returns:
the identier of this result

setInResponseTo

public void setInResponseTo(java.lang.String id)
Sets the identifier of the query being responded

Parameters:
id - The identifier

getInResponseTo

public java.lang.String getInResponseTo()
Gets the identifier of the query being responded

Returns:
The inResponseTo identifier

setResult

public void setResult(javax.xml.namespace.QName code)
Sets the result code for the response

Parameters:
code - A valid result code (as thefined above)

getResult

public javax.xml.namespace.QName getResult()
Gets the status code of this response

Returns:
A qualified name describing the result

getInterfaces

public java.util.ArrayList<java.net.URI> getInterfaces()
Returns the list of interfaces associated with a ConnectTo result.

Returns:
An string array with the list of interfaces

setInterfaces

public void setInterfaces(java.util.ArrayList<java.net.URI> interf)
Returns the list of interfaces associated with a ConnectTo result.

Parameters:
interf - An string array with the list of interfaces

setAdditionalData

public void setAdditionalData(java.lang.String data)
Sets additional data


getAdditionalData

public java.lang.String getAdditionalData(java.lang.String data)
Gets additional data


toString

public java.lang.String toString()
Creates a w3c.dom.Element from the information stored in this object

Overrides:
toString in class java.lang.Object

fromInputStream

public boolean fromInputStream(java.io.InputStream stream)
Imports the data from an InputStream into this response.

Returns:
true on success, false on fail

getProducerId

public java.net.URI getProducerId()
Gets the component identifier for the eduGAIN component producing this response .

Returns:
an URN following eduGAIN naming conventions.

setProducerId

public void setProducerId(java.net.URI producerId)
Sets the component identifier for the eduGAIN component producing this response.

Parameters:
producerId - An URN following eduGAIN component naming conventions.

getConsumerId

public java.net.URI getConsumerId()
Gets the component identifier for the eduGAIN component consuming this response .

Returns:
an URN following eduGAIN naming conventions.

setConsumerId

public void setConsumerId(java.net.URI consumerId)
Sets the component identifier for the eduGAIN component consuming this response.

Parameters:
consumerId - An URN following eduGAIN component naming conventions.

getResultMessage

public java.lang.String getResultMessage()
Gets the message associated with the result.


getValidatedTrust

@Deprecated
public int getValidatedTrust()
Deprecated. 

Returns the result of a previous trust validation


setValidatedTrust

@Deprecated
public void setValidatedTrust(int validatedTrust)
Deprecated. 

Sets the result of validating the trust of this request


setResultMessage

public void setResultMessage(java.lang.String resultMessage)
Sets the message associated with the result.

Parameters:
resultMessage - The message

getIssued

public java.util.Date getIssued()
Returns the date this response was issued

Returns:
the issue instant

setIssued

public void setIssued(java.util.Date issued)
Sets the date this response is being issued (Issue Instant)

Parameters:
issued - The issue instant

getNotBefore

public java.util.Date getNotBefore()
Gets the date before this response should not be used

Returns:
the date before this response should not be used

setNotBefore

public void setNotBefore(java.util.Date notBefore)
Sets the date before this response should not be used

Parameters:
notBefore - The date when this response will be valid

getNotOnOrAfter

public java.util.Date getNotOnOrAfter()
Gets the date after this response should not be used

Returns:
the date after this response should not be used

setNotOnOrAfter

public void setNotOnOrAfter(java.util.Date notOnOrAfter)
Sets the date after this response should not be used

Parameters:
notOnOrAfter - The date when this response won't be valid

getSigningProperties

@Deprecated
public java.util.Properties getSigningProperties()
Deprecated. 

Gets properties used for signing this response.


setSigningProperties

@Deprecated
public void setSigningProperties(java.util.Properties signingProperties)
Deprecated. 

Sets properties used for signing this response.