Package com.dtolabs.rundeck.core.common
Class FrameworkBase
- java.lang.Object
-
- com.dtolabs.rundeck.core.common.FrameworkBase
-
- All Implemented Interfaces:
IExecutionProviders,IExecutionServices,IFramework,IFrameworkNodes,IFrameworkServices,IServicesRegistration
- Direct Known Subclasses:
Framework
public class FrameworkBase extends java.lang.Object implements IFramework
Manages the elements of the Ctl framework. Provides access to the various kinds of framework resource managers likeFrameworkProjectMgr,Authorization.
User: alexh Date: Jun 4, 2004 Time: 8:16:42 PM
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringFRAMEWORK_GLOBALS_PROPstatic org.slf4j.Loggerloggerstatic java.lang.StringNODES_RESOURCES_FILE_PROPstatic java.lang.StringPROJECT_GLOBALS_PROP
-
Constructor Summary
Constructors Constructor Description FrameworkBase(ProjectManager projectManager, IPropertyLookup lookup, IFrameworkServices services, IFrameworkNodes iFrameworkNodes)Standard constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description NodeEntryImplcreateFrameworkNode()static PropertyRetrievercreatePropertyRetriever(java.io.File basedir)INodeSetfilterAuthorizedNodes(java.lang.String project, java.util.Set<java.lang.String> actions, INodeSet unfiltered, com.dtolabs.rundeck.core.authorization.AuthContext authContext)ExecutionServicegetExecutionService()FileCopiergetFileCopierForNodeAndProject(INodeEntry node, ExecutionContext context)provide file copier for the node and projectFileCopierServicegetFileCopierService()java.lang.StringgetFrameworkNodeHostname()Gets the value of "framework.server.hostname" propertyjava.lang.StringgetFrameworkNodeName()Gets the value of "framework.server.name" propertyIFrameworkNodesgetFrameworkNodes()ProjectManagergetFrameworkProjectMgr()Gets DepotMgr for this framework instanceIFrameworkServicesgetFrameworkServices()static FrameworkgetInstance(java.lang.String basedir, java.lang.String projectsdir)Deprecated.INodeDescgetNodeDesc()Gets theINodeDescvalue describing the framework nodeNodeDispatchergetNodeDispatcherForContext(ExecutionContext context)provide node dispatcher for contextNodeDispatcherServicegetNodeDispatcherService()NodeExecutorgetNodeExecutorForNodeAndProject(INodeEntry node, ExecutionContext context)provide node executor for the node and projectNodeExecutorServicegetNodeExecutorService()NodeStepExecutorgetNodeStepExecutorForItem(NodeStepExecutionItem item, ExecutionContext context, INodeEntry node)provide node step executor for item and projectNodeStepExecutionServicegetNodeStepExecutorService()OrchestratorServicegetOrchestratorService()ServiceProviderLoadergetPluginManager()java.util.Map<java.lang.String,java.lang.String>getProjectGlobals(java.lang.String project)Retrieves the global properties defined for the specified project.ProjectManagergetProjectManager()java.lang.StringgetProjectProperty(java.lang.String project, java.lang.String key)java.lang.StringgetProperty(java.lang.String name)Return the property value by nameIPropertyLookupgetPropertyLookup()ResourceFormatGeneratorServicegetResourceFormatGeneratorService()ResourceFormatParserServicegetResourceFormatParserService()ResourceModelSourceServicegetResourceModelSourceService()FrameworkSupportServicegetService(java.lang.String name)StepExecutionServicegetStepExecutionService()StepExecutorgetStepExecutorForItem(StepExecutionItem item, java.lang.String project)provide step executor for the item and the projectWorkflowExecutionServicegetWorkflowExecutionService()WorkflowStrategyServicegetWorkflowStrategyService()booleanhasProjectProperty(java.lang.String key, java.lang.String project)booleanhasProperty(java.lang.String key)voidinitialize(Framework framework)initializebooleanisLocalNode(INodeDesc node)Return true if the node is the local framework node.voidoverrideService(java.lang.String name, FrameworkSupportService service)Override existing registrationvoidsetFrameworkNodes(IFrameworkNodes frameworkNodes)voidsetFrameworkServices(IFrameworkServices frameworkServices)voidsetProjectManager(ProjectManager projectManager)voidsetService(java.lang.String name, FrameworkSupportService service)Set a service by name if not yet set, will not override existing registrationjava.lang.StringtoString()Returns a string with useful information for debugging.-
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.IFramework
getPropertyRetriever
-
-
-
-
Field Detail
-
logger
public static final org.slf4j.Logger logger
-
NODES_RESOURCES_FILE_PROP
public static final java.lang.String NODES_RESOURCES_FILE_PROP
- See Also:
- Constant Field Values
-
FRAMEWORK_GLOBALS_PROP
public static final java.lang.String FRAMEWORK_GLOBALS_PROP
- See Also:
- Constant Field Values
-
PROJECT_GLOBALS_PROP
public static final java.lang.String PROJECT_GLOBALS_PROP
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FrameworkBase
public FrameworkBase(ProjectManager projectManager, IPropertyLookup lookup, IFrameworkServices services, IFrameworkNodes iFrameworkNodes)
Standard constructor
-
-
Method Detail
-
initialize
public void initialize(Framework framework)
Description copied from interface:IFrameworkServicesinitialize- Specified by:
initializein interfaceIFrameworkServices
-
getFrameworkProjectMgr
public ProjectManager getFrameworkProjectMgr()
Gets DepotMgr for this framework instance- Specified by:
getFrameworkProjectMgrin interfaceIFramework- Returns:
- returns instance of IFrameworkProjectMgr
-
getService
public FrameworkSupportService getService(java.lang.String name)
- Specified by:
getServicein interfaceIServicesRegistration- Parameters:
name- service name- Returns:
- a service by name
-
overrideService
public void overrideService(java.lang.String name, FrameworkSupportService service)Description copied from interface:IServicesRegistrationOverride existing registration- Specified by:
overrideServicein interfaceIServicesRegistration- Parameters:
name- nameservice- service
-
setService
public void setService(java.lang.String name, FrameworkSupportService service)Description copied from interface:IServicesRegistrationSet a service by name if not yet set, will not override existing registration- Specified by:
setServicein interfaceIServicesRegistration- Parameters:
name- nameservice- service, or null to remove the registration
-
getStepExecutorForItem
public StepExecutor getStepExecutorForItem(StepExecutionItem item, java.lang.String project) throws ExecutionServiceException
Description copied from interface:IExecutionProvidersprovide step executor for the item and the project- Specified by:
getStepExecutorForItemin interfaceIExecutionProviders- Returns:
- Throws:
ExecutionServiceException
-
getNodeDispatcherService
public NodeDispatcherService getNodeDispatcherService()
- Specified by:
getNodeDispatcherServicein interfaceIExecutionServices
-
getExecutionService
public ExecutionService getExecutionService()
- Specified by:
getExecutionServicein interfaceIFrameworkServices
-
getOrchestratorService
public OrchestratorService getOrchestratorService()
- Specified by:
getOrchestratorServicein interfaceIExecutionServices
-
getWorkflowExecutionService
public WorkflowExecutionService getWorkflowExecutionService()
- Specified by:
getWorkflowExecutionServicein interfaceIExecutionServices
-
getWorkflowStrategyService
public WorkflowStrategyService getWorkflowStrategyService()
- Specified by:
getWorkflowStrategyServicein interfaceIExecutionServices
-
getStepExecutionService
public StepExecutionService getStepExecutionService()
- Specified by:
getStepExecutionServicein interfaceIExecutionServices
-
getFileCopierForNodeAndProject
public FileCopier getFileCopierForNodeAndProject(INodeEntry node, ExecutionContext context) throws ExecutionServiceException
Description copied from interface:IExecutionProvidersprovide file copier for the node and project- Specified by:
getFileCopierForNodeAndProjectin interfaceIExecutionProviders- Returns:
- Throws:
ExecutionServiceException
-
getFileCopierService
public FileCopierService getFileCopierService()
- Specified by:
getFileCopierServicein interfaceIExecutionServices
-
getNodeExecutorForNodeAndProject
public NodeExecutor getNodeExecutorForNodeAndProject(INodeEntry node, ExecutionContext context) throws ExecutionServiceException
Description copied from interface:IExecutionProvidersprovide node executor for the node and project- Specified by:
getNodeExecutorForNodeAndProjectin interfaceIExecutionProviders- Returns:
- Throws:
ExecutionServiceException
-
getNodeExecutorService
public NodeExecutorService getNodeExecutorService()
- Specified by:
getNodeExecutorServicein interfaceIExecutionServices
-
getNodeStepExecutorService
public NodeStepExecutionService getNodeStepExecutorService()
- Specified by:
getNodeStepExecutorServicein interfaceIExecutionServices
-
getNodeStepExecutorForItem
public NodeStepExecutor getNodeStepExecutorForItem(NodeStepExecutionItem item, ExecutionContext context, INodeEntry node) throws ExecutionServiceException
Description copied from interface:IExecutionProvidersprovide node step executor for item and project- Specified by:
getNodeStepExecutorForItemin interfaceIExecutionProviders- Returns:
- Throws:
ExecutionServiceException
-
getNodeDispatcherForContext
public NodeDispatcher getNodeDispatcherForContext(ExecutionContext context) throws ExecutionServiceException
Description copied from interface:IExecutionProvidersprovide node dispatcher for context- Specified by:
getNodeDispatcherForContextin interfaceIExecutionProviders- Returns:
- Throws:
ExecutionServiceException
-
getResourceModelSourceService
public ResourceModelSourceService getResourceModelSourceService()
- Specified by:
getResourceModelSourceServicein interfaceIExecutionServices
-
getResourceFormatParserService
public ResourceFormatParserService getResourceFormatParserService()
- Specified by:
getResourceFormatParserServicein interfaceIExecutionServices
-
getResourceFormatGeneratorService
public ResourceFormatGeneratorService getResourceFormatGeneratorService()
- Specified by:
getResourceFormatGeneratorServicein interfaceIExecutionServices
-
getPluginManager
public ServiceProviderLoader getPluginManager()
- Specified by:
getPluginManagerin interfaceIFrameworkServices
-
createPropertyRetriever
public static PropertyRetriever createPropertyRetriever(java.io.File basedir)
-
getInstance
@Deprecated public static Framework getInstance(java.lang.String basedir, java.lang.String projectsdir)
Deprecated.- Parameters:
basedir-projectsdir-- Returns:
-
getProperty
public java.lang.String getProperty(java.lang.String name)
Return the property value by name- Parameters:
name- Property key- Returns:
- property value
-
hasProperty
public boolean hasProperty(java.lang.String key)
- Parameters:
key- property key- Returns:
- true if the property exists
-
hasProjectProperty
public boolean hasProjectProperty(java.lang.String key, java.lang.String project)- Parameters:
project- projectkey- property name- Returns:
- true if the property is set for the project or the framework
-
getProjectProperty
public java.lang.String getProjectProperty(java.lang.String project, java.lang.String key)- Parameters:
project- projectkey- property name- Returns:
- the property value for the key from the project or framework properties if it exists, otherwise return null.
-
getProjectGlobals
public java.util.Map<java.lang.String,java.lang.String> getProjectGlobals(java.lang.String project)
Retrieves the global properties defined for the specified project. This variables are defined either in the framework (framework.globals.*) or in the project (project.globals.*). The prefix (xxx.globals.) will be stripped from the property name. For variables defines both in framework and project contexts, the variable defined in the project will have priority.- Parameters:
project- The project identifier.- Returns:
- Map with global variables.
-
getPropertyLookup
public IPropertyLookup getPropertyLookup()
- Specified by:
getPropertyLookupin interfaceIFramework- Returns:
- property lookup
-
toString
public java.lang.String toString()
Returns a string with useful information for debugging.- Overrides:
toStringin classjava.lang.Object- Returns:
- Formatted string
-
getFrameworkNodeHostname
public java.lang.String getFrameworkNodeHostname()
Description copied from interface:IFrameworkGets the value of "framework.server.hostname" property- Specified by:
getFrameworkNodeHostnamein interfaceIFramework- Specified by:
getFrameworkNodeHostnamein interfaceIFrameworkNodes- Returns:
- Returns value of framework.server.hostname property
-
getFrameworkNodeName
public java.lang.String getFrameworkNodeName()
Description copied from interface:IFrameworkGets the value of "framework.server.name" property- Specified by:
getFrameworkNodeNamein interfaceIFramework- Specified by:
getFrameworkNodeNamein interfaceIFrameworkNodes- Returns:
- Returns value of framework.server.name property
-
createFrameworkNode
public NodeEntryImpl createFrameworkNode()
- Specified by:
createFrameworkNodein interfaceIFramework- Specified by:
createFrameworkNodein interfaceIFrameworkNodes- Returns:
- Generate a node entry for the framework with default values
-
filterAuthorizedNodes
public INodeSet filterAuthorizedNodes(java.lang.String project, java.util.Set<java.lang.String> actions, INodeSet unfiltered, com.dtolabs.rundeck.core.authorization.AuthContext authContext)
- Specified by:
filterAuthorizedNodesin interfaceIFramework- Specified by:
filterAuthorizedNodesin interfaceIFrameworkNodes- Parameters:
project- project nameactions- action setunfiltered- nodesauthContext- authoriziation- Returns:
- the nodeset consisting only of the input nodes where the specified actions are all authorized
-
getNodeDesc
public INodeDesc getNodeDesc()
Description copied from interface:IFrameworkGets theINodeDescvalue describing the framework node- Specified by:
getNodeDescin interfaceIFramework- Specified by:
getNodeDescin interfaceIFrameworkNodes- Returns:
- the singleton
INodeDescobject for this framework instance
-
isLocalNode
public boolean isLocalNode(INodeDesc node)
Description copied from interface:IFrameworkReturn true if the node is the local framework node. Compares the (logical) node names of the nodes after eliding any embedded 'user@' parts.- Specified by:
isLocalNodein interfaceIFramework- Specified by:
isLocalNodein interfaceIFrameworkNodes- Parameters:
node- the node- Returns:
- true if the node's name is the same as the framework's node name
-
getFrameworkServices
public IFrameworkServices getFrameworkServices()
-
setFrameworkServices
public void setFrameworkServices(IFrameworkServices frameworkServices)
-
getFrameworkNodes
public IFrameworkNodes getFrameworkNodes()
-
setFrameworkNodes
public void setFrameworkNodes(IFrameworkNodes frameworkNodes)
-
getProjectManager
public ProjectManager getProjectManager()
-
setProjectManager
public void setProjectManager(ProjectManager projectManager)
-
-