org.eclipse.ecf.provider.zookeeper.core
Class AdvertisedService

java.lang.Object
  extended by org.eclipse.ecf.discovery.ServiceInfo
      extended by org.eclipse.ecf.provider.zookeeper.core.AdvertisedService
All Implemented Interfaces:
java.io.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 of AdvertisedService is build either with an OSGi service reference ServiceReference or ServiceInfo 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_SERVICES, ROOT, ROOT_SLASH, SLASH, STRING_DELIM, URI_POSITION, ZOODISCOVERYID_POSITION
 
Fields inherited from interface org.eclipse.ecf.provider.zookeeper.core.internal.IService
LOCATION, PRIORITY, PROTOCOLS, WEIGHT
 
Constructor Summary
AdvertisedService(IServiceInfo serviceInfo)
           
AdvertisedService(org.osgi.framework.ServiceReference ref)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 java.lang.String getAbsolutePath()
           
 java.net.URI getLocation()
          Get URI for service
 java.lang.String getNodeId()
           
 java.lang.String getPath()
           
 java.util.Properties getProperties()
           
 byte[] getPropertiesAsBytes()
          Stored as value of a zookeeper node
 java.lang.String getPropertiesAsString()
           
static java.util.Map<java.lang.String,IServiceInfo> getPublishedServices()
           
 IServiceID getServiceID()
          Get ServiceID for service.
 org.osgi.framework.ServiceReference getServiceReference()
           
 org.eclipse.ecf.provider.zookeeper.core.internal.IService getWrappedService()
           
 boolean isLocalNode()
           
 void regenerateNodeId()
           
static IServiceInfo removePublished(java.lang.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
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

AdvertisedService

public AdvertisedService(org.osgi.framework.ServiceReference ref)

AdvertisedService

public AdvertisedService(IServiceInfo serviceInfo)
Method Detail

getPublishedServices

public static java.util.Map<java.lang.String,IServiceInfo> getPublishedServices()

removePublished

public static IServiceInfo removePublished(java.lang.String id)

getProperties

public java.util.Properties getProperties()
Specified by:
getProperties in interface org.eclipse.ecf.provider.zookeeper.core.internal.IService

getNodeId

public java.lang.String getNodeId()

regenerateNodeId

public void regenerateNodeId()
Specified by:
regenerateNodeId in interface org.eclipse.ecf.provider.zookeeper.node.internal.INode

getLocation

public java.net.URI getLocation()
Description copied from interface: IServiceInfo
Get URI for service

Specified by:
getLocation in interface IServiceInfo
Overrides:
getLocation in class ServiceInfo
Returns:
URI the location for the service.

getServiceID

public IServiceID getServiceID()
Description copied from interface: IServiceInfo
Get ServiceID for service.

Specified by:
getServiceID in interface IServiceInfo
Overrides:
getServiceID in class ServiceInfo
Returns:
ServiceID the serviceID for the service. Will not be null.

compareTo

public int compareTo(java.lang.Object o)

getServiceReference

public org.osgi.framework.ServiceReference getServiceReference()
Returns:
ServiceReference may be null if this AdvertisedService instance is not built calling constructor AdvertisedService(ServiceReference ref).

getPropertiesAsBytes

public byte[] getPropertiesAsBytes()
Description copied from interface: org.eclipse.ecf.provider.zookeeper.core.internal.IService
Stored as value of a zookeeper node

Specified by:
getPropertiesAsBytes in interface org.eclipse.ecf.provider.zookeeper.core.internal.IService
Returns:
byte value of string

getPropertiesAsString

public java.lang.String getPropertiesAsString()
Specified by:
getPropertiesAsString in interface org.eclipse.ecf.provider.zookeeper.core.internal.IService

getPath

public java.lang.String getPath()
Specified by:
getPath in interface org.eclipse.ecf.provider.zookeeper.node.internal.INode

getAbsolutePath

public java.lang.String getAbsolutePath()
Specified by:
getAbsolutePath in interface org.eclipse.ecf.provider.zookeeper.node.internal.INode

isLocalNode

public boolean isLocalNode()
Specified by:
isLocalNode in interface org.eclipse.ecf.provider.zookeeper.node.internal.INode

getWrappedService

public org.eclipse.ecf.provider.zookeeper.core.internal.IService getWrappedService()
Specified by:
getWrappedService in interface org.eclipse.ecf.provider.zookeeper.node.internal.INode