Class AdvertisedService
- java.lang.Object
-
- org.eclipse.ecf.discovery.ServiceInfo
-
- org.eclipse.ecf.provider.zookeeper.core.AdvertisedService
-
- All Implemented Interfaces:
Serializable,org.eclipse.core.runtime.IAdaptable,IServiceInfo,org.eclipse.ecf.provider.zookeeper.core.internal.IService,org.eclipse.ecf.provider.zookeeper.node.internal.INode
public class AdvertisedService extends ServiceInfo implements org.eclipse.ecf.provider.zookeeper.node.internal.INode, org.eclipse.ecf.provider.zookeeper.core.internal.IService
Encapsulate a service to be advertised and made visible for discovery. An object ofAdvertisedServiceis build either with an OSGi service referenceServiceReferenceorServiceInfoobject.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.eclipse.ecf.discovery.ServiceInfo
DEFAULT_PRIORITY, DEFAULT_TTL, DEFAULT_WEIGHT, priority, properties, serviceID, serviceName, timeToLive, UNKNOWN_PROTOCOL, weight
-
Fields inherited from interface org.eclipse.ecf.provider.zookeeper.node.internal.INode
_BYTES_, _URI_, _ZOODISCOVERYID_, ID_POSITION, NODE_PROPERTY_NAME_NA, NODE_PROPERTY_NAME_PROTOCOLS, NODE_PROPERTY_NAME_SCOPE, NODE_PROPERTY_SERVICE_NAME, NODE_PROPERTY_SERVICES, NODE_SERVICE_PROPERTIES, ROOT, ROOT_SLASH, SLASH, STRING_DELIM, URI_POSITION, ZOODISCOVERYID_POSITION
-
-
Constructor Summary
Constructors Constructor Description AdvertisedService(IServiceInfo serviceInfo)AdvertisedService(ServiceReference ref)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Object o)StringgetAbsolutePath()URIgetLocation()Get URI for serviceStringgetNodeId()StringgetPath()byte[]getPropertiesAsBytes()The byte representation of the service properties, appropriate to be stored in the zooKeeper nodestatic Map<String,IServiceInfo>getPublishedServices()IServiceIDgetServiceID()Get ServiceID for service.ServiceReferencegetServiceReference()org.eclipse.ecf.provider.zookeeper.core.internal.IServicegetWrappedService()booleanisLocalNode()voidregenerateNodeId()static IServiceInforemovePublished(String id)-
Methods inherited from class org.eclipse.ecf.discovery.ServiceInfo
getAdapter, getPriority, getServiceName, getServiceProperties, getTTL, getWeight, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.ecf.discovery.IServiceInfo
getPriority, getServiceName, getServiceProperties, getTTL, getWeight
-
-
-
-
Constructor Detail
-
AdvertisedService
public AdvertisedService(ServiceReference ref)
-
AdvertisedService
public AdvertisedService(IServiceInfo serviceInfo)
-
-
Method Detail
-
getPublishedServices
public static Map<String,IServiceInfo> getPublishedServices()
-
removePublished
public static IServiceInfo removePublished(String id)
-
getNodeId
public String getNodeId()
-
regenerateNodeId
public void regenerateNodeId()
- Specified by:
regenerateNodeIdin interfaceorg.eclipse.ecf.provider.zookeeper.node.internal.INode
-
getLocation
public URI getLocation()
Description copied from interface:IServiceInfoGet URI for service- Specified by:
getLocationin interfaceIServiceInfo- Overrides:
getLocationin classServiceInfo- Returns:
URIthe location for the service.
-
getServiceID
public IServiceID getServiceID()
Description copied from interface:IServiceInfoGet ServiceID for service.- Specified by:
getServiceIDin interfaceIServiceInfo- Overrides:
getServiceIDin classServiceInfo- Returns:
- ServiceID the serviceID for the service. Will not be
null.
-
compareTo
public int compareTo(Object o)
-
getServiceReference
public ServiceReference getServiceReference()
- Returns:
- ServiceReference may be null if this
AdvertisedServiceinstance is notbuiltcalling constructorAdvertisedService(ServiceReference ref).
-
getPropertiesAsBytes
public byte[] getPropertiesAsBytes()
Description copied from interface:org.eclipse.ecf.provider.zookeeper.core.internal.IServiceThe byte representation of the service properties, appropriate to be stored in the zooKeeper node- Specified by:
getPropertiesAsBytesin interfaceorg.eclipse.ecf.provider.zookeeper.core.internal.IService- Returns:
- byte representation of the properties
-
getPath
public String getPath()
- Specified by:
getPathin interfaceorg.eclipse.ecf.provider.zookeeper.node.internal.INode
-
getAbsolutePath
public String getAbsolutePath()
- Specified by:
getAbsolutePathin interfaceorg.eclipse.ecf.provider.zookeeper.node.internal.INode
-
isLocalNode
public boolean isLocalNode()
- Specified by:
isLocalNodein interfaceorg.eclipse.ecf.provider.zookeeper.node.internal.INode
-
getWrappedService
public org.eclipse.ecf.provider.zookeeper.core.internal.IService getWrappedService()
- Specified by:
getWrappedServicein interfaceorg.eclipse.ecf.provider.zookeeper.node.internal.INode
-
-