Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 23ecabb81f963713f170dba10f1039a41bda8fef (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
/*******************************************************************************
* Copyright (c) 2009 EclipseSource 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:
*   EclipseSource - initial API and implementation
******************************************************************************/
package org.eclipse.ecf.remoteservice;

import org.eclipse.ecf.core.identity.*;

/**
 * @since 8.3
 */
public class RemoteServiceNamespace extends Namespace {

	private static final long serialVersionUID = 5697857375725279019L;

	private static final String REMOTE_SERVICE_SCHEME = "remoteservice"; //$NON-NLS-1$

	public static final String NAME = "ecf.namespace.remoteservice"; //$NON-NLS-1$

	public RemoteServiceNamespace() {
		// nothing
	}

	public RemoteServiceNamespace(String name, String desc) {
		super(name, desc);
	}

	public ID createInstance(Object[] parameters) throws IDCreateException {
		if (parameters == null || parameters.length != 2)
			throw new IDCreateException("Parameters incorrect for remote ID creation"); //$NON-NLS-1$
		try {
			return new RemoteServiceID(this, (ID) parameters[0], ((Long) parameters[1]).longValue());
		} catch (Exception e) {
			throw new IDCreateException("Exception creating remoteID", e); //$NON-NLS-1$
		}
	}

	public String getScheme() {
		return REMOTE_SERVICE_SCHEME;
	}

	/**
	 * @since 8.12
	 */
	@Override
	public Class<?>[][] getSupportedParameterTypes() {
		return new Class<?>[][] {{String.class, Long.class}};
	}
}

Back to the top