Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: b393047e18fe5a22868cf41c0477bb09f69555ff (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
/*******************************************************************************
 * Copyright (c) 2013, 2014 Wind River Systems, 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:
 * Wind River Systems - initial API and implementation
 *******************************************************************************/
package org.eclipse.tcf.te.tcf.core.interfaces;

import org.eclipse.tcf.services.IPathMap;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.services.interfaces.IService;

/**
 * Path map service.
 * <p>
 * Allow the access and manipulation of the configured (object) path maps
 * for a given context.
 */
public interface IPathMapService extends IService {
	/**
	 * Protocol used to mark path map rules to be used to map host paths to target paths.
	 */
	public final static String PATHMAP_PROTOCOL_HOST_TO_TARGET = "file"; //$NON-NLS-1$

	/**
	 * Return the configured (object) path mappings for the given context.
	 * <p>
	 * <b>Note:</b> This method must be called from outside the TCF event dispatch thread.
	 *
	 * @param context The context. Must not be <code>null</code>.
	 * @return The configured path map or <code>null</code>.
	 */
	public IPathMap.PathMapRule[] getPathMap(Object context);

	/**
	 * Adds a new path mapping rule to the configured (object) path mapping for the
	 * given context.
	 * <p>
	 * The method will check the path mappings if a path map rule for the given source
	 * and destination already exist. If this is the case, the method will do nothing
	 * and returns the existing path map rule.
	 * <p>
	 * The method auto applies the new path map to an possibly open shared channel.
	 * <p>
	 * <b>Note:</b> This method must be called from outside the TCF event dispatch thread.
	 *
	 * @param context The context. Must not be <code>null</code>.
	 * @param source The path map rule source attribute value. Must not be <code>null</code>.
	 * @param destination The path map rule destination attribute value. Must not be <code>null</code>.
	 *
	 * @return The path map rule object representing the added path map rule.
	 */
	public IPathMap.PathMapRule addPathMap(Object context, String source, String destination);

	/**
	 * Removes the given path mapping rule from the configured (object) path mappings
	 * for the given context.
	 * <p>
	 * The method auto applies the new path map to an possibly open shared channel.
	 * <p>
	 * <b>Note:</b> This method must be called from outside the TCF event dispatch thread.
	 *
	 * @param context The context. Must not be <code>null</code>.
	 * @param rule The path map rule. Must not be <code>null</code>.
	 */
	public void removePathMap(Object context, IPathMap.PathMapRule rule);

	/**
	 * Apply the configured (object) path mappings to the given context.
	 * <p>
	 * <b>Note:</b> This method must be called from outside the TCF event dispatch thread.
	 *
	 * @param context The context. Must not be <code>null</code>.
	 * @param callback The callback to invoke once the operation completed. Must not be <code>null</code>.
	 */
	public void applyPathMap(Object context, ICallback callback);

	/**
	 * Returns the current client ID used to identify path map rules handled
	 * by the current Eclipse instance.
	 *
	 * @return The current client ID.
	 */
	public String getClientID();
}

Back to the top