org.livetribe.slp
Class ServiceURL

java.lang.Object
  extended by org.livetribe.slp.ServiceURL
All Implemented Interfaces:
Serializable

public class ServiceURL
extends Object
implements Serializable

A ServiceURL represents the location of a service. A client given a ServiceURL should be able to contact the remote service that the ServiceURL represents with the information carried by the ServiceURL itself. A ServiceURL is a URI that defines at least scheme and address portion, and that may have the service: scheme.
ServiceURLs have a lifetime, used to denote the period of time over which the service is available.

Version:
$Rev: 258 $ $Date: 2006-08-23 15:45:17 +0200 (Wed, 23 Aug 2006) $
See Also:
ServiceType, Serialized Form

Field Summary
static int LIFETIME_DEFAULT
          The constant used to denote the default lifetime of service URLs (3 hours).
static int LIFETIME_MAXIMUM
          The constant used to denote the maximum value for the lifetime of service URLs.
static int LIFETIME_NONE
          The constant used to denote that this service URL has no lifetime.
static int LIFETIME_PERMANENT
          The constant used to denote that this service URL has an infinite lifetime.
static int NO_PORT
          The constant used to denote that the service did not specify a port.
 
Constructor Summary
ServiceURL(String url)
          Creates a ServiceURL parsing the given string, with a default lifetime.
ServiceURL(String url, int lifetime)
          Creates a ServiceURL parsing the given string, with the specified lifetime, in seconds.
 
Method Summary
 boolean equals(Object obj)
           
 String getHost()
          Returns the host portion of this service URL.
 int getLifetime()
          Returns the lifetime, in seconds, of this service URL.
 int getPort()
          Returns the port number of this service URL.
 ServiceType getServiceType()
          Returns the ServiceType of this service URL.
 String getTransport()
          Returns the network layer transport identifier, which is the empty string for the IP transport.
 String getURL()
          Returns the string form of this service URL, that can be passed to ServiceURL(String) to be parsed.
 String getURLPath()
          Returns the path of this service URL.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_PORT

public static final int NO_PORT
The constant used to denote that the service did not specify a port.

See Also:
Constant Field Values

LIFETIME_NONE

public static final int LIFETIME_NONE
The constant used to denote that this service URL has no lifetime. It is wrong to advertise services with no lifetime, but this constant can be used to create ServiceURLs used to perform activities different from service registration.

See Also:
Constant Field Values

LIFETIME_DEFAULT

public static final int LIFETIME_DEFAULT
The constant used to denote the default lifetime of service URLs (3 hours).

See Also:
Constant Field Values

LIFETIME_MAXIMUM

public static final int LIFETIME_MAXIMUM
The constant used to denote the maximum value for the lifetime of service URLs.

See Also:
Constant Field Values

LIFETIME_PERMANENT

public static final int LIFETIME_PERMANENT
The constant used to denote that this service URL has an infinite lifetime.

See Also:
Constant Field Values
Constructor Detail

ServiceURL

public ServiceURL(String url)
Creates a ServiceURL parsing the given string, with a default lifetime.

Parameters:
url - The string to be parsed

ServiceURL

public ServiceURL(String url,
                  int lifetime)
Creates a ServiceURL parsing the given string, with the specified lifetime, in seconds.

Parameters:
url - The string to be parsed
lifetime - The lifetime, in seconds, for this service URL
Method Detail

getServiceType

public ServiceType getServiceType()
Returns the ServiceType of this service URL.


getTransport

public String getTransport()
Returns the network layer transport identifier, which is the empty string for the IP transport.


getHost

public String getHost()
Returns the host portion of this service URL.


getPort

public int getPort()
Returns the port number of this service URL.

See Also:
NO_PORT

getURLPath

public String getURLPath()
Returns the path of this service URL.


getLifetime

public int getLifetime()
Returns the lifetime, in seconds, of this service URL.


getURL

public String getURL()
Returns the string form of this service URL, that can be passed to ServiceURL(String) to be parsed.


equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
See Also:
getURL()


Copyright © 2006-2012 LiveTribe. All Rights Reserved.