org.jcoderz.commons.connector.http
Class HttpConnectionRequestInfo

java.lang.Object
  extended by org.jcoderz.commons.connector.ConnectionRequestInfoBase
      extended by org.jcoderz.commons.connector.http.HttpConnectionRequestInfo
All Implemented Interfaces:
ConnectionRequestInfo

public class HttpConnectionRequestInfo
extends ConnectionRequestInfoBase

This class contains the request information for a requested connection. It implements the java connector architecture interface HttpConnectionRequestInfo.


Constructor Summary
HttpConnectionRequestInfo(HttpManagedConnectionFactoryImpl mcf)
          Constructor.
HttpConnectionRequestInfo(HttpManagedConnectionFactoryImpl mcf, HttpConnectionSpec cs)
          Constructor.
 
Method Summary
 String canonicKey()
          Create canonic key string.
 boolean equals(Object obj)
          Compare two instances based on the relevant properties.
 HttpConnectionSpec getConnectionSpec()
          Gets the connection specification object of this request information.
 int hashCode()
          Calculate hashCode based on all relevant properties.
 String toString()
          Create canonic human-readable string.
 
Methods inherited from class org.jcoderz.commons.connector.ConnectionRequestInfoBase
getUserPassword, setUserPassword, setUserPassword
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpConnectionRequestInfo

public HttpConnectionRequestInfo(HttpManagedConnectionFactoryImpl mcf)
Constructor. Called by a managed connection factory.

Parameters:
mcf - the calling managed connection factory

HttpConnectionRequestInfo

public HttpConnectionRequestInfo(HttpManagedConnectionFactoryImpl mcf,
                                 HttpConnectionSpec cs)
Constructor. Create a HttpConnectionRequestInfo from a ConnectionSpec.

Parameters:
mcf - the calling managed connectin factory
cs - the used connection specification
Method Detail

equals

public boolean equals(Object obj)
Compare two instances based on the relevant properties.

Depends on {link #canonicKey() canonicKey}

Specified by:
equals in interface ConnectionRequestInfo
Overrides:
equals in class Object
Parameters:
obj - other object instance
Returns:
boolean - true if given object is equal to this request information object, false else.

hashCode

public int hashCode()
Calculate hashCode based on all relevant properties.

Depends on {link #canonicKey() canonicKey}

Specified by:
hashCode in interface ConnectionRequestInfo
Overrides:
hashCode in class Object
Returns:
int - the calculated hashCode

toString

public String toString()
Create canonic human-readable string. A canonic string contains *all* relevant information of the Connection Request info.

Overrides:
toString in class Object
Returns:
String - the result of canonicKey

canonicKey

public String canonicKey()
Create canonic key string. Return a canonic string which contains *all* relevant information of the Connection Request info. Example: "{user=Hans password=asecret domain=Purchasing}" NOTE: hashCode() and equals() depend on the proper implementation of this !

Returns:
String - the canonical string

getConnectionSpec

public HttpConnectionSpec getConnectionSpec()
Gets the connection specification object of this request information.

Returns:
PaymentProtocolConnectionSpec - the specification object


Copyright 2007 The jCoderZ Project.