audiojury.domain
Interface ProjectProcessing

All Known Implementing Classes:
ProjectManager, ProjectStoragePlugin

public interface ProjectProcessing

This interface describes operations that can be made on a Project.


Method Summary
 void activateProject(java.lang.String name, java.lang.String activeName)
          Activates a project by copying it from the dynamic directory to the active directory and also changing the name.
 void closeProject(java.lang.String name)
          Moves a project from active to closed state.
 Scale[] createStandardScales()
          Generates the standard Scales 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.
 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 projects.
 java.util.Hashtable listProjects(int state)
          Lists projects in a specific state.
 java.util.Hashtable listProjectsAndTests(int state)
          Lists projects and tests in a specific state.
 Project newProject(java.lang.String name)
          Creates a new project.
 Project openProject(java.lang.String name)
          Opens a project that is in dynamic state.
 Scale[] openScales()
          Opens scales from a scale.conf file.
 void reactivateProject(java.lang.String name)
          Reactivates a project by copying it from the closed directory.
 void renameProject(java.lang.String name, java.lang.String newname)
          Renames a project in dynamic state.
 void saveProject(Project project)
          Saves a project object to disk.
 void saveScales(Scale[] scales)
          Saves Scale objects in a stream file named scale.conf
 

Method Detail

createStandardScales

public Scale[] createStandardScales()
Generates the standard Scales ACR, CCR and DCR.

Returns:
An array of standard scales.

openScales

public Scale[] openScales()
                   throws ProjectOperationException
Opens scales from a scale.conf file. The scale is located in the project base directory.

Returns:
An array of scales loaded from file.
Throws:
ProjectOperationException - if there was an unhandled exception while performing the operation.

saveScales

public void saveScales(Scale[] scales)
                throws ProjectOperationException
Saves Scale objects in a stream file named scale.conf

Parameters:
scales - An array of scales.
Throws:
ProjectOperationException - if there was an unhandled exception while performing the operation.

listProjectsAndTests

public java.util.Hashtable listProjectsAndTests(int state)
                                         throws ProjectOperationException
Lists projects and tests in a specific state.

Parameters:
state - List projects in this state. State identifiers are defined in audiojury.domain.Project
Returns:
A 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.
Throws:
ProjectOperationException - if there was an unhandled exception while performing the operation.
See Also:
audiojury.domain.Project#

listProjects

public java.util.Hashtable listProjects(int state)
                                 throws ProjectOperationException
Lists projects in a specific state.

Parameters:
state - List projects in this state. State identifiers are defined in Project.
Returns:
A hashtable with project names as keys. Each entry is the path to the respective project.
Throws:
ProjectOperationException - if there was an unhandled exception while performing the operation.
See Also:
audiojury.domain.Project#

listActiveProjects

public java.util.Hashtable listActiveProjects()
                                       throws ProjectOperationException
Used by the client to discover available projects. The keys in the table are strings of project names.

Returns:
A hashtable where the keys are project name strings.
Throws:
ProjectOperationException - if there was an unhandled exception while performing the operation.

isUniqueProjectName

public boolean isUniqueProjectName(java.lang.String name,
                                   int state)
                            throws ProjectOperationException
Checks it a project name is unique within a specific project state domain.

Parameters:
name - A name candidate.
state - The project state domain to check against. Project states are defined in audiojury.domain.Project
Returns:
True if the project name has not been used, and therefore is unique. False otherwise.
Throws:
ProjectOperationException - if there was an unhandled exception while performing the operation.

duplicateProject

public void duplicateProject(java.lang.String name,
                             java.lang.String newname)
                      throws ProjectOperationException,
                             NotUniqueNameException
Duplicates a project in dynamic state.

Parameters:
name - The name of the project to duplicate.
newname - The name of the copy that will be created.
Throws:
ProjectOperationException - if there was an unhandled exception while performing the operation.
NotUniqueNameException - if the proposed name is not unique.

renameProject

public void renameProject(java.lang.String name,
                          java.lang.String newname)
                   throws ProjectOperationException,
                          NotUniqueNameException
Renames a project in dynamic state.

Parameters:
name - The current name of the project.
newname - The new desired name of the project.
Throws:
ProjectOperationException - if there was an unhandled exception while performing the operation.
NotUniqueNameException - if the proposed name is not unique.

closeProject

public void closeProject(java.lang.String name)
                  throws ProjectOperationException
Moves a project from active to closed state.

Parameters:
name - The name of the project to close. The project must be in active state for the closure to be possible.
Throws:
ProjectOperationException - if there was an unhandled exception while performing the operation.

reactivateProject

public void reactivateProject(java.lang.String name)
                       throws ProjectOperationException
Reactivates a project by copying it from the closed directory.

Parameters:
name - The name of the project to reactivate.
Throws:
ProjectOperationException - if there was an unhandled exception while performing the operation.

activateProject

public void activateProject(java.lang.String name,
                            java.lang.String activeName)
                     throws ProjectOperationException
Activates a project by copying it from the dynamic directory to the active directory and also changing the name. If a shared folder exists the project is also copied there.

Parameters:
name - The name of the project to activate
activeName - The name the project should have in active state.
Throws:
ProjectOperationException - if there was an unhandled exception while performing the operation.

deleteProject

public void deleteProject(java.lang.String name,
                          int state)
                   throws ProjectOperationException
Deletes a project permanently.

Parameters:
name - Name of the project to rename.
state - In which state to look for the project.
Throws:
ProjectOperationException - if there was an unhandled exception while performing the operation.

saveProject

public void saveProject(Project project)
                 throws ProjectOperationException
Saves a project object to disk.

Parameters:
project - A project object to save.
Throws:
ProjectOperationException - if there was an unhandled exception while performing the operation.

openProject

public Project openProject(java.lang.String name)
                    throws ProjectOperationException,
                           NoProjectFoundException
Opens a project that is in dynamic state.

Parameters:
name - The name of the project.
Returns:
The opened project.
Throws:
ProjectOperationException - if there was an unhandled exception while performing the operation.
NoProjectFoundException - if the proposed name is not unique.

newProject

public Project newProject(java.lang.String name)
                   throws ProjectOperationException,
                          NotUniqueNameException
Creates a new project.

Parameters:
name - The desired name of the new project.
Returns:
A new project object.
Throws:
ProjectOperationException - if there was an unhandled exception while performing the operation.
NotUniqueNameException - if the proposed name is not unique.