SunSPOT API V5.0


com.sun.spot.io.j2me.socket
Class ProxyInitializer

java.lang.Object
  extended by com.sun.spot.io.j2me.socket.ProxyInitializer

public class ProxyInitializer
extends Object

Handles the string used to initialize a connection between a SocketConnection and the socket proxy on the host.

Author:
Martin Morissette

Field Summary
static String INITIALIZER
           
static String SEPERATOR
           
 
Constructor Summary
ProxyInitializer(String initStr)
          Create a ProxyInitializer from a initializer string formatted using the ProxyInitializer format "connect "
ProxyInitializer(String host, String port)
          Create a ProxyInitializer object from a host and port string
 
Method Summary
 String getHost()
          Returns the hostname to connect to
 String getPort()
          Returns the port number to connect to
 int getPortInt()
          Returns the port number to connect to
 String toString()
          Returns a formatted string representing the initStr to be sent to the proxy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INITIALIZER

public static final String INITIALIZER
See Also:
Constant Field Values

SEPERATOR

public static final String SEPERATOR
See Also:
Constant Field Values
Constructor Detail

ProxyInitializer

public ProxyInitializer(String host,
                        String port)
Create a ProxyInitializer object from a host and port string

Parameters:
host - hostname to connect to (exmaple: www.sun.com)
port - port number to use for connection (example 80)

ProxyInitializer

public ProxyInitializer(String initStr)
                 throws IllegalArgumentException
Create a ProxyInitializer from a initializer string formatted using the ProxyInitializer format "connect "

Parameters:
initStr - initializer string
Throws:
IllegalArgumentException - thrown when the initStr is not properly formatted.
Method Detail

getHost

public String getHost()
Returns the hostname to connect to

Returns:
hostname to connect to

getPort

public String getPort()
Returns the port number to connect to

Returns:
port number to connect to

getPortInt

public int getPortInt()
Returns the port number to connect to

Returns:
port number to connect to

toString

public String toString()
Returns a formatted string representing the initStr to be sent to the proxy

Overrides:
toString in class Object
Returns:
a string representation of the object.

SunSPOT API V5.0


Copyright � 2006-2008 Sun Microsystems, Inc. All Rights Reserved.