FileDocCategorySizeDatePackage
HostAndPort.javaAPI DocGlassfish v2 API3334Fri May 04 22:34:10 BST 2007com.sun.enterprise.admin.util

HostAndPort

public class HostAndPort extends Object implements Serializable
Represents a host and a port in a convenient package that also accepts a convenient constructor.

Fields Summary
public static final long
serialVersionUID
protected String
mHost
protected int
mPort
private boolean
secure
Constructors Summary
public HostAndPort(String host, int port, boolean secure)



        
	this.mHost = host;
	this.mPort = port;
	this.secure = secure;
  
public HostAndPort(HostAndPort rhs)

	this(rhs.mHost,rhs.mPort,rhs.secure);
  
public HostAndPort(String host, int port)

	  this(host, port, false);
	
public HostAndPort(String str)
Construct a new HostAndPort from a string of the form "host:port"

param
str string of the form "host:port"

		StringTokenizer	tokenizer	=
			new StringTokenizer( str, ":", false);
		
		mHost	= tokenizer.nextToken();
		
		final String portString	= tokenizer.nextToken();
		mPort	= new Integer( portString ).intValue();
	
Methods Summary
public java.lang.StringgetHost()

		return( mHost );
	
public intgetPort()

		return( mPort );
	
public booleanisSecure()

	return this.secure;
  
public java.lang.StringtoString()

		return( mHost + ":" + mPort );