public class MockConfigurationContext extends java.lang.Object implements ConfigurationContext
Constructor and Description |
---|
MockConfigurationContext(ControllerService service,
java.util.Map<PropertyDescriptor,java.lang.String> properties,
ControllerServiceLookup serviceLookup,
VariableRegistry variableRegistry) |
MockConfigurationContext(java.util.Map<PropertyDescriptor,java.lang.String> properties,
ControllerServiceLookup serviceLookup) |
MockConfigurationContext(java.util.Map<PropertyDescriptor,java.lang.String> properties,
ControllerServiceLookup serviceLookup,
VariableRegistry variableRegistry) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.String> |
getAllProperties() |
java.util.Map<PropertyDescriptor,java.lang.String> |
getProperties() |
PropertyValue |
getProperty(PropertyDescriptor property)
Retrieves the current value set for the given descriptor, if a value is
set - else uses the descriptor to determine the appropriate default value
|
java.lang.String |
getSchedulingPeriod() |
java.lang.Long |
getSchedulingPeriod(java.util.concurrent.TimeUnit timeUnit)
Returns the amount of time, in the given
TimeUnit that will
elapsed between the return of one execution of the
component's onTrigger method and
the time at which the method is invoked again. |
public MockConfigurationContext(java.util.Map<PropertyDescriptor,java.lang.String> properties, ControllerServiceLookup serviceLookup)
public MockConfigurationContext(java.util.Map<PropertyDescriptor,java.lang.String> properties, ControllerServiceLookup serviceLookup, VariableRegistry variableRegistry)
public MockConfigurationContext(ControllerService service, java.util.Map<PropertyDescriptor,java.lang.String> properties, ControllerServiceLookup serviceLookup, VariableRegistry variableRegistry)
public PropertyValue getProperty(PropertyDescriptor property)
PropertyContext
getProperty
in interface PropertyContext
property
- to lookup the value ofpublic java.util.Map<PropertyDescriptor,java.lang.String> getProperties()
getProperties
in interface ConfigurationContext
ControllerService
public java.util.Map<java.lang.String,java.lang.String> getAllProperties()
getAllProperties
in interface PropertyContext
public java.lang.String getSchedulingPeriod()
getSchedulingPeriod
in interface ConfigurationContext
null
if
the component does not have a scheduling period (e.g., for ControllerServices)public java.lang.Long getSchedulingPeriod(java.util.concurrent.TimeUnit timeUnit)
ConfigurationContext
TimeUnit
that will
elapsed between the return of one execution of the
component's onTrigger
method and
the time at which the method is invoked again. This method will return
null if the component does not have a scheduling period (e.g., for ControllerServices)getSchedulingPeriod
in interface ConfigurationContext
timeUnit
- unit of time for schedulingnull
if component does not have a scheduling
period