Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2016-02-25 19:54:07 +0000
committerslewis2016-02-25 19:54:07 +0000
commit792864c19f13cd85be335eecc4dccc76ae74f61f (patch)
tree883896f25dafe7a6e20ae8a15f7a08d18e392f27 /framework
parent5d719e336a7a5c88edd27a635edb707ea327fe56 (diff)
downloadorg.eclipse.ecf-792864c19f13cd85be335eecc4dccc76ae74f61f.tar.gz
org.eclipse.ecf-792864c19f13cd85be335eecc4dccc76ae74f61f.tar.xz
org.eclipse.ecf-792864c19f13cd85be335eecc4dccc76ae74f61f.zip
Refactoring of remote service constants.
Diffstat (limited to 'framework')
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/Constants.java207
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/client/AbstractRSAClientContainer.java10
2 files changed, 212 insertions, 5 deletions
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/Constants.java b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/Constants.java
index 7ae7fbd92..e7fb02d9c 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/Constants.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/Constants.java
@@ -11,10 +11,15 @@
package org.eclipse.ecf.remoteservice;
+import java.util.Map;
+import org.eclipse.ecf.core.IContainerFactory;
+import org.eclipse.ecf.core.security.IConnectContext;
+
/**
* Remote service API constants.
*
* @noimplement This interface is not intended to be implemented by clients.
+ * @since 8.9
*/
public interface Constants {
@@ -201,4 +206,206 @@ public interface Constants {
* @deprecated
*/
public static final String SERVICE_CONTAINER_FACTORY_NAME = "ecf.rsvc.cfn"; //$NON-NLS-1$
+
+ /**
+ * ECF discovery service type for Remote Service Admin. All ECF remote
+ * services published by Remote Service Admin advertisers should have this
+ * value as one of the entries in the list returned from
+ * {@link IServiceTypeID#getServices()}.
+ * @since 8.9
+ */
+ public static final String DISCOVERY_SERVICE_TYPE = "ecfosgirsvc"; //$NON-NLS-1$
+ /**
+ * ECF discovery scope property. Value type is String+. If set, the value
+ * will be used by the {@link IServiceInfoFactory} during
+ * {@link IServiceInfoFactory#createServiceInfo(org.eclipse.ecf.discovery.IDiscoveryAdvertiser, EndpointDescription)}
+ * to create an {@link IServiceTypeID} via
+ * {@link IServiceIDFactory#createServiceTypeID(org.eclipse.ecf.core.identity.Namespace, String[], String[], String[], String)}
+ * . The scopes value determines the third parameter. If not explicitly set,
+ * the {@link IServiceTypeID#DEFAULT_SCOPE} is used.
+ * @since 8.9
+ */
+ public static final String DISCOVERY_SCOPE = "ecf.endpoint.discovery.scope"; //$NON-NLS-1$
+ /**
+ * ECF discovery protocols property. Value type is String+. If set, the
+ * value will be used by the {@link IServiceInfoFactory} during
+ * {@link IServiceInfoFactory#createServiceInfo(org.eclipse.ecf.discovery.IDiscoveryAdvertiser, EndpointDescription)}
+ * to create an {@link IServiceTypeID} via
+ * {@link IServiceIDFactory#createServiceTypeID(org.eclipse.ecf.core.identity.Namespace, String[], String[], String[], String)}
+ * . The protocols value determines the fourth parameter. If not explicitly
+ * set, the {@link IServiceTypeID#DEFAULT_PROTO} is used.
+ * @since 8.9
+ */
+ public static final String DISCOVERY_PROTOCOLS = "ecf.endpoint.discovery.protocols"; //$NON-NLS-1$
+ /**
+ * ECF discovery naming authority property. Value type is String. If set,
+ * the value will be used by the {@link IServiceInfoFactory} during
+ * {@link IServiceInfoFactory#createServiceInfo(org.eclipse.ecf.discovery.IDiscoveryAdvertiser, EndpointDescription)}
+ * to create an {@link IServiceTypeID} via
+ * {@link IServiceIDFactory#createServiceTypeID(org.eclipse.ecf.core.identity.Namespace, String[], String[], String[], String)}
+ * . The protocols value determines the fifth parameter. If not explicitly
+ * set, the {@link IServiceTypeID#DEFAULT_NA} is used.
+ * @since 8.9
+ */
+ public static final String DISCOVERY_NAMING_AUTHORITY = "ecf.endpoint.discovery.namingauthority"; //$NON-NLS-1$
+ /**
+ * ECF discovery service name property. Value type is String. If set, the
+ * value will be used by the {@link IServiceInfoFactory} during
+ * {@link IServiceInfoFactory#createServiceInfo(org.eclipse.ecf.discovery.IDiscoveryAdvertiser, EndpointDescription)}
+ * to create an {@link IServiceInfo} with a given name. The default is a
+ * globally unique identifier. Note that if this value is explicitly set,
+ * care should be taken to not have the name conflict with other remote
+ * service names.
+ * @since 8.9
+ */
+ public static final String DISCOVERY_SERVICE_NAME = "ecf.endpoint.discovery.servicename"; //$NON-NLS-1$
+ /**
+ * ECF service name default prefix. If the DISCOVERY_SERVICE_NAME is
+ * <b>not</b> set, this prefix will be the precede the unique identifier.
+ * @since 8.9
+ */
+ public static final String DISCOVERY_DEFAULT_SERVICE_NAME_PREFIX = "osgirsvc_"; //$NON-NLS-1$
+ /**
+ * ECF {@link EndpointDescription} property (with value of type String) that
+ * defines the unique {@link org.eclipse.ecf.core.identity.Namespace} name.
+ * If present in the {@link EndpointDescription}, the value will be used to
+ * create the containerID for accessing a remote service. The Namespace name
+ * is optional because typically the ID protocol specifier (e.g. 'ecftcp' in
+ * ID with name: 'ecftcp://localhost:3282/server') can be used to
+ * unambiguously determine the appropriate
+ * {@link org.eclipse.ecf.core.identity.Namespace} used to create the
+ * container ID for remote service import.
+ * @since 8.9
+ */
+ public static final String ENDPOINT_CONTAINER_ID_NAMESPACE = "ecf.endpoint.id.ns"; //$NON-NLS-1$
+ /**
+ * ECF {@link EndpointDescription} property (with value of type String) that
+ * defines the ecf endpoint id (typically the container id).
+ *
+ * @since 8.9
+ */
+ public static final String ENDPOINT_ID = "ecf.endpoint.id"; //$NON-NLS-1$
+ /**
+ * ECF {@link EndpointDescription} property (with value of type Long) that
+ * defines a service timestamp set upon initial export of the remote
+ * service.
+ *
+ * @since 8.9
+ */
+ public static final String ENDPOINT_TIMESTAMP = "ecf.endpoint.ts"; //$NON-NLS-1$
+ /**
+ * Optional ECF {@link EndpointDescription} property (with value of type
+ * String) that defines a connect target ID. If set/non-<code>null</code>,
+ * this property can be used by remote service consumers to connect to a
+ * specific container, and access a remote service exposed by some
+ * <b>other</b> member of the group.
+ * @since 8.9
+ */
+ public static final String ENDPOINT_CONNECTTARGET_ID = "ecf.endpoint.connecttarget.id"; //$NON-NLS-1$
+ /**
+ * Optional ECF {@link EndpointDescription} property (with value of type
+ * String+) that defines one or more IDs used for filtering remote service
+ * references during
+ * {@link RemoteServiceAdmin#importService(org.osgi.service.remoteserviceadmin.EndpointDescription)}
+ * .
+ * @since 8.9
+ */
+ public static final String ENDPOINT_IDFILTER_IDS = "ecf.endpoint.idfilter.ids"; //$NON-NLS-1$
+ /**
+ * Optional ECF {@link EndpointDescription} property (with value of type
+ * String), that defines a remote services properties filter used during
+ * {@link RemoteServiceAdmin#importService(org.osgi.service.remoteserviceadmin.EndpointDescription)}
+ * .
+ * @since 8.9
+ */
+ public static final String ENDPOINT_REMOTESERVICE_FILTER = "ecf.endpoint.rsfilter"; //$NON-NLS-1$
+
+ /**
+ * Container factory arguments for exported remote service hosts. If
+ * specified as a service property upon remote service registration, this
+ * property allows ECF containers to be initialized and configured upon
+ * creation during the call to
+ * {@link HostContainerSelector#selectHostContainers(org.osgi.framework.ServiceReference, Map, String[], String[], String[])}
+ * . The type of the value may be String, ID, or Object[]. The
+ * IContainerFactory.createContainer method is then selected based upon the
+ * type of the value...i.e.
+ * {@link IContainerFactory#createContainer(org.eclipse.ecf.core.ContainerTypeDescription, String)}
+ * ,
+ * {@link IContainerFactory#createContainer(org.eclipse.ecf.core.identity.ID)}
+ * , or {@link IContainerFactory#createContainer(String, Object[])}, and the
+ * value is passed in for container creation.
+ * @since 8.9
+ */
+ public static final String SERVICE_EXPORTED_CONTAINER_FACTORY_ARGS = "ecf.exported.containerfactoryargs"; //$NON-NLS-1$
+ /**
+ * Container connect context for exported remote service hosts. If specified
+ * as a service property for remote service export, this property allows ECF
+ * containers to have given a connect context for authentication upon
+ * container connection by
+ * {@link HostContainerSelector#selectHostContainers(org.osgi.framework.ServiceReference, Map, String[], String[], String[])}
+ * . The type of the value is {@link IConnectContext}.
+ * @since 8.9
+ */
+ public static final String SERVICE_EXPORTED_CONTAINER_CONNECT_CONTEXT = "ecf.exported.containerconnectcontext"; //$NON-NLS-1$
+ /**
+ * Container ID of the target host container for remote service export. If
+ * specified as a service property for remote service export, this property
+ * is used to match against the set of available containers in
+ * {@link HostContainerSelector#selectHostContainers(org.osgi.framework.ServiceReference, Map, String[], String[], String[])}
+ * . The type of the value is ID.
+ * @since 8.9
+ */
+ public static final String SERVICE_EXPORTED_CONTAINER_ID = "ecf.exported.containerid"; //$NON-NLS-1$
+
+ /**
+ * Service property marking the service for async proxy export. It defines
+ * the async interfaces under which this service will be exported on the
+ * remote proxy. This list must be a subset of the types service was
+ * exported (i.e. subset of interfaces specified by #
+ * {@link org.osgi.service.remoteserviceadmin.RemoteConstants#SERVICE_EXPORTED_INTERFACES}
+ * . The single value of an asterisk (&quot;*&quot;, &#92;u002A) indicates
+ * all the interface types under which the service was exported.
+ * <p>
+ * The interfaces in the String[] can either be
+ * <ol>
+ * <li>The same fully qualified name as an interface in the #
+ * {@link org.osgi.service.remoteserviceadmin.RemoteConstants#SERVICE_EXPORTED_INTERFACES}
+ * property</li>
+ * <li>The fully qualified name of an interface that follows the
+ * asynchronous proxy conventions to match with one of the existing exported
+ * types.</li>
+ *
+ * <p>
+ * This property may be supplied in the {@code properties}
+ * {@code Dictionary} object passed to the
+ * {@code BundleContext.registerService} method. The value of this property
+ * must be of type {@code String}, {@code String[]}, or {@code Collection}
+ * of {@code String}.
+ * @since 8.9
+ *
+ */
+ public static final String SERVICE_EXPORTED_ASYNC_INTERFACES = "ecf.exported.async.interfaces"; //$NON-NLS-1$
+
+ /**
+ * Allows exporting ECF containers to determine the type of value associated
+ * with the
+ * {@link org.osgi.service.remoteserviceadmin.RemoteConstants#SERVICE_IMPORTED}
+ * property on the OSGi remote service consumer. For ECF, the default value
+ * type is {@link IRemoteService}. If set to some other value (e.g.
+ * {@link Boolean} by the exporting host container, then consumers can use
+ * the SERVICE_IMPORTED value appropriately.
+ * @since 8.9
+ */
+ public static final String SERVICE_IMPORTED_VALUETYPE = "ecf.service.imported.valuetype"; //$NON-NLS-1$
+
+ /**
+ * @since 8.9
+ */
+ public static final String OSGI_ENDPOINT_MODIFIED = "ecf.osgi.endpoint.modified"; //$NON-NLS-1$
+
+ /**
+ * @since 8.9
+ */
+ public static final String OSGI_CONTAINER_ID_NS = "ecf.osgi.ns"; //$NON-NLS-1$
+
}
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/client/AbstractRSAClientContainer.java b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/client/AbstractRSAClientContainer.java
index 85bd991d6..cf7ec9dbe 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/client/AbstractRSAClientContainer.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/client/AbstractRSAClientContainer.java
@@ -107,15 +107,15 @@ public abstract class AbstractRSAClientContainer extends AbstractClientContainer
public IRemoteServiceReference[] importEndpoint(Map<String, Object> endpointDescriptionProperties) throws ContainerConnectException, InvalidSyntaxException {
// ecf.endpoint.id
- String ecfid = EndpointDescriptionPropertiesUtil.verifyStringProperty(endpointDescriptionProperties, "ecf.endpoint.id"); //$NON-NLS-1$
+ String ecfid = EndpointDescriptionPropertiesUtil.verifyStringProperty(endpointDescriptionProperties, Constants.ENDPOINT_ID);
if (ecfid == null)
ecfid = EndpointDescriptionPropertiesUtil.verifyStringProperty(endpointDescriptionProperties, "endpoint.id"); //$NON-NLS-1$
// ecf.endpoint.ts
- Long timestamp = EndpointDescriptionPropertiesUtil.verifyLongProperty(endpointDescriptionProperties, "ecf.endpoint.ts"); //$NON-NLS-1$
+ Long timestamp = EndpointDescriptionPropertiesUtil.verifyLongProperty(endpointDescriptionProperties, Constants.ENDPOINT_TIMESTAMP);
if (timestamp == null)
timestamp = getServiceId(endpointDescriptionProperties);
// ecf.endpoint.ns
- String idNamespace = EndpointDescriptionPropertiesUtil.verifyStringProperty(endpointDescriptionProperties, "ecf.endpoint.id.ns"); //$NON-NLS-1$
+ String idNamespace = EndpointDescriptionPropertiesUtil.verifyStringProperty(endpointDescriptionProperties, Constants.ENDPOINT_CONTAINER_ID_NAMESPACE);
// Create/verify endpointContainerID
ID endpointContainerID = EndpointDescriptionPropertiesUtil.verifyIDProperty(idNamespace, ecfid);
// Get rsId
@@ -124,12 +124,12 @@ public abstract class AbstractRSAClientContainer extends AbstractClientContainer
if (rsId == null)
rsId = EndpointDescriptionPropertiesUtil.verifyLongProperty(endpointDescriptionProperties, "endpoint.service.id"); //$NON-NLS-1$
// Get connectTargetID
- ID connectTargetID = EndpointDescriptionPropertiesUtil.verifyIDProperty(idNamespace, EndpointDescriptionPropertiesUtil.verifyStringProperty(endpointDescriptionProperties, "ecf.endpoint.connecttarget.id")); //$NON-NLS-1$
+ ID connectTargetID = EndpointDescriptionPropertiesUtil.verifyIDProperty(idNamespace, EndpointDescriptionPropertiesUtil.verifyStringProperty(endpointDescriptionProperties, Constants.ENDPOINT_CONNECTTARGET_ID));
// If not explicitly set, then set to endpointContainerID
if (connectTargetID == null)
connectTargetID = endpointContainerID;
// Get idFilter
- ID[] idFilter = EndpointDescriptionPropertiesUtil.verifyIDArray(endpointDescriptionProperties, "ecf.endpoint.idfilter.ids", idNamespace); //$NON-NLS-1$
+ ID[] idFilter = EndpointDescriptionPropertiesUtil.verifyIDArray(endpointDescriptionProperties, Constants.ENDPOINT_IDFILTER_IDS, idNamespace);
// If not set, then set to endpointContainerID
idFilter = (idFilter == null) ? new ID[] {endpointContainerID} : idFilter;
// Get rsFilter

Back to the top