Package org.sblim.slp
Class ServiceURL
- java.lang.Object
-
- org.sblim.slp.ServiceURL
-
- All Implemented Interfaces:
java.io.Serializable
public class ServiceURL extends java.lang.Object implements java.io.SerializableThe ServiceURL object models the advertised SLP service URL. It can be either a service: URL or a regular URL. These objects are returned from service lookup requests, and describe the registered services. This class should be a subclass of java.net.URL but can't since that class is final.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intLIFETIME_DEFAULTThe default URL lifetime (3 hours) in seconds.static intLIFETIME_MAXIMUMThe maximum URL lifetime (about 18 hours) in seconds.static intLIFETIME_NONEIndicates that the URL has a zero lifetime.static intLIFETIME_PERMANENTIndicates that the API implementation should continuously re-register the URL until the application exits.static intNO_PORTIndicates that no port information is required or was returned for this URL.
-
Constructor Summary
Constructors Constructor Description ServiceURL(java.lang.String pServiceURL, int pLifetime)Construct a service URL object having the specified lifetime.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetHost()Returns the host identifier.intgetLifetime()Returns the service advertisement lifetime.intgetPort()Returns the port number, if any.ServiceTypegetServiceType()Returns the service type object representing the service type name of the URL.java.lang.StringgetTransport()Get the network layer transport identifier.java.lang.StringgetURLPath()Returns the URL path description, if any.inthashCode()voidsetServiceType(ServiceType pServicetype)Set the service type name to the object.java.lang.StringtoString()
-
-
-
Field Detail
-
NO_PORT
public static final int NO_PORT
Indicates that no port information is required or was returned for this URL.- See Also:
- Constant Field Values
-
LIFETIME_NONE
public static final int LIFETIME_NONE
Indicates that the URL has a zero lifetime. This value is never returned from the API, but can be used to create a ServiceURL object to deregister, delete attributes, or find attributes.- See Also:
- Constant Field Values
-
LIFETIME_DEFAULT
public static final int LIFETIME_DEFAULT
The default URL lifetime (3 hours) in seconds.- See Also:
- Constant Field Values
-
LIFETIME_MAXIMUM
public static final int LIFETIME_MAXIMUM
The maximum URL lifetime (about 18 hours) in seconds.- See Also:
- Constant Field Values
-
LIFETIME_PERMANENT
public static final int LIFETIME_PERMANENT
Indicates that the API implementation should continuously re-register the URL until the application exits.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ServiceURL
public ServiceURL(java.lang.String pServiceURL, int pLifetime)Construct a service URL object having the specified lifetime.- Parameters:
pServiceURL- The URL as a string. Must be either a service: URL or a valid generic URL according to RFC 2396 [2].pLifetime- The service advertisement lifetime in seconds. This value may be either between LIFETIME_NONE and LIFETIME_MAXIMUM or LIFETIME_PERMANENT.
-
-
Method Detail
-
getServiceType
public ServiceType getServiceType()
Returns the service type object representing the service type name of the URL.- Returns:
- The service type
-
setServiceType
public void setServiceType(ServiceType pServicetype)
Set the service type name to the object. Ignored if the URL is a service: URL.- Parameters:
pServicetype- The service type object.
-
getTransport
public java.lang.String getTransport()
Get the network layer transport identifier. If the transport is IP, an empty string, "", is returned.- Returns:
- The NLT identifier
-
getHost
public java.lang.String getHost()
Returns the host identifier. For IP, this will be the machine name or IP address.- Returns:
- The host
-
getPort
public int getPort()
Returns the port number, if any. For non-IP transports, always returns NO_PORT.- Returns:
- The port
-
getURLPath
public java.lang.String getURLPath()
Returns the URL path description, if any.- Returns:
- The URL path
-
getLifetime
public int getLifetime()
Returns the service advertisement lifetime. This will be a positive int between LIFETIME_NONE and LIFETIME_MAXIMUM.- Returns:
- The lifetime
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-