com.prozima.pengine
Class PEngine

java.lang.Object
  extended by com.prozima.pengine.EventSender
      extended by com.prozima.pengine.PEngine

public class PEngine
extends EventSender

PEngine provides a static, singleton instance of the Prozima Planning Engine. The state of the Planning Engine is modified by executing commands using the method invoke(Command). These commands are then executed and the new state of the Planning Engine can be queried.


Method Summary
 java.util.Map<java.lang.Integer,NodeDates> getAllNodeDates(int inProjectID, int inScheduleID)
          Retrieve a description of all the scheduled dates for all the schedule nodes of a specific Schedule.
 java.util.Set<Project> getAllProjects()
          Retrieve a set of Projects which describes all of the projects which are currently held by PEngine.
 java.util.Set<Resource> getAllResources()
          Retrieves a description of all existing resources.
 java.util.Set<Work> getFinishedWork(int inProjectID, int inNodeID)
          Retrieve all of the finished work for a specific schedule node of a project.
 java.util.Set<Work> getFinishedWork(int inProjectID, int inNodeID, int inResourceID)
          Retrieve all of the finished work for a specific schedule node of a project.
static PEngine getInstance()
          Get the singleton instance of PEngine.
 NodeDates getNodeDates(int inProjectID, int inNodeID)
          Retrieve a description of the scheduled dates for a specific schedule node.
 Project getProject(int inProjectID)
          Retrieve information which describes a specific project.
 Resource getResource(int inResourceID)
          Retrieve the description of a specific resource.
 java.util.Set<Work> getScheduledWork(int inProjectID, int inNodeID)
          Retrieve all the scheduled future work for a specific schedule node of a project.
 java.util.Set<Work> getScheduledWork(int inProjectID, int inNodeID, int inResourceID)
          Retrieve all the scheduled work for a specific schedule node of a project.
 Schedule getScheduleInfo(int inProjectID, int inScheduleID)
          Retrieves the description of a specific schedule.
 ScheduleNode getScheduleNode(int inProjectID, int inNodeID)
          Retrieve a description of a specific schedule node.
 java.util.Set<ScheduleNode> getScheduleNodes(int inProjectID, int inScheduleID)
          Retrieve the descriptions of all the schedule nodes belonging to a specific schedule.
 java.util.Set<Schedule> getSchedules(int inProjectID)
          Retrieves descriptions of all the schedules belonging to a specific project.
 java.util.Set<WBSComponent> getWBSComponents(int inProjectID)
          Retrieve all the Work Breakdown Structure components for a specific project.
 boolean invoke(Command inCommand)
          Execute a command that will manipulate the state of the PEngine.
 
Methods inherited from class com.prozima.pengine.EventSender
addListener, addListener, removeListener, removeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAllNodeDates

public java.util.Map<java.lang.Integer,NodeDates> getAllNodeDates(int inProjectID,
                                                                  int inScheduleID)
Retrieve a description of all the scheduled dates for all the schedule nodes of a specific Schedule.

Parameters:
inProjectID - ID of the Project being queried.
inScheduleID - ID of the Schedule being queried.
Returns:
A Map of Schedule Node ID -> NodeDates objects. Map is empty if there are no nodes. null is never returned.

getAllProjects

public java.util.Set<Project> getAllProjects()
Retrieve a set of Projects which describes all of the projects which are currently held by PEngine. Set may be empty when there are no projects.

Returns:
Set of Project objects which describes all projects.

getAllResources

public java.util.Set<Resource> getAllResources()
Retrieves a description of all existing resources.

Returns:
A Set of Resource objects. Set is empty if there are no nodes. null is never returned.

getFinishedWork

public java.util.Set<Work> getFinishedWork(int inProjectID,
                                           int inNodeID)
Retrieve all of the finished work for a specific schedule node of a project. This represents all of the finished Work which has been logged towards the schedule node.

Parameters:
inProjectID - ID of the Project being queried.
inNodeID - ID of the ScheduleNode being queried.
Returns:
A Set of Work objects. Set is empty if there are no nodes. null is never returned.

getFinishedWork

public java.util.Set<Work> getFinishedWork(int inProjectID,
                                           int inNodeID,
                                           int inResourceID)
Retrieve all of the finished work for a specific schedule node of a project. This represents all of finished Work. Only work for the specified Resource is retrieved.

Parameters:
inProjectID - ID of the Project being queried.
inNodeID - ID of the ScheduleNode being queried.
inResourceID - ID of the Resource.
Returns:
A Set of Work objects. Set is empty if there are no nodes. null is never returned.

getInstance

public static PEngine getInstance()
Get the singleton instance of PEngine. If an instance of PEngine does not already exist then it will be constructed by this method.

Returns:
Instance of PEngine.

getNodeDates

public NodeDates getNodeDates(int inProjectID,
                              int inNodeID)
Retrieve a description of the scheduled dates for a specific schedule node.

Parameters:
inProjectID - ID of the Project being queried.
inNodeID - ID of the Schedule Node.
Returns:
NodeDates object or null if no information could be found for the specified node.

getProject

public Project getProject(int inProjectID)
Retrieve information which describes a specific project.

Returns:
Project object which describes a project. May be null if the project specified does not exist.

getResource

public Resource getResource(int inResourceID)
Retrieve the description of a specific resource.

Returns:
Resource or null if no resource corresponds to this ID.

getScheduledWork

public java.util.Set<Work> getScheduledWork(int inProjectID,
                                            int inNodeID)
Retrieve all the scheduled future work for a specific schedule node of a project.

Parameters:
inProjectID - ID of the Project being queried.
inNodeID - ID of the schedule node being queried.
Returns:
A Set of Work objects. Set is empty if there are no nodes. null is never returned.

getScheduledWork

public java.util.Set<Work> getScheduledWork(int inProjectID,
                                            int inNodeID,
                                            int inResourceID)
Retrieve all the scheduled work for a specific schedule node of a project. Only work for the specified resource is retrieved.

Parameters:
inProjectID - ID of the Project being queried.
inNodeID - ID of the schedule node being queried.
inResourceID - ID of a resource.
Returns:
A Set of Work objects. Set is empty if there are no nodes. null is never returned.

getScheduleInfo

public Schedule getScheduleInfo(int inProjectID,
                                int inScheduleID)
Retrieves the description of a specific schedule.

Parameters:
inProjectID - ID of the project which contains the schedule.
inScheduleID - ID of the Schedule.
Returns:
Schedule object which describes the schedule. May be null if the schedule does not exist.

getScheduleNode

public ScheduleNode getScheduleNode(int inProjectID,
                                    int inNodeID)
Retrieve a description of a specific schedule node.

Parameters:
inProjectID - ID of the project being queried.
inNodeID - ID of the schedule node to be retrieved.
Returns:
A ScheduleNode object or one of its subclasses. null if the schedule node could not be found.

getScheduleNodes

public java.util.Set<ScheduleNode> getScheduleNodes(int inProjectID,
                                                    int inScheduleID)
Retrieve the descriptions of all the schedule nodes belonging to a specific schedule.

Parameters:
inProjectID - ID of the project being queried.
inScheduleID - ID of the schedule being queried.
Returns:
A Set of ScheduleNode objects (or one of its subclasses). Set is empty if there are no nodes. null is never returned.

getSchedules

public java.util.Set<Schedule> getSchedules(int inProjectID)
Retrieves descriptions of all the schedules belonging to a specific project. Each schedule may only be associated with a single project.

Parameters:
inProjectID - ID of the project whose schedules will be listed.
Returns:
Set of Schedule objects which describes schedules. Set may be empty if no schedules exist for the project. Null is never returned.

getWBSComponents

public java.util.Set<WBSComponent> getWBSComponents(int inProjectID)
Retrieve all the Work Breakdown Structure components for a specific project. Note: Method will change substantially before version 1.0.

Returns:
Set of WBSComponent objects. Set may be empty if this project has no WBS Components defined.

invoke

public boolean invoke(Command inCommand)
Execute a command that will manipulate the state of the PEngine. Concurrency: Method can be called from a worker thread or the EDT. Actual execution of command is always performed using a worker thread.

Parameters:
inCommand - Command describing a change or changes to the state of PEngine. null should not be passed as a parameter.
Returns:
true if the parameters were OK and the command can be executed. false if one of the parameters was configured incorrectly.