|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Observable | +--audiojury.action.ProjectManager
Manages a collection of Project
s.
The class implements the Singleton design pattern, which means
there is only one instance of this class. This is necessary to make concurrent
access to Project
s impossible.
Method Summary | |
void |
activateProject(java.lang.String name,
java.lang.String activeName)
Adds a snapshot tag to the Project name and then activates the Project . |
void |
closeProject(java.lang.String name)
Moves a Project from active to closed state. |
Scale[] |
createStandardScales()
Generates the standard Scale s ACR, CCR and DCR. |
void |
deleteProject(java.lang.String name,
int state)
Deletes a Project permanently. |
void |
duplicateProject(java.lang.String name,
java.lang.String newname)
Duplicates a Project in dynamic state. |
protected ProjectBuilder |
getProjectBuilder()
Gets the ProjectBuilder currently being used. |
static ProjectManager |
getUniqueInstance()
Enforces the Singleton design pattern by always returning the same instance of ProjectManager . |
boolean |
isUniqueProjectName(java.lang.String name,
int state)
Checks it a project name is unique within a specific project state domain. |
java.util.Hashtable |
listActiveProjects()
Used by the client to discover available Project s.
|
java.util.Hashtable |
listProjects(int state)
Lists Project s. |
java.util.Hashtable |
listProjectsAndTests(int state)
Lists Project s and Test s. |
Project |
newProject(java.lang.String name)
Creates a new Project . |
Project |
openProject(java.lang.String name)
Opens a Project that is in dynamic state. |
Project |
openProjectPassive(java.lang.String name)
Open the Project in read-only mode. |
Scale[] |
openScales()
Opens a Scale from a scale.conf file.
|
void |
reactivateProject(java.lang.String name)
Moves a Project from closed state back to active state. |
void |
registerObserver(java.util.Observer observer)
Registers an observer so it can be notified when the state of the ProjectManager changes. |
void |
renameProject(java.lang.String name,
java.lang.String newname)
Renames a Project in dynamic state. |
void |
saveProject(Project proj)
Saves a Project object to disk. |
void |
saveScales(Scale[] scales)
Saves Scale objects in a stream file named scale.conf |
void |
setProjectStoragePlugin(ProjectStoragePlugin plugin)
Sets sets the storage plugin to use. |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void setProjectStoragePlugin(ProjectStoragePlugin plugin)
plugin
- The desired storage plugin.public void registerObserver(java.util.Observer observer)
observer
- The observer to register.public Scale[] createStandardScales()
Scale
s ACR, CCR and DCR.
createStandardScales
in interface ProjectProcessing
Scale
s.public Scale[] openScales() throws ProjectOperationException
Scale
from a scale.conf file.
The Scale
is located in the project base directory.
openScales
in interface ProjectProcessing
Scale
s loaded from file.
ProjectOperationException
- if an unhandled error occurs.public void saveScales(Scale[] scales) throws ProjectOperationException
Scale
objects in a stream file named scale.conf
saveScales
in interface ProjectProcessing
scales
- An array of Scale
s.
ProjectOperationException
- if an unhandled exception occurs.public java.util.Hashtable listProjectsAndTests(int state) throws ProjectOperationException
Project
s and Test
s.
listProjectsAndTests
in interface ProjectProcessing
state
- List projects in this state. State identifiers are defined in Project
.
Hashtable
with project names as keys. Each entry consists of
another Hashtable
, listing the tests in the respective projects.
The keys of this hashtable are test names and the entries are paths to tests.
ProjectOperationException
- if an unhandled exception occurs.audiojury.domain.Project#
public java.util.Hashtable listProjects(int state) throws ProjectOperationException
Project
s.
listProjects
in interface ProjectProcessing
state
- List projects in this state. State identifiers are defined in Project
.
Hashtable
with project names as keys. Each entry is the path to
the respective project.
ProjectOperationException
- if an unhandled exception occurs.audiojury.domain.Project#
public java.util.Hashtable listActiveProjects() throws ProjectOperationException
Project
s.
The keys in the table are strings of project names.
listActiveProjects
in interface ProjectProcessing
Hashtable
where the keys are project name Strings
.
ProjectOperationException
- if an unhandled exception occurs.public void duplicateProject(java.lang.String name, java.lang.String newname) throws ProjectOperationException, NotUniqueNameException
Project
in dynamic state.
duplicateProject
in interface ProjectProcessing
name
- The name of the project to duplicate.newname
- The name of the copy that will be created.
ProjectOperationException
- if an unhandled exception occurs.
NotUniqueNameException
- if the proposed name is not unique.public void renameProject(java.lang.String name, java.lang.String newname) throws ProjectOperationException, NotUniqueNameException
Project
in dynamic state.
renameProject
in interface ProjectProcessing
name
- The current name of the project.newname
- The new desired name of the project.
ProjectOperationException
- if an unhandled exception occurs.
NotUniqueNameException
- if the proposed name is not unique.public void closeProject(java.lang.String name) throws ProjectOperationException
Project
from active to closed state.
closeProject
in interface ProjectProcessing
name
- The name of the project to close. The project must
be in active state for the closure to be possible.
ProjectOperationException
- if an unhandled exception occurs.public void reactivateProject(java.lang.String name) throws ProjectOperationException
Project
from closed state back to active state.
reactivateProject
in interface ProjectProcessing
name
- The name of the project to reactivate.
ProjectOperationException
- if an unhandled exception occurs.public void activateProject(java.lang.String name, java.lang.String activeName) throws ProjectOperationException
Project
name and then activates the Project
.
activateProject
in interface ProjectProcessing
name
- The name of the project to activateactiveName
- Not used. It exsist because this class implements the ProjectProcessing
interface. Safe to set to null or "".
ProjectOperationException
- if an unhandled exception occurs.public void deleteProject(java.lang.String name, int state) throws ProjectOperationException
Project
permanently.
deleteProject
in interface ProjectProcessing
name
- Name of the Project
to rename.state
- In which state to look for the project.
ProjectOperationException
- if an unhandled exception occurs.public void saveProject(Project proj) throws ProjectOperationException
Project
object to disk.
saveProject
in interface ProjectProcessing
proj
- A Project
object to save.
ProjectOperationException
- if an unhandled exception occurs.public Project openProject(java.lang.String name) throws ProjectOperationException, NoProjectFoundException
Project
that is in dynamic state.
openProject
in interface ProjectProcessing
name
- The name of the project.
Project
.
ProjectOperationException
- if an unhandled exception occurs.
NoProjectFoundException
- if no project could be found with the specified name.public Project openProjectPassive(java.lang.String name) throws ProjectOperationException, NoProjectFoundException
Project
in read-only mode. Used by the client.
name
- The name of the project.
Project
.
ProjectOperationException
- if an unhandled exception occurs.
NoProjectFoundException
- if no project could be found with the specified name.public Project newProject(java.lang.String name) throws ProjectOperationException, NotUniqueNameException
Project
.
newProject
in interface ProjectProcessing
name
- The desired name of the new Project
.
Project
object.
ProjectOperationException
- if an unhandled exception occurs.
NotUniqueNameException
- if the proposed name is not unique.public boolean isUniqueProjectName(java.lang.String name, int state) throws ProjectOperationException
isUniqueProjectName
in interface ProjectProcessing
name
- A name candidate.state
- The project state domain to check against. Project states are
defined in audiojury.domain.Project
ProjectOperationException
- if an unhandled exception occurs.public static ProjectManager getUniqueInstance()
ProjectManager
. This should be used instead of
a constructor.
protected ProjectBuilder getProjectBuilder()
ProjectBuilder
currently being used.
ProjectBuilder
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |