de.smartics.maven.issues.cache
Class TaskDataCache

Package class diagram package TaskDataCache
java.lang.Object
  extended by de.smartics.maven.issues.cache.TaskDataCache

public class TaskDataCache
     
     
extends Object

Local cache for task data retrieved from the remote Task repository. The cache is useful for multi project reports where the same tasks will be retrieved for each sub project. Instead of connecting to the remote repository the report renderer will try to read the local stored information. This information is either cached in-memory or on a secondary storage medium (defaults to an XML file on the file system).

Author:
Robert Reiner

Constructor Summary
TaskDataCache()
          Convenience constructor to create a cache where all tasks are stored in-memory.
TaskDataCache(File persistentStoreDirectory)
          Convenience constructor to create a file based task data store to write to the given location.
TaskDataCache(TaskDataStore taskStore)
          Default constructor.
 
Method Summary
 void addTask(org.eclipse.mylyn.tasks.core.data.TaskData task)
          Adds the task to the cache.
 org.eclipse.mylyn.tasks.core.data.TaskData getTask(String id)
          Returns the task uniquely references by the given identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskDataCache

public TaskDataCache()
Convenience constructor to create a cache where all tasks are stored in-memory.


TaskDataCache

public TaskDataCache(File persistentStoreDirectory)
Convenience constructor to create a file based task data store to write to the given location.

Parameters:
persistentStoreDirectory - the reference to the directory to store the individual task files. If this value is null the tasks will only be stored in-memory with a strong hash map. If not- null, a weak hash map is used and tasks that are removed from memory are written to this location.

TaskDataCache

public TaskDataCache(TaskDataStore taskStore)
Default constructor.

Parameters:
taskStore - the reference to the task store to store the individual task data. If this value is null the tasks will only be stored in-memory with a strong hash map. If not- null, a weak hash map is used and tasks that are removed from memory are written to this store.
Method Detail

getTask

public org.eclipse.mylyn.tasks.core.data.TaskData getTask(String id)
Returns the task uniquely references by the given identifier.

Parameters:
id - the unique identifier of the task.
Returns:
the requested task.

addTask

public void addTask(org.eclipse.mylyn.tasks.core.data.TaskData task)
Adds the task to the cache. The task can be retrieved by getTask(String) by passing in the identifier of the task ( TaskData.getTaskId()).

Parameters:
task - the task information to cache.


Copyright © 2008-2010 Kronseder & Reiner GmbH - smartics. All Rights Reserved.