Package org.eclipse.ecf.discovery
Class ServiceInfo
java.lang.Object
org.eclipse.ecf.discovery.ServiceInfo
- All Implemented Interfaces:
Serializable
,org.eclipse.core.runtime.IAdaptable
,IServiceInfo
- Direct Known Subclasses:
JSLPServiceInfo
Base implementation of
IServiceInfo
. Subclasses may be created as
appropriate.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final long
static final int
protected int
protected IServiceProperties
protected IServiceID
protected String
protected long
static final String
protected int
-
Constructor Summary
ModifierConstructorDescriptionprotected
ServiceInfo
(URI anURI, String aServiceName, IServiceTypeID aServiceTypeID) Create an IServiceInfo instance.ServiceInfo
(URI anURI, String aServiceName, IServiceTypeID aServiceTypeID, int priority, int weight, IServiceProperties props) Create an IServiceInfo instance.ServiceInfo
(URI anURI, String aServiceName, IServiceTypeID aServiceTypeID, int priority, int weight, IServiceProperties props, long ttl) Create an IServiceInfo instance.ServiceInfo
(URI anURI, String aServiceName, IServiceTypeID aServiceTypeID, IServiceProperties props) Create an IServiceInfo instance. -
Method Summary
Modifier and TypeMethodDescriptiongetAdapter
(Class adapter) Get URI for serviceint
The priority for the service Priority: The priority of this target host.Get ServiceID for service.(non-Javadoc)Map with any/all properties associated with the service.long
getTTL()
(non-Javadoc)int
The weight for the service.toString()
-
Field Details
-
DEFAULT_TTL
public static final long DEFAULT_TTL- Since:
- 4.0
- See Also:
-
DEFAULT_PRIORITY
public static final int DEFAULT_PRIORITY- See Also:
-
DEFAULT_WEIGHT
public static final int DEFAULT_WEIGHT- See Also:
-
UNKNOWN_PROTOCOL
- See Also:
-
serviceName
- Since:
- 3.0
-
serviceID
-
priority
protected int priority -
weight
protected int weight -
properties
-
timeToLive
protected long timeToLive- Since:
- 4.0
-
-
Constructor Details
-
ServiceInfo
protected ServiceInfo() -
ServiceInfo
Create an IServiceInfo instance.- Parameters:
anURI
- The (absolute) location of the service.aServiceName
- a user chosen service name. Only ASCII characters are allowed.aServiceTypeID
- the service type identifier.- Since:
- 3.0
-
ServiceInfo
public ServiceInfo(URI anURI, String aServiceName, IServiceTypeID aServiceTypeID, IServiceProperties props) Create an IServiceInfo instance.- Parameters:
anURI
- The (absolute) location of the service.aServiceName
- a user chosen service name. Only ASCII characters are allowed.aServiceTypeID
- the service type identifier.props
- generic service properties.- Since:
- 3.0
-
ServiceInfo
public ServiceInfo(URI anURI, String aServiceName, IServiceTypeID aServiceTypeID, int priority, int weight, IServiceProperties props) Create an IServiceInfo instance.- Parameters:
anURI
- The (absolute) location of the service.aServiceName
- a user chosen service name. Only ASCII characters are allowed.aServiceTypeID
- the service type identifier.priority
- the service priority. The priority of this target host. A client MUST attempt to contact the target host with the lowest-numbered priority it can reach; target hosts with the same priority SHOULD be tried in an order defined by the weight field.weight
- the service weight. A server selection mechanism. The weight field specifies a relative weight for entries with the same priority. Larger weights SHOULD be given a proportionately higher probability of being selected. Domain administrators SHOULD use Weight 0 when there isn't any server selection to do. In the presence of records containing weights greater than 0, records with weight 0 should have a very small chance of being selected.props
- generic service properties.- Since:
- 3.0
-
ServiceInfo
public ServiceInfo(URI anURI, String aServiceName, IServiceTypeID aServiceTypeID, int priority, int weight, IServiceProperties props, long ttl) Create an IServiceInfo instance.- Parameters:
anURI
- The (absolute) location of the service.aServiceName
- a user chosen service name. Only ASCII characters are allowed.aServiceTypeID
- the service type identifier.priority
- the service priority. The priority of this target host. A client MUST attempt to contact the target host with the lowest-numbered priority it can reach; target hosts with the same priority SHOULD be tried in an order defined by the weight field.weight
- the service weight. A server selection mechanism. The weight field specifies a relative weight for entries with the same priority. Larger weights SHOULD be given a proportionately higher probability of being selected. Domain administrators SHOULD use Weight 0 when there isn't any server selection to do. In the presence of records containing weights greater than 0, records with weight 0 should have a very small chance of being selected.props
- generic service properties.ttl
- time to live- Since:
- 4.0
-
-
Method Details
-
getLocation
Description copied from interface:IServiceInfo
Get URI for service- Specified by:
getLocation
in interfaceIServiceInfo
- Returns:
URI
the location for the service.
-
getServiceID
Description copied from interface:IServiceInfo
Get ServiceID for service.- Specified by:
getServiceID
in interfaceIServiceInfo
- Returns:
- ServiceID the serviceID for the service. Will not be
null
.
-
getPriority
public int getPriority()Description copied from interface:IServiceInfo
The priority for the service Priority: The priority of this target host. A client MUST attempt to contact the target host with the lowest-numbered priority it can reach; target hosts with the same priority SHOULD be tried in an order defined by the weight field.- Specified by:
getPriority
in interfaceIServiceInfo
- Returns:
- int the priority. 0 if no priority information for service.
-
getWeight
public int getWeight()Description copied from interface:IServiceInfo
The weight for the service. 0 if no weight information for service. Weight: A server selection mechanism. The weight field specifies a relative weight for entries with the same priority. Larger weights SHOULD be given a proportionately higher probability of being selected. Domain administrators SHOULD use Weight 0 when there isn't any server selection to do. In the presence of records containing weights greater than 0, records with weight 0 should have a very small chance of being selected.- Specified by:
getWeight
in interfaceIServiceInfo
- Returns:
- int the weight
-
getServiceProperties
Description copied from interface:IServiceInfo
Map with any/all properties associated with the service. Properties are assumed to be name/value pairs, both of type String.- Specified by:
getServiceProperties
in interfaceIServiceInfo
- Returns:
- Map the properties associated with this service. Will not be
null
.
-
toString
-
getAdapter
- Specified by:
getAdapter
in interfaceorg.eclipse.core.runtime.IAdaptable
-
getServiceName
(non-Javadoc)- Specified by:
getServiceName
in interfaceIServiceInfo
- Returns:
- A human readable service name. Not used for uniqueness!
- Since:
- 3.0
- See Also:
-
getTTL
public long getTTL()(non-Javadoc)- Specified by:
getTTL
in interfaceIServiceInfo
- Returns:
- long the time to live in seconds
- Since:
- 4.0
- See Also:
-