Skip to main content
summaryrefslogtreecommitdiffstats
blob: 2aa3eae3856117323ddc71cff2a9b188b1f1f1d7 (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
/*******************************************************************************
 * Copyright (c) 2004, 2009 Tasktop Technologies 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:
 *     Tasktop Technologies - initial API and implementation
 *******************************************************************************/

package org.eclipse.mylyn.tasks.core.data;

import java.util.Set;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;

/**
 * @author Steffen Pingel
 * @since 3.0
 * @noimplement This interface is not intended to be implemented by clients.
 * @noextend This interface is not intended to be extended by clients.
 */
public interface ITaskDataWorkingCopy {

	/**
	 * Get the unsubmitted edits made locally by the user.
	 *
	 * @return TaskData containing only those attributes that have been edited.
	 * @since 3.0
	 */
	public abstract TaskData getEditsData();

	/**
	 * Get the "old" data that was retrieved from the repository some time in the past. When the
	 * {@link #getRepositoryData() repository data} contains unread incoming changes, the last read data is the data
	 * that the user last (marked) read. If the task has never been read, this will be the same as the
	 * {@link #getRepositoryData() repository data}.
	 * <p>
	 * When new TaskData is retrieved, if the previous incoming changes in the repository data have been
	 * {@link AbstractTask#isMarkReadPending() marked read}, the last read data is replaced with the repository data,
	 * and the repository data is replaced with the newly retrieved data. If the data has not been marked read, the
	 * repository data is replaced with the newly retrieved data and the last read data is unchanged.
	 *
	 * @return TaskData that has been read by the user, or the latest data retrieved from the repository if the task has
	 *         never been read
	 * @since 3.0
	 */
	public abstract TaskData getLastReadData();

	/**
	 * Get the TaskData that results from applying the user's {@link #getEditsData() edits} to the new
	 * {@link #getRepositoryData() repository data}. This is the only TaskData used to populate the task editor.
	 *
	 * @return TaskData used to populate the task editor
	 * @since 3.0
	 */
	public abstract TaskData getLocalData();

	/**
	 * Get the "new" data that was recently retrieved from the repository and may have changed since the
	 * {@link #getLastReadData() last read} data was read.
	 *
	 * @return TaskData that may contain incoming changes; the most current copy of the repository's data
	 * @since 3.0
	 */
	public abstract TaskData getRepositoryData();

	/**
	 * @since 3.0
	 */
	public abstract boolean isSaved();

	/**
	 * @since 3.0
	 */
	public abstract void revert();

	/**
	 * @since 3.0
	 */
	public abstract void refresh(IProgressMonitor monitor) throws CoreException;

	/**
	 * @since 3.0
	 */
	public abstract void save(Set<TaskAttribute> edits, IProgressMonitor monitor) throws CoreException;

	/**
	 * @since 3.0
	 */
	public abstract String getConnectorKind();

	/**
	 * @since 3.0
	 */
	public abstract String getRepositoryUrl();

	/**
	 * @since 3.0
	 */
	public abstract String getTaskId();

}

Back to the top