Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ca2734a98fa07ead44087a6c9d7bbd0c6902341f (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
/*******************************************************************************
 * Copyright (c) 2011, 2012 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.locator.interfaces.services;

import java.util.Collection;

import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;


/**
 * The service to update the properties of given locator model nodes.
 */
public interface IPeerModelUpdateService extends IPeerModelService {

	/**
	 * Adds the given peer to the list of know peers.
	 * <p>
	 * A previous mapping to a peer model with the same id as the given peer model is overwritten.
	 *
	 * @param peer The peer model object. Must not be <code>null</code>.
	 */
	public void add(IPeerNode peer);

	/**
	 * Removes the given peer from the list of known peers.
	 *
	 * @param peer The peer model object. Must not be <code>null</code.
	 */
	public void remove(IPeerNode peer);

	/**
	 * Update the service nodes of the given peer node with the new set of
	 * local and/or remote services.
	 *
	 * @param peerNode The peer model instance. Must not be <code>null</code>.
	 * @param localServices The list of local service names or <code>null</code>.
	 * @param remoteServices The list of remote service names or <code>null</code>.
	 */
	public void updatePeerServices(IPeerNode peerNode, Collection<String> localServices, Collection<String> remoteServices);

	/**
	 * Adds the given child peer to the parent peer.
	 * <p>
	 * <b>Note:</b> The parent peer node is determined by calling {@link IPeerNode#getParentNode()}.
	 *              The call has to return a non-null value, otherwise {@link #addChild(IPeerNode)}
	 *              will do nothing.
	 *
	 * @param parent The parent peer model node. Must not be <code>null</code>.
	 * @param child The child peer model object. Must not be <code>null</code>.
	 */
	public void addChild(IPeerNode child);

	/**
	 * Removes the given child peer from the parent peer.
	 * <p>
	 * <b>Note:</b> The parent peer node is determined by calling {@link IPeerNode#getParentNode()}.
	 *              The call has to return a non-null value, otherwise {@link #removeChild(IPeerNode)}
	 *              will do nothing.
	 *
	 * @param parent The parent peer model node. Must not be <code>null</code>.
	 * @param child The child peer model object. Must not be <code>null</code>.
	 */
	public void removeChild(IPeerNode child);

	/**
	 * Merge user defined peer attributes from the given peer into the given peer node.
	 *
	 * @param node The peer node. Must not be <code>null</code>.
	 * @param peer The peer. Must not be <code>null</code>.
	 * @param force If <code>true</code>, the peer attributes are merged even if the peer id's don't match.
	 */
	public void mergeUserDefinedAttributes(IPeerNode node, IPeer peer, boolean force);
}

Back to the top