diff --git a/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/EwonUtil.java b/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/EwonUtil.java index 74a2a400..7ac03cda 100644 --- a/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/EwonUtil.java +++ b/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/EwonUtil.java @@ -37,7 +37,7 @@ public class EwonUtil { private static final int defaultReadTimeout = 60000; /** Log handler */ - private static Logger logger = LoggerFactory.getLogger("Ewon.EwonUtil"); + private static final Logger logger = LoggerFactory.getLogger("Ewon.EwonUtil"); /** Trust manager used for HTTP connections. Note: Bypasses trust verification. */ private static final TrustManager[] BYPASS_TRUST_MGR = diff --git a/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/GatewayHook.java b/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/GatewayHook.java index 7d0523b0..895d7ac9 100644 --- a/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/GatewayHook.java +++ b/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/GatewayHook.java @@ -38,7 +38,7 @@ public class GatewayHook extends AbstractGatewayModuleHook { * Listener for changes in Ewon Connector settings. Invokes {@link this#restart()} to restart the * connector. */ - private RecordListenerAdapter settingsListener = + private final RecordListenerAdapter settingsListener = new RecordListenerAdapter() { public void recordUpdated(EwonConnectorSettings record) { logger.info("Settings have been updated. Restarting module."); diff --git a/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/SyncManager.java b/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/SyncManager.java index e3d5ac9d..d7018919 100644 --- a/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/SyncManager.java +++ b/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/SyncManager.java @@ -87,25 +87,25 @@ public class SyncManager { private static final String CONFIG_EWON_ALL_REALTIME_TAG_NAME = "_config/AllRealtime"; /** Hash set of registered Ewon Connector tags */ - private HashSet registeredTags = new HashSet<>(); + private final HashSet registeredTags = new HashSet<>(); /** Hash set of registered Ewon Connector Ewons */ - private HashSet registeredEwons = new HashSet<>(); + private final HashSet registeredEwons = new HashSet<>(); /** Hash set of Ewons to be updated in realtime */ - private HashSet realtimeEwons = new HashSet<>(); + private final HashSet realtimeEwons = new HashSet<>(); /** Current gateway context */ - GatewayContext gatewayContext; + final GatewayContext gatewayContext; /** Log handler */ - Logger logger = LoggerFactory.getLogger("Ewon.EwonSyncManager"); + final Logger logger = LoggerFactory.getLogger("Ewon.EwonSyncManager"); /** Current tag provider */ - ManagedTagProvider provider; + final ManagedTagProvider provider; /** Name of current tag provider */ - String providerName; + final String providerName; /** Current communication manager */ CommunicationManger comm; @@ -114,7 +114,7 @@ public class SyncManager { String tagHistoryStore; /** Cache of last synchronization information, key = ewonId, value = lastSynchroDate */ - Map lastSyncCache = new HashMap<>(); + final Map lastSyncCache = new HashMap<>(); /** Boolean if tag history is enabled */ boolean historyEnabled = false; diff --git a/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/comm/CommunicationManger.java b/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/comm/CommunicationManger.java index 008dadd0..d18dc7ba 100644 --- a/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/comm/CommunicationManger.java +++ b/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/comm/CommunicationManger.java @@ -13,7 +13,7 @@ /** Ewon Connector communication manager */ public class CommunicationManger { /** Communication manager logger */ - private Logger logger = LoggerFactory.getLogger("Ewon.CommManager"); + private final Logger logger = LoggerFactory.getLogger("Ewon.CommManager"); /** JSON string and object serialization library */ private final Gson gson = new Gson(); diff --git a/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/config/EwonConnectorSettings.java b/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/config/EwonConnectorSettings.java index e68128be..58c5a55b 100644 --- a/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/config/EwonConnectorSettings.java +++ b/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/config/EwonConnectorSettings.java @@ -18,7 +18,7 @@ */ public class EwonConnectorSettings extends PersistentRecord { /** Record meta information for Ewon Connector */ - public static RecordMeta META = + public static final RecordMeta META = new RecordMeta<>(EwonConnectorSettings.class, "ewonConnectorSettings"); /** Ewon Connector identifier */ diff --git a/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/data/EwonsData.java b/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/data/EwonsData.java index 2b0f4b03..c9354218 100644 --- a/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/data/EwonsData.java +++ b/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/data/EwonsData.java @@ -9,7 +9,7 @@ public class EwonsData extends DMResult { boolean moreDataAvailable = false; /** Transaction identifier */ - Long transactionId = 0L; + final Long transactionId = 0L; /** * Get array of every Ewon's data diff --git a/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/data/TMResult.java b/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/data/TMResult.java index 9f3ca501..18dc01ef 100644 --- a/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/data/TMResult.java +++ b/eWonConnector-gateway/src/main/java/com/hms_networks/americas/sc/ignition/data/TMResult.java @@ -8,7 +8,7 @@ /** Class representation of a result from Talk2M */ public class TMResult { /** Hash map of tag values in result */ - HashMap TagValues; + final HashMap TagValues; /** Number of columns in Talk2M response */ static final int NUM_COLUMNS = 6;