com.dtolabs.rundeck.core.common
Class FrameworkProjectMgr

java.lang.Object
  extended by com.dtolabs.rundeck.core.common.FrameworkResource
      extended by com.dtolabs.rundeck.core.common.FrameworkResourceParent
          extended by com.dtolabs.rundeck.core.common.FrameworkProjectMgr
All Implemented Interfaces:
IFrameworkProjectMgr, IFrameworkResource, IFrameworkResourceParent, PropertyRetriever, IPropertyLookup

public class FrameworkProjectMgr
extends FrameworkResourceParent
implements IFrameworkProjectMgr

DepotMgr is a framework resource that provides interfaces for looking up other resources such as FrameworkType FrameworkResourceInstance, etc.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.dtolabs.rundeck.core.common.FrameworkResourceParent
FrameworkResourceParent.NoSuchResourceException
 
Field Summary
static org.apache.log4j.Logger log
           
 
Fields inherited from class com.dtolabs.rundeck.core.common.FrameworkResource
VALID_RESOURCE_NAME_REGEX
 
Method Summary
static FrameworkProjectMgr create(java.lang.String name, java.io.File baseDir, Framework framework)
          Factory method.
 IFrameworkResource createChild(java.lang.String projectName)
          create a new child resource
 FrameworkProject createFrameworkProject(java.lang.String projectName)
          Add a new project to the map.
 FrameworkProject createFrameworkProject(java.lang.String projectName, java.util.Properties properties)
          Add a new project to the map.
 boolean existsFrameworkProject(java.lang.String project)
          Determines if Depot exists in framework.
 Framework getFramework()
          Gets the instance of the framework for this resource mgr
 FrameworkProject getFrameworkProject(java.lang.String name)
          Looks for name as an existing Depot object and returns it
 java.util.Properties getProperties()
           
 java.util.Map getPropertiesMap()
          Retrieves map of property data
 java.lang.String getProperty(java.lang.String key)
          get property value
 java.io.File getPropertyFile()
           
 boolean hasProperty(java.lang.String key)
          checks if property value exists
 boolean isConfiguredObjectDeploymentsCheck(java.lang.String projectName)
          Checks if objects must be registered in the resources.properties file
 java.util.Collection listFrameworkProjects()
          returns a collection of Depot objects
 IFrameworkResource loadChild(java.lang.String name)
          Load a specified child by name, returning null if it does not exist
 java.lang.String toString()
          Prints internal state info for debugging purposes
 
Methods inherited from class com.dtolabs.rundeck.core.common.FrameworkResourceParent
childCouldBeLoaded, existsChild, existsChildResourceDirectory, getChild, getChildren, initialize, listChildNames, listChildren, remove
 
Methods inherited from class com.dtolabs.rundeck.core.common.FrameworkResource
getBaseDir, getLogger, getName, getParent, isValid, storeProperties
 
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.IFrameworkResourceParent
childCouldBeLoaded, existsChild, existsChildResourceDirectory, getChild, initialize, listChildNames, listChildren, remove
 
Methods inherited from interface com.dtolabs.rundeck.core.common.IFrameworkResource
getBaseDir, getName, getParent, isValid
 

Field Detail

log

public static final org.apache.log4j.Logger log
Method Detail

create

public static FrameworkProjectMgr create(java.lang.String name,
                                         java.io.File baseDir,
                                         Framework framework)
Factory method.

Parameters:
name - Name of manager. informational purposes
baseDir - Basedir where child resources live
framework - Framework instance

createFrameworkProject

public FrameworkProject createFrameworkProject(java.lang.String projectName)
Add a new project to the map. Checks if project has its own module library and creates a ModuleLookup object accordingly.

Specified by:
createFrameworkProject in interface IFrameworkProjectMgr
Parameters:
projectName - Name of the project
Returns:
newly created FrameworkProject

createFrameworkProject

public FrameworkProject createFrameworkProject(java.lang.String projectName,
                                               java.util.Properties properties)
Add a new project to the map. Checks if project has its own module library and creates a ModuleLookup object accordingly.

Specified by:
createFrameworkProject in interface IFrameworkProjectMgr
Parameters:
projectName - Name of the project
properties - additional properties to include in the project's properties file

listFrameworkProjects

public java.util.Collection listFrameworkProjects()
returns a collection of Depot objects

Specified by:
listFrameworkProjects in interface IFrameworkProjectMgr
Returns:

getFrameworkProject

public FrameworkProject getFrameworkProject(java.lang.String name)
Looks for name as an existing Depot object and returns it

Specified by:
getFrameworkProject in interface IFrameworkProjectMgr
Parameters:
name - The name of the project
Returns:

existsFrameworkProject

public boolean existsFrameworkProject(java.lang.String project)
Determines if Depot exists in framework.

Specified by:
existsFrameworkProject in interface IFrameworkProjectMgr
Parameters:
project - The name of the project
Returns:

toString

public java.lang.String toString()
Prints internal state info for debugging purposes

Overrides:
toString in class FrameworkResource
Returns:

getProperties

public java.util.Properties getProperties()

getPropertyFile

public java.io.File getPropertyFile()

createChild

public IFrameworkResource createChild(java.lang.String projectName)
Description copied from class: FrameworkResourceParent
create a new child resource

Specified by:
createChild in interface IFrameworkResourceParent
Overrides:
createChild in class FrameworkResourceParent
Parameters:
projectName - name of child
Returns:
new child

loadChild

public IFrameworkResource loadChild(java.lang.String name)
Description copied from interface: IFrameworkResourceParent
Load a specified child by name, returning null if it does not exist

Specified by:
loadChild in interface IFrameworkResourceParent
Returns:

getFramework

public Framework getFramework()
Description copied from interface: IFrameworkProjectMgr
Gets the instance of the framework for this resource mgr

Specified by:
getFramework in interface IFrameworkProjectMgr
Returns:
Framework instance

isConfiguredObjectDeploymentsCheck

public boolean isConfiguredObjectDeploymentsCheck(java.lang.String projectName)
Checks if objects must be registered in the resources.properties file

Specified by:
isConfiguredObjectDeploymentsCheck in interface IFrameworkProjectMgr
Parameters:
projectName - Name of project to check
Returns:
true if registration is required

getProperty

public java.lang.String getProperty(java.lang.String key)
get property value

Specified by:
getProperty in interface PropertyRetriever
Specified by:
getProperty in interface IPropertyLookup
Parameters:
key - the name of the property
Returns:
property value

hasProperty

public boolean hasProperty(java.lang.String key)
checks if property value exists

Specified by:
hasProperty in interface IPropertyLookup
Parameters:
key - name of the property
Returns:
true if it exists; false otherwise

getPropertiesMap

public java.util.Map getPropertiesMap()
Retrieves map of property data

Specified by:
getPropertiesMap in interface IPropertyLookup
Returns:
Map containing property key/value pair
Throws:
PropertyLookupException - thrown if loaderror