diff --git a/bundles/org.openhab.core.automation.module.script/src/main/java/org/openhab/core/automation/module/script/internal/handler/AbstractScriptModuleHandler.java b/bundles/org.openhab.core.automation.module.script/src/main/java/org/openhab/core/automation/module/script/internal/handler/AbstractScriptModuleHandler.java index 7edbb2a78f..c9da2ac419 100644 --- a/bundles/org.openhab.core.automation.module.script/src/main/java/org/openhab/core/automation/module/script/internal/handler/AbstractScriptModuleHandler.java +++ b/bundles/org.openhab.core.automation.module.script/src/main/java/org/openhab/core/automation/module/script/internal/handler/AbstractScriptModuleHandler.java @@ -44,10 +44,10 @@ public abstract class AbstractScriptModuleHandler extends Base private final Logger logger = LoggerFactory.getLogger(AbstractScriptModuleHandler.class); /** Constant defining the configuration parameter of modules that specifies the mime type of a script */ - protected static final String SCRIPT_TYPE = "type"; + public static final String SCRIPT_TYPE = "type"; /** Constant defining the configuration parameter of modules that specifies the script itself */ - protected static final String SCRIPT = "script"; + public static final String SCRIPT = "script"; protected final ScriptEngineManager scriptEngineManager; diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/RuleEngineImpl.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/RuleEngineImpl.java index 351b5dd497..e876d8cc5d 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/RuleEngineImpl.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/RuleEngineImpl.java @@ -124,26 +124,26 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener managedRules = new ConcurrentHashMap<>(); + private final Map managedRules = new ConcurrentHashMap<>(); /** * {@link Map} holding all created {@link TriggerHandlerCallback} instances, corresponding to each {@link Rule}. * There is only one {@link TriggerHandlerCallback} instance per {@link Rule}. The relation is * {@link Rule}'s UID to {@link TriggerHandlerCallback} instance. */ - private final Map thCallbacks = new HashMap<>(); + private final Map thCallbacks = new HashMap<>(); /** * {@link Map} holding all {@link ModuleType} UIDs that are available in some rule's module definition. The relation * is {@link ModuleType}'s UID to {@link Set} of {@link Rule} UIDs. */ - private final Map> mapModuleTypeToRules = new HashMap<>(); + private final Map> mapModuleTypeToRules = new HashMap<>(); /** * {@link Map} holding all available {@link ModuleHandlerFactory}s linked with {@link ModuleType}s that they * supporting. The relation is {@link ModuleType}'s UID to {@link ModuleHandlerFactory} instance. */ - private final Map moduleHandlerFactories; + private final Map moduleHandlerFactories; /** * {@link Set} holding all available {@link ModuleHandlerFactory}s. @@ -173,7 +173,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener> contextMap; + private final Map> contextMap; /** * This field holds reference to {@link ModuleTypeRegistry}. The {@link RuleEngineImpl} needs it to auto-map @@ -191,7 +191,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener> scheduleTasks = new HashMap<>(31); + private final Map> scheduleTasks = new HashMap<>(31); /** * Performs the {@link Rule} re-initialization tasks. @@ -209,6 +209,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener>> it = mapModuleTypeToRules.entrySet().iterator(); it - .hasNext();) { - Map.Entry> e = it.next(); + for (Iterator>> it = mapModuleTypeToRules.entrySet() + .iterator(); it.hasNext();) { + Map.Entry> e = it.next(); Set rules = e.getValue(); if (rules != null && rules.contains(rUID)) { rules.remove(rUID); @@ -859,9 +860,6 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener moduleTypes) { - Map> mapMissingHandlers = null; + Map> mapMissingHandlers = null; for (Iterator it = moduleTypes.iterator(); it.hasNext();) { String moduleTypeName = it.next(); Set rules = null; @@ -946,7 +944,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener> e : mapMissingHandlers.entrySet()) { + for (Entry> e : mapMissingHandlers.entrySet()) { String rUID = e.getKey(); List missingTypes = e.getValue(); StringBuffer sb = new StringBuffer(); @@ -974,7 +972,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener context = contextMap.get(ruleUID); + Map context = contextMap.get(ruleUID); if (context != null) { context.clear(); } @@ -1081,8 +1079,8 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener outputs) { - Map context = getContext(ruleUID, null); + private void updateContext(String ruleUID, String moduleUID, @Nullable Map outputs) { + Map context = getContext(ruleUID, null); if (outputs != null) { for (Map.Entry entry : outputs.entrySet()) { String key = moduleUID + OUTPUT_SEPARATOR + entry.getKey(); @@ -1094,8 +1092,8 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener getContext(String ruleUID, @Nullable Set connections) { - Map context = contextMap.get(ruleUID); + private Map getContext(String ruleUID, @Nullable Set connections) { + Map context = contextMap.get(ruleUID); if (context == null) { context = new HashMap<>(); contextMap.put(ruleUID, context); @@ -1151,7 +1149,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener context = getContext(ruleUID, managedCondition.getConnections()); + Map context = getContext(ruleUID, managedCondition.getConnections()); if (tHandler != null && !tHandler.isSatisfied(Collections.unmodifiableMap(context))) { logger.debug("The condition '{}' of rule '{}' is unsatisfied.", condition.getId(), ruleUID); return false; @@ -1181,7 +1179,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener context = getContext(ruleUID, managedAction.getConnections()); + Map context = getContext(ruleUID, managedAction.getConnections()); try { Map outputs = aHandler.execute(Collections.unmodifiableMap(context)); if (outputs != null) { @@ -1365,7 +1363,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener outputs, Map, OutputRef> tagMap) { + private void initTagsMap(String moduleId, List outputs, Map, @Nullable OutputRef> tagMap) { for (Output output : outputs) { Set tags = output.getTags(); if (!tags.isEmpty()) { diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ChannelEventTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ChannelEventTriggerHandler.java index 66d85453ea..c78f450359 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ChannelEventTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ChannelEventTriggerHandler.java @@ -38,13 +38,13 @@ import org.slf4j.LoggerFactory; */ public class ChannelEventTriggerHandler extends BaseTriggerModuleHandler implements EventSubscriber, EventFilter { - private final Logger logger = LoggerFactory.getLogger(ChannelEventTriggerHandler.class); - public static final String MODULE_TYPE_ID = "core.ChannelEventTrigger"; - private static final String CFG_CHANNEL_EVENT = "event"; - private static final String CFG_CHANNEL = "channelUID"; - private static final String TOPIC = "smarthome/channels/*/triggered"; + public static final String CFG_CHANNEL_EVENT = "event"; + public static final String CFG_CHANNEL = "channelUID"; + public static final String TOPIC = "smarthome/channels/*/triggered"; + + private final Logger logger = LoggerFactory.getLogger(ChannelEventTriggerHandler.class); private final String eventOnChannel; private final String channelUID; diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/CompareConditionHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/CompareConditionHandler.java index 0b91ca3ca1..05a419028c 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/CompareConditionHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/CompareConditionHandler.java @@ -33,8 +33,6 @@ import org.slf4j.LoggerFactory; */ public class CompareConditionHandler extends BaseConditionModuleHandler { - public final Logger logger = LoggerFactory.getLogger(CompareConditionHandler.class); - public static final String MODULE_TYPE = "core.GenericCompareCondition"; public static final String INPUT_LEFT_OBJECT = "input"; @@ -42,6 +40,8 @@ public class CompareConditionHandler extends BaseConditionModuleHandler { public static final String RIGHT_OP = "right"; public static final String OPERATOR = "operator"; + public final Logger logger = LoggerFactory.getLogger(CompareConditionHandler.class); + public CompareConditionHandler(Condition module) { super(module); } diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/DayOfWeekConditionHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/DayOfWeekConditionHandler.java index dbe9ead6b1..648ac6a656 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/DayOfWeekConditionHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/DayOfWeekConditionHandler.java @@ -29,12 +29,12 @@ import org.slf4j.LoggerFactory; */ public class DayOfWeekConditionHandler extends BaseConditionModuleHandler { - private final Logger logger = LoggerFactory.getLogger(DayOfWeekConditionHandler.class); - public static final String MODULE_TYPE_ID = "timer.DayOfWeekCondition"; public static final String MODULE_CONTEXT_NAME = "MODULE"; - private static final String CFG_DAYS = "days"; + public static final String CFG_DAYS = "days"; + + private final Logger logger = LoggerFactory.getLogger(DayOfWeekConditionHandler.class); private final Set days; diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GenericCronTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GenericCronTriggerHandler.java index ef0731ead2..4ea8a96542 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GenericCronTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GenericCronTriggerHandler.java @@ -32,13 +32,14 @@ import org.slf4j.LoggerFactory; */ public class GenericCronTriggerHandler extends BaseTriggerModuleHandler implements SchedulerRunnable { - private final Logger logger = LoggerFactory.getLogger(GenericCronTriggerHandler.class); - public static final String MODULE_TYPE_ID = "timer.GenericCronTrigger"; public static final String CALLBACK_CONTEXT_NAME = "CALLBACK"; public static final String MODULE_CONTEXT_NAME = "MODULE"; - private static final String CFG_CRON_EXPRESSION = "cronExpression"; + public static final String CFG_CRON_EXPRESSION = "cronExpression"; + + private final Logger logger = LoggerFactory.getLogger(GenericCronTriggerHandler.class); + private final CronScheduler scheduler; private final String expression; private ScheduledCompletableFuture schedule; diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GenericEventConditionHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GenericEventConditionHandler.java index ed8dc6b7c6..650522129a 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GenericEventConditionHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GenericEventConditionHandler.java @@ -28,8 +28,6 @@ import org.slf4j.LoggerFactory; */ public class GenericEventConditionHandler extends BaseConditionModuleHandler { - public final Logger logger = LoggerFactory.getLogger(GenericEventConditionHandler.class); - public static final String MODULETYPE_ID = "core.GenericEventCondition"; private static final String TOPIC = "topic"; @@ -37,6 +35,8 @@ public class GenericEventConditionHandler extends BaseConditionModuleHandler { private static final String SOURCE = "source"; private static final String PAYLOAD = "payload"; + public final Logger logger = LoggerFactory.getLogger(GenericEventConditionHandler.class); + public GenericEventConditionHandler(Condition module) { super(module); } diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GenericEventTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GenericEventTriggerHandler.java index d6ac54ad66..ba06cbfbfd 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GenericEventTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GenericEventTriggerHandler.java @@ -46,6 +46,12 @@ import org.slf4j.LoggerFactory; */ public class GenericEventTriggerHandler extends BaseTriggerModuleHandler implements EventSubscriber, EventFilter { + public static final String MODULE_TYPE_ID = "core.GenericEventTrigger"; + + private static final String CFG_EVENT_TOPIC = "eventTopic"; + private static final String CFG_EVENT_SOURCE = "eventSource"; + private static final String CFG_EVENT_TYPES = "eventTypes"; + private final Logger logger = LoggerFactory.getLogger(GenericEventTriggerHandler.class); private final String source; @@ -53,14 +59,7 @@ public class GenericEventTriggerHandler extends BaseTriggerModuleHandler impleme private final Set types; private final BundleContext bundleContext; - public static final String MODULE_TYPE_ID = "core.GenericEventTrigger"; - - private static final String CFG_EVENT_TOPIC = "eventTopic"; - private static final String CFG_EVENT_SOURCE = "eventSource"; - private static final String CFG_EVENT_TYPES = "eventTypes"; - - @SuppressWarnings("rawtypes") - private ServiceRegistration eventSubscriberRegistration; + private ServiceRegistration eventSubscriberRegistration; public GenericEventTriggerHandler(Trigger module, BundleContext bundleContext) { super(module); diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupCommandTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupCommandTriggerHandler.java index 8fc92696a7..64b4540550 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupCommandTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupCommandTriggerHandler.java @@ -57,8 +57,8 @@ public class GroupCommandTriggerHandler extends BaseTriggerModuleHandler impleme public static final String MODULE_TYPE_ID = "core.GroupCommandTrigger"; - private static final String CFG_GROUPNAME = "groupName"; - private static final String CFG_COMMAND = "command"; + public static final String CFG_GROUPNAME = "groupName"; + public static final String CFG_COMMAND = "command"; private ServiceRegistration eventSubscriberRegistration; private @Nullable ItemRegistry itemRegistry; diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupStateTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupStateTriggerHandler.java index 548b288a21..0ee5d5d706 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupStateTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupStateTriggerHandler.java @@ -48,6 +48,14 @@ import org.slf4j.LoggerFactory; */ @NonNullByDefault public class GroupStateTriggerHandler extends BaseTriggerModuleHandler implements EventSubscriber, EventFilter { + + public static final String UPDATE_MODULE_TYPE_ID = "core.GroupStateUpdateTrigger"; + public static final String CHANGE_MODULE_TYPE_ID = "core.GroupStateChangeTrigger"; + + public static final String CFG_GROUPNAME = "groupName"; + public static final String CFG_STATE = "state"; + public static final String CFG_PREVIOUS_STATE = "previousState"; + private final Logger logger = LoggerFactory.getLogger(GroupStateTriggerHandler.class); private final String groupName; @@ -57,13 +65,6 @@ public class GroupStateTriggerHandler extends BaseTriggerModuleHandler implement private final BundleContext bundleContext; private @Nullable ItemRegistry itemRegistry; - public static final String UPDATE_MODULE_TYPE_ID = "core.GroupStateUpdateTrigger"; - public static final String CHANGE_MODULE_TYPE_ID = "core.GroupStateChangeTrigger"; - - private static final String CFG_GROUPNAME = "groupName"; - private static final String CFG_STATE = "state"; - private static final String CFG_PREVIOUS_STATE = "previousState"; - private ServiceRegistration eventSubscriberRegistration; public GroupStateTriggerHandler(Trigger module, BundleContext bundleContext) { diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemCommandActionHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemCommandActionHandler.java index 39fd246099..e117679def 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemCommandActionHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemCommandActionHandler.java @@ -36,11 +36,11 @@ import org.slf4j.LoggerFactory; */ public class ItemCommandActionHandler extends BaseActionModuleHandler { - private final Logger logger = LoggerFactory.getLogger(ItemCommandActionHandler.class); - public static final String ITEM_COMMAND_ACTION = "core.ItemCommandAction"; - private static final String ITEM_NAME = "itemName"; - private static final String COMMAND = "command"; + public static final String ITEM_NAME = "itemName"; + public static final String COMMAND = "command"; + + private final Logger logger = LoggerFactory.getLogger(ItemCommandActionHandler.class); private ItemRegistry itemRegistry; private EventPublisher eventPublisher; diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemCommandTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemCommandTriggerHandler.java index 43198875ec..606abec895 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemCommandTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemCommandTriggerHandler.java @@ -41,6 +41,11 @@ import org.slf4j.LoggerFactory; */ public class ItemCommandTriggerHandler extends BaseTriggerModuleHandler implements EventSubscriber, EventFilter { + public static final String MODULE_TYPE_ID = "core.ItemCommandTrigger"; + + public static final String CFG_ITEMNAME = "itemName"; + public static final String CFG_COMMAND = "command"; + private final Logger logger = LoggerFactory.getLogger(ItemCommandTriggerHandler.class); private final String itemName; @@ -50,13 +55,7 @@ public class ItemCommandTriggerHandler extends BaseTriggerModuleHandler implemen private final Set types; private final BundleContext bundleContext; - public static final String MODULE_TYPE_ID = "core.ItemCommandTrigger"; - - private static final String CFG_ITEMNAME = "itemName"; - private static final String CFG_COMMAND = "command"; - - @SuppressWarnings("rawtypes") - private ServiceRegistration eventSubscriberRegistration; + private ServiceRegistration eventSubscriberRegistration; public ItemCommandTriggerHandler(Trigger module, BundleContext bundleContext) { super(module); diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateConditionHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateConditionHandler.java index a1644043c5..99ff9953c8 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateConditionHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateConditionHandler.java @@ -33,12 +33,6 @@ import org.slf4j.LoggerFactory; */ public class ItemStateConditionHandler extends BaseConditionModuleHandler { - private final Logger logger = LoggerFactory.getLogger(ItemStateConditionHandler.class); - - public static final String ITEM_STATE_CONDITION = "core.ItemStateCondition"; - - private ItemRegistry itemRegistry; - /** * Constants for Config-Parameters corresponding to Definition in * ItemModuleTypeDefinition.json @@ -47,6 +41,12 @@ public class ItemStateConditionHandler extends BaseConditionModuleHandler { private static final String OPERATOR = "operator"; private static final String STATE = "state"; + private final Logger logger = LoggerFactory.getLogger(ItemStateConditionHandler.class); + + public static final String ITEM_STATE_CONDITION = "core.ItemStateCondition"; + + private ItemRegistry itemRegistry; + public ItemStateConditionHandler(Condition condition) { super(condition); } diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateTriggerHandler.java index 9ed70791d5..57d9da0a53 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateTriggerHandler.java @@ -44,6 +44,14 @@ import org.slf4j.LoggerFactory; * @author Simon Merschjohann - Initial contribution */ public class ItemStateTriggerHandler extends BaseTriggerModuleHandler implements EventSubscriber, EventFilter { + + public static final String UPDATE_MODULE_TYPE_ID = "core.ItemStateUpdateTrigger"; + public static final String CHANGE_MODULE_TYPE_ID = "core.ItemStateChangeTrigger"; + + public static final String CFG_ITEMNAME = "itemName"; + public static final String CFG_STATE = "state"; + public static final String CFG_PREVIOUS_STATE = "previousState"; + private final Logger logger = LoggerFactory.getLogger(ItemStateTriggerHandler.class); private final String itemName; @@ -52,15 +60,7 @@ public class ItemStateTriggerHandler extends BaseTriggerModuleHandler implements private Set types; private final BundleContext bundleContext; - public static final String UPDATE_MODULE_TYPE_ID = "core.ItemStateUpdateTrigger"; - public static final String CHANGE_MODULE_TYPE_ID = "core.ItemStateChangeTrigger"; - - private static final String CFG_ITEMNAME = "itemName"; - private static final String CFG_STATE = "state"; - private static final String CFG_PREVIOUS_STATE = "previousState"; - - @SuppressWarnings("rawtypes") - private ServiceRegistration eventSubscriberRegistration; + private ServiceRegistration eventSubscriberRegistration; public ItemStateTriggerHandler(Trigger module, BundleContext bundleContext) { super(module); diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/SystemTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/SystemTriggerHandler.java index 7149d74598..5cbf289e23 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/SystemTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/SystemTriggerHandler.java @@ -43,11 +43,11 @@ import org.slf4j.LoggerFactory; @NonNullByDefault public class SystemTriggerHandler extends BaseTriggerModuleHandler implements EventSubscriber, EventFilter { - private final Logger logger = LoggerFactory.getLogger(SystemTriggerHandler.class); - public static final String STARTLEVEL_MODULE_TYPE_ID = "core.SystemStartlevelTrigger"; - private static final String CFG_STARTLEVEL = "startlevel"; - private static final String OUT_STARTLEVEL = "startlevel"; + public static final String CFG_STARTLEVEL = "startlevel"; + public static final String OUT_STARTLEVEL = "startlevel"; + + private final Logger logger = LoggerFactory.getLogger(SystemTriggerHandler.class); private final Integer startlevel; private final Set types; diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ThingStatusTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ThingStatusTriggerHandler.java index 759f63f6c5..ff105234c4 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ThingStatusTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ThingStatusTriggerHandler.java @@ -45,6 +45,18 @@ import org.slf4j.LoggerFactory; @NonNullByDefault public class ThingStatusTriggerHandler extends BaseTriggerModuleHandler implements EventSubscriber, EventFilter { + public static final String UPDATE_MODULE_TYPE_ID = "core.ThingStatusUpdateTrigger"; + public static final String CHANGE_MODULE_TYPE_ID = "core.ThingStatusChangeTrigger"; + + public static final String CFG_THING_UID = "thingUID"; + public static final String CFG_STATUS = "status"; + public static final String CFG_PREVIOUS_STATUS = "previousStatus"; + + public static final String OUT_STATUS = "status"; + public static final String OUT_NEW_STATUS = "newStatus"; + public static final String OUT_OLD_STATUS = "oldStatus"; + public static final String OUT_EVENT = "event"; + private final Logger logger = LoggerFactory.getLogger(ThingStatusTriggerHandler.class); private final String thingUID; @@ -53,18 +65,6 @@ public class ThingStatusTriggerHandler extends BaseTriggerModuleHandler implemen private final Set types; private final BundleContext bundleContext; - public static final String UPDATE_MODULE_TYPE_ID = "core.ThingStatusUpdateTrigger"; - public static final String CHANGE_MODULE_TYPE_ID = "core.ThingStatusChangeTrigger"; - - private static final String CFG_THING_UID = "thingUID"; - private static final String CFG_STATUS = "status"; - private static final String CFG_PREVIOUS_STATUS = "previousStatus"; - - private static final String OUT_STATUS = "status"; - private static final String OUT_NEW_STATUS = "newStatus"; - private static final String OUT_OLD_STATUS = "oldStatus"; - private static final String OUT_EVENT = "event"; - private final ServiceRegistration eventSubscriberRegistration; public ThingStatusTriggerHandler(Trigger module, BundleContext bundleContext) { diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/TimeOfDayConditionHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/TimeOfDayConditionHandler.java index 23096a0bb9..d803d4cbb0 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/TimeOfDayConditionHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/TimeOfDayConditionHandler.java @@ -29,8 +29,6 @@ import org.slf4j.LoggerFactory; */ public class TimeOfDayConditionHandler extends BaseConditionModuleHandler { - private final Logger logger = LoggerFactory.getLogger(TimeOfDayConditionHandler.class); - public static final String MODULE_TYPE_ID = "core.TimeOfDayCondition"; /** @@ -39,6 +37,8 @@ public class TimeOfDayConditionHandler extends BaseConditionModuleHandler { */ private static final String START_TIME = "startTime"; private static final String END_TIME = "endTime"; + private final Logger logger = LoggerFactory.getLogger(TimeOfDayConditionHandler.class); + /** * The start time of the user configured time span. */ diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/TimeOfDayTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/TimeOfDayTriggerHandler.java index 98139da779..e77bc54c21 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/TimeOfDayTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/TimeOfDayTriggerHandler.java @@ -37,7 +37,7 @@ public class TimeOfDayTriggerHandler extends BaseTriggerModuleHandler implements public static final String MODULE_TYPE_ID = "timer.TimeOfDayTrigger"; public static final String MODULE_CONTEXT_NAME = "MODULE"; - private static final String CFG_TIME = "time"; + public static final String CFG_TIME = "time"; private final CronScheduler scheduler; private final String expression;