public class Framework extends FrameworkResourceParent
FrameworkProjectMgr
, Authorization
.
User: alexh
Date: Jun 4, 2004
Time: 8:16:42 PMFrameworkResourceParent.NoSuchResourceException
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CENTRALDISPATCHER_CLS_DEFAULT |
static java.lang.String |
CENTRALDISPATCHER_CLS_PROP |
static java.lang.String |
DEFAULT_LIBEXT_CACHE_DIR_NAME |
static java.lang.String |
DEFAULT_LIBEXT_DIR_NAME |
static java.lang.String |
FRAMEWORK_LIBEXT_CACHE_DIR |
static java.lang.String |
FRAMEWORK_LIBEXT_DIR |
static java.lang.String |
FRAMEWORK_PLUGINS_ENABLED |
static org.apache.log4j.Logger |
logger |
static java.lang.String |
NODES_FILE_AUTOGEN_PROP |
static java.lang.String |
NODES_RESOURCES_FILE_PROP |
static Attribute |
RUNDECK_APP_CONTEXT
Environmental attribute for the rundeck app
|
static java.util.Set<Attribute> |
RUNDECK_APP_ENV
the rundeck app environment for authorization
|
static java.lang.String |
SYSTEM_PROP_LIBEXT |
static java.lang.String |
SYSTEM_PROP_LIBEXT_CACHE |
VALID_RESOURCE_NAME_CHARSET_REGEX, VALID_RESOURCE_NAME_REGEX
Modifier and Type | Method and Description |
---|---|
boolean |
childCouldBeLoaded(java.lang.String name)
Default implementation checks whether a subdir under the basedir exists with the specified name.
|
NodeEntryImpl |
createFrameworkNode()
Generate a node entry for the framework with default values
|
static PropertyRetriever |
createProjectPropertyRetriever(java.io.File baseDir,
java.io.File projectsBaseDir,
java.lang.String projectName)
Create a safe project property retriever given a basedir and project name
|
static PropertyLookup |
createPropertyLookupFromBasedir(java.io.File baseDir)
Create a safe framework property retriever given a basedir
|
static PropertyRetriever |
createPropertyRetriever(java.io.File baseDir)
Create a safe framework property retriever given a basedir
|
INodeSet |
filterAuthorizedNodes(java.lang.String project,
java.util.Set<java.lang.String> actions,
INodeSet unfiltered,
AuthContext authContext)
Return the nodeset consisting only of the input nodes where the specified actions are all authorized
|
java.util.Collection<INodeEntry> |
filterNodes(NodesSelector nodeset,
java.lang.String project,
java.io.File nodesFile)
Read the nodes file for a project and return a filtered set of nodes
|
INodeSet |
filterNodeSet(NodesSelector nodeset,
java.lang.String project,
java.io.File nodesFile)
Read the nodes file for a project and return a filtered set of nodes
|
CentralDispatcher |
getCentralDispatcherMgr()
Return CentralDispatcher implementation.
|
java.io.File |
getConfigDir()
Get the config dir
|
static java.io.File |
getConfigDir(java.io.File baseDir)
Return the config dir for the framework given a basedir
|
ExecutionService |
getExecutionService() |
FileCopier |
getFileCopierForNodeAndProject(INodeEntry node,
java.lang.String project) |
FileCopierService |
getFileCopierService() |
java.lang.String |
getFrameworkNodeHostname()
Gets the value of "framework.server.hostname" property
|
java.lang.String |
getFrameworkNodeName()
Gets the value of "framework.server.name" property
|
IFrameworkProjectMgr |
getFrameworkProjectMgr()
Gets DepotMgr for this framework instance
|
java.io.File |
getFrameworkProjectsBaseDir() |
static Framework |
getInstance(java.lang.String rdeck_base_dir,
java.lang.String projects_base_dir)
Returns the singleton instance of Framework object.
|
static Framework |
getInstanceWithoutProjectsDir(java.lang.String rdeck_base_dir)
Returns an instance of Framework object.
|
java.io.File |
getLibextCacheDir()
Return the cache directory used by the plugin system
|
java.io.File |
getLibextDir()
Return the directory containing plugins/extensions for the framework.
|
INodeDesc |
getNodeDesc()
Gets the
INodeDesc value describing the framework node |
NodeDispatcher |
getNodeDispatcherForContext(ExecutionContext context) |
NodeExecutor |
getNodeExecutorForNodeAndProject(INodeEntry node,
java.lang.String project) |
NodeExecutorService |
getNodeExecutorService() |
NodeStepExecutor |
getNodeStepExecutorForItem(NodeStepExecutionItem item) |
NodeStepExecutionService |
getNodeStepExecutorService() |
IFrameworkResourceParent |
getParent()
This is the root.
|
ServiceProviderLoader |
getPluginManager() |
java.lang.String |
getProjectProperty(java.lang.String project,
java.lang.String key)
Return the property value for the key from the project or framework properties if it exists, otherwise
return null.
|
static java.lang.String |
getProjectsBaseDir(java.io.File baseDir)
Get the path for the projects directory from the basedir
|
java.lang.String |
getProperty(java.lang.String name)
Return the property value by name
|
static java.io.File |
getPropertyFile(java.io.File configDir)
Get the framework property file from the config dir
|
IPropertyLookup |
getPropertyLookup() |
PropertyRetriever |
getPropertyRetriever()
Return a PropertyRetriever interface for framework-scoped properties
|
ResourceFormatGeneratorService |
getResourceFormatGeneratorService() |
ResourceFormatParserService |
getResourceFormatParserService() |
ResourceModelSourceService |
getResourceModelSourceService() |
FrameworkSupportService |
getService(java.lang.String name)
Return a service by name
|
StepExecutionService |
getStepExecutionService() |
WorkflowExecutionService |
getWorkflowExecutionService() |
boolean |
hasProjectProperty(java.lang.String key,
java.lang.String project)
Return true if the property is set for the project or the framework
|
boolean |
hasProperty(java.lang.String key)
Return true if the property exists
|
void |
initialize()
Initialize children, the various resource management objects
|
boolean |
isLocalNode(INodeDesc node)
Return true if the node is the local framework node.
|
java.util.Collection |
listChildNames()
Default implementation lists the subdirectory names and adds any existing child names
|
IFrameworkResource |
loadChild(java.lang.String name)
Load a specified child by name, returning null if it does not exist
|
void |
setCentralDispatcherMgr(CentralDispatcher centralDispatcherMgr)
Set the CentralDispatcherMgr instance
|
void |
setService(java.lang.String name,
FrameworkSupportService service)
Set a service by name
|
java.lang.String |
toString()
Returns a string with useful information for debugging.
|
createChild, existsChild, existsChildResourceDirectory, getChild, getChildren, listChildren, remove
getBaseDir, getLogger, getName, isValid, storeProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBaseDir, getName, isValid
public static final org.apache.log4j.Logger logger
public static final java.lang.String CENTRALDISPATCHER_CLS_PROP
public static final java.lang.String NODES_RESOURCES_FILE_PROP
public static final java.lang.String NODES_FILE_AUTOGEN_PROP
public static final java.lang.String CENTRALDISPATCHER_CLS_DEFAULT
public static final Attribute RUNDECK_APP_CONTEXT
public static final java.util.Set<Attribute> RUNDECK_APP_ENV
public static final java.lang.String FRAMEWORK_LIBEXT_DIR
public static final java.lang.String FRAMEWORK_LIBEXT_CACHE_DIR
public static final java.lang.String DEFAULT_LIBEXT_DIR_NAME
public static final java.lang.String DEFAULT_LIBEXT_CACHE_DIR_NAME
public static final java.lang.String SYSTEM_PROP_LIBEXT
public static final java.lang.String SYSTEM_PROP_LIBEXT_CACHE
public static final java.lang.String FRAMEWORK_PLUGINS_ENABLED
public IFrameworkResourceParent getParent()
getParent
in interface IFrameworkResource
getParent
in class FrameworkResource
FrameworkResourceException
- Throws an exception if this is calledpublic 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 IFrameworkResource loadChild(java.lang.String name)
IFrameworkResourceParent
public java.util.Collection listChildNames()
FrameworkResourceParent
listChildNames
in interface IFrameworkResourceParent
listChildNames
in class FrameworkResourceParent
public void initialize()
initialize
in interface IFrameworkResourceParent
initialize
in class FrameworkResourceParent
public CentralDispatcher getCentralDispatcherMgr()
public IFrameworkProjectMgr getFrameworkProjectMgr()
public static java.lang.String getProjectsBaseDir(java.io.File baseDir)
baseDir
- public static java.io.File getPropertyFile(java.io.File configDir)
configDir
- public static PropertyRetriever createPropertyRetriever(java.io.File baseDir)
baseDir
- public static PropertyLookup createPropertyLookupFromBasedir(java.io.File baseDir)
baseDir
- public static PropertyRetriever createProjectPropertyRetriever(java.io.File baseDir, java.io.File projectsBaseDir, java.lang.String projectName)
baseDir
- framework base directoryprojectsBaseDir
- projects base directoryprojectName
- name of the projectpublic FrameworkSupportService getService(java.lang.String name)
public void setService(java.lang.String name, FrameworkSupportService service)
public ExecutionService getExecutionService()
public WorkflowExecutionService getWorkflowExecutionService()
public StepExecutionService getStepExecutionService()
public FileCopier getFileCopierForNodeAndProject(INodeEntry node, java.lang.String project) throws ExecutionServiceException
ExecutionServiceException
public FileCopierService getFileCopierService()
public NodeExecutor getNodeExecutorForNodeAndProject(INodeEntry node, java.lang.String project) throws ExecutionServiceException
ExecutionServiceException
public NodeExecutorService getNodeExecutorService() throws ExecutionServiceException
ExecutionServiceException
public NodeStepExecutionService getNodeStepExecutorService() throws ExecutionServiceException
ExecutionServiceException
public NodeStepExecutor getNodeStepExecutorForItem(NodeStepExecutionItem item) throws ExecutionServiceException
ExecutionServiceException
public NodeDispatcher getNodeDispatcherForContext(ExecutionContext context) throws ExecutionServiceException
ExecutionServiceException
public ResourceModelSourceService getResourceModelSourceService()
public ResourceFormatParserService getResourceFormatParserService()
public ResourceFormatGeneratorService getResourceFormatGeneratorService()
public ServiceProviderLoader getPluginManager()
public static Framework getInstanceWithoutProjectsDir(java.lang.String rdeck_base_dir)
rdeck_base_dir
- path name to the rdeck_basepublic static Framework getInstance(java.lang.String rdeck_base_dir, java.lang.String projects_base_dir)
Constants
is used.rdeck_base_dir
- path name to the rdeck_baseprojects_base_dir
- path name to the projects basepublic void setCentralDispatcherMgr(CentralDispatcher centralDispatcherMgr)
centralDispatcherMgr
- the instancepublic java.lang.String getProperty(java.lang.String name)
name
- Property keypublic PropertyRetriever getPropertyRetriever()
public boolean hasProperty(java.lang.String key)
public boolean hasProjectProperty(java.lang.String key, java.lang.String project)
public java.lang.String getProjectProperty(java.lang.String project, java.lang.String key)
public IPropertyLookup getPropertyLookup()
public java.lang.String toString()
toString
in class FrameworkResource
public java.lang.String getFrameworkNodeHostname()
public java.lang.String getFrameworkNodeName()
public NodeEntryImpl createFrameworkNode()
public java.util.Collection<INodeEntry> filterNodes(NodesSelector nodeset, java.lang.String project, java.io.File nodesFile) throws NodeFileParserException
nodeset
- node filter setproject
- project nameNodeFileParserException
public INodeSet filterNodeSet(NodesSelector nodeset, java.lang.String project, java.io.File nodesFile) throws NodeFileParserException
nodeset
- node filter setproject
- project nameNodeFileParserException
public INodeSet filterAuthorizedNodes(java.lang.String project, java.util.Set<java.lang.String> actions, INodeSet unfiltered, AuthContext authContext)
public java.io.File getConfigDir()
public static java.io.File getConfigDir(java.io.File baseDir)
baseDir
- public java.io.File getLibextDir()
public java.io.File getLibextCacheDir()
public java.io.File getFrameworkProjectsBaseDir()
public INodeDesc getNodeDesc()
INodeDesc
value describing the framework nodeINodeDesc
object for this framework instancepublic boolean isLocalNode(INodeDesc node)
node
- the node