org.jacorb.orb
Class IIOPAddress

java.lang.Object
  extended byorg.jacorb.orb.IIOPAddress
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable

public class IIOPAddress
extends java.lang.Object
implements org.apache.avalon.framework.configuration.Configurable

Version:
$Id: IIOPAddress.java,v 1.15 2004/08/25 11:37:11 simon.mcqueen Exp $
Author:
Andre Spiegel

Constructor Summary
IIOPAddress(java.lang.String host, int port)
          Creates a new IIOPAddress for host and port.
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
 boolean equals(java.lang.Object other)
           
 java.lang.String getHostname()
          Returns the host part of this IIOPAddress, as a DNS hostname.
 java.lang.String getIP()
          Returns the host part of this IIOPAddress, as a numeric IP address in dotted decimal form.
 java.lang.String getOriginalHost()
          Method for use by the PrintIOR utility.
 int getPort()
          Returns the port number of this address, represented as an integer in the range 0..65535.
 int hashCode()
           
static IIOPAddress read(InputStream in)
           
 byte[] toCDR()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IIOPAddress

public IIOPAddress(java.lang.String host,
                   int port)
Creates a new IIOPAddress for host and port.

Parameters:
host - either a DNS name, or a textual representation of a numeric IP address (dotted decimal)
port - the port number represented as an integer, in the range 0..65535. As a special convenience, a negative number is converted by adding 65536 to it; this helps using values that were previously stored in a Java short.
Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

read

public static IIOPAddress read(InputStream in)

getIP

public java.lang.String getIP()
Returns the host part of this IIOPAddress, as a numeric IP address in dotted decimal form. If the numeric IP address was specified when this object was created, then that address is returned. Otherwise, this method performs a DNS lookup on the hostname.


getHostname

public java.lang.String getHostname()
Returns the host part of this IIOPAddress, as a DNS hostname. If the DNS name was specified when this IIOPAddress was created, then that name is returned. Otherwise, this method performs a reverse DNS lookup on the IP address.


getPort

public int getPort()
Returns the port number of this address, represented as an integer in the range 0..65535.


equals

public boolean equals(java.lang.Object other)

hashCode

public int hashCode()

toString

public java.lang.String toString()

toCDR

public byte[] toCDR()

getOriginalHost

public java.lang.String getOriginalHost()
Method for use by the PrintIOR utility. Previously it called getHostname() which may or may not have returned what was actually encoded in the IOR. This is of limited use for debugging purposes. This method attempts to return the string that this address was actually constructed with (i.e. what the IOR actually contains as its host string).

Returns:
Host name or IP address or both if the original host string cannot be determined.