Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 24baae3ecf5e0be79665a0a9c3f15335cba039d5 (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
/*******************************************************************************
 * Copyright (c) 2000, 2017 IBM Corporation 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:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.team.internal.core.subscribers;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.ITeamStatus;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.Subscriber;

/**
 * Records resource synchronization changes from a Team subscriber. The actual changes
 * are calculated via the SubscriberEventHandler and stored in this input.
 */
public class SyncSetInputFromSubscriber extends SyncSetInput  {

	private Subscriber subscriber;

	public SyncSetInputFromSubscriber(Subscriber subscriber, SubscriberEventHandler handler) {
		super(handler);
		this.subscriber = subscriber;
	}

	@Override
	public void disconnect() {
	}

	public Subscriber getSubscriber() {
		return subscriber;
	}

	@Override
	protected void fetchInput(IProgressMonitor monitor) throws TeamException {
		// don't calculate changes. The SubscriberEventHandler will fetch the
		// input in a job and update this sync set when the changes are
		// calculated.
	}

	/**
	 * Handle an error that occurred while populating the receiver's set.
	 * The <code>ITeamStatus</code> includes the resource for which the
	 * error occurred.
	 * This error is propogated to any set listeners.
	 * @param status the error status
	 */
	public void handleError(ITeamStatus  status) {
		getSyncSet().addError(status);
	}
}

Back to the top