public class FrameworkProject extends FrameworkResource implements IRundeckProject
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ETC_DIR_NAME |
static java.lang.String |
NODES_XML |
static java.lang.String |
PROJECT_RESOURCES_MERGE_NODE_ATTRIBUTES |
static java.lang.String |
PROP_FILENAME |
static java.lang.String |
RESOURCES_SOURCE_PROP_PREFIX |
VALID_RESOURCE_DESCRIPTION_CHARSET_REGEX, VALID_RESOURCE_DESCRIPTION_REGEX, VALID_RESOURCE_NAME_CHARSET_REGEX, VALID_RESOURCE_NAME_REGEX| Constructor and Description |
|---|
FrameworkProject(java.lang.String name,
java.io.File basedir,
IFilesystemFramework filesystemFramework,
IFrameworkProjectMgr resourceMgr,
IRundeckProjectConfig projectConfig,
IRundeckProjectConfigModifier projectConfigModifier)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
static java.util.Set<com.dtolabs.rundeck.core.authorization.Attribute> |
authorizationEnvironment(java.lang.String project)
Creates an authorization environment for a project.
|
boolean |
childCouldBeLoaded(java.lang.String name) |
static FrameworkProject |
create(java.lang.String name,
java.io.File projectsDir,
IFilesystemFramework filesystemFramework,
IFrameworkProjectMgr resourceMgr,
java.util.function.Supplier<ResourceFormatGeneratorService> getResourceFormatGeneratorService,
java.util.function.Supplier<ResourceModelSourceService> getResourceModelSourceService) |
static void |
createFileStructure(java.io.File projectDir)
Creates the file structure for a project
|
boolean |
deleteFileResource(java.lang.String path) |
static boolean |
exists(java.lang.String project,
IFrameworkProjectMgr projectResourceMgr) |
boolean |
existsDirResource(java.lang.String path) |
boolean |
existsFileResource(java.lang.String path) |
protected void |
generateProjectPropertiesFile(boolean overwrite,
java.util.Properties properties,
boolean addDefault) |
java.util.Date |
getConfigCreatedTime() |
java.util.Date |
getConfigLastModifiedTime() |
java.io.File |
getEtcDir()
Gets the config dir for this project
|
IFrameworkProjectMgr |
getFrameworkProjectMgr() |
IProjectInfo |
getInfo() |
INodeSet |
getNodeSet()
Returns the set of nodes for the project
|
com.dtolabs.rundeck.core.authorization.Authorization |
getProjectAuthorization() |
static java.io.File |
getProjectEtcDir(java.io.File baseDir)
Get the etc dir from the basedir
|
IProjectNodes |
getProjectNodes() |
java.util.Map<java.lang.String,java.lang.String> |
getProjectProperties() |
static java.io.File |
getProjectPropertyFile(java.io.File baseDir)
Get the project property file from the basedir
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties() |
java.lang.String |
getProperty(java.lang.String name) |
java.util.ArrayList<java.lang.Throwable> |
getResourceModelSourceExceptions() |
boolean |
hasProperty(java.lang.String key) |
static boolean |
isInstalled(FrameworkProject d)
Checks if project is installed by checking if it's basedir directory exists.
|
java.util.Collection<java.lang.String> |
listChildNames() |
java.util.List<java.lang.String> |
listDirPaths(java.lang.String path) |
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
listResourceModelConfigurations()
list the configurations of resource model providers.
|
long |
loadFileResource(java.lang.String path,
java.io.OutputStream output)
Read a file at a path for the project
|
void |
mergeProjectProperties(java.util.Properties properties,
java.util.Set<java.lang.String> removePrefixes)
Update the project properties file by setting updating the given properties, and removing
any properties that have a prefix in the removePrefixes set
|
void |
setProjectAuthorization(com.dtolabs.rundeck.core.authorization.Authorization projectAuthorization) |
void |
setProjectNodesFactory(IProjectNodesFactory projectNodesFactory) |
void |
setProjectProperties(java.util.Properties properties)
Set the project properties file contents exactly
|
long |
storeFileResource(java.lang.String path,
java.io.InputStream input)
Store a file at a path for the project
|
existsSubdir, getBaseDir, getLogger, getName, getSubdir, listSubdirNames, listSubdirs, removeSubDir, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetNamepublic static final java.lang.String PROP_FILENAME
public static final java.lang.String ETC_DIR_NAME
public static final java.lang.String NODES_XML
public static final java.lang.String RESOURCES_SOURCE_PROP_PREFIX
public static final java.lang.String PROJECT_RESOURCES_MERGE_NODE_ATTRIBUTES
public FrameworkProject(java.lang.String name,
java.io.File basedir,
IFilesystemFramework filesystemFramework,
IFrameworkProjectMgr resourceMgr,
IRundeckProjectConfig projectConfig,
IRundeckProjectConfigModifier projectConfigModifier)
name - Name of the projectbasedir - the base directory for the DepotresourceMgr - managerprojectConfig - configpublic static java.util.Set<com.dtolabs.rundeck.core.authorization.Attribute> authorizationEnvironment(java.lang.String project)
project - project namepublic IProjectInfo getInfo()
getInfo in interface IRundeckProjectpublic static java.io.File getProjectEtcDir(java.io.File baseDir)
public static java.io.File getProjectPropertyFile(java.io.File baseDir)
public java.lang.String getProperty(java.lang.String name)
getProperty in interface IRundeckProjectgetProperty in interface IRundeckProjectConfigname - property namepublic boolean hasProperty(java.lang.String key)
hasProperty in interface IRundeckProjecthasProperty in interface IRundeckProjectConfigkey - property namepublic java.util.Map<java.lang.String,java.lang.String> getProperties()
getProperties in interface IRundeckProjectgetProperties in interface IRundeckProjectConfigpublic java.util.Map<java.lang.String,java.lang.String> getProjectProperties()
getProjectProperties in interface IRundeckProjectgetProjectProperties in interface IRundeckProjectConfigpublic java.util.Date getConfigLastModifiedTime()
getConfigLastModifiedTime in interface IRundeckProjectgetConfigLastModifiedTime in interface IRundeckProjectConfigpublic java.util.Date getConfigCreatedTime()
getConfigCreatedTime in interface IRundeckProjectgetConfigCreatedTime in interface IRundeckProjectConfigpublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> listResourceModelConfigurations()
listResourceModelConfigurations in interface IRundeckProjectpublic static FrameworkProject create(java.lang.String name, java.io.File projectsDir, IFilesystemFramework filesystemFramework, IFrameworkProjectMgr resourceMgr, java.util.function.Supplier<ResourceFormatGeneratorService> getResourceFormatGeneratorService, java.util.function.Supplier<ResourceModelSourceService> getResourceModelSourceService)
getResourceFormatGeneratorService - getResourceModelSourceService - name - project nameprojectsDir - projects dirresourceMgr - resourcemanagerpublic boolean childCouldBeLoaded(java.lang.String name)
public java.util.Collection<java.lang.String> listChildNames()
public IFrameworkProjectMgr getFrameworkProjectMgr()
public static boolean exists(java.lang.String project,
IFrameworkProjectMgr projectResourceMgr)
public java.io.File getEtcDir()
public INodeSet getNodeSet() throws NodeFileParserException
getNodeSet in interface IRundeckProjectINodeSetNodeFileParserException - on parse errorpublic static void createFileStructure(java.io.File projectDir)
throws java.io.IOException
projectDir - The project base directoryjava.io.IOException - on io errorpublic boolean existsFileResource(java.lang.String path)
existsFileResource in interface IRundeckProjectpath - path relative to the projectpublic boolean existsDirResource(java.lang.String path)
existsDirResource in interface IRundeckProjectpath - path relative to the projectpublic java.util.List<java.lang.String> listDirPaths(java.lang.String path)
listDirPaths in interface IRundeckProjectpath - path relative to the projectpublic boolean deleteFileResource(java.lang.String path)
deleteFileResource in interface IRundeckProjectpath - path relative to the projectpublic long storeFileResource(java.lang.String path,
java.io.InputStream input)
throws java.io.IOException
IRundeckProjectstoreFileResource in interface IRundeckProjectpath - path relative to the projectinput - inputjava.io.IOException - if an IO error occurspublic long loadFileResource(java.lang.String path,
java.io.OutputStream output)
throws java.io.IOException
IRundeckProjectloadFileResource in interface IRundeckProjectpath - path relative to the projectoutput - outputjava.io.IOException - if an IO error occursprotected void generateProjectPropertiesFile(boolean overwrite,
java.util.Properties properties,
boolean addDefault)
public void mergeProjectProperties(java.util.Properties properties,
java.util.Set<java.lang.String> removePrefixes)
mergeProjectProperties in interface IRundeckProjectproperties - new properties to put in the fileremovePrefixes - prefixes of properties to remove from the filepublic void setProjectProperties(java.util.Properties properties)
setProjectProperties in interface IRundeckProjectproperties - new properties to use in the filepublic static boolean isInstalled(FrameworkProject d)
d - Depot object to check.public java.util.ArrayList<java.lang.Throwable> getResourceModelSourceExceptions()
public IProjectNodes getProjectNodes()
getProjectNodes in interface IRundeckProjectpublic com.dtolabs.rundeck.core.authorization.Authorization getProjectAuthorization()
getProjectAuthorization in interface IRundeckProjectpublic void setProjectAuthorization(com.dtolabs.rundeck.core.authorization.Authorization projectAuthorization)
public void setProjectNodesFactory(IProjectNodesFactory projectNodesFactory)