|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkieker.webgui.service.impl.ProjectServiceImpl
@Service public final class ProjectServiceImpl
This is an implementation of the IProjectService
interface for the project management. It makes sure that accesses to the projects are synchronized. Most
of the work is delegated to the underlying layer or to the utility classes.
Constructor Summary | |
---|---|
ProjectServiceImpl()
Default constructor. |
Method Summary | |
---|---|
void |
addProject(String projectName,
String username)
This method adds a new project to the application. |
void |
cleanAnalysis(String projectName)
This method cleans the analysis of the given project. |
void |
copyProject(String originalProjectName,
String newProjectName)
This method makes a copy of a project and saves it under another name. |
boolean |
deleteLibrary(String projectName,
String libName)
Deletes the given library of the given project. |
void |
deleteProject(String projectName)
This method removes the given project from the application. |
void |
emergencyShutdownOfAnalysis(String projectName)
Initializes an emergency shutdown. |
String |
getAnalysisLayout(String projectName)
Delivers the stored analysis layout for the given project. |
ComponentListContainer |
getAvailableComponents(String projectName)
Delivers the available components (readers, filters and repositories) for the given project. |
ClassLoader |
getClassLoader(String projectName,
Object requester)
This method delivers a class loader containing the currently available libraries of the given project. |
String |
getCockpitLayout(String projectName)
Delivers the stored cockpit layout for the given project. |
kieker.analysis.AnalysisController.STATE |
getCurrentState(String projectName)
This method delivers the current state of the given project. |
long |
getCurrTimeStamp(String projectName)
Delivers the current time stamp of the given project. |
Object |
getDisplay(String projectName,
String viewName,
String displayName)
This method delivers the display object of the (currently running) analysis for the given project and the given parameters. |
DisplayType |
getDisplayType(String projectName,
String viewName,
String displayConnectorName)
Delivers the type of the given display connector. |
String |
getLastUser(String projectName)
Delivers the last user of the given project or a substituion if the meta data is corrupt or missing. |
Object[] |
getLogEntries(String projectName)
This method delivers the available log entries of the analysis controller of the given project. |
String |
getOwner(String projectName)
Delivers the owner of the given project or a substituion if the meta data is corrupt or missing. |
List<String> |
getProjects()
Delivers a list of the currently available projects. |
void |
importProject(String projectName,
String username,
org.primefaces.model.UploadedFile file)
This method imports an existing kax-file into the application. |
protected void |
initialize()
This method does some initialization work after construction. |
void |
initializeAnalysis(String projectName)
This method initializes the analysis of the given project. |
List<String> |
listAllLibraries(String projectName)
This method lists all available libraries of the given project. |
kieker.analysis.model.analysisMetaModel.MIProject |
loadProject(String projectName)
This method loads the kax-file for the given project name and delivers an initializes instance of MIProject . |
void |
reloadDisplays(String projectName)
Reloads the displays of the given project. |
void |
renameProject(String originalProjectName,
String newProjectName)
This method renames the given project. |
void |
saveProject(String projectName,
kieker.analysis.model.analysisMetaModel.MIProject project,
long timeStamp,
boolean overwriteNewerProject,
String username,
String analysisLayout,
String cockpitLayout)
This method tries to save the given model instance for the given project. |
void |
startAnalysis(String projectName)
This method starts the analysis of the given project. |
void |
stopAnalysis(String projectName)
This method stops the analysis of the given project. |
void |
uploadLibrary(org.primefaces.model.UploadedFile file,
String projectName)
This method tries to upload a dependency to the given project. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProjectServiceImpl()
Method Detail |
---|
@PostConstruct protected void initialize()
public void addProject(String projectName, String username) throws ProjectAlreadyExistingException, IOException
IProjectService
IOException
, it will make sure that the project-directories will be removed as if the method would never have been called.
addProject
in interface IProjectService
projectName
- The name of the new project.username
- The name of the user who created the project.
ProjectAlreadyExistingException
- If a project with the same name exists already.
IOException
- If something went wrong during the creation of the project.public void deleteProject(String projectName) throws ProjectNotExistingException, IOException, ProjectStillRunningException
IProjectService
deleteProject
in interface IProjectService
projectName
- The name of the project.
ProjectNotExistingException
- If a project with the given name doesn't exist.
IOException
- If something went wrong during the removing.
ProjectStillRunningException
- If the project is still running.public void copyProject(String originalProjectName, String newProjectName) throws ProjectNotExistingException, ProjectAlreadyExistingException, IOException
IProjectService
IOException
, it will make sure that the
project-directories of the destination-project will be removed as if the method would never have been called.
copyProject
in interface IProjectService
originalProjectName
- The name of the source project.newProjectName
- The name of the target project.
ProjectNotExistingException
- If a project with the given (source) name doesn't exist.
ProjectAlreadyExistingException
- If a project with the same (target) name exists already.
IOException
- If something went wrong during the creation of the target-project or during the loading of the source-project.public void renameProject(String originalProjectName, String newProjectName) throws ProjectNotExistingException, ProjectAlreadyExistingException, IOException
IProjectService
renameProject
in interface IProjectService
originalProjectName
- The old project name.newProjectName
- The new project name.
ProjectNotExistingException
- If a project with the given (source) name doesn't exist.
ProjectAlreadyExistingException
- If a project with the same (target) name exists already.
IOException
- If something went wrong during the creation of the target-project or during the loading of the source-project.public void importProject(String projectName, String username, org.primefaces.model.UploadedFile file) throws ProjectAlreadyExistingException, IOException
IProjectService
importProject
in interface IProjectService
projectName
- The name of the new project.username
- The name of the user who imported the project.file
- The kax file to be uploaded.
ProjectAlreadyExistingException
- If a project with the same name exists already.
IOException
- If something went wrong during the creation of the project or the uploading of the file.public kieker.analysis.model.analysisMetaModel.MIProject loadProject(String projectName) throws ProjectNotExistingException, IOException
IProjectService
MIProject
.
loadProject
in interface IProjectService
projectName
- The name of the project to be loaded.
ProjectNotExistingException
- If a project with the given (source) name doesn't exist.
IOException
- If something went wrong during the opening of the project.public void saveProject(String projectName, kieker.analysis.model.analysisMetaModel.MIProject project, long timeStamp, boolean overwriteNewerProject, String username, String analysisLayout, String cockpitLayout) throws ProjectNotExistingException, IOException, NewerProjectException
IProjectService
NewerProjectException
will be thrown. If
something goes wrong during the storage, it is not guaranteed that the resulting file will be valid.
saveProject
in interface IProjectService
projectName
- The name of the project which has to be saved.project
- The model instance to be stored in the corresponding kax-file.timeStamp
- The time stamp which has to be compared with the "real" time stamp of the project.overwriteNewerProject
- Determines whether a newer project file will be overwritten without further warning or not.username
- The name of the user who saves the project.analysisLayout
- The current layout of the analysis graph. It is valid if this parameter is null. In this case the stored layout will not be changed.cockpitLayout
- The current layout of the cockpit. It is valid if this parameter is null. In this case the stored layout will not be changed.
ProjectNotExistingException
- If a project with the given name does not exist.
IOException
- If something went wrong during the storage of the model instance.
NewerProjectException
- If the project on the file system is newer and the overwriteNewerProject-flag has not been set.public long getCurrTimeStamp(String projectName) throws ProjectNotExistingException
IProjectService
getCurrTimeStamp
in interface IProjectService
projectName
- The name of the project whose time stamp will be delivered.
ProjectNotExistingException
- If a project with the given name does not exist.public void uploadLibrary(org.primefaces.model.UploadedFile file, String projectName) throws ProjectNotExistingException, IOException
IProjectService
uploadLibrary
in interface IProjectService
file
- The file to be uploaded to the project.projectName
- The name of the project.
ProjectNotExistingException
- If a project with the given name does not exist.
IOException
- If something went wrong during the uploading.public ClassLoader getClassLoader(String projectName, Object requester) throws ProjectNotExistingException, IOException
IProjectService
getClassLoader
in interface IProjectService
projectName
- The name of the project.requester
- The requester of the class loader.
ProjectNotExistingException
- If a project with the given name does not exist.
IOException
- If something went wrong during the initialization of the class loader.public ComponentListContainer getAvailableComponents(String projectName)
IProjectService
getAvailableComponents
in interface IProjectService
projectName
- The project whose components should be loaded.
public List<String> listAllLibraries(String projectName) throws ProjectNotExistingException
IProjectService
listAllLibraries
in interface IProjectService
projectName
- The name of the project whose libraries have to be delivered.
ProjectNotExistingException
- If a project with the given name does not exist.public void initializeAnalysis(String projectName) throws ProjectNotExistingException, InvalidAnalysisStateException, AnalysisInitializationException, IOException
IProjectService
initializeAnalysis
in interface IProjectService
projectName
- The name of the project whose analysis should be initialized.
ProjectNotExistingException
- If a project with the given name does not exist.
InvalidAnalysisStateException
- If the analysis of the given project is in the wrong state to be initialized. This means that it has not been cleaned yet.
AnalysisInitializationException
- If an error occurred during the initialization of the analysis.
IOException
- If something went wrong while loading the file.public void cleanAnalysis(String projectName) throws ProjectNotExistingException, InvalidAnalysisStateException
IProjectService
cleanAnalysis
in interface IProjectService
projectName
- The name of the project whose analysis should be cleaned.
ProjectNotExistingException
- If a project with the given name does not exist.
InvalidAnalysisStateException
- If the analysis of the given project is in the wrong state to be cleaned. This means that it has not been terminated yet.public void startAnalysis(String projectName) throws ProjectNotExistingException, InvalidAnalysisStateException
IProjectService
startAnalysis
in interface IProjectService
projectName
- The name of the project whose analysis should be started.
ProjectNotExistingException
- If a project with the given name does not exist.
InvalidAnalysisStateException
- If the analysis of the given project is in the wrong state to be started. This means that it has not been initialized yet.public void stopAnalysis(String projectName) throws ProjectNotExistingException, InvalidAnalysisStateException
IProjectService
stopAnalysis
in interface IProjectService
projectName
- The name of the project whose analysis should be stopped.
ProjectNotExistingException
- If a project with the given name does not exist.
InvalidAnalysisStateException
- If the analysis of the given project is in the wrong state to be stopped. This means that it has not been started yet or is no longer running.public void emergencyShutdownOfAnalysis(String projectName) throws ProjectNotExistingException, InvalidAnalysisStateException
IProjectService
emergencyShutdownOfAnalysis
in interface IProjectService
projectName
- The name of the project whose analysis should be stopped.
ProjectNotExistingException
- If a project with the given name does not exist.
InvalidAnalysisStateException
- If the analysis of the given project is in the wrong state to be stopped.public Object getDisplay(String projectName, String viewName, String displayName) throws InvalidAnalysisStateException
IProjectService
AbstractDisplay
, but in fact the project specific class loader has been used.
getDisplay
in interface IProjectService
projectName
- The name of the project.viewName
- The name of the view.displayName
- The name of the display.
InvalidAnalysisStateException
- If the analysis of the given project is in the wrong state to deliver the display.public kieker.analysis.AnalysisController.STATE getCurrentState(String projectName)
IProjectService
getCurrentState
in interface IProjectService
projectName
- The name of the project whose state have to be returned.
null
otherwise.public Object[] getLogEntries(String projectName) throws InvalidAnalysisStateException
IProjectService
getLogEntries
in interface IProjectService
projectName
- The name of the project.
InvalidAnalysisStateException
- If the analysis is in an invalid state to deliver the entries.public boolean deleteLibrary(String projectName, String libName) throws IOException, ProjectNotExistingException
IProjectService
deleteLibrary
in interface IProjectService
projectName
- The name of the project.libName
- The name of the library.
IOException
- If something went wrong during the reloading of the components.
ProjectNotExistingException
- If a project with the given name does not exist.public String getOwner(String projectName) throws ProjectNotExistingException
IProjectService
getOwner
in interface IProjectService
projectName
- The name of the project whose owner should be delivered.
ProjectNotExistingException
- If a project with the given name does not exist.public String getLastUser(String projectName) throws ProjectNotExistingException
IProjectService
getLastUser
in interface IProjectService
projectName
- The name of the project whose last user should be delivered.
ProjectNotExistingException
- If a project with the given name does not exist.public String getAnalysisLayout(String projectName)
IProjectService
getAnalysisLayout
in interface IProjectService
projectName
- The name of the project.
public String getCockpitLayout(String projectName)
IProjectService
getCockpitLayout
in interface IProjectService
projectName
- The name of the project.
public DisplayType getDisplayType(String projectName, String viewName, String displayConnectorName)
IProjectService
getDisplayType
in interface IProjectService
projectName
- The name of the project.viewName
- The name of the view.displayConnectorName
- The name of the display connector.
public List<String> getProjects()
IProjectService
getProjects
in interface IProjectService
public void reloadDisplays(String projectName) throws AnalysisDisplayReloadException, InvalidAnalysisStateException
IProjectService
reloadDisplays
in interface IProjectService
projectName
- The name of the project.
AnalysisDisplayReloadException
- If something went wrong while reloading the displays.
InvalidAnalysisStateException
- If the analysis is in an invalid state for the operation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |