com.dtolabs.rundeck.core.plugins.configuration
Class PropertyResolverFactory

java.lang.Object
  extended by com.dtolabs.rundeck.core.plugins.configuration.PropertyResolverFactory

public class PropertyResolverFactory
extends java.lang.Object

Factory for different property resolvers for use by plugins


Field Summary
static java.lang.String FRAMEWORK_PREFIX
           
static java.lang.String PLUGIN_PREFIX
           
static java.lang.String PROJECT_PREFIX
           
static java.lang.String SEP
           
 
Constructor Summary
PropertyResolverFactory()
           
 
Method Summary
static PropertyResolver createFrameworkProjectRuntimeResolver(Framework framework, java.lang.String projectName, java.util.Map<java.lang.String,java.lang.Object> instanceProperties, java.lang.String pluginType, java.lang.String providerName)
          Create a PropertyResolver for a plugin for resolving Framework, Project and instance scoped properties.
static PropertyResolver createInstanceResolver(java.util.Map<java.lang.String,java.lang.Object> instanceProperties)
          Create a PropertyResolver for a plugin for resolving only instance scoped properties.
static PropertyResolver createPrefixedResolver(PropertyResolver resolver, java.lang.String providerName, java.lang.String pluginType)
          Create a resolver from a set of retrievers, possibly null
static PropertyResolver createResolver(PropertyRetriever instanceRetriever, PropertyRetriever projectRetriever, PropertyRetriever frameworkRetriever)
          Create a resolver from a set of retrievers, possibly null
static PropertyResolver createStepPluginRuntimeResolver(StepExecutionContext context, java.util.Map<java.lang.String,java.lang.Object> instanceProperties, java.lang.String pluginType, java.lang.String providerName)
          Create a PropertyResolver for a plugin for resolving Framework, Project and instance scoped properties.
static java.lang.String frameworkPropertyPrefix(java.lang.String basePrefix)
           
static PropertyRetriever instanceRetriever(java.util.Map<java.lang.String,?> configuration)
          Create a basic retriever from a Map of values
static java.util.Map<java.lang.String,java.lang.Object> mapPropertyValues(java.util.List<Property> list, PropertyResolver resolver)
          Return All property values for the input property set mapped by name to value.
static java.lang.String pluginPropertyPrefix(java.lang.String stepType, java.lang.String pluginName)
           
static java.lang.String projectPropertyPrefix(java.lang.String basePrefix)
           
static PropertyResolver withDefaultScope(PropertyScope scope, PropertyResolver resolver)
          Return a new PropertyResolver using the given scope by default if the requested property scope is unspecified
static PropertyResolver withDefaultValues(PropertyResolver resolver, PropertyRetriever defaults)
          Return a new PropertyResolver which will return values taken from the defaults if the given resolver returns null
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEP

public static final java.lang.String SEP
See Also:
Constant Field Values

PROJECT_PREFIX

public static final java.lang.String PROJECT_PREFIX
See Also:
Constant Field Values

FRAMEWORK_PREFIX

public static final java.lang.String FRAMEWORK_PREFIX
See Also:
Constant Field Values

PLUGIN_PREFIX

public static final java.lang.String PLUGIN_PREFIX
See Also:
Constant Field Values
Constructor Detail

PropertyResolverFactory

public PropertyResolverFactory()
Method Detail

pluginPropertyPrefix

public static java.lang.String pluginPropertyPrefix(java.lang.String stepType,
                                                    java.lang.String pluginName)

projectPropertyPrefix

public static java.lang.String projectPropertyPrefix(java.lang.String basePrefix)

frameworkPropertyPrefix

public static java.lang.String frameworkPropertyPrefix(java.lang.String basePrefix)

mapPropertyValues

public static java.util.Map<java.lang.String,java.lang.Object> mapPropertyValues(java.util.List<Property> list,
                                                                                 PropertyResolver resolver)
Return All property values for the input property set mapped by name to value.

Returns:
All mapped properties by name and value.

createStepPluginRuntimeResolver

public static PropertyResolver createStepPluginRuntimeResolver(StepExecutionContext context,
                                                               java.util.Map<java.lang.String,java.lang.Object> instanceProperties,
                                                               java.lang.String pluginType,
                                                               java.lang.String providerName)
Create a PropertyResolver for a plugin for resolving Framework, Project and instance scoped properties.


createFrameworkProjectRuntimeResolver

public static PropertyResolver createFrameworkProjectRuntimeResolver(Framework framework,
                                                                     java.lang.String projectName,
                                                                     java.util.Map<java.lang.String,java.lang.Object> instanceProperties,
                                                                     java.lang.String pluginType,
                                                                     java.lang.String providerName)
Create a PropertyResolver for a plugin for resolving Framework, Project and instance scoped properties.

Parameters:
framework - the framework
projectName - name of the project, or null to disable project property resolution
instanceProperties - instance properties, or null

createResolver

public static PropertyResolver createResolver(PropertyRetriever instanceRetriever,
                                              PropertyRetriever projectRetriever,
                                              PropertyRetriever frameworkRetriever)
Create a resolver from a set of retrievers, possibly null

Parameters:
instanceRetriever -
projectRetriever -
frameworkRetriever -
Returns:

createPrefixedResolver

public static PropertyResolver createPrefixedResolver(PropertyResolver resolver,
                                                      java.lang.String providerName,
                                                      java.lang.String pluginType)
Create a resolver from a set of retrievers, possibly null

Returns:

createInstanceResolver

public static PropertyResolver createInstanceResolver(java.util.Map<java.lang.String,java.lang.Object> instanceProperties)
Create a PropertyResolver for a plugin for resolving only instance scoped properties.


instanceRetriever

public static PropertyRetriever instanceRetriever(java.util.Map<java.lang.String,?> configuration)
Create a basic retriever from a Map of values

Parameters:
configuration -
Returns:

withDefaultScope

public static PropertyResolver withDefaultScope(PropertyScope scope,
                                                PropertyResolver resolver)
Return a new PropertyResolver using the given scope by default if the requested property scope is unspecified


withDefaultValues

public static PropertyResolver withDefaultValues(PropertyResolver resolver,
                                                 PropertyRetriever defaults)
Return a new PropertyResolver which will return values taken from the defaults if the given resolver returns null