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 ofAdvertisedService
is build either with an OSGi service referenceServiceReference
orServiceInfo
object.- 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 int
compareTo(Object o)
String
getAbsolutePath()
URI
getLocation()
Get URI for serviceString
getNodeId()
String
getPath()
byte[]
getPropertiesAsBytes()
The byte representation of the service properties, appropriate to be stored in the zooKeeper nodestatic Map<String,IServiceInfo>
getPublishedServices()
IServiceID
getServiceID()
Get ServiceID for service.ServiceReference
getServiceReference()
org.eclipse.ecf.provider.zookeeper.core.internal.IService
getWrappedService()
boolean
isLocalNode()
void
regenerateNodeId()
static IServiceInfo
removePublished(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:
regenerateNodeId
in interfaceorg.eclipse.ecf.provider.zookeeper.node.internal.INode
-
getLocation
public URI getLocation()
Description copied from interface:IServiceInfo
Get URI for service- Specified by:
getLocation
in interfaceIServiceInfo
- Overrides:
getLocation
in classServiceInfo
- Returns:
URI
the location for the service.
-
getServiceID
public IServiceID getServiceID()
Description copied from interface:IServiceInfo
Get ServiceID for service.- Specified by:
getServiceID
in interfaceIServiceInfo
- Overrides:
getServiceID
in 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
AdvertisedService
instance is notbuilt
calling constructorAdvertisedService(ServiceReference ref)
.
-
getPropertiesAsBytes
public byte[] getPropertiesAsBytes()
Description copied from interface:org.eclipse.ecf.provider.zookeeper.core.internal.IService
The byte representation of the service properties, appropriate to be stored in the zooKeeper node- Specified by:
getPropertiesAsBytes
in interfaceorg.eclipse.ecf.provider.zookeeper.core.internal.IService
- Returns:
- byte representation of the properties
-
getPath
public String getPath()
- Specified by:
getPath
in interfaceorg.eclipse.ecf.provider.zookeeper.node.internal.INode
-
getAbsolutePath
public String getAbsolutePath()
- Specified by:
getAbsolutePath
in interfaceorg.eclipse.ecf.provider.zookeeper.node.internal.INode
-
isLocalNode
public boolean isLocalNode()
- Specified by:
isLocalNode
in interfaceorg.eclipse.ecf.provider.zookeeper.node.internal.INode
-
getWrappedService
public org.eclipse.ecf.provider.zookeeper.core.internal.IService getWrappedService()
- Specified by:
getWrappedService
in interfaceorg.eclipse.ecf.provider.zookeeper.node.internal.INode
-
-