|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dtolabs.rundeck.core.common.FrameworkResource
com.dtolabs.rundeck.core.common.FrameworkResourceParent
com.dtolabs.rundeck.core.common.FrameworkProject
public class FrameworkProject
Represents a project in the framework. A project is a repository of installed managed entities organized by their type.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.dtolabs.rundeck.core.common.FrameworkResourceParent |
---|
FrameworkResourceParent.NoSuchResourceException |
Field Summary | |
---|---|
static java.lang.String |
ETC_DIR_NAME
|
static java.lang.String |
FRAMEWORK_RESOURCES_ALLOWED_URL_PREFIX
|
static java.lang.String |
NODES_XML
|
static java.lang.String |
PROJECT_RESOURCES_ALLOWED_URL_PREFIX
|
static java.lang.String |
PROJECT_RESOURCES_FILE_PROPERTY
|
static java.lang.String |
PROJECT_RESOURCES_FILEFORMAT_PROPERTY
|
static java.lang.String |
PROJECT_RESOURCES_MERGE_NODE_ATTRIBUTES
|
static java.lang.String |
PROJECT_RESOURCES_URL_PROPERTY
|
static java.lang.String |
PROP_FILENAME
|
static java.lang.String |
RESOURCES_SOURCE_PROP_PREFIX
|
Fields inherited from class com.dtolabs.rundeck.core.common.FrameworkResource |
---|
VALID_RESOURCE_NAME_REGEX |
Constructor Summary | |
---|---|
FrameworkProject(java.lang.String name,
java.io.File basedir,
IFrameworkProjectMgr resourceMgr)
Constructor |
|
FrameworkProject(java.lang.String name,
java.io.File basedir,
IFrameworkProjectMgr resourceMgr,
java.util.Properties properties)
Constructor |
Method Summary | |
---|---|
boolean |
childCouldBeLoaded(java.lang.String name)
Default implementation checks whether a subdir under the basedir exists with the specified name. |
static FrameworkProject |
create(java.lang.String name,
java.io.File projectsDir,
IFrameworkProjectMgr resourceMgr)
Create a new Depot object at the specified projects.directory |
static FrameworkProject |
create(java.lang.String name,
java.io.File projectsDir,
IFrameworkProjectMgr resourceMgr,
java.util.Properties properties)
Create a new Depot object at the specified projects.directory |
IFrameworkResource |
createChild(java.lang.String resourceType)
Create a new type and store it |
static void |
createFileStructure(java.io.File projectDir)
Creates the file structure for a project |
static PropertyRetriever |
createProjectPropertyRetriever(java.io.File baseDir,
java.io.File projectsBaseDir,
java.lang.String projectName)
Create a property retriever for a project given the framework basedir |
static boolean |
exists(java.lang.String project,
IFrameworkProjectMgr projectResourceMgr)
|
boolean |
existsFrameworkType(java.lang.String name)
|
protected void |
generateProjectPropertiesFile(boolean overwrite)
Create project.properties file based on $RDECK_BASE/etc/project.properties |
protected void |
generateProjectPropertiesFile(boolean overwrite,
java.util.Properties properties)
Create project.properties file based on $RDECK_BASE/etc/project.properties |
protected void |
generateProjectPropertiesFile(boolean overwrite,
java.util.Properties properties,
boolean merge,
java.util.Set<java.lang.String> removePrefixes)
Create project.properties file based on $RDECK_BASE/etc/project.properties |
java.io.File |
getEtcDir()
Gets the config dir for this project |
IFrameworkProjectMgr |
getFrameworkProjectMgr()
|
INodeSet |
getNodeSet()
Returns the set of nodes for the project |
java.lang.String |
getNodesResourceFilePath()
Return specific nodes resources file path for the project, based on the framework.nodes.file.name property |
java.util.Map |
getProperties()
|
java.lang.String |
getProperty(java.lang.String name)
Return the property value by name |
java.io.File |
getPropertyFile()
|
PropertyRetriever |
getPropertyRetriever()
Return a PropertyRetriever interface for project-scoped properties |
java.util.ArrayList<java.lang.Exception> |
getResourceModelSourceExceptions()
Return the set of exceptions produced by the last attempt to invoke all node providers |
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 |
listChildNames()
Default implementation lists the subdirectory names and adds any existing child names |
java.util.List<java.util.Map> |
listResourceModelConfigurations()
list the configurations of resource model providers. |
IFrameworkResource |
loadChild(java.lang.String name)
Load a specified child by name, returning null if it does not exist |
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 |
boolean |
updateNodesResourceFile()
Conditionally update the nodes resources file if a URL source is defined for it and return true if the update process was invoked and succeeded |
void |
updateNodesResourceFile(java.io.File source)
Update the resources file from a source file |
void |
updateNodesResourceFile(INodeSet nodeset)
Update the resources file given an input Nodes set |
void |
updateNodesResourceFileFromUrl(java.lang.String providerURL,
java.lang.String username,
java.lang.String password)
Update the nodes resources file from a specific URL, with BASIC authentication as provided or as defined in the URL's userInfo section. |
Methods inherited from class com.dtolabs.rundeck.core.common.FrameworkResourceParent |
---|
existsChild, existsChildResourceDirectory, getChild, getChildren, initialize, listChildren, remove |
Methods inherited from class com.dtolabs.rundeck.core.common.FrameworkResource |
---|
getBaseDir, getLogger, getName, getParent, isValid, storeProperties, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.dtolabs.rundeck.core.common.IFrameworkResource |
---|
getBaseDir, getName, getParent, isValid |
Field Detail |
---|
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 PROJECT_RESOURCES_URL_PROPERTY
public static final java.lang.String PROJECT_RESOURCES_FILE_PROPERTY
public static final java.lang.String PROJECT_RESOURCES_FILEFORMAT_PROPERTY
public static final java.lang.String PROJECT_RESOURCES_ALLOWED_URL_PREFIX
public static final java.lang.String FRAMEWORK_RESOURCES_ALLOWED_URL_PREFIX
public static final java.lang.String RESOURCES_SOURCE_PROP_PREFIX
public static final java.lang.String PROJECT_RESOURCES_MERGE_NODE_ATTRIBUTES
Constructor Detail |
---|
public FrameworkProject(java.lang.String name, java.io.File basedir, IFrameworkProjectMgr resourceMgr)
name
- Name of the projectbasedir
- the base directory for the Depotpublic FrameworkProject(java.lang.String name, java.io.File basedir, IFrameworkProjectMgr resourceMgr, java.util.Properties properties)
name
- Name of the projectbasedir
- the base directory for the DepotMethod Detail |
---|
public static PropertyRetriever createProjectPropertyRetriever(java.io.File baseDir, java.io.File projectsBaseDir, java.lang.String projectName)
baseDir
- the framework basedirprojectsBaseDir
- projectName
-
public java.util.List<java.util.Map> listResourceModelConfigurations()
public static FrameworkProject create(java.lang.String name, java.io.File projectsDir, IFrameworkProjectMgr resourceMgr)
name
- projectsDir
- resourceMgr
-
public static FrameworkProject create(java.lang.String name, java.io.File projectsDir, IFrameworkProjectMgr resourceMgr, java.util.Properties properties)
name
- projectsDir
- resourceMgr
-
public IFrameworkResource loadChild(java.lang.String name)
IFrameworkResourceParent
public boolean childCouldBeLoaded(java.lang.String name)
FrameworkResourceParent
FrameworkResourceParent.existsChildResourceDirectory(String)
)
Should be overridden by subtypes if this is not the desired behavior.
childCouldBeLoaded
in interface IFrameworkResourceParent
childCouldBeLoaded
in class FrameworkResourceParent
public java.util.Collection listChildNames()
FrameworkResourceParent
listChildNames
in interface IFrameworkResourceParent
listChildNames
in class FrameworkResourceParent
public IFrameworkResource createChild(java.lang.String resourceType)
createChild
in interface IFrameworkResourceParent
createChild
in class FrameworkResourceParent
resourceType
-
public java.io.File getPropertyFile()
public IFrameworkProjectMgr getFrameworkProjectMgr()
public static boolean exists(java.lang.String project, IFrameworkProjectMgr projectResourceMgr)
public boolean existsFrameworkType(java.lang.String name)
public java.io.File getEtcDir()
public java.lang.String getNodesResourceFilePath()
public INodeSet getNodeSet() throws NodeFileParserException
INodeSet
NodeFileParserException
public boolean updateNodesResourceFile() throws UpdateUtils.UpdateException
UpdateUtils.UpdateException
- if an error occurs while trying to update the resources filepublic void updateNodesResourceFileFromUrl(java.lang.String providerURL, java.lang.String username, java.lang.String password) throws UpdateUtils.UpdateException
providerURL
- URL to retrieve resources file definitionusername
- username or nullpassword
- or null
UpdateUtils.UpdateException
- if an error occurs during the update processpublic void updateNodesResourceFile(java.io.File source) throws UpdateUtils.UpdateException
source
- the source file
UpdateUtils.UpdateException
- if an error occurs while trying to update the resources filepublic void updateNodesResourceFile(INodeSet nodeset) throws UpdateUtils.UpdateException
UpdateUtils.UpdateException
- if an error occurs while trying to update the resources file or generate
nodespublic java.lang.String getProperty(java.lang.String name)
name
-
public boolean hasProperty(java.lang.String key)
public java.util.Map getProperties()
public PropertyRetriever getPropertyRetriever()
public static void createFileStructure(java.io.File projectDir) throws java.io.IOException
projectDir
- The project base directory
java.io.IOException
protected void generateProjectPropertiesFile(boolean overwrite)
overwrite
- Overwrite existing properties fileprotected void generateProjectPropertiesFile(boolean overwrite, java.util.Properties properties)
overwrite
- Overwrite existing properties fileprotected void generateProjectPropertiesFile(boolean overwrite, java.util.Properties properties, boolean merge, java.util.Set<java.lang.String> removePrefixes)
overwrite
- Overwrite existing properties fileproperties
- properties to usemerge
- if true, merge existing properties that are not replacedremovePrefixes
- set of property prefixes to remove from originalpublic void mergeProjectProperties(java.util.Properties properties, java.util.Set<java.lang.String> removePrefixes)
properties
- new properties to put in the fileremovePrefixes
- prefixes of properties to remove from the filepublic static boolean isInstalled(FrameworkProject d)
d
- Depot object to check.
public java.util.ArrayList<java.lang.Exception> getResourceModelSourceExceptions()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |