Package com.dtolabs.rundeck.core.common
Class FrameworkProjectMgr
- java.lang.Object
-
- com.dtolabs.rundeck.core.common.FrameworkResource
-
- com.dtolabs.rundeck.core.common.FrameworkProjectMgr
-
- All Implemented Interfaces:
IFrameworkProjectMgr,IFrameworkResource,ProjectManager
public class FrameworkProjectMgr extends FrameworkResource implements IFrameworkProjectMgr
Filesystem based project manager
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Loggerlog-
Fields inherited from class com.dtolabs.rundeck.core.common.FrameworkResource
VALID_RESOURCE_DESCRIPTION_CHARSET_REGEX, VALID_RESOURCE_DESCRIPTION_REGEX, VALID_RESOURCE_NAME_CHARSET_REGEX, VALID_RESOURCE_NAME_REGEX
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanchildCouldBeLoaded(java.lang.String name)intcountFrameworkProjects()IRundeckProjectcreateFrameworkProject(java.lang.String projectName)Create a new project.IRundeckProjectcreateFrameworkProject(java.lang.String projectName, java.util.Properties properties)IRundeckProjectcreateFrameworkProjectStrict(java.lang.String projectName, java.util.Properties properties)Create a new project if it doesn't, otherwise throw exceptionFrameworkProjectcreateFSFrameworkProject(java.lang.String projectName)Create a new project.voiddisableFrameworkProject(java.lang.String projectName)Disables a project so it becomes unavailable without deleting it.voidenableFrameworkProject(java.lang.String projectName)Enables a previously disabled project.booleanexistsFrameworkProject(java.lang.String project)Checks if project by that name existsFilesystemFrameworkgetFilesystemFramework()FrameworkProjectgetFrameworkProject(java.lang.String name)Get the specified existing projectIProjectNodesFactorygetNodesFactory()java.lang.StringgetProjectDescription(java.lang.String projectName)Gets the project descriptionjava.util.PropertiesgetProperties()booleanisFrameworkProjectDisabled(java.lang.String projectName)java.util.List<java.lang.String>listChildNames()java.util.Collection<java.lang.String>listFrameworkProjectNames()List all the project namesjava.util.Collection<IRundeckProject>listFrameworkProjects()List all currentFrameworkProjectobjectsFrameworkProjectloadChild(java.lang.String name)IRundeckProjectConfigloadProjectConfig(java.lang.String projectName)voidremoveFrameworkProject(java.lang.String projectName)Remove a project definitionvoidsetNodesFactory(IProjectNodesFactory nodesFactory)java.lang.StringtoString()-
Methods inherited from class com.dtolabs.rundeck.core.common.FrameworkResource
existsSubdir, getBaseDir, getLogger, getName, getSubdir, listSubdirNames, listSubdirs, removeSubDir
-
-
-
-
Method Detail
-
createFrameworkProject
public IRundeckProject createFrameworkProject(java.lang.String projectName)
Description copied from interface:ProjectManagerCreate a new project. This also creates its structure- Specified by:
createFrameworkProjectin interfaceProjectManager- Parameters:
projectName- Name of the project- Returns:
- newly created
FrameworkProject
-
createFSFrameworkProject
public FrameworkProject createFSFrameworkProject(java.lang.String projectName)
Description copied from interface:IFrameworkProjectMgrCreate a new project. This also creates its structure- Specified by:
createFSFrameworkProjectin interfaceIFrameworkProjectMgr- Parameters:
projectName- Name of the project- Returns:
- newly created
FrameworkProject
-
getFilesystemFramework
public FilesystemFramework getFilesystemFramework()
-
createFrameworkProject
public IRundeckProject createFrameworkProject(java.lang.String projectName, java.util.Properties properties)
- Specified by:
createFrameworkProjectin interfaceProjectManager- Parameters:
projectName- Name of the projectproperties- additional properties to include in the project's properties file- Returns:
- Create a new project if it doesn't exist, otherwise returns existing project
-
createFrameworkProjectStrict
public IRundeckProject createFrameworkProjectStrict(java.lang.String projectName, java.util.Properties properties)
Create a new project if it doesn't, otherwise throw exception- Specified by:
createFrameworkProjectStrictin interfaceProjectManager- Parameters:
projectName- name of projectproperties- config properties- Returns:
- new project
- Throws:
java.lang.IllegalArgumentException- if the project already exists
-
removeFrameworkProject
public void removeFrameworkProject(java.lang.String projectName)
Remove a project definition- Specified by:
removeFrameworkProjectin interfaceProjectManager- Parameters:
projectName- name of the project
-
listFrameworkProjects
public java.util.Collection<IRundeckProject> listFrameworkProjects()
Description copied from interface:ProjectManagerList all currentFrameworkProjectobjects- Specified by:
listFrameworkProjectsin interfaceProjectManager- Returns:
- a collection of Project objects
-
listFrameworkProjectNames
public java.util.Collection<java.lang.String> listFrameworkProjectNames()
Description copied from interface:ProjectManagerList all the project names- Specified by:
listFrameworkProjectNamesin interfaceProjectManager- Returns:
-
countFrameworkProjects
public int countFrameworkProjects()
- Specified by:
countFrameworkProjectsin interfaceProjectManager- Returns:
- number of projects
-
disableFrameworkProject
public void disableFrameworkProject(java.lang.String projectName)
Description copied from interface:ProjectManagerDisables a project so it becomes unavailable without deleting it.- Specified by:
disableFrameworkProjectin interfaceProjectManager- Parameters:
projectName- name of the project.
-
enableFrameworkProject
public void enableFrameworkProject(java.lang.String projectName)
Description copied from interface:ProjectManagerEnables a previously disabled project.- Specified by:
enableFrameworkProjectin interfaceProjectManager- Parameters:
projectName- name of the project.
-
isFrameworkProjectDisabled
public boolean isFrameworkProjectDisabled(java.lang.String projectName)
- Specified by:
isFrameworkProjectDisabledin interfaceProjectManager- Returns:
- true if the project exists and is disabled. false otherwise.
-
getProjectDescription
public java.lang.String getProjectDescription(java.lang.String projectName)
Description copied from interface:ProjectManagerGets the project description- Specified by:
getProjectDescriptionin interfaceProjectManager- Parameters:
projectName- Project name identifier- Returns:
- The description if any. null otherwise.
-
listChildNames
public java.util.List<java.lang.String> listChildNames()
-
getFrameworkProject
public FrameworkProject getFrameworkProject(java.lang.String name)
Description copied from interface:ProjectManagerGet the specified existing project- Specified by:
getFrameworkProjectin interfaceProjectManager- Parameters:
name- The name of the project- Returns:
- an existing Project object and returns it
-
loadProjectConfig
public IRundeckProjectConfig loadProjectConfig(java.lang.String projectName)
- Specified by:
loadProjectConfigin interfaceProjectManager
-
existsFrameworkProject
public boolean existsFrameworkProject(java.lang.String project)
Description copied from interface:ProjectManagerChecks if project by that name exists- Specified by:
existsFrameworkProjectin interfaceProjectManager- Parameters:
project- The name of the project- Returns:
- true if project exists in framework.
-
childCouldBeLoaded
public boolean childCouldBeLoaded(java.lang.String name)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classFrameworkResource
-
getProperties
public java.util.Properties getProperties()
-
loadChild
public FrameworkProject loadChild(java.lang.String name)
-
getNodesFactory
public IProjectNodesFactory getNodesFactory()
-
setNodesFactory
public void setNodesFactory(IProjectNodesFactory nodesFactory)
-
-