Project JXTA

net.jxta.impl.endpoint
Class Address

java.lang.Object
  |
  +--net.jxta.impl.endpoint.Address

public class Address
extends java.lang.Object
implements net.jxta.endpoint.EndpointAddress

The Address class implements the JXTA Endpoint address. A JXTA endpoint address is a URI that has the following form: protocol://network address/service name/optional parameters For instance, a JXTA Peer on TCP, will have its PipeService Service address defines as: tcp://192.168.1.10/JxtaPipe A particular pipe on would have the following address: tcp://192.168.1.10/JxtaPipe/000...128 bit UUID of the pipe


Constructor Summary
Address()
          Constructor: builds an empty Address.
Address(java.lang.String address)
          Constructor: builds an Address from a string
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this object.
 boolean equals(java.lang.Object target)
          Compares two Addresses for equality.
 java.lang.String getProtocolAddress()
          Return a String that contains the name of the protocol address contained in the EndpointAddress
 java.lang.String getProtocolName()
          Return a String that contains the name of the protocol contained in the EndpointAddress
 java.lang.String getServiceName()
          Return a String that contains the name of the service name contained in the EndpointAddress
 java.lang.String getServiceParameter()
          Return a String that contains the name of the service parameter contained in the EndpointAddress
 java.lang.String makeString()
          Deprecated. Please use toString() instead.
 void setProtocolAddress(java.lang.String address)
          Set the protocol address.
 void setProtocolName(java.lang.String name)
          Set the protocol name.
 void setServiceName(java.lang.String name)
          Set the service name.
 void setServiceParameter(java.lang.String param)
          Set the service parameter
 java.lang.String toString()
          Return a String that contains the canonical representation of the Endpoint Address.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Address

public Address()
Constructor: builds an empty Address.

Address

public Address(java.lang.String address)
Constructor: builds an Address from a string
Method Detail

clone

public java.lang.Object clone()
Returns a clone of this object.
Overrides:
clone in class java.lang.Object
Returns:
the cloned object
Since:
JXTA 1.0

equals

public boolean equals(java.lang.Object target)
Compares two Addresses for equality.
Overrides:
equals in class java.lang.Object
Parameters:
target - the Address to be compared against.
Returns:
boolean true if Addresses are equal, false otherwise.
Since:
JXTA 1.0

toString

public java.lang.String toString()
Return a String that contains the canonical representation of the Endpoint Address.
Overrides:
toString in class java.lang.Object
Returns:
a String containing the EndpointAddress

getProtocolName

public java.lang.String getProtocolName()
                                 throws java.io.IOException
Return a String that contains the name of the protocol contained in the EndpointAddress
Specified by:
getProtocolName in interface net.jxta.endpoint.EndpointAddress
Returns:
a String containing the protocol name

getProtocolAddress

public java.lang.String getProtocolAddress()
                                    throws java.io.IOException
Return a String that contains the name of the protocol address contained in the EndpointAddress
Specified by:
getProtocolAddress in interface net.jxta.endpoint.EndpointAddress
Returns:
a String containing the protocol address

getServiceName

public java.lang.String getServiceName()
                                throws java.io.IOException
Return a String that contains the name of the service name contained in the EndpointAddress
Specified by:
getServiceName in interface net.jxta.endpoint.EndpointAddress
Returns:
a String containing the service name

getServiceParameter

public java.lang.String getServiceParameter()
                                     throws java.io.IOException
Return a String that contains the name of the service parameter contained in the EndpointAddress
Specified by:
getServiceParameter in interface net.jxta.endpoint.EndpointAddress
Returns:
a String containing the protocol name

setProtocolName

public void setProtocolName(java.lang.String name)
Set the protocol name.
Specified by:
setProtocolName in interface net.jxta.endpoint.EndpointAddress
Parameters:
name - String containing the name of the protocol

setProtocolAddress

public void setProtocolAddress(java.lang.String address)
Set the protocol address.
Specified by:
setProtocolAddress in interface net.jxta.endpoint.EndpointAddress
Parameters:
address - String containing the peer address.

setServiceName

public void setServiceName(java.lang.String name)
Set the service name.
Specified by:
setServiceName in interface net.jxta.endpoint.EndpointAddress
Parameters:
name - String containing the name of the service

setServiceParameter

public void setServiceParameter(java.lang.String param)
Set the service parameter
Specified by:
setServiceParameter in interface net.jxta.endpoint.EndpointAddress
Parameters:
name - String containing the service parameter

makeString

public java.lang.String makeString()
                            throws java.io.IOException
Deprecated. Please use toString() instead.

Return a String that contains the canonical representation of the Endpoint Address.
Specified by:
makeString in interface net.jxta.endpoint.EndpointAddress
Returns:
String a String containing the EndpointAddress
Throws:
IOExcetion - if the EndpointAddress is malformed.
Since:
JXTA 1.0

Project JXTA