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_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<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 |
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
|
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.Exception> |
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(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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName
public 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<Attribute> authorizationEnvironment(java.lang.String project)
project
- project namepublic IProjectInfo getInfo()
getInfo
in interface IRundeckProject
public 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 IRundeckProject
getProperty
in interface IRundeckProjectConfig
name
- property namepublic boolean hasProperty(java.lang.String key)
hasProperty
in interface IRundeckProject
hasProperty
in interface IRundeckProjectConfig
key
- property namepublic java.util.Map<java.lang.String,java.lang.String> getProperties()
getProperties
in interface IRundeckProject
getProperties
in interface IRundeckProjectConfig
public java.util.Map<java.lang.String,java.lang.String> getProjectProperties()
getProjectProperties
in interface IRundeckProject
getProjectProperties
in interface IRundeckProjectConfig
public java.util.Date getConfigLastModifiedTime()
getConfigLastModifiedTime
in interface IRundeckProject
getConfigLastModifiedTime
in interface IRundeckProjectConfig
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> listResourceModelConfigurations()
listResourceModelConfigurations
in interface IRundeckProject
public 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 IRundeckProject
INodeSet
NodeFileParserException
- 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 IRundeckProject
path
- path relative to the projectpublic boolean existsDirResource(java.lang.String path)
existsDirResource
in interface IRundeckProject
path
- path relative to the projectpublic java.util.List<java.lang.String> listDirPaths(java.lang.String path)
listDirPaths
in interface IRundeckProject
path
- path relative to the projectpublic boolean deleteFileResource(java.lang.String path)
deleteFileResource
in interface IRundeckProject
path
- path relative to the projectpublic long storeFileResource(java.lang.String path, java.io.InputStream input) throws java.io.IOException
IRundeckProject
storeFileResource
in interface IRundeckProject
path
- 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
IRundeckProject
loadFileResource
in interface IRundeckProject
path
- 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 IRundeckProject
properties
- new properties to put in the fileremovePrefixes
- prefixes of properties to remove from the filepublic void setProjectProperties(java.util.Properties properties)
setProjectProperties
in interface IRundeckProject
properties
- new properties to use in the filepublic static boolean isInstalled(FrameworkProject d)
d
- Depot object to check.public java.util.ArrayList<java.lang.Exception> getResourceModelSourceExceptions()
public IProjectNodes getProjectNodes()
getProjectNodes
in interface IRundeckProject
public Authorization getProjectAuthorization()
getProjectAuthorization
in interface IRundeckProject
public void setProjectAuthorization(Authorization projectAuthorization)
public void setProjectNodesFactory(IProjectNodesFactory projectNodesFactory)