Package gri.tasks.managers

Source Code of gri.tasks.managers.BasicTaskManager

/*
* File: BasicTaskManager.java
* Author: Daniel Rogers
* Created on Jan 4, 2010
*
*/
package gri.tasks.managers;

import gri.tasks.TaskDef;

import gri.tasks.AsyncTask;

import gri.tasks.Task;

/**
* TaskManager which simply stores a list of TaskEntry objects.
*
* @author rogersda
*/
public class BasicTaskManager implements TaskManager {

  TaskCollection entries;
 
  // --------------------------------------------- Constructors
 
  public BasicTaskManager(TaskCollection entries) {
    this.entries = entries;
  }
 
  // ------------------------------------------------ Accessors
 
  public TaskCollection getTasks()      {return entries;}
 
  // ------------------------------------------- Implementation

  public String [] getTaskIds() {
    return entries.getTaskIds();
  }
 
  public TaskEntry getTaskEntry(String id) {
    return entries.getTaskEntry(id);
  }
 
  public TaskDescription getTaskDescription(String id) {
    TaskEntry entry = getTaskEntry(id);
    return entry == null ?
        null : entry.getTaskDescription();
  }
 
  public TaskDef getTaskDefinition(String id) {
    Task task = getTask(id);
    return task == null ?
        null : task.getTaskDef();
  }
 
  public Task getTask(String id) {
    TaskEntry entry = getTaskEntry(id);
    return entry == null ?
        null : entry.getTask();
  }
 
  public AsyncTask getAsyncTask(String id) {
    TaskEntry entry = getTaskEntry(id);
    return entry == null ?
        null : entry.getAsyncTask();
  }
 
}
TOP

Related Classes of gri.tasks.managers.BasicTaskManager

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.