JXTA

net.jxta.endpoint
Class EndpointAddress

java.lang.Object
  extended by net.jxta.endpoint.EndpointAddress

public class EndpointAddress
extends Object

Describes a destination to which JXTA messages may be sent. This may be:

An Endpoint Address is a specialized interpretation of a URI. Wherever it makes sense you should use a URI in preference to an Endpoint Address. An Endpoint Address is composed of four components: a protocol (also called a scheme), a protocol address (also called an authority), an optional service name and optional service parameter.

The Protocol

The Protocol Address

The Service Name (optional)

The Service Parameter (optional)

See Also:
EndpointService, MessageTransport, Messenger, PipeService

Constructor Summary
EndpointAddress(EndpointAddress base, String service, String serviceParam)
          Constructor which builds an endpoint address from a base address and replacement service and params
EndpointAddress(ID id, String service, String serviceParam)
          Constructor which builds an address from a standard jxta id and a service and param.
EndpointAddress(String address)
          Builds an Address from a string
EndpointAddress(String protocol, String address, String service, String serviceParam)
          Constructor which builds an address the four standard constituent parts.
EndpointAddress(URI address)
          Create an EndpointAddress whose value is initialized from the provided URI.
 
Method Summary
 EndpointAddress clone()
          Deprecated. EndpointAddress objects are immutable and never need to be cloned.
 boolean equals(Object target)
          
 String getProtocolAddress()
          Return a String that contains the protocol address contained in the EndpointAddress
 String getProtocolName()
          Return a String that contains the name of the protocol contained in the EndpointAddress
 String getServiceName()
          Return a String that contains the service name contained in the EndpointAddress
 String getServiceParameter()
          Return a String that contains the service parameter contained in the EndpointAddress
 int hashCode()
          
 String toString()
          
 URI toURI()
          Return a URI which represents the endpoint address.
static EndpointAddress unmodifiableEndpointAddress(EndpointAddress address)
          Deprecated. All EndpointAddresses are now unmodifiable so this method is no longer needed.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EndpointAddress

public EndpointAddress(String address)
Builds an Address from a string

Parameters:
address - the string representation of the address.

EndpointAddress

public EndpointAddress(URI address)
Create an EndpointAddress whose value is initialized from the provided URI.

Parameters:
address - the URI representation of the address.

EndpointAddress

public EndpointAddress(EndpointAddress base,
                       String service,
                       String serviceParam)
Constructor which builds an endpoint address from a base address and replacement service and params

Parameters:
base - The EndpointAddress on which the new EndpointAddress will be based
service - The service name for the endpoint address or null if there is no service name.
serviceParam - The service parameter for the endpoint address or null if there is no parameter.

EndpointAddress

public EndpointAddress(String protocol,
                       String address,
                       String service,
                       String serviceParam)
Constructor which builds an address the four standard constituent parts.

Parameters:
protocol - The addressing scheme to be used for the endpoint address.
address - The destination for the endpoint address.
service - The service name for the endpoint address or null if there is no service name.
serviceParam - The service parameter for the endpoint address or null if there is no parameter.

EndpointAddress

public EndpointAddress(ID id,
                       String service,
                       String serviceParam)
Constructor which builds an address from a standard jxta id and a service and param.

Parameters:
id - the ID which will be the destination of the endpoint address.
service - The service name for the endpoint address or null if there is no service name.
serviceParam - The service parameter for the endpoint address or null if there is no parameter.
Method Detail

unmodifiableEndpointAddress

@Deprecated
public static EndpointAddress unmodifiableEndpointAddress(EndpointAddress address)
Deprecated. All EndpointAddresses are now unmodifiable so this method is no longer needed.

Returns an unmodifiable clone of the provided EndpointAddress.

Parameters:
address - the address to be cloned.
Returns:
the unmodifiable address clone.

clone

@Deprecated
public EndpointAddress clone()
Deprecated. EndpointAddress objects are immutable and never need to be cloned.

Overrides:
clone in class Object

equals

public boolean equals(Object target)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object

toURI

public URI toURI()
Return a URI which represents the endpoint address.

Returns:
a URI which represents the endpoint address.

getProtocolName

public String getProtocolName()
Return a String that contains the name of the protocol contained in the EndpointAddress

Returns:
a String containing the protocol name

getProtocolAddress

public String getProtocolAddress()
Return a String that contains the protocol address contained in the EndpointAddress

Returns:
a String containing the protocol address

getServiceName

public String getServiceName()
Return a String that contains the service name contained in the EndpointAddress

Returns:
a String containing the service name

getServiceParameter

public String getServiceParameter()
Return a String that contains the service parameter contained in the EndpointAddress

Returns:
a String containing the protocol name

JXSE