Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2006-12-31 23:41:48 +0000
committerslewis2006-12-31 23:41:48 +0000
commita7ebc347b0740f1afb30c3705dfb4fe3855bba38 (patch)
tree1b670e695155d8ee04a33dcf51ae9c959227c9f7 /framework/bundles/org.eclipse.ecf.discovery/src
parentac6dbafd48171e16d9df582c9840e1a48131f117 (diff)
downloadorg.eclipse.ecf-a7ebc347b0740f1afb30c3705dfb4fe3855bba38.tar.gz
org.eclipse.ecf-a7ebc347b0740f1afb30c3705dfb4fe3855bba38.tar.xz
org.eclipse.ecf-a7ebc347b0740f1afb30c3705dfb4fe3855bba38.zip
Documentation and formatting updates
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.discovery/src')
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IDiscoveryContainerAdapter.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceEvent.java2
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceInfo.java6
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceListener.java6
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceProperties.java27
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceTypeListener.java2
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceContainerEvent.java12
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java27
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceProperties.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java27
10 files changed, 92 insertions, 25 deletions
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IDiscoveryContainerAdapter.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IDiscoveryContainerAdapter.java
index edf64ce85..a675d7b97 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IDiscoveryContainerAdapter.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IDiscoveryContainerAdapter.java
@@ -34,9 +34,9 @@ public interface IDiscoveryContainerAdapter {
* is discovered.
*
* @param type
- * the ServiceID of the desired type to listen for
+ * the ServiceID of the desired type to listen for. Should not be <code>null</code>.
* @param listener
- * the listener to be notified
+ * the listener to be notified. Should not be <code>null</code>.
*/
public void addServiceListener(ServiceID type, IServiceListener listener);
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceEvent.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceEvent.java
index 1f34e2013..37719aee4 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceEvent.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceEvent.java
@@ -18,7 +18,7 @@ public interface IServiceEvent extends IContainerEvent {
/**
* Get the service info associated with this event
*
- * @return IServiceInfo any info associated with this event. May be null.
+ * @return IServiceInfo any info associated with this event. May be <code>null</code>.
*/
public IServiceInfo getServiceInfo();
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceInfo.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceInfo.java
index 11691dd9a..aefd7c119 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceInfo.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceInfo.java
@@ -22,7 +22,7 @@ public interface IServiceInfo {
/**
* Get InetAddress for service
*
- * @return InetAddress the address for the service. May be null if address
+ * @return InetAddress the address for the service. May be <code>null</code> if address
* is not known.
*/
public InetAddress getAddress();
@@ -30,7 +30,7 @@ public interface IServiceInfo {
/**
* Get ServiceID for service.
*
- * @return ServiceID the serviceID for the service. Must not be null.
+ * @return ServiceID the serviceID for the service. Will not be <code>null</code>.
*/
public ServiceID getServiceID();
@@ -59,7 +59,7 @@ public interface IServiceInfo {
* Map with any/all properties associated with the service. Properties are
* assumed to be name/value pairs, both of type String.
*
- * @return Map the properties associated with this service
+ * @return Map the properties associated with this service. Will not be <code>null</code>.
*/
public IServiceProperties getServiceProperties();
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceListener.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceListener.java
index 587e04235..b55972ad7 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceListener.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceListener.java
@@ -17,14 +17,14 @@ public interface IServiceListener {
/**
* Notification that a service has been added.
*
- * @param event
+ * @param event Will not be <code>null</code>.
*/
public void serviceAdded(IServiceEvent event);
/**
* Notification that a service has been removed.
*
- * @param event
+ * @param event Will not be <code>null</code>.
*/
public void serviceRemoved(IServiceEvent event);
@@ -32,7 +32,7 @@ public interface IServiceListener {
* Notification that a service has been resolved (that complete service info
* is now available).
*
- * @param event
+ * @param event Will not be <code>null</code>.
*/
public void serviceResolved(IServiceEvent event);
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceProperties.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceProperties.java
index c5c974947..725f772dd 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceProperties.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceProperties.java
@@ -16,7 +16,7 @@ public interface IServiceProperties {
* Get property names. This should return an Enumeration of String objects
* that identify all of the names in this IServiceProperties instance
*
- * @return Enumeration of all service property names as Strings
+ * @return Enumeration of all service property names as Strings. Will not be <code>null</code>.
*/
public Enumeration getPropertyNames();
@@ -26,8 +26,9 @@ public interface IServiceProperties {
* name, or if the property has some other type than String.
*
* @param name
- * the name of the property to return
- * @return the property as a String
+ * the name of the property to return. Must not be <code>null</code>.
+ * @return the property as a String. Will be <code>null</code> if property does
+ * not exist.
*/
public String getPropertyString(String name);
@@ -37,19 +38,21 @@ public interface IServiceProperties {
* name, or if the property has some other type than byte[].
*
* @param name
- * the name of the property to return
- * @return the property as a byte[]
+ * the name of the property to return. Must not be <code>null</code>.
+ * @return the property as a byte[]. Will be <code>null</code> if property does
+ * not exist.
*/
public byte[] getPropertyBytes(String name);
/**
* Get property as an Object. Returns a non-null Object if there is a
- * property of the given name. Returns null if there is no property by that
+ * property of the given name. Returns <code>null</code> if there is no property by that
* name.
*
* @param name
- * the name of the property to return
- * @return the property as an Object
+ * the name of the property to return. Must not be <code>null</code>.
+ * @return the property as an Object. Returns <code>null</code> if there is no
+ * property of given name.
*/
public Object getProperty(String name);
@@ -57,12 +60,12 @@ public interface IServiceProperties {
* Set property as String.
*
* @param name
- * the property name of the property. Must not be null.
+ * the property name of the property. Must not be <code>null</code>.
* @param value
* the property value to associated with the name. Must not be
- * null
- * @return Object that was previous value associated with given name. Null
- * if not previously in properties
+ * <code>null</code>.
+ * @return Object that was previous value associated with given name. May be <code>null</code>
+ * if not previously in properties.
*/
public Object setPropertyString(String name, String value);
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceTypeListener.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceTypeListener.java
index 149b451ac..e6a04664c 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceTypeListener.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceTypeListener.java
@@ -16,7 +16,7 @@ public interface IServiceTypeListener {
/**
* Notification that a service type has been added
*
- * @param event
+ * @param event Must not be <code>null</code>.
*/
public void serviceTypeAdded(IServiceEvent event);
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceContainerEvent.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceContainerEvent.java
index 1cefa5ecb..3fab97ae9 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceContainerEvent.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceContainerEvent.java
@@ -12,7 +12,8 @@ package org.eclipse.ecf.discovery;
import org.eclipse.ecf.core.identity.ID;
/**
- * Event implementation of IServiceEvent interface
+ * Base event implementation of {@link IServiceEvent}. Subclasses
+ * may be created as appropriate.
*/
public class ServiceContainerEvent implements IServiceEvent {
@@ -27,14 +28,23 @@ public class ServiceContainerEvent implements IServiceEvent {
this.containerID = containerID;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.discovery.IServiceEvent#getServiceInfo()
+ */
public IServiceInfo getServiceInfo() {
return info;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.core.events.IContainerEvent#getLocalContainerID()
+ */
public ID getLocalContainerID() {
return containerID;
}
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
public String toString() {
StringBuffer buf = new StringBuffer("ServiceContainerEvent[");
buf.append("serviceinfo=").append(info).append("]");
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java
index 96b4251da..280b418ca 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java
@@ -15,7 +15,8 @@ import java.net.InetAddress;
import org.eclipse.ecf.discovery.identity.ServiceID;
/**
- * Information provided by discovery protocol about a remote service
+ * Base implementation of {@link IServiceInfo}. Subclasses
+ * may be created as appropriate.
*/
public class ServiceInfo implements IServiceInfo, Serializable {
@@ -52,6 +53,9 @@ public class ServiceInfo implements IServiceInfo, Serializable {
this.properties = props;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.discovery.IServiceInfo#getAddress()
+ */
public InetAddress getAddress() {
return addr;
}
@@ -60,30 +64,51 @@ public class ServiceInfo implements IServiceInfo, Serializable {
this.addr = address;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.discovery.IServiceInfo#getServiceID()
+ */
public ServiceID getServiceID() {
return serviceID;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.discovery.IServiceInfo#getPort()
+ */
public int getPort() {
return port;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.discovery.IServiceInfo#getPriority()
+ */
public int getPriority() {
return priority;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.discovery.IServiceInfo#getWeight()
+ */
public int getWeight() {
return weight;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.discovery.IServiceInfo#getServiceProperties()
+ */
public IServiceProperties getServiceProperties() {
return properties;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.discovery.IServiceInfo#isResolved()
+ */
public boolean isResolved() {
return (addr != null);
}
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
public String toString() {
StringBuffer buf = new StringBuffer("ServiceInfo[");
buf.append("addr=").append(addr).append(";id=").append(serviceID)
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceProperties.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceProperties.java
index 65bde10dd..d7e305df8 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceProperties.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceProperties.java
@@ -11,6 +11,10 @@ package org.eclipse.ecf.discovery;
import java.util.Enumeration;
import java.util.Properties;
+/**
+ * Service properties implementation class for {@link IServiceProperties}. Subclasses
+ * may be created as appropriate.
+ */
public class ServiceProperties implements IServiceProperties {
Properties props = new Properties();
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java
index a2911cd0e..777ef1298 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java
@@ -12,7 +12,8 @@ import org.eclipse.ecf.core.identity.BaseID;
import org.eclipse.ecf.core.identity.Namespace;
/**
- * Identity type to represent discovered service
+ * Service identity type. ServiceIDs are IDs that uniquely identify
+ * a remote service. Subclasses may be created as appropriate.
*
*/
public class ServiceID extends BaseID {
@@ -42,6 +43,9 @@ public class ServiceID extends BaseID {
return type + name;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.core.identity.BaseID#namespaceCompareTo(org.eclipse.ecf.core.identity.BaseID)
+ */
protected int namespaceCompareTo(BaseID o) {
if (o instanceof ServiceID) {
ServiceID other = (ServiceID) o;
@@ -52,6 +56,9 @@ public class ServiceID extends BaseID {
}
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.core.identity.BaseID#namespaceEquals(org.eclipse.ecf.core.identity.BaseID)
+ */
protected boolean namespaceEquals(BaseID o) {
if (o == null)
return false;
@@ -64,22 +71,40 @@ public class ServiceID extends BaseID {
return false;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.core.identity.BaseID#namespaceGetName()
+ */
protected String namespaceGetName() {
return getFullyQualifiedName();
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.core.identity.BaseID#namespaceHashCode()
+ */
protected int namespaceHashCode() {
return getFullyQualifiedName().hashCode();
}
+ /**
+ * Get service type for this ID.
+ * @return String service type. Will not be <code>null</code>.
+ */
public String getServiceType() {
return type;
}
+ /**
+ * Get service name for this ID.
+ *
+ * @return String service name. Will not be <code>null</code>.
+ */
public String getServiceName() {
return name;
}
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
public String toString() {
StringBuffer buf = new StringBuffer("ServiceID[");
buf.append("type=").append(type).append(";name=").append(name).append(

Back to the top