Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/osgi
diff options
context:
space:
mode:
authorslewis2013-12-13 20:36:03 +0000
committerslewis2013-12-13 20:36:03 +0000
commit54cd3af4c60f383d70b541327add74919d7fc5f1 (patch)
tree1c40c085e8b3f22deaf096b3679e910516320370 /osgi
parenta84d5c1128849df00e15fcd9c6c39415cebab198 (diff)
downloadorg.eclipse.ecf-54cd3af4c60f383d70b541327add74919d7fc5f1.tar.gz
org.eclipse.ecf-54cd3af4c60f383d70b541327add74919d7fc5f1.tar.xz
org.eclipse.ecf-54cd3af4c60f383d70b541327add74919d7fc5f1.zip
Added use of UUID (globally unique ID) for EndpointDescription
endpoint.id property. ECF distribution provider id now present in ecf.endpoint.id (new property). Change-Id: I3e13d0dc23d2915752088661b9276636270e7f56
Diffstat (limited to 'osgi')
-rw-r--r--osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/EndpointDescription.java12
-rw-r--r--osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteServiceAdmin.java20
2 files changed, 16 insertions, 16 deletions
diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/EndpointDescription.java b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/EndpointDescription.java
index e35a61901..ac0e33e18 100644
--- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/EndpointDescription.java
+++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/EndpointDescription.java
@@ -45,7 +45,7 @@ import org.osgi.framework.Version;
public class EndpointDescription extends
org.osgi.service.remoteserviceadmin.EndpointDescription {
- private String id;
+ private String ecfid;
private Long timestamp;
private String idNamespace;
private ID containerID;
@@ -96,12 +96,12 @@ public class EndpointDescription extends
}
private void verifyECFProperties() {
- this.id = verifyStringProperty(RemoteConstants.ENDPOINT_ID);
- if (this.id == null) {
+ this.ecfid = verifyStringProperty(RemoteConstants.ENDPOINT_ID);
+ if (this.ecfid == null) {
LogUtility
.logWarning(
"verifyECFProperties", DebugOptions.ENDPOINT_DESCRIPTION_READER, EndpointDescription.class, "ECFEndpointDescription property " + RemoteConstants.ENDPOINT_ID + " not set. Using OSGI endpoint.id"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- this.id = getId();
+ this.ecfid = getId();
}
this.timestamp = verifyLongProperty(RemoteConstants.ENDPOINT_TIMESTAMP);
if (this.timestamp == null) {
@@ -111,7 +111,7 @@ public class EndpointDescription extends
this.timestamp = getServiceId();
}
this.idNamespace = verifyStringProperty(RemoteConstants.ENDPOINT_CONTAINER_ID_NAMESPACE);
- this.containerID = verifyIDProperty(idNamespace, getId());
+ this.containerID = verifyIDProperty(idNamespace, this.ecfid);
this.connectTargetID = verifyIDProperty(RemoteConstants.ENDPOINT_CONNECTTARGET_ID);
this.idFilter = verifyIDFilter();
this.rsFilter = verifyStringProperty(RemoteConstants.ENDPOINT_REMOTESERVICE_FILTER);
@@ -204,7 +204,7 @@ public class EndpointDescription extends
* @since 3.1
*/
public String getEndpointId() {
- return id;
+ return ecfid;
}
/**
diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteServiceAdmin.java b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteServiceAdmin.java
index 0eb3682dd..0b5edf702 100644
--- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteServiceAdmin.java
+++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteServiceAdmin.java
@@ -1340,11 +1340,20 @@ public class RemoteServiceAdmin implements
overridingProperties,
org.osgi.service.remoteserviceadmin.RemoteConstants.ENDPOINT_ID);
if (endpointId == null)
- endpointId = containerID.getName();
+ endpointId = UUID.randomUUID().toString();
endpointDescriptionProperties
.put(org.osgi.service.remoteserviceadmin.RemoteConstants.ENDPOINT_ID,
endpointId);
+ // ECF ENDPOINT ID
+ String ecfEndpointId = (String) PropertiesUtil.getPropertyValue(
+ serviceReference, overridingProperties,
+ RemoteConstants.ENDPOINT_ID);
+ if (ecfEndpointId == null)
+ ecfEndpointId = containerID.getName();
+ endpointDescriptionProperties.put(RemoteConstants.ENDPOINT_ID,
+ ecfEndpointId);
+
// ENDPOINT_SERVICE_ID
// This is always set to the value from serviceReference as per 122.5.1
Long serviceId = (Long) serviceReference
@@ -1399,15 +1408,6 @@ public class RemoteServiceAdmin implements
remoteIntentsSupported);
// ECF properties
- // ECF ENDPOINT ID
- String ecfEndpointId = (String) PropertiesUtil.getPropertyValue(serviceReference, overridingProperties,
- RemoteConstants.ENDPOINT_ID);
- if (ecfEndpointId == null)
- ecfEndpointId = endpointId;
- endpointDescriptionProperties
- .put(RemoteConstants.ENDPOINT_ID,
- endpointId);
-
// ID namespace
String idNamespace = containerID.getNamespace().getName();
endpointDescriptionProperties.put(

Back to the top