org.jacorb.orb.iiop

Class IIOPAddress

public class IIOPAddress extends ProtocolAddressBase

Version: $Id: IIOPAddress.java,v 1.12 2006/07/27 08:26:40 alphonse.bendt Exp $

Author: Andre Spiegel, Phil Mesnier

Constructor Summary
IIOPAddress(String hoststr, int port)
Creates a new IIOPAddress for host and port.
IIOPAddress()
Creates a new IIOPAddress that will be initialized later by a string
Method Summary
voidconfigure(Configuration configuration)
booleanequals(Object other)
booleanfromString(String s)
InetAddressgetConfiguredHost()
Returns the host as supplied to the constructor.
StringgetHostname()
Returns the host part of this IIOPAddress, as a DNS hostname.
StringgetIP()
Returns the host part of this IIOPAddress, as a numeric IP address in dotted decimal form.
StringgetOriginalHost()
Method for use by the PrintIOR utility.
intgetPort()
Returns the port number of this address, represented as an integer in the range 0..65535.
inthashCode()
static IIOPAddressread(InputStream in)
static IIOPAddressread(CDRInputStream cdr)
voidsetHostname(String hn)
Used by the ORB to configure just the hostname portion of a proxy IOR address
voidsetPort(int p)
StringtoString()
voidwrite(CDROutputStream cdr)

Constructor Detail

IIOPAddress

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

Parameters: hoststr 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.

IIOPAddress

public IIOPAddress()
Creates a new IIOPAddress that will be initialized later by a string

Method Detail

configure

public void configure(Configuration configuration)

equals

public boolean equals(Object other)

fromString

public boolean fromString(String s)

getConfiguredHost

public InetAddress getConfiguredHost()
Returns the host as supplied to the constructor. This replaces IIOPListener.getConfiguredHost().

getHostname

public 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.

getIP

public 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.

getOriginalHost

public 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.

getPort

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

hashCode

public int hashCode()

read

public static IIOPAddress read(InputStream in)

read

public static IIOPAddress read(CDRInputStream cdr)

setHostname

public void setHostname(String hn)
Used by the ORB to configure just the hostname portion of a proxy IOR address

setPort

public void setPort(int p)

toString

public String toString()

write

public void write(CDROutputStream cdr)