net.geant.edugain.base
Class Request

java.lang.Object
  extended by net.geant.edugain.base.Request
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AttributeRequest, AuthenticationRequest, AuthorizationRequest

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

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

Version:
1.0
Author:
Jose Manuel Macias, Diego R. Lopez, Jaime Perez
See Also:
Serialized Form

Field Summary
protected  java.lang.String cacheReference
          An optional parameter including a ResponseID argument of a previous Response.
protected  java.net.URI consumerId
          The component identifier for the consumer of the request.
protected  java.util.Date issued
          The date the Request was issued.
protected  org.apache.log4j.Logger log
          Generic logger attribute.
protected  java.net.URI producerId
          The component identifier for the producer of the request.
private  java.security.SecureRandom random
          A secure random number generator
protected  java.lang.String requestID
          A reference (internally generated by the requester) for this operation to be used in further interactions regarding the request.
protected  java.net.URI resource
          The URI of the resource the authorisation is requested for.
protected  java.lang.Object samlObject
          The OpenSAML object associated with this response.
protected  boolean strictMode
          According to the eduGAIN Trust Fabric:
 
Constructor Summary
Request()
          Creates a new instance of a Request.
 
Method Summary
 void generateRequestID()
          Sets a ramdomly generated reference for this request operation to be used in the inResponseTo field of the corresponding response.
 java.lang.String getCacheReference()
          Gets the value of the cacheReference field
 java.net.URI getConsumerId()
          Gets the component identifier for the eduGAIN component consuming this request .
 java.util.Date getIssued()
          Returns the date this request was issued
 java.net.URI getProducerId()
          Gets the component identifier for the eduGAIN component producing this request .
 java.lang.String getRequestID()
          Returns the identifier of the request
 java.net.URI getResource()
          Gets the URI of the resource whose access originated the operation
 boolean isStrict()
          Check if this Response is in strict mode.
 void setCacheReference(java.lang.String cref)
          Sets a cache reference (this includes a ResponseID argument of a previous AuthNResponse )
 void setConsumerId(java.net.URI consumerId)
          Sets the component identifier for the eduGAIN component consuming this request.
 void setIssued(java.util.Date issued)
          Sets the date this request is being issued (Issue Instant)
 void setProducerId(java.net.URI producerId)
          Sets the component identifier for the eduGAIN component producing this request.
 void setRequestID(java.lang.String id)
          Sets a reference for this request externally.
 void setResource(java.net.URI res)
          The URI of the resource whose access originated the operation
 void setStrict(boolean mode)
          Set this Response in strict mode.
 java.lang.String toString()
          Marshalls this Request into its string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

random

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


log

protected org.apache.log4j.Logger log
Generic logger attribute. Please initialize it adequately in the implementing classes.


requestID

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


resource

protected java.net.URI resource
The URI of the resource the authorisation is requested for.


producerId

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


consumerId

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


cacheReference

protected java.lang.String cacheReference
An optional parameter including a ResponseID argument of a previous Response.


issued

protected java.util.Date issued
The date the Request was issued.


samlObject

protected java.lang.Object samlObject
The OpenSAML object associated with this response.


strictMode

protected boolean strictMode

According to the eduGAIN Trust Fabric:

XML Signatures MUST be used in the following SAML constructs:

XML Signatures SHOULD be used in the following SAML constructs:

Constructor Detail

Request

public Request()
Creates a new instance of a Request.

Method Detail

isStrict

public boolean isStrict()
Check if this Response is in strict mode. If strict mode set, then every Response will be signed and validated. Strict mode will be ignored when the eduGAIN Trust Model forces signatures. Please, refer to the eduGAIN Trust Model in the specifications to know when this signatures are mandatory.

Returns:
True if this Response is in strict mode, False else.

setStrict

public void setStrict(boolean mode)
Set this Response in strict mode. If strict mode set, then every Response will be signed and validated. Strict mode will be ignored when the eduGAIN Trust Model forces signatures. Please, refer to the eduGAIN Trust Model in the specifications to know when this signatures are mandatory.

Parameters:
mode - True if this Response should be strict, False else.

generateRequestID

public void generateRequestID()
Sets a ramdomly generated reference for this request operation to be used in the inResponseTo field of the corresponding response.


setRequestID

public void setRequestID(java.lang.String id)

Sets a reference for this request externally.

WARNING: this method is used only when rebuilding the request. Please never use it with your own IDs!


getRequestID

public java.lang.String getRequestID()
Returns the identifier of the request


setResource

public void setResource(java.net.URI res)
The URI of the resource whose access originated the operation


getResource

public java.net.URI getResource()
Gets the URI of the resource whose access originated the operation


setCacheReference

public void setCacheReference(java.lang.String cref)
Sets a cache reference (this includes a ResponseID argument of a previous AuthNResponse )


getProducerId

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

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 request.

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 request .

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 request.

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

getCacheReference

public java.lang.String getCacheReference()
Gets the value of the cacheReference field

Returns:
the value of the cacheReference field

getIssued

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


setIssued

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


toString

public java.lang.String toString()
Marshalls this Request into its string representation.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of this Request.