Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-03-13 07:06:28 +0000
committerslewis2007-03-13 07:06:28 +0000
commit65fa28890fddc92acc74e746dec3d977e9f8b647 (patch)
treea366fe1bd6e486e8150916fd879afc0de282385a /framework/bundles/org.eclipse.ecf.discovery/src
parent7b40b78cf3803aa347bc63ab53e998d432f9dd73 (diff)
downloadorg.eclipse.ecf-65fa28890fddc92acc74e746dec3d977e9f8b647.tar.gz
org.eclipse.ecf-65fa28890fddc92acc74e746dec3d977e9f8b647.tar.xz
org.eclipse.ecf-65fa28890fddc92acc74e746dec3d977e9f8b647.zip
Added IServiceID interface and replaced references to ServiceID class to IServiceID interface
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.java8
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IServiceInfo.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java9
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/IServiceID.java32
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java4
5 files changed, 45 insertions, 12 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 f585c6ead..26b1ad88e 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
@@ -12,7 +12,7 @@ package org.eclipse.ecf.discovery;
import java.io.IOException;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ecf.discovery.identity.ServiceID;
+import org.eclipse.ecf.discovery.identity.IServiceID;
/**
* Entry point discovery container adapter. This interface exposes the ability
@@ -97,14 +97,14 @@ public interface IDiscoveryContainerAdapter extends IAdaptable {
* defined by the first parameter.
*
* @param service
- * ServiceID of the service to get info about. Must not be
+ * IServiceID of the service to get info about. Must not be
* <code>null</code>.
* @param timeout
* int time to wait for a response (in ms)
* @return IServiceInfo the service info retrieved. <code>null</code> if
* no information retrieved within timeout.
*/
- public IServiceInfo getServiceInfo(ServiceID service, int timeout);
+ public IServiceInfo getServiceInfo(IServiceID service, int timeout);
/**
* Asynchronously (within given timeout) retrieve info about the service
@@ -118,7 +118,7 @@ public interface IDiscoveryContainerAdapter extends IAdaptable {
* @param timeout
* int time to wait for a response (in ms)
*/
- public void requestServiceInfo(ServiceID service, int timeout);
+ public void requestServiceInfo(IServiceID service, int timeout);
/**
* Unregister service defined by serviceInfo.
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 aefd7c119..1d69c496a 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
@@ -11,7 +11,7 @@ package org.eclipse.ecf.discovery;
import java.net.InetAddress;
-import org.eclipse.ecf.discovery.identity.ServiceID;
+import org.eclipse.ecf.discovery.identity.IServiceID;
/**
* Service information contrace. Defines the information associated with a
@@ -32,7 +32,7 @@ public interface IServiceInfo {
*
* @return ServiceID the serviceID for the service. Will not be <code>null</code>.
*/
- public ServiceID getServiceID();
+ public IServiceID getServiceID();
/**
* The port for the service
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 40d5fa691..272394d47 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
@@ -12,6 +12,7 @@ package org.eclipse.ecf.discovery;
import java.io.Serializable;
import java.net.InetAddress;
+import org.eclipse.ecf.discovery.identity.IServiceID;
import org.eclipse.ecf.discovery.identity.ServiceID;
/**
@@ -24,7 +25,7 @@ public class ServiceInfo implements IServiceInfo, Serializable {
InetAddress addr = null;
- ServiceID serviceID;
+ IServiceID serviceID;
int port;
@@ -43,10 +44,10 @@ public class ServiceInfo implements IServiceInfo, Serializable {
this.properties = props;
}
- public ServiceInfo(InetAddress address, ServiceID id, int port,
+ public ServiceInfo(InetAddress address, IServiceID serviceID, int port,
int priority, int weight, IServiceProperties props) {
this.addr = address;
- this.serviceID = id;
+ this.serviceID = serviceID;
this.port = port;
this.priority = priority;
this.weight = weight;
@@ -67,7 +68,7 @@ public class ServiceInfo implements IServiceInfo, Serializable {
/* (non-Javadoc)
* @see org.eclipse.ecf.discovery.IServiceInfo#getServiceID()
*/
- public ServiceID getServiceID() {
+ public IServiceID getServiceID() {
return serviceID;
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/IServiceID.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/IServiceID.java
new file mode 100644
index 000000000..25bbfc84f
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/IServiceID.java
@@ -0,0 +1,32 @@
+/****************************************************************************
+ * Copyright (c) 2004 Composent, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Composent, Inc. - initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.ecf.discovery.identity;
+
+import org.eclipse.ecf.core.identity.ID;
+
+/**
+ * Service identity contract.
+ */
+public interface IServiceID extends ID {
+
+ /**
+ * Get service type for this ID.
+ * @return String service type. Will not be <code>null</code>.
+ */
+ public String getServiceType();
+ /**
+ * Get service name for this ID.
+ *
+ * @return String service name. May be <code>null</code>.
+ */
+ public String getServiceName();
+}
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 bc8593912..cf30935ba 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
@@ -17,7 +17,7 @@ import org.eclipse.ecf.internal.discovery.Messages;
* a remote service. Subclasses may be created as appropriate.
*
*/
-public class ServiceID extends BaseID {
+public class ServiceID extends BaseID implements IServiceID {
private static final long serialVersionUID = 1L;
protected String type;
@@ -97,7 +97,7 @@ public class ServiceID extends BaseID {
/**
* Get service name for this ID.
*
- * @return String service name. Will not be <code>null</code>.
+ * @return String service name. May be <code>null</code>.
*/
public String getServiceName() {
return name;

Back to the top