Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: b3b8c40c988a338f3edb97ba40a789fdf18cd332 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
/****************************************************************************
 * Copyright (c) 2004, 2009 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.remoteservice;

import org.eclipse.ecf.core.IContainer;

/**
 * Remote service API constants.
 */
public interface Constants {

	/**
	 * Service property (named "remote.objectClass") identifying all
	 * of the class names under which a service was registered in the remote
	 * services API (of type <code>java.lang.String[]</code>).
	 * 
	 * <p>
	 * This property is set by the remote services API when a service is
	 * registered.
	 */
	public static final String OBJECTCLASS = "remote.objectClass"; //$NON-NLS-1$

	/**
	 * Service property (named &quot;remote.service.id&quot;) identifying a
	 * service's registration number (of type <code>java.lang.Long</code>).
	 * 
	 * <p>
	 * The value of this property is assigned by the remote services API when a
	 * service is registered. The remote services API assigns a unique value
	 * that is larger than all previously assigned values since the remote
	 * services API was started. These values are NOT persistent across restarts
	 * of the remote services API.
	 */
	public static final String SERVICE_ID = "remote.service.id"; //$NON-NLS-1$

	/**
	 * Service property (named &quot;remote.service.ranking&quot;) identifying a
	 * service's ranking number (of type <code>java.lang.Integer</code>).
	 * 
	 * <p>
	 * This property may be supplied in the <code>properties
	 * Dictionary</code>
	 * object passed to the
	 * <code>IRemoteServiceContainerAdapter.registerRemoteService</code>
	 * method.
	 * 
	 * <p>
	 * The service ranking is used by the remote services API to determine the
	 * <i>default </i> service to be returned from a call to the
	 * {@link IRemoteServiceContainerAdapter#getRemoteServiceReferences(org.eclipse.ecf.core.identity.ID[], String, String)}
	 * method: If more than one service implements the specified class, the
	 * <code>RemoteServiceReference</code> object with the highest ranking is
	 * returned.
	 * 
	 * <p>
	 * The default ranking is zero (0). A service with a ranking of
	 * <code>Integer.MAX_VALUE</code> is very likely to be returned as the
	 * default service, whereas a service with a ranking of
	 * <code>Integer.MIN_VALUE</code> is very unlikely to be returned.
	 * 
	 * <p>
	 * If the supplied property value is not of type
	 * <code>java.lang.Integer</code>, it is deemed to have a ranking value
	 * of zero.
	 */
	public static final String SERVICE_RANKING = "remote.service.ranking"; //$NON-NLS-1$

	/**
	 * Service property (named &quot;remote.service.vendor&quot;) identifying a
	 * service's vendor.
	 * 
	 * <p>
	 * This property may be supplied in the properties <code>Dictionary</code>
	 * object passed to the
	 * <code>IRemoteServiceContainerAdapter.registerRemoteService</code>
	 * method.
	 */
	public static final String SERVICE_VENDOR = "remote.service.vendor"; //$NON-NLS-1$

	/**
	 * Service property (named &quot;remoteservice.description&quot;)
	 * identifying a service's description.
	 * 
	 * <p>
	 * This property may be supplied in the properties <code>Dictionary</code>
	 * object passed to the
	 * <code>IRemoteServiceContainerAdapter.registerRemoteService</code>
	 * method.
	 */
	public static final String SERVICE_DESCRIPTION = "remote.service.description"; //$NON-NLS-1$

	/**
	 * Service property (named &quot;remoteservice.description&quot;)
	 * identifying a a registration's target for receiving the service. The
	 * value of the property MUST be either a non-<code>null</code> instance
	 * of org.eclipse.ecf.core.identity.ID OR an ID[].
	 * <p>
	 * This property may be supplied in the properties <code>Dictionary</code>
	 * object passed to the
	 * <code>IRemoteServiceContainerAdapter.registerRemoteService</code>
	 * method.
	 */
	public static final String SERVICE_REGISTRATION_TARGETS = "remote.service.registration.targets"; //$NON-NLS-1$

	/**
	 * Service property that defines the container factory name.
	 * <p>
	 * This property may be supplied in the properties <code>Dictionary</code>
	 * object passed to the
	 * <code>IRemoteServiceContainerAdapter.registerRemoteService</code>
	 * method.
	 */
	public static final String CONTAINER_FACTORY_NAME = "org.eclipse.ecf.containerFactoryName"; //$NON-NLS-1$

	/**
	 * Service property that defines the container target for connection.
	 * <p>
	 * This property may be supplied in the properties <code>Dictionary</code>
	 * object passed to the
	 * <code>IRemoteServiceContainerAdapter.registerRemoteService</code>
	 * method.
	 */
	public static final String CONTAINER_TARGET = "org.eclipse.ecf.containerTarget"; //$NON-NLS-1$

	/**
	 * Service property that defines the container target password.
	 * <p>
	 * This property may be supplied in the properties <code>Dictionary</code>
	 * object passed to the
	 * <code>IRemoteServiceContainerAdapter.registerRemoteService</code>
	 * method.
	 */
	public static final String CONTAINER_PASSWORD = "org.eclipse.ecf.containerPassword"; //$NON-NLS-1$

	/**
	 * Service property that defines the remote service container ID.
	 * <p>
	 * This property may be supplied in the properties <code>Dictionary</code>
	 * object passed to the <code>BundleContext.registerService</code> method.
	 */
	public static final String REMOTE_SERVICE_CONTAINER_ID = "org.eclipse.ecf.containerID"; //$NON-NLS-1$

	/**
	 * Service property that defines the remote service container ID factory name.
	 * <p>
	 * This property may be supplied in the properties <code>Dictionary</code>
	 * object passed to the <code>BundleContext.registerService</code> method.
	 */
	public static final String REMOTE_SERVICE_CONTAINER_ID_FACTORY_NAME = "org.eclipse.ecf.containerID.factory"; //$NON-NLS-1$

	/**
	 * Service property that determines whether a remote service proxy is automatically added to the local
	 * service registry.  This property can be used to expose remote services transparently
	 * to client (i.e. automatically putting a proxy into the client's local service registry).
	 * If this property is set in during service registration, then the the associated remote 
	 * service proxy should be added to the client's service registry by the implementing provider.  The value 
	 * of the property can be any non-<code>null</code> value.  
	 * <p></p>
	 * For example:
	 * <pre>
	 * final Dictionary props = new Hashtable();
	 * props.put(Constants.AUTOREGISTER_REMOTE_PROXY, "true");
	 * // Register
	 * adapters[0].registerRemoteService(new String[] {IConcatService.class.getName()}, serviceImpl, props);
	 * </pre>
	 * 
	 */
	public static final String AUTOREGISTER_REMOTE_PROXY = "org.eclipse.ecf.serviceRegistrationRemote"; //$NON-NLS-1$

	// Constants for use with the ECF remote services API

	/**
	 * Constant defining the ECF remote services discovery service type.  This service type should
	 * be provided in the service type id when registering a remote service.  Then clients may
	 * identify an ECF remote service type ID and therefore be made aware of how the client can
	 * interact with the service.  
	 */
	public static final String DISCOVERY_SERVICE_TYPE = "remotesvcs"; //$NON-NLS-1$

	/**
	 * Discovery service property to specify a namespace name for creating a connect id.  Note that
	 * this property should be equal to the name of the namespace retrieved from {@link IContainer#getConnectNamespace()}.
	 * Note that this property is <b>optional</b> if DISCOVERY_SERVICE_TYPE is specified.
	 */
	public static final String DISCOVERY_CONNECT_ID_NAMESPACE_PROPERTY = "cns"; //$NON-NLS-1$

	/**
	 * Discovery service property to specify value for creating a connect id.  Note that
	 * this property should be equal to connectID retrieved from {@link IContainer#getConnectedID()}.
	 * Note that this property is <b>optional</b> if DISCOVERY_SERVICE_TYPE is specified.
	 */
	public static final String DISCOVERY_CONNECT_ID_PROPERTY = "cid"; //$NON-NLS-1$

	/**
	 * Discovery service property to specify a namespace name for creating a target service ID.
	 * Note that this property is <b>optional</b> if the DISCOVERY_SERVICE_TYPE is as given above. It is 
	 * expected that clients will use the value of this property, along with the DISCOVERY_SERVICE_ID_PROPERTY
	 * to create an ID instance for the 'idFilter' parameter via
	 * remoteServicesContainerAdapter.getRemoteServiceReferences(ID [] idFilter, String clazz, String filter). 

	 */
	public static final String DISCOVERY_SERVICE_ID_NAMESPACE_PROPERTY = "sns"; //$NON-NLS-1$

	/**
	 * Discovery service property for a 'remotesvcs' discovery type.  Note that this
	 * property is <b>optional</b> if the DISCOVERY_SERVICE_TYPE is as given above.  It is expected
	 * that clients will use the value of this property, along with the DISCOVERY_CONNECT_ID_NAMESPACE_PROPERTY
	 * to create an ID instance for the 'idFilter' parameter via
	 * remoteServicesContainerAdapter.getRemoteServiceReferences(ID [] idFilter, String clazz, String filter). 
	 */
	public static final String DISCOVERY_SERVICE_ID_PROPERTY = "sid"; //$NON-NLS-1$

	/**
	 * Discovery service property for specifying the remote interface type.  Note that this
	 * property is <b>required</b> if the DISCOVERY_SERVICE_TYPE is as given.  It is expected
	 * that clients will use the value of this property to perform service lookups with the 
	 * 'clazz' parameter via
	 * remoteServicesContainerAdapter.getRemoteServiceReferences(ID [] idFilter, String clazz, String filter).  
	 */
	public static final String DISCOVERY_OBJECTCLASS_PROPERTY = "cls"; //$NON-NLS-1$
	/**
	 * Discovery service property for specifying the service lookup filter for
	 * client service lookup via 
	 * remoteServicesContainerAdapter.getRemoteServiceReferences(ID [] idFilter, String clazz, String filter).  
	 * Note that this
	 * property is <b>optional</b> if the DISCOVERY_SERVICE_TYPE is as given above.
	 */
	public static final String DISCOVERY_FILTER_PROPERTY = "fltr"; //$NON-NLS-1$

	/**
	 * Discovery service property for specifying the container factory type.  Note that this
	 * property is <b>optional</b> if the DISCOVERY_SERVICE_TYPE is used as given above.
	 */
	public static final String DISCOVERY_CONTAINER_FACTORY_PROPERTY = "cft"; //$NON-NLS-1$

	public static final String REMOTESERVICE_NAMESPACE_NAME = "remote.service.namespace"; //$NON-NLS-1$

}

Back to the top