org.eclipse.ecf.osgi.services.discovery
Class RemoteServiceEndpointDescription

java.lang.Object
  extended by org.eclipse.ecf.osgi.services.discovery.RemoteServiceEndpointDescription
All Implemented Interfaces:
IRemoteServiceEndpointDescription, ServiceEndpointDescription

public abstract class RemoteServiceEndpointDescription
extends java.lang.Object
implements IRemoteServiceEndpointDescription


Field Summary
protected  java.util.Map serviceProperties
           
 
Constructor Summary
RemoteServiceEndpointDescription(java.util.Map properties)
           
 
Method Summary
abstract  ID getConnectTargetID()
          Get the ECF container target ID (the ID of the container that is the target to connect to).
abstract  ID getEndpointAsID()
          Get the ECF endpoint ID (the ID of the endpoint that exposes the given remote service).
 java.lang.String getEndpointID()
          Returns the value of the property with key ServicePublication.ENDPOINT_ID.
 java.lang.String getEndpointInterfaceName(java.lang.String interfaceName)
          Returns non-Java endpoint interface name associated with the given interface.
 java.net.URI getLocation()
          Returns the value of the property with key ServicePublication.ENDPOINT_LOCATION.
 java.util.Map getProperties()
          Returns all service endpoint properties.
 java.lang.Object getProperty(java.lang.String key)
          Getter method for the property value of a given key.
 java.util.Collection getPropertyKeys()
          Returns all names of service endpoint properties.
 java.util.Collection getProvidedInterfaces()
          Returns the value of the property with key ServicePublication.SERVICE_INTERFACE_NAME.
 long getRemoteServiceId()
          Get the remote service id for this service endpoint description.
 java.lang.String getRemoteServicesFilter()
          Get the ECF remote services filter string.
abstract  IServiceID getServiceID()
           
 java.lang.String[] getServiceIntents()
           
 java.lang.String[] getSupportedConfigs()
           
 java.lang.String getVersion(java.lang.String interfaceName)
          Returns version of the given interface.
 void setProperties(java.util.Map props)
          Set the properties for this endpoint description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serviceProperties

protected java.util.Map serviceProperties
Constructor Detail

RemoteServiceEndpointDescription

public RemoteServiceEndpointDescription(java.util.Map properties)
Method Detail

getEndpointID

public java.lang.String getEndpointID()
Description copied from interface: ServiceEndpointDescription
Returns the value of the property with key ServicePublication.ENDPOINT_ID.

Specified by:
getEndpointID in interface ServiceEndpointDescription
Returns:
Unique id of service endpoint, or null if it hasn't been provided.

getEndpointInterfaceName

public java.lang.String getEndpointInterfaceName(java.lang.String interfaceName)
Description copied from interface: ServiceEndpointDescription
Returns non-Java endpoint interface name associated with the given interface.

Value of the property with key ServicePublication.ENDPOINT_INTERFACE_NAME is used by this operation.

Specified by:
getEndpointInterfaceName in interface ServiceEndpointDescription
Parameters:
interfaceName - for which its non-Java endpoint interface name should be returned.
Returns:
non-Java endpoint interface name, or null if it hasn't been provided or if given interface name is null.

getLocation

public java.net.URI getLocation()
Description copied from interface: ServiceEndpointDescription
Returns the value of the property with key ServicePublication.ENDPOINT_LOCATION.

Specified by:
getLocation in interface ServiceEndpointDescription
Returns:
The url of the service location, or null if it hasn't been provided.

getProperties

public java.util.Map getProperties()
Description copied from interface: ServiceEndpointDescription
Returns all service endpoint properties.

Specified by:
getProperties in interface ServiceEndpointDescription
Returns:
all properties of the service as a Map (<String, Object>). The map is never null or empty but contains at least mandatory ServicePublication properties. Since ServiceEndpointDescription objects are immutable, the returned map is also not going to be updated at a later point of time.

getProperty

public java.lang.Object getProperty(java.lang.String key)
Description copied from interface: ServiceEndpointDescription
Getter method for the property value of a given key.

Specified by:
getProperty in interface ServiceEndpointDescription
Parameters:
key - Name of the property
Returns:
The property value, or null if none is found for the given key or if provided key is null.

getPropertyKeys

public java.util.Collection getPropertyKeys()
Description copied from interface: ServiceEndpointDescription
Returns all names of service endpoint properties.

Specified by:
getPropertyKeys in interface ServiceEndpointDescription
Returns:
a Collection (<String>) of property names available in the ServiceEndpointDescription. The collection is never null or empty but contains at least names of mandatory ServicePublication properties. Since ServiceEndpointDescription objects are immutable, the returned collection is also not going to be updated at a later point of time.

getProvidedInterfaces

public java.util.Collection getProvidedInterfaces()
Description copied from interface: ServiceEndpointDescription
Returns the value of the property with key ServicePublication.SERVICE_INTERFACE_NAME.

Specified by:
getProvidedInterfaces in interface ServiceEndpointDescription
Returns:
Collection (<String>) of service interface names provided by the advertised service endpoint. The collection is never null or empty but contains at least one service interface.

getVersion

public java.lang.String getVersion(java.lang.String interfaceName)
Description copied from interface: ServiceEndpointDescription
Returns version of the given interface.

Value of the property with key ServicePublication.SERVICE_INTERFACE_VERSION is used by this operation.

Specified by:
getVersion in interface ServiceEndpointDescription
Parameters:
interfaceName - for which its version should be returned.
Returns:
Version of given service interface, or null if it hasn't been provided or if given interface name is null.

getRemoteServiceId

public long getRemoteServiceId()
Description copied from interface: IRemoteServiceEndpointDescription
Get the remote service id for this service endpoint description.

Specified by:
getRemoteServiceId in interface IRemoteServiceEndpointDescription
Returns:
long remote service id for the remote service.

getEndpointAsID

public abstract ID getEndpointAsID()
Description copied from interface: IRemoteServiceEndpointDescription
Get the ECF endpoint ID (the ID of the endpoint that exposes the given remote service). This ID must not be null.

Specified by:
getEndpointAsID in interface IRemoteServiceEndpointDescription
Returns:
ID that is the ECF endpoint ID that exposes the service described by this description.

getConnectTargetID

public abstract ID getConnectTargetID()
Description copied from interface: IRemoteServiceEndpointDescription
Get the ECF container target ID (the ID of the container that is the target to connect to). This may return null, meaning that no target ID is available, and that the endpoint ID returned from IRemoteServiceEndpointDescription.getEndpointAsID() is also the target container ID. If not null, the ID returned from this method may be used to connect to an intermediate target via IContainer connect.

Specified by:
getConnectTargetID in interface IRemoteServiceEndpointDescription
Returns:
ID that may be used by local IContainer to connect to remote target.

getServiceID

public abstract IServiceID getServiceID()

getRemoteServicesFilter

public java.lang.String getRemoteServicesFilter()
Description copied from interface: IRemoteServiceEndpointDescription
Get the ECF remote services filter string. May return null.

Specified by:
getRemoteServicesFilter in interface IRemoteServiceEndpointDescription
Returns:
String that is to be used as the filter for the call to getRemoteServicesReferences(ID,interface,filter);

setProperties

public void setProperties(java.util.Map props)
Description copied from interface: IRemoteServiceEndpointDescription
Set the properties for this endpoint description. This allows clients to examine and potentially change the service properties given by the service host (and delivered via discovery), and potentially change them via this method. The resulting properties will then be used in subsequent processing of this service endpoint description.

Specified by:
setProperties in interface IRemoteServiceEndpointDescription
Parameters:
props - the new set of properties. Must not be null.

getSupportedConfigs

public java.lang.String[] getSupportedConfigs()
Specified by:
getSupportedConfigs in interface IRemoteServiceEndpointDescription

getServiceIntents

public java.lang.String[] getServiceIntents()
Specified by:
getServiceIntents in interface IRemoteServiceEndpointDescription