FileDocCategorySizeDatePackage
HostAndPort.javaAPI DocGlassfish v2 API3409Fri May 04 22:36:22 BST 2007com.sun.enterprise.admin.jmx.remote.comm

HostAndPort

public class HostAndPort extends Object implements Serializable
Represents a host and a port in a convenient package that also accepts a convenient constructor.
author
Lloyd Chambers
since
S1AS7.0
version
1.1

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 );