Search in sources :

Example 1 with SingleTaskDataCollector

use of org.eclipse.linuxtools.internal.mylyn.osio.rest.core.response.data.SingleTaskDataCollector in project linuxtools by eclipse.

the class OSIORestHarness method getTaskFromServer.

public TaskData getTaskFromServer(String taskId) throws OSIORestException, CoreException {
    Set<String> taskIds = new HashSet<String>();
    taskIds.add(taskId);
    SingleTaskDataCollector singleTaskDataCollector = new SingleTaskDataCollector();
    connector().getClient(repository()).getTaskData(taskIds, repository(), singleTaskDataCollector, null);
    TaskData taskDataGet = singleTaskDataCollector.getTaskData();
    assertNotNull(taskDataGet);
    assertNotNull(taskDataGet.getRoot());
    return taskDataGet;
}
Also used : SingleTaskDataCollector(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.response.data.SingleTaskDataCollector) HashSet(java.util.HashSet) TaskData(org.eclipse.mylyn.tasks.core.data.TaskData)

Example 2 with SingleTaskDataCollector

use of org.eclipse.linuxtools.internal.mylyn.osio.rest.core.response.data.SingleTaskDataCollector in project linuxtools by eclipse.

the class OSIORestTaskDataHandler method getTaskData.

public TaskData getTaskData(TaskRepository repository, String taskId, IProgressMonitor monitor) throws CoreException {
    Set<String> taskIds = new HashSet<String>();
    taskIds.add(taskId);
    SingleTaskDataCollector singleTaskDataCollector = new SingleTaskDataCollector();
    getMultiTaskData(repository, taskIds, singleTaskDataCollector, monitor);
    if (singleTaskDataCollector.getTaskData() == null) {
        throw new CoreException(new Status(IStatus.ERROR, OSIORestCore.ID_PLUGIN, // $NON-NLS-1$
        "Task data could not be retrieved. Please re-synchronize task"));
    }
    return singleTaskDataCollector.getTaskData();
}
Also used : Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) SingleTaskDataCollector(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.response.data.SingleTaskDataCollector) CoreException(org.eclipse.core.runtime.CoreException) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)2 SingleTaskDataCollector (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.response.data.SingleTaskDataCollector)2 CoreException (org.eclipse.core.runtime.CoreException)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 TaskData (org.eclipse.mylyn.tasks.core.data.TaskData)1