equip.net
Class ServerURL

java.lang.Object
  extended byequip.net.ServerURL

public class ServerURL
extends java.lang.Object

Class for holding and parsing a single EQUIP URL. Note: defined independently in both C++ and Java, but not IDL'd.

The URL is parsed to form a Moniker, that can then be resolved and used to contact the server. The current URL schemes are:

In all cases (currently), if a value is specified for the URL path (e.g. as in equip://host:port/path) then the above moniker will be used to determine how to contact a TraderProxy service, and the path will be passed to the trader service in a lookup operation; the information returned from the trader will then be used to contact the actual server.

Consequently, the default port for an EQUIP URL is DEFAULT_TRADER_PORT.value, and should normally be used only to communicate with trader processes.

The default host is an IP address of the local host as returned by InetAddress.getLocalHost(). The loopback address is not used since this results in non-global URLs and monikers. Of course, IP addresses are not global if you cross a NAT firewall...


Constructor Summary
ServerURL(Moniker moniker)
          Create directly from a Moniker
ServerURL(java.lang.String url)
          Create by parsing the supplied string as an EQUIP URL.
 
Method Summary
 Moniker getMoniker()
          Get the created Moniker, which can be resolved and used to locate the service.
 java.lang.String getURL()
          From the parsed Moniker, work back to an equivalent EQUIP URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerURL

public ServerURL(java.lang.String url)
Create by parsing the supplied string as an EQUIP URL.


ServerURL

public ServerURL(Moniker moniker)
Create directly from a Moniker

Method Detail

getMoniker

public Moniker getMoniker()
Get the created Moniker, which can be resolved and used to locate the service.


getURL

public java.lang.String getURL()
From the parsed Moniker, work back to an equivalent EQUIP URL. Since the URL is not kept as a string, this may be different from the value originally specified.

Returns:
null if the attempt failed