ymsg.network
Class HTTPConnectionHandler

Object
  extended byConnectionHandler
      extended byHTTPConnectionHandler
All Implemented Interfaces:
ServiceConstants

public class HTTPConnectionHandler
extends ConnectionHandler
implements ServiceConstants

Connection handler for HTTP proxy connections to Yahoo. Pass this class into the Session constructor to create a session which can work through firewalls.

Warning: HTTP is notoriously unreliable, even for geniune Yahoo, software. Not all problems with this class stem from bugs in its code. Hopefully future revisions of this handler will be able to smooth out any problems, or at least report them to the application better.

For more information on the Java properties used by this class, read Sun's Java Networking Properties page.

There is a system properties which alters the target of a connection. ymsg.network.httpHost can be used to set the host to which the connection will be made. In reality is it highly unlikely that this property should need to be changed from its default: http.pager.yahoo.com.

For users who access Yahoo from behind a firewall which requires HTTP proxy authorization, the property ymsg.network.httpProxyAuth can be used to set content for the Proxy-Authorization HTTP header. A typical value (using the basic encoding scheme) might look something like Basic Ab0Cd1Ef2Gh3z9==, where the second part is the proxy username followed by a colon followed by the proxy password, encoded using BASE64. (Alternative encoding schemes may take different forms.)

Since:
1.0

Field Summary
 
Fields inherited from interface ServiceConstants
SERVICE_ADDIDENT, SERVICE_ADDIGNORE, SERVICE_AUTH, SERVICE_AUTHRESP, SERVICE_CALENDAR, SERVICE_CHATCONNECT, SERVICE_CHATDISCONNECT, SERVICE_CHATGOTO, SERVICE_CHATINVITE, SERVICE_CHATLEAVE, SERVICE_CHATLOGOFF, SERVICE_CHATLOGON, SERVICE_CHATMSG, SERVICE_CHATPING, SERVICE_CHATPM, SERVICE_CONFADDINVITE, SERVICE_CONFDECLINE, SERVICE_CONFINVITE, SERVICE_CONFLOGOFF, SERVICE_CONFLOGON, SERVICE_CONFMSG, SERVICE_CONTACTIGNORE, SERVICE_CONTACTNEW, SERVICE_CONTACTREJECT, SERVICE_FILETRANSFER, SERVICE_FRIENDADD, SERVICE_FRIENDREMOVE, SERVICE_GAMELOGOFF, SERVICE_GAMELOGON, SERVICE_GAMEMSG, SERVICE_GROUPRENAME, SERVICE_IDACT, SERVICE_IDDEACT, SERVICE_IDLE, SERVICE_ISAWAY, SERVICE_ISBACK, SERVICE_LIST, SERVICE_LOGOFF, SERVICE_LOGON, SERVICE_MAILSTAT, SERVICE_MESSAGE, SERVICE_NEWMAIL, SERVICE_NEWPERSONMAIL, SERVICE_NOTIFY, SERVICE_P2PFILEXFER, SERVICE_PASSTHROUGH2, SERVICE_PEERTOPEER, SERVICE_PING, SERVICE_SYSMESSAGE, SERVICE_USERSTAT, SERVICE_VOICECHAT, SERVICE_X_BUZZ, SERVICE_X_CHATUPDATE, SERVICE_X_ERROR, SERVICE_X_EXCEPTION, SERVICE_X_OFFLINE
 
Constructor Summary
HTTPConnectionHandler()
          Connect using the Java system properties http.proxyHost and http.proxyPort.
HTTPConnectionHandler(String ph, int pp)
          Connect using a specific HTTP proxy host and port, with no excempt hosts.
HTTPConnectionHandler(String ph, int pp, String ex)
          Connect using a specific HTTP proxy host and port, with a list of excempt hosts.
HTTPConnectionHandler(String ph, int pp, Vector ex)
          Connect using a specific HTTP proxy host and port, with a list of excempt hosts, as a Vector.
 
Method Summary
 String toString()
          Returns the string representation of this object.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTTPConnectionHandler

public HTTPConnectionHandler()
                      throws IllegalArgumentException
Connect using the Java system properties http.proxyHost and http.proxyPort. If host is unset, this constructor will look for the old (pre Java2 v1.3) names of proxyHost and proxyPort. If these are also unset, this constructor will throw an IllegalArgumentException.

Throws:
IllegalStateException - If no HTTP proxy properties set
IllegalArgumentException
Since:
1.0

HTTPConnectionHandler

public HTTPConnectionHandler(String ph,
                             int pp,
                             String ex)
Connect using a specific HTTP proxy host and port, with a list of excempt hosts.

Note: this constructor sets the Java system properties http.proxyHost, http.proxyPort, proxyHost, proxyPort, and http.nonProxyHosts. These settings will be global throughout the JVM.

Note: http.nonProxyHosts is unsupported in Java prior to Java2 v1.3.

Parameters:
ph - proxy host
pp - proxy port
ex - proxy exemption list, pipe char separated.
Since:
1.0

HTTPConnectionHandler

public HTTPConnectionHandler(String ph,
                             int pp,
                             Vector ex)
Connect using a specific HTTP proxy host and port, with a list of excempt hosts, as a Vector. (The list is converted into the usual pipe separated String format.)

Note: this constructor sets the Java system properties http.proxyHost, http.proxyPort, proxyHost, proxyPort, and http.nonProxyHosts. These settings will be global throughout the JVM.

Note: http.nonProxyHosts is unsupported in Java prior to Java2 v1.3.

Parameters:
ph - proxy host
pp - proxy port
ex - proxy exemption list, one host per element
Since:
1.0

HTTPConnectionHandler

public HTTPConnectionHandler(String ph,
                             int pp)
Connect using a specific HTTP proxy host and port, with no excempt hosts.

Note: this constructor sets the Java system properties http.proxyHost, http.proxyPort, proxyHost, proxyPort, and http.nonProxyHosts. These settings will be global throughout the JVM.

Note: http.nonProxyHosts is unsupported in Java prior to Java2 v1.3.

Parameters:
ph - proxy host
pp - proxy port
Since:
1.0
Method Detail

toString

public String toString()
Returns the string representation of this object.

Returns:
object as a string