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:
- AdvertisedService,- DiscoverdService,- JSLPServiceInfo
 
 public class ServiceInfo extends Object implements IServiceInfo, Serializable Base implementation ofIServiceInfo. Subclasses may be created as appropriate.- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intDEFAULT_PRIORITYstatic longDEFAULT_TTLstatic intDEFAULT_WEIGHTprotected intpriorityprotected IServicePropertiespropertiesprotected IServiceIDserviceIDprotected StringserviceNameprotected longtimeToLivestatic StringUNKNOWN_PROTOCOLprotected intweight
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedServiceInfo()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 SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAdapter(Class adapter)URIgetLocation()Get URI for serviceintgetPriority()The priority for the service Priority: The priority of this target host.IServiceIDgetServiceID()Get ServiceID for service.StringgetServiceName()(non-Javadoc)IServicePropertiesgetServiceProperties()Map with any/all properties associated with the service.longgetTTL()(non-Javadoc)intgetWeight()The weight for the service.StringtoString()
 
- 
- 
- 
Field Detail- 
DEFAULT_TTLpublic static final long DEFAULT_TTL - Since:
- 4.0
- See Also:
- Constant Field Values
 
 - 
DEFAULT_PRIORITYpublic static final int DEFAULT_PRIORITY - See Also:
- Constant Field Values
 
 - 
DEFAULT_WEIGHTpublic static final int DEFAULT_WEIGHT - See Also:
- Constant Field Values
 
 - 
UNKNOWN_PROTOCOLpublic static final String UNKNOWN_PROTOCOL - See Also:
- Constant Field Values
 
 - 
serviceNameprotected String serviceName - Since:
- 3.0
 
 - 
serviceIDprotected IServiceID serviceID 
 - 
priorityprotected int priority 
 - 
weightprotected int weight 
 - 
propertiesprotected IServiceProperties properties 
 - 
timeToLiveprotected long timeToLive - Since:
- 4.0
 
 
- 
 - 
Constructor Detail- 
ServiceInfoprotected ServiceInfo() 
 - 
ServiceInfopublic ServiceInfo(URI anURI, String aServiceName, IServiceTypeID aServiceTypeID) 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
 
 - 
ServiceInfopublic 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
 
 - 
ServiceInfopublic 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
 
 - 
ServiceInfopublic 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 Detail- 
getLocationpublic URI getLocation() Description copied from interface:IServiceInfoGet URI for service- Specified by:
- getLocationin interface- IServiceInfo
- Returns:
- URIthe location for the service.
 
 - 
getServiceIDpublic IServiceID getServiceID() Description copied from interface:IServiceInfoGet ServiceID for service.- Specified by:
- getServiceIDin interface- IServiceInfo
- Returns:
- ServiceID the serviceID for the service. Will not be
         null.
 
 - 
getPrioritypublic int getPriority() Description copied from interface:IServiceInfoThe 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:
- getPriorityin interface- IServiceInfo
- Returns:
- int the priority. 0 if no priority information for service.
 
 - 
getWeightpublic int getWeight() Description copied from interface:IServiceInfoThe 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:
- getWeightin interface- IServiceInfo
- Returns:
- int the weight
 
 - 
getServicePropertiespublic IServiceProperties getServiceProperties() Description copied from interface:IServiceInfoMap with any/all properties associated with the service. Properties are assumed to be name/value pairs, both of type String.- Specified by:
- getServicePropertiesin interface- IServiceInfo
- Returns:
- Map the properties associated with this service. Will not be
         null.
 
 - 
getAdapterpublic Object getAdapter(Class adapter) - Specified by:
- getAdapterin interface- org.eclipse.core.runtime.IAdaptable
 
 - 
getServiceNamepublic String getServiceName() (non-Javadoc)- Specified by:
- getServiceNamein interface- IServiceInfo
- Returns:
- A human readable service name. Not used for uniqueness!
- Since:
- 3.0
- See Also:
- IServiceInfo.getServiceName()
 
 - 
getTTLpublic long getTTL() (non-Javadoc)- Specified by:
- getTTLin interface- IServiceInfo
- Returns:
- long the time to live in seconds
- Since:
- 4.0
- See Also:
- IServiceInfo.getTTL()
 
 
- 
 
-