Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2007-06-22 21:45:19 -0400
committermkersten2007-06-22 21:45:19 -0400
commita4907cc0d72cdc9e6eb7c1e62234edd01214b072 (patch)
treed00f7d5cc76c67787a47ae1b9db301faa2cbd1d4 /org.eclipse.mylyn.tasks.core
parent8104b39adcbc0fa7cc24c841fa897b73f430d0a3 (diff)
downloadorg.eclipse.mylyn.tasks-a4907cc0d72cdc9e6eb7c1e62234edd01214b072.tar.gz
org.eclipse.mylyn.tasks-a4907cc0d72cdc9e6eb7c1e62234edd01214b072.tar.xz
org.eclipse.mylyn.tasks-a4907cc0d72cdc9e6eb7c1e62234edd01214b072.zip
NEW - bug 193842: [api] review Mylyn 2.0 APIs
https://bugs.eclipse.org/bugs/show_bug.cgi?id=193842
Diffstat (limited to 'org.eclipse.mylyn.tasks.core')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java (renamed from org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IRepositoryConstants.java)4
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTaskListFactory.java3
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesContentHandler.java3
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskExternalizationException.java (renamed from org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskExternalizationException.java)5
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryFilter.java (renamed from org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryFilter.java)6
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java3
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskListFactory.java4
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/MylarMessages.properties16
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTemplate.java2
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskComment.java5
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskContainerDelta.java3
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java29
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java26
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java30
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TasksMessages.java50
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/UnrecognizedReponseException.java27
16 files changed, 61 insertions, 155 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IRepositoryConstants.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java
index abfa9d132..b502b36e9 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IRepositoryConstants.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
-package org.eclipse.mylyn.tasks.core;
+package org.eclipse.mylyn.internal.tasks.core;
/**
* @author Mik Kersten
@@ -24,7 +24,7 @@ public interface IRepositoryConstants {
public static final String PROPERTY_VERSION = "version";
- public static final String PROPERTY_KIND = "kind";
+ public static final String PROPERTY_CONNECTOR_KIND = "kind";
public static final String PROPERTY_URL = "url";
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTaskListFactory.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTaskListFactory.java
index d1080b93b..da12f1c63 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTaskListFactory.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTaskListFactory.java
@@ -13,7 +13,6 @@ package org.eclipse.mylyn.internal.tasks.core;
import org.eclipse.mylyn.tasks.core.AbstractTask;
import org.eclipse.mylyn.tasks.core.AbstractTaskListFactory;
-import org.eclipse.mylyn.tasks.core.TaskExternalizationException;
import org.w3c.dom.Element;
/**
@@ -27,7 +26,7 @@ public class LocalTaskListFactory extends AbstractTaskListFactory {
}
@Override
- public AbstractTask createTask(String repositoryUrl, String taskId, String summary, Element element) throws TaskExternalizationException {
+ public AbstractTask createTask(String repositoryUrl, String taskId, String summary, Element element) {
LocalTask task = new LocalTask(taskId, summary);
return task;
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesContentHandler.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesContentHandler.java
index c1f931848..7b7394e7c 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesContentHandler.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesContentHandler.java
@@ -14,7 +14,6 @@ import java.util.HashSet;
import java.util.Set;
import org.eclipse.mylyn.internal.monitor.core.util.XmlStringConverter;
-import org.eclipse.mylyn.tasks.core.IRepositoryConstants;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
@@ -36,7 +35,7 @@ public class SaxRepositoriesContentHandler extends DefaultHandler {
try {
if (localName.equals(TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY) && attributes != null) {
String kind = XmlStringConverter.convertXmlToString(attributes
- .getValue(IRepositoryConstants.PROPERTY_KIND));
+ .getValue(IRepositoryConstants.PROPERTY_CONNECTOR_KIND));
String url = XmlStringConverter.convertXmlToString(attributes
.getValue(IRepositoryConstants.PROPERTY_URL));
if (kind != null && kind.length() > 0 && url != null && url.length() > 0) {
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskExternalizationException.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskExternalizationException.java
index 63b2eaaf1..9507b95e8 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskExternalizationException.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskExternalizationException.java
@@ -8,10 +8,11 @@
* Contributors:
* University Of British Columbia - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.tasks.core;
+package org.eclipse.mylyn.internal.tasks.core;
/**
- * @author Mik Kersten and Ken Sueda
+ * @author Mik Kersten
+ * @author Ken Sueda
*/
public class TaskExternalizationException extends Exception {
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryFilter.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryFilter.java
index 214fb2cba..edeeb18ef 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryFilter.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryFilter.java
@@ -9,14 +9,16 @@
* University Of British Columbia - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.tasks.core;
+package org.eclipse.mylyn.internal.tasks.core;
-import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
/**
* Task repository filter to build list of repositories with required capabilities.
*
* @author Eugene Kleshov
+ * @since 2.0
*/
public interface TaskRepositoryFilter {
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java
index 5931a3e15..3f068326f 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java
@@ -28,6 +28,7 @@ import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.mylyn.context.core.ContextCorePlugin;
import org.eclipse.mylyn.internal.monitor.core.util.StatusManager;
+import org.eclipse.mylyn.internal.tasks.core.IRepositoryConstants;
import org.eclipse.mylyn.internal.tasks.core.TaskDataManager;
import org.eclipse.mylyn.tasks.core.AbstractTask.RepositoryTaskSyncState;
@@ -338,7 +339,7 @@ public abstract class AbstractRepositoryConnector {
*/
public String getSynchronizationTimestamp(TaskRepository repository, Set<AbstractTask> changedTasks) {
Date mostRecent = new Date(0);
- String mostRecentTimeStamp = repository.getSyncTimeStamp();
+ String mostRecentTimeStamp = repository.getSynchronizationTimeStamp();
for (AbstractTask task : changedTasks) {
Date taskModifiedDate;
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskListFactory.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskListFactory.java
index ac0957ba8..e4df21618 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskListFactory.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskListFactory.java
@@ -40,11 +40,11 @@ public abstract class AbstractTaskListFactory {
return false;
}
- public AbstractRepositoryQuery createQuery(String repositoryUrl, String queryString, String label, Element element) throws TaskExternalizationException {
+ public AbstractRepositoryQuery createQuery(String repositoryUrl, String queryString, String label, Element element){
return null;
}
- public abstract AbstractTask createTask(String repositoryUrl, String taskId, String label, Element element) throws TaskExternalizationException;
+ public abstract AbstractTask createTask(String repositoryUrl, String taskId, String label, Element element);
public String getQueryElementName(AbstractRepositoryQuery query) {
return "";
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/MylarMessages.properties b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/MylarMessages.properties
deleted file mode 100644
index 7733bc894..000000000
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/MylarMessages.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-### Mylar messages.
-
-### repository
-### {0} generally is the repository url
-repository_error = Repository error from {0}:\n\n{1}
-repository_login_failure = Unable to login to {0}.\n\n{1}\n\nPlease validate credentials via Task Repositories view.
-repository_not_found = Repository {0} could not be found.
-repository_comment_reqd = You have to specify a new comment when making this change. Please comment on the reason for this change.
-repository_collision = Mid-air collision occurred while submitting to {0}.\n\nSynchronize task and re-submit changes.
-### repositoryUrl, class.simpleName, class.getMessage
-io_error = I/O Error occurred while communicating with {0}.\n\n{1}: {2}
-network_error = A network error occurred connecting to {0}.\n\n{1}
-internal_error = An internal error has occurred: {0}
-operation_cancelled = {0} was canceled by the user.
-
-
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTemplate.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTemplate.java
index 2e0c64560..4b618d4e8 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTemplate.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTemplate.java
@@ -21,7 +21,7 @@ import java.util.Map;
* @author Steffen Pingel
* @since 2.0
*/
-public class RepositoryTemplate {
+public final class RepositoryTemplate {
public final Map<String, String> genericAttributes = new LinkedHashMap<String, String>();
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskComment.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskComment.java
index a0334205a..61678ef47 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskComment.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskComment.java
@@ -14,9 +14,10 @@ package org.eclipse.mylyn.tasks.core;
import java.io.Serializable;
/**
- * A comment posted on a bug.
+ * A comment posted by a user on a task.
*
- * @author Rob Elves (revisions for bug 136219)
+ * @author Rob Elves
+ * @since 2.0
*/
public class TaskComment extends AttributeContainer implements Serializable {
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskContainerDelta.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskContainerDelta.java
index 5c055d9ce..20c3ae45b 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskContainerDelta.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskContainerDelta.java
@@ -13,9 +13,10 @@ package org.eclipse.mylyn.tasks.core;
/**
- * Immutable.
+ * Immutable. Defines changes to Task List elements.
*
* @author Mik Kersten
+ * @since 2.0
*/
public final class TaskContainerDelta {
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java
index 686ff3e62..8ec3caed9 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java
@@ -30,13 +30,14 @@ import org.eclipse.mylyn.internal.tasks.core.TaskCategory;
import org.eclipse.mylyn.internal.tasks.core.UnfiledCategory;
/**
- * TODO: some asymetry left between query containers and other task containers
+ * Stores and manages task list elements and their containment hierarchy.
*
* @author Mik Kersten
+ * @since 2.0
*/
public class TaskList {
- private int lastTaskNum = 0;
+ private int lastLocalTaskId = 0;
private Set<ITaskListChangeListener> changeListeners = new CopyOnWriteArraySet<ITaskListChangeListener>();
@@ -69,7 +70,7 @@ public class TaskList {
defaultCategory = new UnfiledCategory();
activeTasks = new CopyOnWriteArrayList<AbstractTask>();
- lastTaskNum = 0;
+ lastLocalTaskId = 0;
categories.put(defaultCategory.getHandleIdentifier(), defaultCategory);
categories.put(archiveContainer.getHandleIdentifier(), archiveContainer);
}
@@ -656,30 +657,30 @@ public class TaskList {
}
}
- public int getNextTaskNum() {
- return ++lastTaskNum;
+ public int getNextLocalTaskId() {
+ return ++lastLocalTaskId;
}
- public void setLastTaskNum(int lastTaskNum) {
- this.lastTaskNum = lastTaskNum;
+ public void setLastLocalTaskId(int lastTaskNum) {
+ this.lastLocalTaskId = lastTaskNum;
}
/** For tasklist persistence. Use getNextTaskNum for task construction */
- public int getLastTaskNum() {
- return lastTaskNum;
+ public int getLastLocalTaskId() {
+ return lastLocalTaskId;
}
/** Note: use getNextTaskNum for new task construction */
- public int findLargestTaskHandle() {
+ public int findLargestTaskId() {
int max = 0;
- max = Math.max(largestTaskHandleHelper(tasks.values()), max);
+ max = Math.max(largestTaskIdHelper(tasks.values()), max);
for (AbstractTaskCategory cat : getTaskContainers()) {
- max = Math.max(largestTaskHandleHelper(cat.getChildren()), max);
+ max = Math.max(largestTaskIdHelper(cat.getChildren()), max);
}
return max;
}
- private int largestTaskHandleHelper(Collection<AbstractTask> tasks) {
+ private int largestTaskIdHelper(Collection<AbstractTask> tasks) {
int ihandle = 0;
int max = 0;
for (AbstractTask task : tasks) {
@@ -692,7 +693,7 @@ public class TaskList {
}
}
max = Math.max(ihandle, max);
- ihandle = largestTaskHandleHelper(task.getChildren());
+ ihandle = largestTaskIdHelper(task.getChildren());
max = Math.max(ihandle, max);
}
return max;
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java
index 2e9d914e0..362eb04be 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java
@@ -23,6 +23,7 @@ import java.util.TimeZone;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.mylyn.internal.monitor.core.util.StatusManager;
+import org.eclipse.mylyn.internal.tasks.core.IRepositoryConstants;
import org.eclipse.mylyn.web.core.WebClientUtil;
/**
@@ -42,6 +43,7 @@ import org.eclipse.mylyn.web.core.WebClientUtil;
* @author Mik Kersten
* @author Rob Elves
* @author Eugene Kuleshov
+ * @since 2.0
*/
public class TaskRepository {
@@ -121,7 +123,7 @@ public class TaskRepository {
}
public TaskRepository(String kind, String serverUrl, String version, String encoding, String timeZoneId) {
- this.properties.put(IRepositoryConstants.PROPERTY_KIND, kind);
+ this.properties.put(IRepositoryConstants.PROPERTY_CONNECTOR_KIND, kind);
this.properties.put(IRepositoryConstants.PROPERTY_URL, serverUrl);
this.properties.put(IRepositoryConstants.PROPERTY_VERSION, version);
this.properties.put(IRepositoryConstants.PROPERTY_ENCODING, encoding);
@@ -131,7 +133,7 @@ public class TaskRepository {
}
public TaskRepository(String kind, String serverUrl, Map<String, String> properties) {
- this.properties.put(IRepositoryConstants.PROPERTY_KIND, kind);
+ this.properties.put(IRepositoryConstants.PROPERTY_CONNECTOR_KIND, kind);
this.properties.put(IRepositoryConstants.PROPERTY_URL, serverUrl);
this.properties.putAll(properties);
// use platform proxy by default (headless will need to set this to false)
@@ -307,10 +309,10 @@ public class TaskRepository {
return false;
}
}
- if (getKind() == null) {
- return repository.getKind() == null;
+ if (getConnectorKind() == null) {
+ return repository.getConnectorKind() == null;
} else {
- return getKind().equals(repository.getKind());
+ return getConnectorKind().equals(repository.getConnectorKind());
}
} else {
@@ -321,7 +323,7 @@ public class TaskRepository {
@Override
public int hashCode() {
int res = getUrl()==null ? 1 : getUrl().hashCode();
- return res * 31 + (getKind()==null ? 1 : getKind().hashCode());
+ return res * 31 + (getConnectorKind()==null ? 1 : getConnectorKind().hashCode());
}
@Override
@@ -332,8 +334,8 @@ public class TaskRepository {
/**
* @return "<unknown>" if kind is unknown
*/
- public String getKind() {
- String kind = properties.get(IRepositoryConstants.PROPERTY_KIND);
+ public String getConnectorKind() {
+ String kind = properties.get(IRepositoryConstants.PROPERTY_CONNECTOR_KIND);
if (kind != null) {
return kind;
} else {
@@ -373,7 +375,7 @@ public class TaskRepository {
: timeZoneId);
}
- public String getSyncTimeStamp() {
+ public String getSynchronizationTimeStamp() {
return this.properties.get(IRepositoryConstants.PROPERTY_SYNCTIMESTAMP);
}
@@ -381,7 +383,7 @@ public class TaskRepository {
* ONLY for use by IRepositoryConstants. To set the sync time call
* IRepositoryConstants.setSyncTime(repository, date);
*/
- public void setSyncTimeStamp(String syncTime) {
+ public void setSynchronizationTimeStamp(String syncTime) {
this.properties.put(IRepositoryConstants.PROPERTY_SYNCTIMESTAMP, syncTime);
}
@@ -424,7 +426,7 @@ public class TaskRepository {
public Proxy getProxy() {
Proxy proxy = Proxy.NO_PROXY;
- if (useDefaultProxy()) {
+ if (isDefaultProxyEnabled()) {
proxy = WebClientUtil.getPlatformProxy();
} else {
@@ -444,7 +446,7 @@ public class TaskRepository {
/**
* Use platform proxy settings
*/
- public boolean useDefaultProxy() {
+ public boolean isDefaultProxyEnabled() {
return "true".equals(getProperty(PROXY_USEDEFAULT));
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java
index 5ec533438..e5606cc65 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java
@@ -26,8 +26,11 @@ import org.eclipse.mylyn.internal.monitor.core.util.StatusManager;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoriesExternalizer;
/**
+ * Provides facilities for managing the lifecycle of and access to task repositories.
+ *
* @author Mik Kersten
* @author Rob Elves
+ * @since 2.0
*/
public class TaskRepositoryManager {
@@ -87,11 +90,11 @@ public class TaskRepositoryManager {
public void addRepository(TaskRepository repository, String repositoryFilePath) {
Set<TaskRepository> repositories;
- if (!repositoryMap.containsKey(repository.getKind())) {
+ if (!repositoryMap.containsKey(repository.getConnectorKind())) {
repositories = new HashSet<TaskRepository>();
- repositoryMap.put(repository.getKind(), repositories);
+ repositoryMap.put(repository.getConnectorKind(), repositories);
} else {
- repositories = repositoryMap.get(repository.getKind());
+ repositories = repositoryMap.get(repository.getConnectorKind());
}
repositories.add(repository);
saveRepositories(repositoryFilePath);
@@ -101,7 +104,7 @@ public class TaskRepositoryManager {
}
public void removeRepository(TaskRepository repository, String repositoryFilePath) {
- Set<TaskRepository> repositories = repositoryMap.get(repository.getKind());
+ Set<TaskRepository> repositories = repositoryMap.get(repository.getConnectorKind());
if (repositories != null) {
repository.flushAuthenticationCredentials();
repositories.remove(repository);
@@ -266,8 +269,8 @@ public class TaskRepositoryManager {
migration = true;
}
- if (repositoryMap.containsKey(repository.getKind())) {
- repositoryMap.get(repository.getKind()).add(repository);
+ if (repositoryMap.containsKey(repository.getConnectorKind())) {
+ repositoryMap.get(repository.getConnectorKind()).add(repository);
} else {
orphanedRepositories.add(repository);
}
@@ -334,16 +337,9 @@ public class TaskRepositoryManager {
saveRepositories(repositoriesFilePath);
}
- public void setSyncTime(TaskRepository repository, String syncTime, String repositoriesFilePath) {
- repository.setSyncTimeStamp(syncTime);
+ public void setSynchronizationTime(TaskRepository repository, String syncTime, String repositoriesFilePath) {
+ repository.setSynchronizationTimeStamp(syncTime);
saveRepositories(repositoriesFilePath);
-
- // String prefIdSyncTime = repository.getUrl() + PROPERTY_DELIM +
- // PROPERTY_SYNCTIMESTAMP;
- // if (repository.getSyncTimeStamp() != null) {
- // MylarTaskListPlugin.getMylarCorePrefs().setValue(prefIdSyncTime,
- // repository.getSyncTimeStamp());
- // }
}
public synchronized boolean saveRepositories(String destinationPath) {
@@ -360,10 +356,6 @@ public class TaskRepositoryManager {
}
try {
- // String dataDirectory =
- // TasksUiPlugin.getDefault().getDataDirectory();
- // File repositoriesFile = new File(dataDirectory + File.separator +
- // TasksUiPlugin.DEFAULT_REPOSITORIES_FILE);
File repositoriesFile = new File(destinationPath);
externalizer.writeRepositoriesToXML(repositoriesToWrite, repositoriesFile);
} catch (Throwable t) {
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TasksMessages.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TasksMessages.java
deleted file mode 100644
index 7a1bf7727..000000000
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TasksMessages.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 University Of British Columbia 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.tasks.core;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * @author Rob Elves
- */
-public class TasksMessages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.mylyn.tasks.core.MylarMessages";//$NON-NLS-1$
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, TasksMessages.class);
- }
-
- private TasksMessages() {
- // Do not instantiate
- }
-
- public static String repository_login_failure;
-
- public static String repository_not_found;
-
- public static String repository_comment_reqd;
-
- public static String repository_collision;
-
- public static String operation_cancelled;
-
- public static String network_error;
-
- public static String io_error;
-
- public static String internal_error;
-
-
- public static String repository_error;
-
-}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/UnrecognizedReponseException.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/UnrecognizedReponseException.java
deleted file mode 100644
index 723bc8a8f..000000000
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/UnrecognizedReponseException.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 University Of British Columbia 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.tasks.core;
-
-import java.io.IOException;
-
-
-/**
- * @author Rob Elves
- */
-public class UnrecognizedReponseException extends IOException {
-
- private static final long serialVersionUID = 3937060773477757464L;
-
- public UnrecognizedReponseException(String message) {
- super(message);
- }
-}

Back to the top