org.eclipse.ecf.osgi.services.discovery.local
Class ServiceEndpointDescriptionImpl

java.lang.Object
  extended by org.eclipse.ecf.osgi.services.discovery.local.ServiceEndpointDescriptionImpl
All Implemented Interfaces:
ServiceEndpointDescription

public class ServiceEndpointDescriptionImpl
extends java.lang.Object
implements ServiceEndpointDescription


Constructor Summary
ServiceEndpointDescriptionImpl()
           
ServiceEndpointDescriptionImpl(java.util.Collection interfaceNames, java.util.Collection interfacesAndVersions, java.util.Collection endPointInterfaces, java.util.Map props, java.lang.String endpntID)
           
 
Method Summary
 void addProperty(java.lang.String key, java.lang.Object value)
           
static java.lang.String convertJavaInterface2Path(java.lang.String javaInterfaceName)
           
static java.lang.String convertPath2JavaInterface(java.lang.String interfaceNameEncodedAsPath)
           
 boolean equals(java.lang.Object serviceDescription)
           
 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.
 java.lang.String getVersion(java.lang.String interfaceName)
          Returns version of the given interface.
 int hashCode()
           
 void setProperties(java.util.Map props)
           
 void setProvidedInterfaces(java.util.Collection interfaceNames)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceEndpointDescriptionImpl

public ServiceEndpointDescriptionImpl()

ServiceEndpointDescriptionImpl

public ServiceEndpointDescriptionImpl(java.util.Collection interfaceNames,
                                      java.util.Collection interfacesAndVersions,
                                      java.util.Collection endPointInterfaces,
                                      java.util.Map props,
                                      java.lang.String endpntID)
Parameters:
interfaceNames -
interfacesAndVersions -
endPointInterfaces -
props -
Throws:
ServiceLocationException
Method Detail

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.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

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.
See Also:
ServiceEndpointDescription.getProvidedInterfaces()

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.
See Also:
ServiceEndpointDescription.getEndpointInterfaceName(java.lang.String)

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.
See Also:
ServiceEndpointDescription.getVersion(java.lang.String)

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.

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:
Collection
See Also:
ServiceEndpointDescription.getPropertyKeys()

addProperty

public void addProperty(java.lang.String key,
                        java.lang.Object value)
Parameters:
key -
value -

convertJavaInterface2Path

public static java.lang.String convertJavaInterface2Path(java.lang.String javaInterfaceName)
Parameters:
javaInterfaceName -
Returns:
String

convertPath2JavaInterface

public static java.lang.String convertPath2JavaInterface(java.lang.String interfaceNameEncodedAsPath)
Parameters:
interfaceNameEncodedAsPath -
Returns:
String

equals

public boolean equals(java.lang.Object serviceDescription)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

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.
See Also:
ServiceEndpointDescription.getEndpointID()

setProvidedInterfaces

public void setProvidedInterfaces(java.util.Collection interfaceNames)
Parameters:
interfaceNames - the list of interfaceNames provided by this ServiceEndpointDescription

setProperties

public void setProperties(java.util.Map props)