From c605c9a0c0a1d44ef24c30c01e300e8c1877b33c Mon Sep 17 00:00:00 2001 From: "Alex J Hawk (HMS)" <51409174+alexjhawk@users.noreply.github.com> Date: Fri, 17 Nov 2023 11:47:06 -0500 Subject: [PATCH] WIP: DO NOT MERGE --- .idea/checkstyle-idea.xml | 16 + .idea/compiler.xml | 23 +- .idea/encodings.xml | 44 ++ alarms/pom.xml | 76 +++ .../sc/extensions/alarms/AlarmConstants.java | 0 .../sc/extensions/alarms/AlarmMonitor.java | 0 .../sc/extensions/alarms/package.html | 0 api/pom.xml | 76 +++ .../api/ApplicationControlApiListener.java | 0 config/pom.xml | 77 +++ .../sc/extensions/config/ConfigFile.java | 0 .../config/ConfigFileAccessManager.java | 0 .../config/ConfigFileUpdateStep.java | 180 +++---- .../extensions/config/ConfigFileUpdater.java | 356 ++++++------ .../extensions/config/ConfigFileVersion.java | 410 +++++++------- .../exceptions/ConfigFileException.java | 0 .../exceptions/ConfigFileParseException.java | 0 .../exceptions/ConfigFileReadException.java | 0 .../exceptions/ConfigFileWriteException.java | 0 .../sc/extensions/config/package.html | 0 connectors/pom.xml | 104 ++++ .../framework/AbstractConnectorConfig.java | 0 .../framework/AbstractConnectorMain.java | 0 .../AbstractConnectorMainConstants.java | 0 .../framework/AbstractConnectorMainUtils.java | 0 .../connectors/framework/package.html | 0 datapoint/pom.xml | 70 +++ .../sc/extensions/datapoint/DataPoint.java | 12 + .../datapoint/DataPointBoolean.java | 0 .../extensions/datapoint/DataPointDword.java | 0 .../extensions/datapoint/DataPointFloat.java | 0 .../datapoint/DataPointInteger.java | 0 .../DataPointIntegerMappedString.java | 0 .../extensions/datapoint/DataPointString.java | 0 .../sc/extensions/datapoint/DataQuality.java | 0 .../sc/extensions/datapoint/DataType.java | 0 .../sc/extensions/datapoint/package.html | 0 ebd/pom.xml | 70 +++ .../sc/extensions/ebd/EbdConstants.java | 16 + .../extensions/ebd}/EbdTimeoutException.java | 2 +- .../sc/extensions/ebd/EbdUtility.java | 46 ++ .../americas/sc/extensions/ebd/package.html | 8 + eventfile/pom.xml | 84 +++ .../sc/extensions/eventfile/EventFile.java | 11 +- .../eventfile/EventFileConstants.java | 0 .../sc/extensions/eventfile/package.html | 0 fileutils/pom.xml | 59 ++ .../fileutils/FileAccessManager.java | 0 .../extensions/fileutils/FileConstants.java | 0 .../sc/extensions/fileutils/FileManager.java | 0 .../sc/extensions/fileutils/package.html | 0 flexy.properties | 3 - historicaldata/pom.xml | 111 ++++ .../historicaldata/CircularizedFileCheck.java | 1 + .../CircularizedFileException.java | 0 .../CorruptedTimeTrackerException.java | 0 .../DiagnosticTagConfigurationException.java | 0 .../DiagnosticTagUpdateException.java | 0 .../HistoricalDataConstants.java | 6 - .../historicaldata/HistoricalDataManager.java | 38 +- ...storicalDataQueueDiagnosticTagManager.java | 0 .../HistoricalDataQueueManager.java | 1 + .../historicaldata/RapidCatchUp.java | 4 +- .../historicaldata/RapidCatchUpTracker.java | 0 .../TimeTrackerUnrecoverableException.java | 0 .../sc/extensions/historicaldata/package.html | 0 json/pom.xml | 70 +++ .../sc/extensions/json/JSONArray.java | 0 .../sc/extensions/json/JSONException.java | 0 .../sc/extensions/json/JSONObject.java | 0 .../sc/extensions/json/JSONString.java | 0 .../sc/extensions/json/JSONStringer.java | 0 .../sc/extensions/json/JSONTokener.java | 0 .../sc/extensions/json/JSONWriter.java | 0 .../sc/extensions/json/StringWriter.java | 0 .../americas/sc/extensions/json/package.html | 0 localdatafiles/pom.xml | 97 ++++ .../LocalDataFileConstants.java | 0 .../localdatafiles/LocalDataFileManager.java | 0 .../sc/extensions/localdatafiles/package.html | 0 localization/pom.xml | 59 ++ .../localization/LocalizationManager.java | 0 .../sc/extensions/localization/package.html | 0 .../localization/DateTimeStrings.properties | 0 .../DateTimeStrings_en.properties | 0 .../DateTimeStrings_es.properties | 0 logging/pom.xml | 59 ++ .../sc/extensions/logging/LogQueue.java | 0 .../sc/extensions/logging/Logger.java | 0 .../sc/extensions/logging/SocketLogger.java | 0 .../sc/extensions/logging/package.html | 0 mqtt/pom.xml | 77 +++ .../mqtt/ConstrainedMqttManager.java | 0 .../sc/extensions/mqtt/MqttConstants.java | 0 .../sc/extensions/mqtt/MqttException.java | 0 .../sc/extensions/mqtt/MqttManager.java | 0 .../sc/extensions/mqtt/MqttStatusCode.java | 0 .../americas/sc/extensions/mqtt/package.html | 0 pom.xml | 435 ++++++--------- realtimedata/pom.xml | 84 +++ .../RealTimeDataQueueManager.java | 0 .../RealTimeTagDataPointManager.java | 0 .../sc/extensions/realtimedata/package.html | 0 retry/pom.xml | 59 ++ .../extensions/retry/AutomaticRetryCode.java | 0 .../retry/AutomaticRetryCodeExponential.java | 0 .../retry/AutomaticRetryCodeLinear.java | 0 .../retry/AutomaticRetryResult.java | 0 .../extensions/retry/AutomaticRetryState.java | 0 .../americas/sc/extensions/retry/package.html | 0 security/pom.xml | 70 +++ .../sc/extensions/security/HashUtilities.java | 0 .../security/SCWonkaSecurityProvider.java | 0 .../security/SecurityProviderUtilities.java | 0 .../sc/extensions/security/package.html | 0 src/assembly/sc-project.xml | 30 -- src/test/java/LibraryTest.java | 22 - string/pom.xml | 59 ++ .../string/PreAllocatedStringBuilder.java | 0 .../string/QuoteSafeStringTokenizer.java | 0 .../sc/extensions/string/StringUtils.java | 0 .../sc/extensions/string/package.html | 0 system/pom.xml | 112 ++++ .../system/application/SCAppArgsParser.java | 0 .../system/application/SCAppConstants.java | 44 +- .../system/application/SCAppManagement.java | 0 .../application/SCAppRebootWatchdog.java | 508 +++++++++--------- .../system/application/package.html | 0 .../system/http/SCHttpAuthException.java | 0 .../http/SCHttpConnectionException.java | 0 .../system/http/SCHttpEwonException.java | 0 .../system/http/SCHttpUnknownException.java | 0 .../extensions/system/http/SCHttpUtility.java | 0 .../sc/extensions/system/http/package.html | 0 .../requests/SCHttpDeleteRequestInfo.java | 0 .../http/requests/SCHttpGetRequestInfo.java | 0 .../http/requests/SCHttpHeadRequestInfo.java | 0 .../requests/SCHttpOptionsRequestInfo.java | 0 .../http/requests/SCHttpPatchRequestInfo.java | 0 .../http/requests/SCHttpPostRequestInfo.java | 0 .../http/requests/SCHttpPurgeRequestInfo.java | 0 .../http/requests/SCHttpPutRequestInfo.java | 0 .../http/requests/SCHttpRequestInfo.java | 0 .../system/http/requests/package.html | 0 .../extensions/system/info/SCSystemInfo.java | 0 .../sc/extensions/system/info/package.html | 0 .../sc/extensions/system/package.html | 0 .../sc/extensions/system/tags/SCTagUtils.java | 0 .../sc/extensions/system/tags/package.html | 0 .../system/threading/SCCountdownLatch.java | 0 .../extensions/system/threading/package.html | 0 .../time/LocalTimeOffsetCalculator.java | 0 .../sc/extensions/system/time/SCTimeSpan.java | 0 .../sc/extensions/system/time/SCTimeUnit.java | 0 .../extensions/system/time/SCTimeUtils.java | 17 +- .../system/time/TimeLibConstants.java | 0 .../sc/extensions/system/time/package.html | 0 taginfo/pom.xml | 91 ++++ .../sc/extensions/taginfo/TagConstants.java | 0 .../sc/extensions/taginfo/TagGroup.java | 0 .../sc/extensions/taginfo/TagInfo.java | 0 .../taginfo/TagInfoBufferException.java | 0 .../taginfo/TagInfoEnumeratedIntToString.java | 0 .../sc/extensions/taginfo/TagInfoManager.java | 0 .../sc/extensions/taginfo/TagType.java | 0 .../sc/extensions/taginfo/package.html | 0 .../sc/extensions/taginfo/TagInfoTest.java | 4 +- tagupdateservice/pom.xml | 84 +++ .../tagupdateservice/TagUpdateHandler.java | 0 .../tagupdateservice/TagUpdateResult.java | 0 .../extensions/tagupdateservice/package.html | 0 util/pom.xml | 59 ++ .../americas/sc/extensions/util/Base64.java | 0 .../extensions/util/RawNumberValueUtils.java | 0 .../americas/sc/extensions/util/package.html | 0 .../util/RawNumberValueUtilsTest.java | 2 +- 176 files changed, 2806 insertions(+), 1140 deletions(-) create mode 100644 .idea/checkstyle-idea.xml create mode 100644 alarms/pom.xml rename {src => alarms/src}/main/java/com/hms_networks/americas/sc/extensions/alarms/AlarmConstants.java (100%) rename {src => alarms/src}/main/java/com/hms_networks/americas/sc/extensions/alarms/AlarmMonitor.java (100%) rename {src => alarms/src}/main/java/com/hms_networks/americas/sc/extensions/alarms/package.html (100%) create mode 100644 api/pom.xml rename {src => api/src}/main/java/com/hms_networks/americas/sc/extensions/api/ApplicationControlApiListener.java (100%) create mode 100644 config/pom.xml rename {src => config/src}/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFile.java (100%) rename {src => config/src}/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileAccessManager.java (100%) rename {src => config/src}/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdateStep.java (96%) rename {src => config/src}/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdater.java (96%) rename {src => config/src}/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileVersion.java (96%) rename {src => config/src}/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileException.java (100%) rename {src => config/src}/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileParseException.java (100%) rename {src => config/src}/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileReadException.java (100%) rename {src => config/src}/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileWriteException.java (100%) rename {src => config/src}/main/java/com/hms_networks/americas/sc/extensions/config/package.html (100%) create mode 100644 connectors/pom.xml rename {src => connectors/src}/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorConfig.java (100%) rename {src => connectors/src}/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorMain.java (100%) rename {src => connectors/src}/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorMainConstants.java (100%) rename {src => connectors/src}/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorMainUtils.java (100%) rename {src => connectors/src}/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/package.html (100%) create mode 100644 datapoint/pom.xml rename {src => datapoint/src}/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPoint.java (87%) rename {src => datapoint/src}/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointBoolean.java (100%) rename {src => datapoint/src}/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointDword.java (100%) rename {src => datapoint/src}/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointFloat.java (100%) rename {src => datapoint/src}/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointInteger.java (100%) rename {src => datapoint/src}/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointIntegerMappedString.java (100%) rename {src => datapoint/src}/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointString.java (100%) rename {src => datapoint/src}/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataQuality.java (100%) rename {src => datapoint/src}/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataType.java (100%) rename {src => datapoint/src}/main/java/com/hms_networks/americas/sc/extensions/datapoint/package.html (100%) create mode 100644 ebd/pom.xml create mode 100644 ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd/EbdConstants.java rename {src/main/java/com/hms_networks/americas/sc/extensions/historicaldata => ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd}/EbdTimeoutException.java (87%) create mode 100644 ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd/EbdUtility.java create mode 100644 ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd/package.html create mode 100644 eventfile/pom.xml rename {src => eventfile/src}/main/java/com/hms_networks/americas/sc/extensions/eventfile/EventFile.java (94%) rename {src => eventfile/src}/main/java/com/hms_networks/americas/sc/extensions/eventfile/EventFileConstants.java (100%) rename {src => eventfile/src}/main/java/com/hms_networks/americas/sc/extensions/eventfile/package.html (100%) create mode 100644 fileutils/pom.xml rename {src => fileutils/src}/main/java/com/hms_networks/americas/sc/extensions/fileutils/FileAccessManager.java (100%) rename {src => fileutils/src}/main/java/com/hms_networks/americas/sc/extensions/fileutils/FileConstants.java (100%) rename {src => fileutils/src}/main/java/com/hms_networks/americas/sc/extensions/fileutils/FileManager.java (100%) rename {src => fileutils/src}/main/java/com/hms_networks/americas/sc/extensions/fileutils/package.html (100%) delete mode 100644 flexy.properties create mode 100644 historicaldata/pom.xml rename {src => historicaldata/src}/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CircularizedFileCheck.java (94%) rename {src => historicaldata/src}/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CircularizedFileException.java (100%) rename {src => historicaldata/src}/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CorruptedTimeTrackerException.java (100%) rename {src => historicaldata/src}/main/java/com/hms_networks/americas/sc/extensions/historicaldata/DiagnosticTagConfigurationException.java (100%) rename {src => historicaldata/src}/main/java/com/hms_networks/americas/sc/extensions/historicaldata/DiagnosticTagUpdateException.java (100%) rename {src => historicaldata/src}/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataConstants.java (95%) rename {src => historicaldata/src}/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataManager.java (92%) rename {src => historicaldata/src}/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataQueueDiagnosticTagManager.java (100%) rename {src => historicaldata/src}/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataQueueManager.java (99%) rename {src => historicaldata/src}/main/java/com/hms_networks/americas/sc/extensions/historicaldata/RapidCatchUp.java (98%) rename {src => historicaldata/src}/main/java/com/hms_networks/americas/sc/extensions/historicaldata/RapidCatchUpTracker.java (100%) rename {src => historicaldata/src}/main/java/com/hms_networks/americas/sc/extensions/historicaldata/TimeTrackerUnrecoverableException.java (100%) rename {src => historicaldata/src}/main/java/com/hms_networks/americas/sc/extensions/historicaldata/package.html (100%) create mode 100644 json/pom.xml rename {src => json/src}/main/java/com/hms_networks/americas/sc/extensions/json/JSONArray.java (100%) rename {src => json/src}/main/java/com/hms_networks/americas/sc/extensions/json/JSONException.java (100%) rename {src => json/src}/main/java/com/hms_networks/americas/sc/extensions/json/JSONObject.java (100%) rename {src => json/src}/main/java/com/hms_networks/americas/sc/extensions/json/JSONString.java (100%) rename {src => json/src}/main/java/com/hms_networks/americas/sc/extensions/json/JSONStringer.java (100%) rename {src => json/src}/main/java/com/hms_networks/americas/sc/extensions/json/JSONTokener.java (100%) rename {src => json/src}/main/java/com/hms_networks/americas/sc/extensions/json/JSONWriter.java (100%) rename {src => json/src}/main/java/com/hms_networks/americas/sc/extensions/json/StringWriter.java (100%) rename {src => json/src}/main/java/com/hms_networks/americas/sc/extensions/json/package.html (100%) create mode 100644 localdatafiles/pom.xml rename {src => localdatafiles/src}/main/java/com/hms_networks/americas/sc/extensions/localdatafiles/LocalDataFileConstants.java (100%) rename {src => localdatafiles/src}/main/java/com/hms_networks/americas/sc/extensions/localdatafiles/LocalDataFileManager.java (100%) rename {src => localdatafiles/src}/main/java/com/hms_networks/americas/sc/extensions/localdatafiles/package.html (100%) create mode 100644 localization/pom.xml rename {src => localization/src}/main/java/com/hms_networks/americas/sc/extensions/localization/LocalizationManager.java (100%) rename {src => localization/src}/main/java/com/hms_networks/americas/sc/extensions/localization/package.html (100%) rename {src => localization/src}/main/resources/com/hms_networks/americas/sc/extensions/localization/DateTimeStrings.properties (100%) rename {src => localization/src}/main/resources/com/hms_networks/americas/sc/extensions/localization/DateTimeStrings_en.properties (100%) rename {src => localization/src}/main/resources/com/hms_networks/americas/sc/extensions/localization/DateTimeStrings_es.properties (100%) create mode 100644 logging/pom.xml rename {src => logging/src}/main/java/com/hms_networks/americas/sc/extensions/logging/LogQueue.java (100%) rename {src => logging/src}/main/java/com/hms_networks/americas/sc/extensions/logging/Logger.java (100%) rename {src => logging/src}/main/java/com/hms_networks/americas/sc/extensions/logging/SocketLogger.java (100%) rename {src => logging/src}/main/java/com/hms_networks/americas/sc/extensions/logging/package.html (100%) create mode 100644 mqtt/pom.xml rename {src => mqtt/src}/main/java/com/hms_networks/americas/sc/extensions/mqtt/ConstrainedMqttManager.java (100%) rename {src => mqtt/src}/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttConstants.java (100%) rename {src => mqtt/src}/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttException.java (100%) rename {src => mqtt/src}/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttManager.java (100%) rename {src => mqtt/src}/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttStatusCode.java (100%) rename {src => mqtt/src}/main/java/com/hms_networks/americas/sc/extensions/mqtt/package.html (100%) create mode 100644 realtimedata/pom.xml rename {src => realtimedata/src}/main/java/com/hms_networks/americas/sc/extensions/realtimedata/RealTimeDataQueueManager.java (100%) rename {src => realtimedata/src}/main/java/com/hms_networks/americas/sc/extensions/realtimedata/RealTimeTagDataPointManager.java (100%) rename {src => realtimedata/src}/main/java/com/hms_networks/americas/sc/extensions/realtimedata/package.html (100%) create mode 100644 retry/pom.xml rename {src => retry/src}/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryCode.java (100%) rename {src => retry/src}/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryCodeExponential.java (100%) rename {src => retry/src}/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryCodeLinear.java (100%) rename {src => retry/src}/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryResult.java (100%) rename {src => retry/src}/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryState.java (100%) rename {src => retry/src}/main/java/com/hms_networks/americas/sc/extensions/retry/package.html (100%) create mode 100644 security/pom.xml rename {src => security/src}/main/java/com/hms_networks/americas/sc/extensions/security/HashUtilities.java (100%) rename {src => security/src}/main/java/com/hms_networks/americas/sc/extensions/security/SCWonkaSecurityProvider.java (100%) rename {src => security/src}/main/java/com/hms_networks/americas/sc/extensions/security/SecurityProviderUtilities.java (100%) rename {src => security/src}/main/java/com/hms_networks/americas/sc/extensions/security/package.html (100%) delete mode 100644 src/assembly/sc-project.xml delete mode 100644 src/test/java/LibraryTest.java create mode 100644 string/pom.xml rename {src => string/src}/main/java/com/hms_networks/americas/sc/extensions/string/PreAllocatedStringBuilder.java (100%) rename {src => string/src}/main/java/com/hms_networks/americas/sc/extensions/string/QuoteSafeStringTokenizer.java (100%) rename {src => string/src}/main/java/com/hms_networks/americas/sc/extensions/string/StringUtils.java (100%) rename {src => string/src}/main/java/com/hms_networks/americas/sc/extensions/string/package.html (100%) create mode 100644 system/pom.xml rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppArgsParser.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppConstants.java (96%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppManagement.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppRebootWatchdog.java (97%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/application/package.html (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpAuthException.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpConnectionException.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpEwonException.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpUnknownException.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpUtility.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/package.html (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpDeleteRequestInfo.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpGetRequestInfo.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpHeadRequestInfo.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpOptionsRequestInfo.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPatchRequestInfo.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPostRequestInfo.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPurgeRequestInfo.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPutRequestInfo.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpRequestInfo.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/package.html (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/info/SCSystemInfo.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/info/package.html (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/package.html (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/tags/SCTagUtils.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/tags/package.html (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/threading/SCCountdownLatch.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/threading/package.html (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/time/LocalTimeOffsetCalculator.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeSpan.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeUnit.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeUtils.java (93%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/time/TimeLibConstants.java (100%) rename {src => system/src}/main/java/com/hms_networks/americas/sc/extensions/system/time/package.html (100%) create mode 100644 taginfo/pom.xml rename {src => taginfo/src}/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagConstants.java (100%) rename {src => taginfo/src}/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagGroup.java (100%) rename {src => taginfo/src}/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfo.java (100%) rename {src => taginfo/src}/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoBufferException.java (100%) rename {src => taginfo/src}/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoEnumeratedIntToString.java (100%) rename {src => taginfo/src}/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoManager.java (100%) rename {src => taginfo/src}/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagType.java (100%) rename {src => taginfo/src}/main/java/com/hms_networks/americas/sc/extensions/taginfo/package.html (100%) rename {src => taginfo/src}/test/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoTest.java (97%) create mode 100644 tagupdateservice/pom.xml rename {src => tagupdateservice/src}/main/java/com/hms_networks/americas/sc/extensions/tagupdateservice/TagUpdateHandler.java (100%) rename {src => tagupdateservice/src}/main/java/com/hms_networks/americas/sc/extensions/tagupdateservice/TagUpdateResult.java (100%) rename {src => tagupdateservice/src}/main/java/com/hms_networks/americas/sc/extensions/tagupdateservice/package.html (100%) create mode 100644 util/pom.xml rename {src => util/src}/main/java/com/hms_networks/americas/sc/extensions/util/Base64.java (100%) rename {src => util/src}/main/java/com/hms_networks/americas/sc/extensions/util/RawNumberValueUtils.java (100%) rename {src => util/src}/main/java/com/hms_networks/americas/sc/extensions/util/package.html (100%) rename {src => util/src}/test/java/com/hms_networks/americas/sc/extensions/util/RawNumberValueUtilsTest.java (99%) diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 00000000..b7c47dd7 --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + 10.12.4 + JavaOnly + true + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 342285f5..0d904220 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -6,7 +6,28 @@ - + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/encodings.xml b/.idea/encodings.xml index aa00ffab..3a16ecc4 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -1,7 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/alarms/pom.xml b/alarms/pom.xml new file mode 100644 index 00000000..58300ba5 --- /dev/null +++ b/alarms/pom.xml @@ -0,0 +1,76 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + alarms + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + com.hms_networks.americas.sc + system + 1.15.8 + + + + + com.hms_networks.americas.sc + taginfo + 1.15.8 + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/alarms/AlarmConstants.java b/alarms/src/main/java/com/hms_networks/americas/sc/extensions/alarms/AlarmConstants.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/alarms/AlarmConstants.java rename to alarms/src/main/java/com/hms_networks/americas/sc/extensions/alarms/AlarmConstants.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/alarms/AlarmMonitor.java b/alarms/src/main/java/com/hms_networks/americas/sc/extensions/alarms/AlarmMonitor.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/alarms/AlarmMonitor.java rename to alarms/src/main/java/com/hms_networks/americas/sc/extensions/alarms/AlarmMonitor.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/alarms/package.html b/alarms/src/main/java/com/hms_networks/americas/sc/extensions/alarms/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/alarms/package.html rename to alarms/src/main/java/com/hms_networks/americas/sc/extensions/alarms/package.html diff --git a/api/pom.xml b/api/pom.xml new file mode 100644 index 00000000..8d69f3ab --- /dev/null +++ b/api/pom.xml @@ -0,0 +1,76 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + api + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + com.hms_networks.americas.sc + logging + 1.15.8 + + + + + com.hms_networks.americas.sc + string + 1.15.8 + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/api/ApplicationControlApiListener.java b/api/src/main/java/com/hms_networks/americas/sc/extensions/api/ApplicationControlApiListener.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/api/ApplicationControlApiListener.java rename to api/src/main/java/com/hms_networks/americas/sc/extensions/api/ApplicationControlApiListener.java diff --git a/config/pom.xml b/config/pom.xml new file mode 100644 index 00000000..228478b7 --- /dev/null +++ b/config/pom.xml @@ -0,0 +1,77 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + config + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + + com.hms_networks.americas.sc + fileutils + 1.15.8 + + + + + com.hms_networks.americas.sc + json + 1.15.8 + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFile.java b/config/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFile.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFile.java rename to config/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFile.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileAccessManager.java b/config/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileAccessManager.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileAccessManager.java rename to config/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileAccessManager.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdateStep.java b/config/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdateStep.java similarity index 96% rename from src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdateStep.java rename to config/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdateStep.java index 5875e7e3..98ee70d8 100644 --- a/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdateStep.java +++ b/config/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdateStep.java @@ -1,90 +1,90 @@ -package com.hms_networks.americas.sc.extensions.config; - -import com.hms_networks.americas.sc.extensions.json.JSONObject; - -/** - * Abstract class for representing a step in the process of updating a configuration file. - * - * @since 1.15.4 - * @author HMS Networks, MU Americas Solution Center - */ -public abstract class ConfigFileUpdateStep implements Comparable { - - /** - * Version of the configuration file that this step will update the configuration file to. - * - * @since 1.15.4 - */ - private ConfigFileVersion stepVersion; - - /** - * Minimum version of the configuration file that this step is compatible with. - * - * @since 1.15.4 - */ - private ConfigFileVersion minCompatibleVersion; - - /** - * Constructor for {@link ConfigFileUpdateStep}. - * - * @param stepVersion version of the configuration file that this step will update the - * configuration file to - * @param minCompatibleVersion minimum version of the configuration file that this step is - * compatible with - * @since 1.15.4 - */ - public ConfigFileUpdateStep( - ConfigFileVersion stepVersion, ConfigFileVersion minCompatibleVersion) { - this.stepVersion = stepVersion; - this.minCompatibleVersion = minCompatibleVersion; - } - - /** - * Updates the configuration file to the version specified by this step. - * - * @param config configuration file - * @return true if successful, false otherwise - * @since 1.15.4 - */ - public abstract boolean updateConfig(JSONObject config); - - /** - * Checks if the specified {@link ConfigFileVersion} is compatible with this step. - * - * @param version version to check - * @return true if compatible, false otherwise - * @since 1.15.4 - */ - public boolean isCompatibleWithVersion(ConfigFileVersion version) { - return version.compareTo(minCompatibleVersion) >= 0 && version.compareTo(stepVersion) < 0; - } - - /** - * Gets the {@link ConfigFileVersion} this step will update the configuration to. - * - * @return {@link ConfigFileVersion} this step will update the configuration to - * @since 1.15.4 - */ - public ConfigFileVersion getStepVersion() { - return stepVersion; - } - - /** - * Compare this {@link ConfigFileUpdateStep} version to another {@link ConfigFileUpdateStep} - * version. - * - * @param o the {@link ConfigFileUpdateStep} to compare to - * @return a negative integer, zero, or a positive integer as the specified version is greater - * than, equal to, or less than this version. - * @since 1.15.4 - */ - public int compareTo(Object o) throws IllegalArgumentException { - if (o instanceof ConfigFileUpdateStep) { - ConfigFileUpdateStep other = (ConfigFileUpdateStep) o; - return stepVersion.compareTo(other.stepVersion); - } else { - throw new IllegalArgumentException( - "Cannot compare ConfigFileUpdateStep to " + o.getClass().getName() + "."); - } - } -} +package com.hms_networks.americas.sc.extensions.config; + +import com.hms_networks.americas.sc.extensions.json.JSONObject; + +/** + * Abstract class for representing a step in the process of updating a configuration file. + * + * @since 1.15.4 + * @author HMS Networks, MU Americas Solution Center + */ +public abstract class ConfigFileUpdateStep implements Comparable { + + /** + * Version of the configuration file that this step will update the configuration file to. + * + * @since 1.15.4 + */ + private ConfigFileVersion stepVersion; + + /** + * Minimum version of the configuration file that this step is compatible with. + * + * @since 1.15.4 + */ + private ConfigFileVersion minCompatibleVersion; + + /** + * Constructor for {@link ConfigFileUpdateStep}. + * + * @param stepVersion version of the configuration file that this step will update the + * configuration file to + * @param minCompatibleVersion minimum version of the configuration file that this step is + * compatible with + * @since 1.15.4 + */ + public ConfigFileUpdateStep( + ConfigFileVersion stepVersion, ConfigFileVersion minCompatibleVersion) { + this.stepVersion = stepVersion; + this.minCompatibleVersion = minCompatibleVersion; + } + + /** + * Updates the configuration file to the version specified by this step. + * + * @param config configuration file + * @return true if successful, false otherwise + * @since 1.15.4 + */ + public abstract boolean updateConfig(JSONObject config); + + /** + * Checks if the specified {@link ConfigFileVersion} is compatible with this step. + * + * @param version version to check + * @return true if compatible, false otherwise + * @since 1.15.4 + */ + public boolean isCompatibleWithVersion(ConfigFileVersion version) { + return version.compareTo(minCompatibleVersion) >= 0 && version.compareTo(stepVersion) < 0; + } + + /** + * Gets the {@link ConfigFileVersion} this step will update the configuration to. + * + * @return {@link ConfigFileVersion} this step will update the configuration to + * @since 1.15.4 + */ + public ConfigFileVersion getStepVersion() { + return stepVersion; + } + + /** + * Compare this {@link ConfigFileUpdateStep} version to another {@link ConfigFileUpdateStep} + * version. + * + * @param o the {@link ConfigFileUpdateStep} to compare to + * @return a negative integer, zero, or a positive integer as the specified version is greater + * than, equal to, or less than this version. + * @since 1.15.4 + */ + public int compareTo(Object o) throws IllegalArgumentException { + if (o instanceof ConfigFileUpdateStep) { + ConfigFileUpdateStep other = (ConfigFileUpdateStep) o; + return stepVersion.compareTo(other.stepVersion); + } else { + throw new IllegalArgumentException( + "Cannot compare ConfigFileUpdateStep to " + o.getClass().getName() + "."); + } + } +} diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdater.java b/config/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdater.java similarity index 96% rename from src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdater.java rename to config/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdater.java index e81defab..fb8ce44b 100644 --- a/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdater.java +++ b/config/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdater.java @@ -1,178 +1,178 @@ -package com.hms_networks.americas.sc.extensions.config; - -import com.hms_networks.americas.sc.extensions.json.JSONException; -import com.hms_networks.americas.sc.extensions.json.JSONObject; -import com.hms_networks.americas.sc.extensions.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; - -/** - * Class for updating a configuration file. - * - * @since 1.15.4 - * @author HMS Networks, MU Americas Solution Center - */ -public class ConfigFileUpdater { - - /** - * Configuration file - * - * @since 1.15.4 - */ - private JSONObject config; - - /** - * List of steps to execute when updating the configuration file - * - * @since 1.15.4 - */ - private ArrayList steps; - - /** - * Application JSON key - * - * @since 1.15.4 - */ - private String applicationJsonKey; - - /** - * Configuration version JSON key - * - * @since 1.15.4 - */ - private String configVersionJsonKey; - - /** - * Default version string to use when no version is specified in the configuration file - * - * @since 1.15.4 - */ - static final String DEFAULT_VERSION_NOT_SPECIFIED = "0.0.0"; - - /** - * Constructor for {@link ConfigFileUpdater}. - * - * @param config configuration file - * @param applicationJsonKey application JSON key - * @param configVersionJsonKey configuration version JSON key - * @since 1.15.4 - */ - public ConfigFileUpdater( - JSONObject config, String applicationJsonKey, String configVersionJsonKey) { - this.config = config; - steps = new ArrayList(); - this.applicationJsonKey = applicationJsonKey; - this.configVersionJsonKey = configVersionJsonKey; - } - - /** - * Checks if the configuration file needs to be updated. - * - * @param version version to check against - * @return true if the configuration file needs to be updated, false otherwise - * @since 1.15.5 - */ - public boolean needsUpdate(ConfigFileVersion version) { - final int versionsEqual = 0; - - return version.compareTo(getConfigFileVersion()) > versionsEqual; - } - - /** - * Gets the configuration file. - * - * @return a {@link JSONObject} containing the configuration file - * @since 1.15.4 - */ - public JSONObject getConfig() { - return config; - } - - /** - * Gets the {@link ConfigFileVersion} of the configuration file. - * - * @return version of configuration file - * @since 1.15.4 - */ - private ConfigFileVersion getConfigFileVersion() { - String versionString; - try { - versionString = config.getJSONObject(applicationJsonKey).getString(configVersionJsonKey); - } catch (JSONException e) { - versionString = DEFAULT_VERSION_NOT_SPECIFIED; - } - return new ConfigFileVersion(versionString); - } - - /** - * Sets the {@link ConfigFileVersion} of the configuration file. - * - * @param version version to set - * @return true if successful, false otherwise - * @since 1.15.4 - */ - private boolean setConfigFileVersion(ConfigFileVersion version) { - boolean success = true; - - try { - config - .getJSONObject(applicationJsonKey) - .put(configVersionJsonKey, version.getVersionString()); - } catch (JSONException e) { - Logger.LOG_CRITICAL( - "Unable to set configuration file version to version: " + version.toString() + "!", e); - success = false; - } - - return success; - } - - /** - * Adds a step to the list of steps to execute when updating the configuration file. - * - * @param step {@link ConfigFileUpdateStep} to add - * @since 1.15.4 - */ - public void addStep(ConfigFileUpdateStep step) { - steps.add(step); - } - - /** - * Updates the configuration file by executing the steps in version order. - * - * @return true if all steps were executed successfully, false otherwise - * @since 1.15.4 - */ - public boolean updateConfig() { - boolean success = true; - - // Sort the steps by version so that they are applied in order - try { - Collections.sort(steps); - } catch (Exception e) { - Logger.LOG_CRITICAL( - "Cannot sort configuration update steps! Aborting config file update.", e); - success = false; - return success; - } - - // Execute each step in order - for (int i = 0; i < steps.size(); i++) { - ConfigFileUpdateStep step = (ConfigFileUpdateStep) steps.get(i); - - if (step.isCompatibleWithVersion(getConfigFileVersion())) { - success = step.updateConfig(config); - if (success) { - success = setConfigFileVersion(step.getStepVersion()); - } else { - // The step is compatible with the current version, but failed to update the config - break; - } - } else { - success = false; - } - } - - return success; - } -} +package com.hms_networks.americas.sc.extensions.config; + +import com.hms_networks.americas.sc.extensions.json.JSONException; +import com.hms_networks.americas.sc.extensions.json.JSONObject; +import com.hms_networks.americas.sc.extensions.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; + +/** + * Class for updating a configuration file. + * + * @since 1.15.4 + * @author HMS Networks, MU Americas Solution Center + */ +public class ConfigFileUpdater { + + /** + * Configuration file + * + * @since 1.15.4 + */ + private JSONObject config; + + /** + * List of steps to execute when updating the configuration file + * + * @since 1.15.4 + */ + private ArrayList steps; + + /** + * Application JSON key + * + * @since 1.15.4 + */ + private String applicationJsonKey; + + /** + * Configuration version JSON key + * + * @since 1.15.4 + */ + private String configVersionJsonKey; + + /** + * Default version string to use when no version is specified in the configuration file + * + * @since 1.15.4 + */ + static final String DEFAULT_VERSION_NOT_SPECIFIED = "0.0.0"; + + /** + * Constructor for {@link ConfigFileUpdater}. + * + * @param config configuration file + * @param applicationJsonKey application JSON key + * @param configVersionJsonKey configuration version JSON key + * @since 1.15.4 + */ + public ConfigFileUpdater( + JSONObject config, String applicationJsonKey, String configVersionJsonKey) { + this.config = config; + steps = new ArrayList(); + this.applicationJsonKey = applicationJsonKey; + this.configVersionJsonKey = configVersionJsonKey; + } + + /** + * Checks if the configuration file needs to be updated. + * + * @param version version to check against + * @return true if the configuration file needs to be updated, false otherwise + * @since 1.15.5 + */ + public boolean needsUpdate(ConfigFileVersion version) { + final int versionsEqual = 0; + + return version.compareTo(getConfigFileVersion()) > versionsEqual; + } + + /** + * Gets the configuration file. + * + * @return a {@link JSONObject} containing the configuration file + * @since 1.15.4 + */ + public JSONObject getConfig() { + return config; + } + + /** + * Gets the {@link ConfigFileVersion} of the configuration file. + * + * @return version of configuration file + * @since 1.15.4 + */ + private ConfigFileVersion getConfigFileVersion() { + String versionString; + try { + versionString = config.getJSONObject(applicationJsonKey).getString(configVersionJsonKey); + } catch (JSONException e) { + versionString = DEFAULT_VERSION_NOT_SPECIFIED; + } + return new ConfigFileVersion(versionString); + } + + /** + * Sets the {@link ConfigFileVersion} of the configuration file. + * + * @param version version to set + * @return true if successful, false otherwise + * @since 1.15.4 + */ + private boolean setConfigFileVersion(ConfigFileVersion version) { + boolean success = true; + + try { + config + .getJSONObject(applicationJsonKey) + .put(configVersionJsonKey, version.getVersionString()); + } catch (JSONException e) { + Logger.LOG_CRITICAL( + "Unable to set configuration file version to version: " + version.toString() + "!", e); + success = false; + } + + return success; + } + + /** + * Adds a step to the list of steps to execute when updating the configuration file. + * + * @param step {@link ConfigFileUpdateStep} to add + * @since 1.15.4 + */ + public void addStep(ConfigFileUpdateStep step) { + steps.add(step); + } + + /** + * Updates the configuration file by executing the steps in version order. + * + * @return true if all steps were executed successfully, false otherwise + * @since 1.15.4 + */ + public boolean updateConfig() { + boolean success = true; + + // Sort the steps by version so that they are applied in order + try { + Collections.sort(steps); + } catch (Exception e) { + Logger.LOG_CRITICAL( + "Cannot sort configuration update steps! Aborting config file update.", e); + success = false; + return success; + } + + // Execute each step in order + for (int i = 0; i < steps.size(); i++) { + ConfigFileUpdateStep step = (ConfigFileUpdateStep) steps.get(i); + + if (step.isCompatibleWithVersion(getConfigFileVersion())) { + success = step.updateConfig(config); + if (success) { + success = setConfigFileVersion(step.getStepVersion()); + } else { + // The step is compatible with the current version, but failed to update the config + break; + } + } else { + success = false; + } + } + + return success; + } +} diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileVersion.java b/config/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileVersion.java similarity index 96% rename from src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileVersion.java rename to config/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileVersion.java index bbb1a75d..6d39bf8b 100644 --- a/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileVersion.java +++ b/config/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileVersion.java @@ -1,205 +1,205 @@ -package com.hms_networks.americas.sc.extensions.config; - -import jregex.*; - -/** - * Class for representing a version of a configuration file. - * - * @since 1.15.4 - * @author HMS Networks, MU Americas Solution Center - */ -public class ConfigFileVersion implements Comparable { - - /** - * Version string - * - * @since 1.15.4 - */ - private String versionString; - - /** - * Major version - * - * @since 1.15.4 - */ - private int majorVersion; - - /** - * Minor version - * - * @since 1.15.4 - */ - private int minorVersion; - - /** - * Patch version - * - * @since 1.15.4 - */ - private int patchVersion; - - /** - * Regex for parsing version string - * - * @since 1.15.4 - */ - private final String VERSION_REGEX = - "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"; - - /** - * Group number for Major Version in {@link VERSION_REGEX} - * - * @since 1.15.4 - */ - private final int MAJOR_VERSION_GROUP = 1; - - /** - * Group number for Minor Version in {@link VERSION_REGEX} - * - * @since 1.15.4 - */ - private final int MINOR_VERSION_GROUP = 2; - - /** - * Group number for Patch Version in {@link VERSION_REGEX} - * - * @since 1.15.4 - */ - private final int PATCH_VERSION_GROUP = 3; - - /** - * Minimum expected number of groups to find in version string - * - * @since 1.15.4 - */ - private final int MIN_EXPECTED_GROUP_COUNT = 3; - - /** - * Constructor for {@link ConfigFileVersion} - * - * @param versionString the version string - * @throws IllegalArgumentException if the version string is invalid - * @since 1.15.4 - */ - public ConfigFileVersion(String versionString) throws IllegalArgumentException { - this.versionString = versionString; - - Pattern pattern = new Pattern(VERSION_REGEX); - - Matcher matcher = pattern.matcher(this.versionString); - - if (!matcher.matches() | matcher.groupCount() < MIN_EXPECTED_GROUP_COUNT) { - throw new IllegalArgumentException("Invalid version string: \"" + this.versionString + "\""); - } - - try { - majorVersion = Integer.parseInt(matcher.group(MAJOR_VERSION_GROUP)); - minorVersion = Integer.parseInt(matcher.group(MINOR_VERSION_GROUP)); - patchVersion = Integer.parseInt(matcher.group(PATCH_VERSION_GROUP)); - } catch (NumberFormatException e) { - throw new IllegalArgumentException("Invalid version string: \"" + this.versionString + "\""); - } - } - - /** - * Get the version string - * - * @return the version string - * @since 1.15.4 - */ - public String getVersionString() { - return versionString; - } - - /** - * Get the major version - * - * @return the major version - * @since 1.15.4 - */ - public int getMajorVersion() { - return majorVersion; - } - - /** - * Get the minor version - * - * @return the minor version - * @since 1.15.4 - */ - public int getMinorVersion() { - return minorVersion; - } - - /** - * Get the patch version - * - * @return the patch version - * @since 1.15.4 - */ - public int getPatchVersion() { - return patchVersion; - } - - /** - * Compare this {@link ConfigFileVersion} to another Object - * - * @param o the Object to compare to - * @return a negative integer, zero, or a positive integer as the specified version is greater - * than, equal to, or less than this version. - * @since 1.15.4 - */ - public int compareTo(Object o) { - final int lessThanResult = -1; - - if (o instanceof ConfigFileVersion) { - return compareTo((ConfigFileVersion) o); - } else { - return lessThanResult; - } - } - - /** - * Compare this {@link ConfigFileVersion} to another {@link ConfigFileVersion} - * - * @param compConfigFileVersion the {@link ConfigFileVersion} to compare to - * @return a negative integer, zero, or a positive integer as the specified version is greater - * than, equal to, or less than this version. - * @since 1.15.4 - */ - public int compareTo(ConfigFileVersion compConfigFileVersion) { - final int lessThanResult = -1; - final int greaterThanResult = 1; - final int equalResult = 0; - - if (majorVersion > compConfigFileVersion.getMajorVersion()) { - return greaterThanResult; - } else if (majorVersion < compConfigFileVersion.getMajorVersion()) { - return lessThanResult; - } else { - if (minorVersion > compConfigFileVersion.getMinorVersion()) { - return greaterThanResult; - } else if (minorVersion < compConfigFileVersion.getMinorVersion()) { - return lessThanResult; - } else { - if (patchVersion > compConfigFileVersion.getPatchVersion()) { - return greaterThanResult; - } else if (patchVersion < compConfigFileVersion.getPatchVersion()) { - return lessThanResult; - } else { - return equalResult; - } - } - } - } - - /** - * Get the string representation of this {@link ConfigFileVersion}. - * - * @return the string representation of this {@link ConfigFileVersion} - * @since 1.15.4 - */ - public String toString() { - return versionString; - } -} +package com.hms_networks.americas.sc.extensions.config; + +import jregex.*; + +/** + * Class for representing a version of a configuration file. + * + * @since 1.15.4 + * @author HMS Networks, MU Americas Solution Center + */ +public class ConfigFileVersion implements Comparable { + + /** + * Version string + * + * @since 1.15.4 + */ + private String versionString; + + /** + * Major version + * + * @since 1.15.4 + */ + private int majorVersion; + + /** + * Minor version + * + * @since 1.15.4 + */ + private int minorVersion; + + /** + * Patch version + * + * @since 1.15.4 + */ + private int patchVersion; + + /** + * Regex for parsing version string + * + * @since 1.15.4 + */ + private final String VERSION_REGEX = + "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"; + + /** + * Group number for Major Version in {@link VERSION_REGEX} + * + * @since 1.15.4 + */ + private final int MAJOR_VERSION_GROUP = 1; + + /** + * Group number for Minor Version in {@link VERSION_REGEX} + * + * @since 1.15.4 + */ + private final int MINOR_VERSION_GROUP = 2; + + /** + * Group number for Patch Version in {@link VERSION_REGEX} + * + * @since 1.15.4 + */ + private final int PATCH_VERSION_GROUP = 3; + + /** + * Minimum expected number of groups to find in version string + * + * @since 1.15.4 + */ + private final int MIN_EXPECTED_GROUP_COUNT = 3; + + /** + * Constructor for {@link ConfigFileVersion} + * + * @param versionString the version string + * @throws IllegalArgumentException if the version string is invalid + * @since 1.15.4 + */ + public ConfigFileVersion(String versionString) throws IllegalArgumentException { + this.versionString = versionString; + + Pattern pattern = new Pattern(VERSION_REGEX); + + Matcher matcher = pattern.matcher(this.versionString); + + if (!matcher.matches() | matcher.groupCount() < MIN_EXPECTED_GROUP_COUNT) { + throw new IllegalArgumentException("Invalid version string: \"" + this.versionString + "\""); + } + + try { + majorVersion = Integer.parseInt(matcher.group(MAJOR_VERSION_GROUP)); + minorVersion = Integer.parseInt(matcher.group(MINOR_VERSION_GROUP)); + patchVersion = Integer.parseInt(matcher.group(PATCH_VERSION_GROUP)); + } catch (NumberFormatException e) { + throw new IllegalArgumentException("Invalid version string: \"" + this.versionString + "\""); + } + } + + /** + * Get the version string + * + * @return the version string + * @since 1.15.4 + */ + public String getVersionString() { + return versionString; + } + + /** + * Get the major version + * + * @return the major version + * @since 1.15.4 + */ + public int getMajorVersion() { + return majorVersion; + } + + /** + * Get the minor version + * + * @return the minor version + * @since 1.15.4 + */ + public int getMinorVersion() { + return minorVersion; + } + + /** + * Get the patch version + * + * @return the patch version + * @since 1.15.4 + */ + public int getPatchVersion() { + return patchVersion; + } + + /** + * Compare this {@link ConfigFileVersion} to another Object + * + * @param o the Object to compare to + * @return a negative integer, zero, or a positive integer as the specified version is greater + * than, equal to, or less than this version. + * @since 1.15.4 + */ + public int compareTo(Object o) { + final int lessThanResult = -1; + + if (o instanceof ConfigFileVersion) { + return compareTo((ConfigFileVersion) o); + } else { + return lessThanResult; + } + } + + /** + * Compare this {@link ConfigFileVersion} to another {@link ConfigFileVersion} + * + * @param compConfigFileVersion the {@link ConfigFileVersion} to compare to + * @return a negative integer, zero, or a positive integer as the specified version is greater + * than, equal to, or less than this version. + * @since 1.15.4 + */ + public int compareTo(ConfigFileVersion compConfigFileVersion) { + final int lessThanResult = -1; + final int greaterThanResult = 1; + final int equalResult = 0; + + if (majorVersion > compConfigFileVersion.getMajorVersion()) { + return greaterThanResult; + } else if (majorVersion < compConfigFileVersion.getMajorVersion()) { + return lessThanResult; + } else { + if (minorVersion > compConfigFileVersion.getMinorVersion()) { + return greaterThanResult; + } else if (minorVersion < compConfigFileVersion.getMinorVersion()) { + return lessThanResult; + } else { + if (patchVersion > compConfigFileVersion.getPatchVersion()) { + return greaterThanResult; + } else if (patchVersion < compConfigFileVersion.getPatchVersion()) { + return lessThanResult; + } else { + return equalResult; + } + } + } + } + + /** + * Get the string representation of this {@link ConfigFileVersion}. + * + * @return the string representation of this {@link ConfigFileVersion} + * @since 1.15.4 + */ + public String toString() { + return versionString; + } +} diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileException.java b/config/src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileException.java rename to config/src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileParseException.java b/config/src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileParseException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileParseException.java rename to config/src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileParseException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileReadException.java b/config/src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileReadException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileReadException.java rename to config/src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileReadException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileWriteException.java b/config/src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileWriteException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileWriteException.java rename to config/src/main/java/com/hms_networks/americas/sc/extensions/config/exceptions/ConfigFileWriteException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/config/package.html b/config/src/main/java/com/hms_networks/americas/sc/extensions/config/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/config/package.html rename to config/src/main/java/com/hms_networks/americas/sc/extensions/config/package.html diff --git a/connectors/pom.xml b/connectors/pom.xml new file mode 100644 index 00000000..89d08403 --- /dev/null +++ b/connectors/pom.xml @@ -0,0 +1,104 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + connectors + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + com.hms_networks.americas.sc + logging + 1.15.8 + + + + + com.hms_networks.americas.sc + string + 1.15.8 + + + + + com.hms_networks.americas.sc + config + 1.15.8 + + + + + com.hms_networks.americas.sc + json + 1.15.8 + + + + + com.hms_networks.americas.sc + system + 1.15.8 + + + + + com.hms_networks.americas.sc + historicaldata + 1.15.8 + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorConfig.java b/connectors/src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorConfig.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorConfig.java rename to connectors/src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorConfig.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorMain.java b/connectors/src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorMain.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorMain.java rename to connectors/src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorMain.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorMainConstants.java b/connectors/src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorMainConstants.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorMainConstants.java rename to connectors/src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorMainConstants.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorMainUtils.java b/connectors/src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorMainUtils.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorMainUtils.java rename to connectors/src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/AbstractConnectorMainUtils.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/package.html b/connectors/src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/package.html rename to connectors/src/main/java/com/hms_networks/americas/sc/extensions/connectors/framework/package.html diff --git a/datapoint/pom.xml b/datapoint/pom.xml new file mode 100644 index 00000000..47e69b46 --- /dev/null +++ b/datapoint/pom.xml @@ -0,0 +1,70 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + datapoint + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + + com.hms_networks.americas.sc + system + 1.15.8 + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPoint.java b/datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPoint.java similarity index 87% rename from src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPoint.java rename to datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPoint.java index e8d4bf56..ec03391e 100644 --- a/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPoint.java +++ b/datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPoint.java @@ -91,6 +91,18 @@ public Date getTimeStampAsDate() throws Exception { return timestampDate; } + /** + * Returns an ISO 8601 formatted string representing the timestamp of the data point in the + * applicable time zone (UTC or local, depending on Ewon's 'Export data in UTC' option). + * + * @return ISO 8601 formatted string representing the timestamp of the data point in the + * applicable time zone + * @throws Exception if unable to get UTC export value + */ + public String getTimeStampAsIso8601DateString() throws Exception { + return SCTimeUtils.getIso8601FormattedTimestampForDate(getTimeStampAsDate()); + } + /** * Get the quality of the data point value * diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointBoolean.java b/datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointBoolean.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointBoolean.java rename to datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointBoolean.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointDword.java b/datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointDword.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointDword.java rename to datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointDword.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointFloat.java b/datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointFloat.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointFloat.java rename to datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointFloat.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointInteger.java b/datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointInteger.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointInteger.java rename to datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointInteger.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointIntegerMappedString.java b/datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointIntegerMappedString.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointIntegerMappedString.java rename to datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointIntegerMappedString.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointString.java b/datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointString.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointString.java rename to datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataPointString.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataQuality.java b/datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataQuality.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataQuality.java rename to datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataQuality.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataType.java b/datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataType.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataType.java rename to datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/DataType.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/package.html b/datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/datapoint/package.html rename to datapoint/src/main/java/com/hms_networks/americas/sc/extensions/datapoint/package.html diff --git a/ebd/pom.xml b/ebd/pom.xml new file mode 100644 index 00000000..bf189966 --- /dev/null +++ b/ebd/pom.xml @@ -0,0 +1,70 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + ebd + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + + com.hms_networks.americas.sc + string + 1.15.8 + + + diff --git a/ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd/EbdConstants.java b/ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd/EbdConstants.java new file mode 100644 index 00000000..43f6b0b1 --- /dev/null +++ b/ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd/EbdConstants.java @@ -0,0 +1,16 @@ +package com.hms_networks.americas.sc.extensions.ebd; + +/** + * Class for storing constants used in the EBD package. + * + * @author HMS Networks, MU Americas Solution Center + * @since 2.0.0 + */ +class EbdConstants { + + /** Default thread sleep time waiting for EBD in ms. */ + public static final int DEFAULT_EBD_THREAD_SLEEP_MS = 5; + + /** Maximum amount of time that EBD call should wait in milliseconds before timing out. */ + public static final long MAX_EBD_WAIT_MS = 15000; +} diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/EbdTimeoutException.java b/ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd/EbdTimeoutException.java similarity index 87% rename from src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/EbdTimeoutException.java rename to ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd/EbdTimeoutException.java index 8c2a8d79..dfdffdee 100644 --- a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/EbdTimeoutException.java +++ b/ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd/EbdTimeoutException.java @@ -1,4 +1,4 @@ -package com.hms_networks.americas.sc.extensions.historicaldata; +package com.hms_networks.americas.sc.extensions.ebd; /** * Class to throw custom exception in the case of Export Block Descriptor calls timing out. diff --git a/ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd/EbdUtility.java b/ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd/EbdUtility.java new file mode 100644 index 00000000..a4450627 --- /dev/null +++ b/ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd/EbdUtility.java @@ -0,0 +1,46 @@ +package com.hms_networks.americas.sc.extensions.ebd; + +import com.ewon.ewonitf.Exporter; +import java.io.IOException; + +/** + * Class to provide utility functionality for executing EBD (Export Block Descriptor) calls on Ewon + * Flexy. + * + * @author HMS Networks, MU Americas Solution Center + * @since 2.0.0 + */ +public class EbdUtility { + + /** + * Executes EBD call, waits for data return. + * + * @param ebdStr EBD string + * @return EBD Exporter - caller must close exporter + * @throws EbdTimeoutException when there is no response before timeout period + * @throws IOException when there is an Exporter Exception + */ + public static Exporter executeEbdCall(String ebdStr) throws IOException, EbdTimeoutException { + final long start = System.currentTimeMillis(); + final Exporter exporter = new Exporter(ebdStr); + int available = exporter.available(); + // check on data availability + while (available == 0) { + // sleep + try { + Thread.sleep(EbdConstants.DEFAULT_EBD_THREAD_SLEEP_MS); + } catch (InterruptedException e) { + e.printStackTrace(); + } + // check for timeout + if (System.currentTimeMillis() - start > EbdConstants.MAX_EBD_WAIT_MS) { + exporter.close(); + throw new EbdTimeoutException("Timeout waiting for Export Block Descriptor."); + } + + // check for data available + available = exporter.available(); + } + return exporter; + } +} diff --git a/ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd/package.html b/ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd/package.html new file mode 100644 index 00000000..d866454c --- /dev/null +++ b/ebd/src/main/java/com/hms_networks/americas/sc/extensions/ebd/package.html @@ -0,0 +1,8 @@ + + +Extension package to provide Export Block Descriptors (EBD) utilities. + +@since 2.0.0 +@author HMS Networks, MU Americas Solution Center + + \ No newline at end of file diff --git a/eventfile/pom.xml b/eventfile/pom.xml new file mode 100644 index 00000000..589feb5d --- /dev/null +++ b/eventfile/pom.xml @@ -0,0 +1,84 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + eventfile + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + + com.hms_networks.americas.sc + string + 1.15.8 + + + + + com.hms_networks.americas.sc + json + 1.15.8 + + + + + com.hms_networks.americas.sc + ebd + 1.15.8 + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/eventfile/EventFile.java b/eventfile/src/main/java/com/hms_networks/americas/sc/extensions/eventfile/EventFile.java similarity index 94% rename from src/main/java/com/hms_networks/americas/sc/extensions/eventfile/EventFile.java rename to eventfile/src/main/java/com/hms_networks/americas/sc/extensions/eventfile/EventFile.java index 23cf3556..5ec56804 100644 --- a/src/main/java/com/hms_networks/americas/sc/extensions/eventfile/EventFile.java +++ b/eventfile/src/main/java/com/hms_networks/americas/sc/extensions/eventfile/EventFile.java @@ -1,9 +1,8 @@ package com.hms_networks.americas.sc.extensions.eventfile; import com.ewon.ewonitf.Exporter; -import com.hms_networks.americas.sc.extensions.historicaldata.CircularizedFileCheck; -import com.hms_networks.americas.sc.extensions.historicaldata.EbdTimeoutException; -import com.hms_networks.americas.sc.extensions.historicaldata.HistoricalDataManager; +import com.hms_networks.americas.sc.extensions.ebd.EbdTimeoutException; +import com.hms_networks.americas.sc.extensions.ebd.EbdUtility; import com.hms_networks.americas.sc.extensions.json.JSONException; import com.hms_networks.americas.sc.extensions.string.QuoteSafeStringTokenizer; import com.hms_networks.americas.sc.extensions.string.StringUtils; @@ -43,7 +42,7 @@ public class EventFile { /** * Read EventFile, check for File Circularized event * - * @deprecated use {@link CircularizedFileCheck} + * @deprecated use {@code CircularizedFileCheck} * @return boolean - did a File Circularized event occur in the recent past * @throws EbdTimeoutException for timeout in EBD read * @throws IOException for errors in parsing response @@ -93,7 +92,7 @@ public static boolean eventDidOccurInDurationMins(int mins, int eventId) } String ebdStr = "$dtEV$ftT$st_m" + Integer.toString(mins); - Exporter ex = HistoricalDataManager.executeEbdCall(ebdStr); + Exporter ex = EbdUtility.executeEbdCall(ebdStr); return parseEventFileExportResponse(ex, Long.toString(eventId)); } @@ -167,7 +166,7 @@ private static String getEbdEventFileSinceAbsoluteTimeRequest(long timestampMill public static boolean didEventOccurSinceAbsolute( String eventId, long absoluteStartTimeMilliseconds) throws IOException, EbdTimeoutException { Exporter ebdExporter = - HistoricalDataManager.executeEbdCall( + EbdUtility.executeEbdCall( getEbdEventFileSinceAbsoluteTimeRequest(absoluteStartTimeMilliseconds)); String exporterFile = StringUtils.getStringFromInputStream(ebdExporter, EVENT_FILE_STRING_ENCODING); diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/eventfile/EventFileConstants.java b/eventfile/src/main/java/com/hms_networks/americas/sc/extensions/eventfile/EventFileConstants.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/eventfile/EventFileConstants.java rename to eventfile/src/main/java/com/hms_networks/americas/sc/extensions/eventfile/EventFileConstants.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/eventfile/package.html b/eventfile/src/main/java/com/hms_networks/americas/sc/extensions/eventfile/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/eventfile/package.html rename to eventfile/src/main/java/com/hms_networks/americas/sc/extensions/eventfile/package.html diff --git a/fileutils/pom.xml b/fileutils/pom.xml new file mode 100644 index 00000000..9b347406 --- /dev/null +++ b/fileutils/pom.xml @@ -0,0 +1,59 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + fileutils + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/fileutils/FileAccessManager.java b/fileutils/src/main/java/com/hms_networks/americas/sc/extensions/fileutils/FileAccessManager.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/fileutils/FileAccessManager.java rename to fileutils/src/main/java/com/hms_networks/americas/sc/extensions/fileutils/FileAccessManager.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/fileutils/FileConstants.java b/fileutils/src/main/java/com/hms_networks/americas/sc/extensions/fileutils/FileConstants.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/fileutils/FileConstants.java rename to fileutils/src/main/java/com/hms_networks/americas/sc/extensions/fileutils/FileConstants.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/fileutils/FileManager.java b/fileutils/src/main/java/com/hms_networks/americas/sc/extensions/fileutils/FileManager.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/fileutils/FileManager.java rename to fileutils/src/main/java/com/hms_networks/americas/sc/extensions/fileutils/FileManager.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/fileutils/package.html b/fileutils/src/main/java/com/hms_networks/americas/sc/extensions/fileutils/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/fileutils/package.html rename to fileutils/src/main/java/com/hms_networks/americas/sc/extensions/fileutils/package.html diff --git a/flexy.properties b/flexy.properties deleted file mode 100644 index ee42a6ec..00000000 --- a/flexy.properties +++ /dev/null @@ -1,3 +0,0 @@ -ewon.address=10.0.0.53 -ewon.username=adm -ewon.password=adm diff --git a/historicaldata/pom.xml b/historicaldata/pom.xml new file mode 100644 index 00000000..e961ee45 --- /dev/null +++ b/historicaldata/pom.xml @@ -0,0 +1,111 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + historicaldata + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + com.hms_networks.americas.sc + datapoint + 1.15.8 + + + + + com.hms_networks.americas.sc + string + 1.15.8 + + + + + com.hms_networks.americas.sc + json + 1.15.8 + + + + + com.hms_networks.americas.sc + system + 1.15.8 + + + + + com.hms_networks.americas.sc + ebd + 1.15.8 + + + + + com.hms_networks.americas.sc + eventfile + 1.15.8 + + + + + com.hms_networks.americas.sc + taginfo + 1.15.8 + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CircularizedFileCheck.java b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CircularizedFileCheck.java similarity index 94% rename from src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CircularizedFileCheck.java rename to historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CircularizedFileCheck.java index a067c250..262c6bb2 100644 --- a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CircularizedFileCheck.java +++ b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CircularizedFileCheck.java @@ -1,5 +1,6 @@ package com.hms_networks.americas.sc.extensions.historicaldata; +import com.hms_networks.americas.sc.extensions.ebd.EbdTimeoutException; import com.hms_networks.americas.sc.extensions.eventfile.EventFile; import java.io.IOException; diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CircularizedFileException.java b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CircularizedFileException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CircularizedFileException.java rename to historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CircularizedFileException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CorruptedTimeTrackerException.java b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CorruptedTimeTrackerException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CorruptedTimeTrackerException.java rename to historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/CorruptedTimeTrackerException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/DiagnosticTagConfigurationException.java b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/DiagnosticTagConfigurationException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/DiagnosticTagConfigurationException.java rename to historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/DiagnosticTagConfigurationException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/DiagnosticTagUpdateException.java b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/DiagnosticTagUpdateException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/DiagnosticTagUpdateException.java rename to historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/DiagnosticTagUpdateException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataConstants.java b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataConstants.java similarity index 95% rename from src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataConstants.java rename to historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataConstants.java index 6e427a2f..6e628710 100644 --- a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataConstants.java +++ b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataConstants.java @@ -46,12 +46,6 @@ class HistoricalDataConstants { /** Minimum amount of Historical FIFO queue that can be set by library users. */ public static final long MIN_QUEUE_SPAN_MINS = 1; - /** Default thread sleep time waiting for EBD in ms. */ - public static final int DEFAULT_EBD_THREAD_SLEEP_MS = 5; - - /** Maximum amount of time that EBD call should wait in milliseconds before timing out. */ - public static final long MAX_EBD_WAIT_MS = 15000; - /** Tag value representing the negative infinity Float/Double value. */ public static final String TAG_VALUE_NEGATIVE_INFINITY = "-inf"; diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataManager.java b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataManager.java similarity index 92% rename from src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataManager.java rename to historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataManager.java index 2e4d76c0..1af9ca60 100644 --- a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataManager.java +++ b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataManager.java @@ -9,6 +9,8 @@ import com.hms_networks.americas.sc.extensions.datapoint.DataPointIntegerMappedString; import com.hms_networks.americas.sc.extensions.datapoint.DataPointString; import com.hms_networks.americas.sc.extensions.datapoint.DataQuality; +import com.hms_networks.americas.sc.extensions.ebd.EbdTimeoutException; +import com.hms_networks.americas.sc.extensions.ebd.EbdUtility; import com.hms_networks.americas.sc.extensions.json.JSONException; import com.hms_networks.americas.sc.extensions.string.QuoteSafeStringTokenizer; import com.hms_networks.americas.sc.extensions.string.StringUtils; @@ -70,7 +72,7 @@ public static ArrayList readHistoricalFifo( stringHistorical); // Execute EBD call and parse results - final Exporter exporter = executeEbdCall(ebdStr); + final Exporter exporter = EbdUtility.executeEbdCall(ebdStr); return parseEBDHistoricalLogExportResponse(exporter); } @@ -117,42 +119,10 @@ public static Map readHistoricalFifo( stringHistorical); // Execute EBD call and parse results - final Exporter exporter = executeEbdCall(ebdStr); + final Exporter exporter = EbdUtility.executeEbdCall(ebdStr); return parseEBDHistoricalLogExportResponse(exporter, timeSpan); } - /** - * Executes EBD call, waits for data return. - * - * @param ebdStr EBD string - * @return EBD Exporter - caller must close exporter - * @throws EbdTimeoutException when there is no response before timeout period - * @throws IOException when there is an Exporter Exception - */ - public static Exporter executeEbdCall(String ebdStr) throws IOException, EbdTimeoutException { - final long start = System.currentTimeMillis(); - final Exporter exporter = new Exporter(ebdStr); - int available = exporter.available(); - // check on data availability - while (available == 0) { - // sleep - try { - Thread.sleep(HistoricalDataConstants.DEFAULT_EBD_THREAD_SLEEP_MS); - } catch (InterruptedException e) { - e.printStackTrace(); - } - // check for timeout - if (System.currentTimeMillis() - start > HistoricalDataConstants.MAX_EBD_WAIT_MS) { - exporter.close(); - throw new EbdTimeoutException("Timeout waiting for Export Block Descriptor."); - } - - // check for data available - available = exporter.available(); - } - return exporter; - } - /** * Prepare Read Historical Log Export Block Descriptor (EBD) string. * diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataQueueDiagnosticTagManager.java b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataQueueDiagnosticTagManager.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataQueueDiagnosticTagManager.java rename to historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataQueueDiagnosticTagManager.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataQueueManager.java b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataQueueManager.java similarity index 99% rename from src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataQueueManager.java rename to historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataQueueManager.java index afa24de7..cd71ea02 100644 --- a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataQueueManager.java +++ b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/HistoricalDataQueueManager.java @@ -1,6 +1,7 @@ package com.hms_networks.americas.sc.extensions.historicaldata; import com.hms_networks.americas.sc.extensions.datapoint.DataPoint; +import com.hms_networks.americas.sc.extensions.ebd.EbdTimeoutException; import com.hms_networks.americas.sc.extensions.fileutils.FileAccessManager; import com.hms_networks.americas.sc.extensions.json.JSONException; import com.hms_networks.americas.sc.extensions.system.time.SCTimeSpan; diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/RapidCatchUp.java b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/RapidCatchUp.java similarity index 98% rename from src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/RapidCatchUp.java rename to historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/RapidCatchUp.java index c0c9ccc5..e463040c 100644 --- a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/RapidCatchUp.java +++ b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/RapidCatchUp.java @@ -2,6 +2,8 @@ import com.ewon.ewonitf.Exporter; import com.hms_networks.americas.sc.extensions.datapoint.DataPoint; +import com.hms_networks.americas.sc.extensions.ebd.EbdTimeoutException; +import com.hms_networks.americas.sc.extensions.ebd.EbdUtility; import com.hms_networks.americas.sc.extensions.json.JSONException; import com.hms_networks.americas.sc.extensions.logging.Logger; import com.hms_networks.americas.sc.extensions.string.StringUtils; @@ -176,7 +178,7 @@ public static RapidCatchUpTracker rapidCatchUpRequest( RapidCatchUpTracker histTracker; try { - final Exporter exporter = HistoricalDataManager.executeEbdCall(ebdRequest); + final Exporter exporter = EbdUtility.executeEbdCall(ebdRequest); histTracker = parseEBDHistoricalLogExportResponseRapidCatchUp(exporter, endTimeTrackingMilliseconds); if (histTracker.isHistoricalTrackingCaughtUp()) { diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/RapidCatchUpTracker.java b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/RapidCatchUpTracker.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/RapidCatchUpTracker.java rename to historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/RapidCatchUpTracker.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/TimeTrackerUnrecoverableException.java b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/TimeTrackerUnrecoverableException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/TimeTrackerUnrecoverableException.java rename to historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/TimeTrackerUnrecoverableException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/package.html b/historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/package.html rename to historicaldata/src/main/java/com/hms_networks/americas/sc/extensions/historicaldata/package.html diff --git a/json/pom.xml b/json/pom.xml new file mode 100644 index 00000000..e0dcadde --- /dev/null +++ b/json/pom.xml @@ -0,0 +1,70 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + json + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + + com.hms_networks.americas.sc + logging + 1.15.8 + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONArray.java b/json/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONArray.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/json/JSONArray.java rename to json/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONArray.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONException.java b/json/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/json/JSONException.java rename to json/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONObject.java b/json/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONObject.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/json/JSONObject.java rename to json/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONObject.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONString.java b/json/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONString.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/json/JSONString.java rename to json/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONString.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONStringer.java b/json/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONStringer.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/json/JSONStringer.java rename to json/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONStringer.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONTokener.java b/json/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONTokener.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/json/JSONTokener.java rename to json/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONTokener.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONWriter.java b/json/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONWriter.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/json/JSONWriter.java rename to json/src/main/java/com/hms_networks/americas/sc/extensions/json/JSONWriter.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/json/StringWriter.java b/json/src/main/java/com/hms_networks/americas/sc/extensions/json/StringWriter.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/json/StringWriter.java rename to json/src/main/java/com/hms_networks/americas/sc/extensions/json/StringWriter.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/json/package.html b/json/src/main/java/com/hms_networks/americas/sc/extensions/json/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/json/package.html rename to json/src/main/java/com/hms_networks/americas/sc/extensions/json/package.html diff --git a/localdatafiles/pom.xml b/localdatafiles/pom.xml new file mode 100644 index 00000000..099c4eaa --- /dev/null +++ b/localdatafiles/pom.xml @@ -0,0 +1,97 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + localdatafiles + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + com.hms_networks.americas.sc + datapoint + 1.15.8 + + + + + com.hms_networks.americas.sc + fileutils + 1.15.8 + + + + + com.hms_networks.americas.sc + logging + 1.15.8 + + + + + com.hms_networks.americas.sc + system + 1.15.8 + + + + + com.hms_networks.americas.sc + taginfo + 1.15.8 + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/localdatafiles/LocalDataFileConstants.java b/localdatafiles/src/main/java/com/hms_networks/americas/sc/extensions/localdatafiles/LocalDataFileConstants.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/localdatafiles/LocalDataFileConstants.java rename to localdatafiles/src/main/java/com/hms_networks/americas/sc/extensions/localdatafiles/LocalDataFileConstants.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/localdatafiles/LocalDataFileManager.java b/localdatafiles/src/main/java/com/hms_networks/americas/sc/extensions/localdatafiles/LocalDataFileManager.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/localdatafiles/LocalDataFileManager.java rename to localdatafiles/src/main/java/com/hms_networks/americas/sc/extensions/localdatafiles/LocalDataFileManager.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/localdatafiles/package.html b/localdatafiles/src/main/java/com/hms_networks/americas/sc/extensions/localdatafiles/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/localdatafiles/package.html rename to localdatafiles/src/main/java/com/hms_networks/americas/sc/extensions/localdatafiles/package.html diff --git a/localization/pom.xml b/localization/pom.xml new file mode 100644 index 00000000..c5cefa10 --- /dev/null +++ b/localization/pom.xml @@ -0,0 +1,59 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + localization + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/localization/LocalizationManager.java b/localization/src/main/java/com/hms_networks/americas/sc/extensions/localization/LocalizationManager.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/localization/LocalizationManager.java rename to localization/src/main/java/com/hms_networks/americas/sc/extensions/localization/LocalizationManager.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/localization/package.html b/localization/src/main/java/com/hms_networks/americas/sc/extensions/localization/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/localization/package.html rename to localization/src/main/java/com/hms_networks/americas/sc/extensions/localization/package.html diff --git a/src/main/resources/com/hms_networks/americas/sc/extensions/localization/DateTimeStrings.properties b/localization/src/main/resources/com/hms_networks/americas/sc/extensions/localization/DateTimeStrings.properties similarity index 100% rename from src/main/resources/com/hms_networks/americas/sc/extensions/localization/DateTimeStrings.properties rename to localization/src/main/resources/com/hms_networks/americas/sc/extensions/localization/DateTimeStrings.properties diff --git a/src/main/resources/com/hms_networks/americas/sc/extensions/localization/DateTimeStrings_en.properties b/localization/src/main/resources/com/hms_networks/americas/sc/extensions/localization/DateTimeStrings_en.properties similarity index 100% rename from src/main/resources/com/hms_networks/americas/sc/extensions/localization/DateTimeStrings_en.properties rename to localization/src/main/resources/com/hms_networks/americas/sc/extensions/localization/DateTimeStrings_en.properties diff --git a/src/main/resources/com/hms_networks/americas/sc/extensions/localization/DateTimeStrings_es.properties b/localization/src/main/resources/com/hms_networks/americas/sc/extensions/localization/DateTimeStrings_es.properties similarity index 100% rename from src/main/resources/com/hms_networks/americas/sc/extensions/localization/DateTimeStrings_es.properties rename to localization/src/main/resources/com/hms_networks/americas/sc/extensions/localization/DateTimeStrings_es.properties diff --git a/logging/pom.xml b/logging/pom.xml new file mode 100644 index 00000000..a5f993da --- /dev/null +++ b/logging/pom.xml @@ -0,0 +1,59 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + logging + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/logging/LogQueue.java b/logging/src/main/java/com/hms_networks/americas/sc/extensions/logging/LogQueue.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/logging/LogQueue.java rename to logging/src/main/java/com/hms_networks/americas/sc/extensions/logging/LogQueue.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/logging/Logger.java b/logging/src/main/java/com/hms_networks/americas/sc/extensions/logging/Logger.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/logging/Logger.java rename to logging/src/main/java/com/hms_networks/americas/sc/extensions/logging/Logger.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/logging/SocketLogger.java b/logging/src/main/java/com/hms_networks/americas/sc/extensions/logging/SocketLogger.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/logging/SocketLogger.java rename to logging/src/main/java/com/hms_networks/americas/sc/extensions/logging/SocketLogger.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/logging/package.html b/logging/src/main/java/com/hms_networks/americas/sc/extensions/logging/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/logging/package.html rename to logging/src/main/java/com/hms_networks/americas/sc/extensions/logging/package.html diff --git a/mqtt/pom.xml b/mqtt/pom.xml new file mode 100644 index 00000000..ca42026a --- /dev/null +++ b/mqtt/pom.xml @@ -0,0 +1,77 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + mqtt + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + + com.hms_networks.americas.sc + system + 1.15.8 + + + + + com.hms_networks.americas.sc + retry + 1.15.8 + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/ConstrainedMqttManager.java b/mqtt/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/ConstrainedMqttManager.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/mqtt/ConstrainedMqttManager.java rename to mqtt/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/ConstrainedMqttManager.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttConstants.java b/mqtt/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttConstants.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttConstants.java rename to mqtt/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttConstants.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttException.java b/mqtt/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttException.java rename to mqtt/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttManager.java b/mqtt/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttManager.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttManager.java rename to mqtt/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttManager.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttStatusCode.java b/mqtt/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttStatusCode.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttStatusCode.java rename to mqtt/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/MqttStatusCode.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/package.html b/mqtt/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/mqtt/package.html rename to mqtt/src/main/java/com/hms_networks/americas/sc/extensions/mqtt/package.html diff --git a/pom.xml b/pom.xml index 7a97358c..3f93c208 100644 --- a/pom.xml +++ b/pom.xml @@ -13,6 +13,40 @@ com.hms_networks.americas.sc extensions + + pom + + + + HMS Networks, Inc. + https://hms-networks.com + + + + + alarms + api + config + connectors + datapoint + ebd + eventfile + fileutils + historicaldata + json + localdatafiles + localization + logging + mqtt + realtimedata + retry + security + string + system + taginfo + tagupdateservice + util + @@ -56,97 +90,26 @@ com.igormaznitsa mvn-jlink-wrapper - 1.1.0 - - - cache-jdk-for-build - initialize - - cache-jdk - - - build.jdk.path - ${project.build.directory}${file.separator}buildJdk - ADOPT - - ${project.build.jdk.version} - x64 - hotspot - jdk - - - - - + org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 + maven-jar-plugin - true - true - ${build.jdk.path}${file.separator}bin${file.separator}javac - ${project.build.jdk.name} - ${project.java.version} - ${project.java.version} + + + true + true + + - - - org.apache.maven.plugins - maven-assembly-plugin - 3.3.0 - - - assemble-executable-jar - package - - single - - - ${project.artifactId}-${project.version}-full - false - - - ${project.main.class} - true - true - - - - jar-with-dependencies - - - - - assemble-project-archives - package - - single - - - ${project.artifactId}-${project.version}-archive - gnu - false - - ${project.basedir}${file.separator}src${file.separator}assembly${file.separator}sc-project.xml - - - - - - org.apache.maven.plugins maven-source-plugin - 3.2.0 - - ${project.artifactId}-${project.version} - attach-sources @@ -161,206 +124,18 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.0 ${build.jdk.path}${file.separator}bin${file.separator}javadoc - ${project.artifactId}-${project.version} private - true - - com.hms_networks.americas.sc.mvnlibs:ewon-etk:* - true - package - - aggregate-jar - - - - - - - - org.codehaus.mojo - wagon-maven-plugin - 2.0.2 - - - ftp-install-jar - install - - upload-single - - - - ${project.build.directory}${file.separator}${project.artifactId}-${project.version}-full.jar - - ftp://${ewon.username}:${ewon.password}@${ewon.address}/usr - - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - 3.0.0 - - - deploy-stop-execution - deploy - - run - - - - - - true - - - - deploy-execute-jar - deploy + attach-javadocs - run - - - - - - true - - - - - - - - org.apache.maven.plugins - maven-deploy-plugin - 2.8.2 - - true - - - - - - com.google.code.maven-replacer-plugin - replacer - 1.5.3 - - - prepare-package - - replace - - - - - ${project.basedir} - - .settings${file.separator}CONNECT (Remote JVM on Device).launch - - .idea${file.separator}runConfigurations${file.separator}DEBUG__Run_on_Device__Remote_JVM_.xml - - starting-files${file.separator}jvmrun - - - - -classpath /usr/.*-full\.jar - -classpath /usr/${project.artifactId}-${project.version}-full.jar - - - key="port" value=".*" - key="port" value="${project.build.debug.port}" - - - key="hostname" value=".*" - key="hostname" value="${ewon.address}" - - - name="PORT" value=".*" - name="PORT" value="${project.build.debug.port}" - - - name="HOST" value=".*" - name="HOST" value="${ewon.address}" - - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.7 - - - - prepare-agent - - - - generate-code-coverage-report - test - - report - - - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - git-assume-unchanged-flexy-properties - initialize - - git - - update-index - --assume-unchanged - ${project.basedir}/flexy.properties - - - - exec - - - - - - - - org.codehaus.mojo - properties-maven-plugin - 1.0.0 - - - initialize - - read-project-properties + jar - - - ${project.basedir}/flexy.properties - - @@ -376,6 +151,128 @@ + + + + com.igormaznitsa + mvn-jlink-wrapper + 1.1.0 + + + cache-jdk-for-build + initialize + + cache-jdk + + + build.jdk.path + ${project.build.directory}${file.separator}buildJdk + + ADOPT + + ${project.build.jdk.version} + x64 + hotspot + jdk + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + true + + true + true + ${build.jdk.path}${file.separator}bin${file.separator}javac + ${project.build.jdk.name} + ${project.java.version} + ${project.java.version} + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + true + true + + + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.0 + + + attach-sources + + jar + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.6.2 + false + + + aggregate-javadocs + + aggregate-jar + + package + + + attach-javadocs + + jar + + + true + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.7 + + + + prepare-agent + + + + generate-code-coverage-report + test + + report + + + + + org.eclipse.m2e diff --git a/realtimedata/pom.xml b/realtimedata/pom.xml new file mode 100644 index 00000000..e36e462b --- /dev/null +++ b/realtimedata/pom.xml @@ -0,0 +1,84 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + realtimedata + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + + com.hms_networks.americas.sc + datapoint + 1.15.8 + + + + + com.hms_networks.americas.sc + logging + 1.15.8 + + + + + com.hms_networks.americas.sc + taginfo + 1.15.8 + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/realtimedata/RealTimeDataQueueManager.java b/realtimedata/src/main/java/com/hms_networks/americas/sc/extensions/realtimedata/RealTimeDataQueueManager.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/realtimedata/RealTimeDataQueueManager.java rename to realtimedata/src/main/java/com/hms_networks/americas/sc/extensions/realtimedata/RealTimeDataQueueManager.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/realtimedata/RealTimeTagDataPointManager.java b/realtimedata/src/main/java/com/hms_networks/americas/sc/extensions/realtimedata/RealTimeTagDataPointManager.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/realtimedata/RealTimeTagDataPointManager.java rename to realtimedata/src/main/java/com/hms_networks/americas/sc/extensions/realtimedata/RealTimeTagDataPointManager.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/realtimedata/package.html b/realtimedata/src/main/java/com/hms_networks/americas/sc/extensions/realtimedata/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/realtimedata/package.html rename to realtimedata/src/main/java/com/hms_networks/americas/sc/extensions/realtimedata/package.html diff --git a/retry/pom.xml b/retry/pom.xml new file mode 100644 index 00000000..7dfe0eb7 --- /dev/null +++ b/retry/pom.xml @@ -0,0 +1,59 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + retry + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryCode.java b/retry/src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryCode.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryCode.java rename to retry/src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryCode.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryCodeExponential.java b/retry/src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryCodeExponential.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryCodeExponential.java rename to retry/src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryCodeExponential.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryCodeLinear.java b/retry/src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryCodeLinear.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryCodeLinear.java rename to retry/src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryCodeLinear.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryResult.java b/retry/src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryResult.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryResult.java rename to retry/src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryResult.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryState.java b/retry/src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryState.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryState.java rename to retry/src/main/java/com/hms_networks/americas/sc/extensions/retry/AutomaticRetryState.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/retry/package.html b/retry/src/main/java/com/hms_networks/americas/sc/extensions/retry/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/retry/package.html rename to retry/src/main/java/com/hms_networks/americas/sc/extensions/retry/package.html diff --git a/security/pom.xml b/security/pom.xml new file mode 100644 index 00000000..2fc288fc --- /dev/null +++ b/security/pom.xml @@ -0,0 +1,70 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + security + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + + com.hms_networks.americas.sc + fileutils + 1.15.8 + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/security/HashUtilities.java b/security/src/main/java/com/hms_networks/americas/sc/extensions/security/HashUtilities.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/security/HashUtilities.java rename to security/src/main/java/com/hms_networks/americas/sc/extensions/security/HashUtilities.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/security/SCWonkaSecurityProvider.java b/security/src/main/java/com/hms_networks/americas/sc/extensions/security/SCWonkaSecurityProvider.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/security/SCWonkaSecurityProvider.java rename to security/src/main/java/com/hms_networks/americas/sc/extensions/security/SCWonkaSecurityProvider.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/security/SecurityProviderUtilities.java b/security/src/main/java/com/hms_networks/americas/sc/extensions/security/SecurityProviderUtilities.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/security/SecurityProviderUtilities.java rename to security/src/main/java/com/hms_networks/americas/sc/extensions/security/SecurityProviderUtilities.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/security/package.html b/security/src/main/java/com/hms_networks/americas/sc/extensions/security/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/security/package.html rename to security/src/main/java/com/hms_networks/americas/sc/extensions/security/package.html diff --git a/src/assembly/sc-project.xml b/src/assembly/sc-project.xml deleted file mode 100644 index 8c00dabc..00000000 --- a/src/assembly/sc-project.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - sc-project - - tar.gz - tar.bz2 - zip - - - - ${project.basedir} - / - true - - **/*.log - **/${project.build.directory}/** - **/.eclipse/** - **/.idea/** - **/.vscode/** - **/.github/** - **/build.xml - **/web-docs/.docusaurus/** - **/web-docs/build/** - **/web-docs/node_modules/** - - - - diff --git a/src/test/java/LibraryTest.java b/src/test/java/LibraryTest.java deleted file mode 100644 index 6b034e29..00000000 --- a/src/test/java/LibraryTest.java +++ /dev/null @@ -1,22 +0,0 @@ -import com.hms_networks.americas.sc.extensions.taginfo.TagInfoTest; -import com.hms_networks.americas.sc.extensions.util.RawNumberValueUtilsTest; - -/** - * Library test class for Ewon Flexy Extensions Library. - * - * @author HMS Networks, MU Americas Solution Center - * @since 1.0.0 - */ -public class LibraryTest { - - /** - * Main test method. Invokes all test methods with a name starting with 'test' and no required - * parameters/arguments. - * - * @param args test arguments (ignored) - */ - public static void main(String[] args) { - junit.textui.TestRunner.run(TagInfoTest.class); - junit.textui.TestRunner.run(RawNumberValueUtilsTest.class); - } -} diff --git a/string/pom.xml b/string/pom.xml new file mode 100644 index 00000000..019a2d93 --- /dev/null +++ b/string/pom.xml @@ -0,0 +1,59 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + string + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/string/PreAllocatedStringBuilder.java b/string/src/main/java/com/hms_networks/americas/sc/extensions/string/PreAllocatedStringBuilder.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/string/PreAllocatedStringBuilder.java rename to string/src/main/java/com/hms_networks/americas/sc/extensions/string/PreAllocatedStringBuilder.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/string/QuoteSafeStringTokenizer.java b/string/src/main/java/com/hms_networks/americas/sc/extensions/string/QuoteSafeStringTokenizer.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/string/QuoteSafeStringTokenizer.java rename to string/src/main/java/com/hms_networks/americas/sc/extensions/string/QuoteSafeStringTokenizer.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/string/StringUtils.java b/string/src/main/java/com/hms_networks/americas/sc/extensions/string/StringUtils.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/string/StringUtils.java rename to string/src/main/java/com/hms_networks/americas/sc/extensions/string/StringUtils.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/string/package.html b/string/src/main/java/com/hms_networks/americas/sc/extensions/string/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/string/package.html rename to string/src/main/java/com/hms_networks/americas/sc/extensions/string/package.html diff --git a/system/pom.xml b/system/pom.xml new file mode 100644 index 00000000..b040cedd --- /dev/null +++ b/system/pom.xml @@ -0,0 +1,112 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + system + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + + com.hms_networks.americas.sc + localization + 1.15.8 + + + + + com.hms_networks.americas.sc + fileutils + 1.15.8 + + + + + com.hms_networks.americas.sc + logging + 1.15.8 + + + + + com.hms_networks.americas.sc + retry + 1.15.8 + + + + + com.hms_networks.americas.sc + string + 1.15.8 + + + + + com.hms_networks.americas.sc + json + 1.15.8 + + + + + com.hms_networks.americas.sc + config + 1.15.8 + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppArgsParser.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppArgsParser.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppArgsParser.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppArgsParser.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppConstants.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppConstants.java similarity index 96% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppConstants.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppConstants.java index 68b6fa89..cda48df3 100644 --- a/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppConstants.java +++ b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppConstants.java @@ -1,22 +1,22 @@ -package com.hms_networks.americas.sc.extensions.system.application; - -import java.io.File; - -/** - * Class for storing constants used in the {@link - * com.hms_networks.americas.sc.extensions.system.application} package. - * - * @since 1.14.0 - * @author HMS Networks, MU Americas Solution Center - */ -public class SCAppConstants { - - /** Filename of jvmrun file */ - public static final String JVM_RUN_FILENAME = "jvmrun"; - - /** Directory jvmrun file is located in */ - public static final String JVM_RUN_DIRECTORY = File.separator + "usr"; - - /** File path for jvmrun file */ - public static final String JVM_RUN_PATH = JVM_RUN_DIRECTORY + File.separator + JVM_RUN_FILENAME; -} +package com.hms_networks.americas.sc.extensions.system.application; + +import java.io.File; + +/** + * Class for storing constants used in the {@link + * com.hms_networks.americas.sc.extensions.system.application} package. + * + * @since 1.14.0 + * @author HMS Networks, MU Americas Solution Center + */ +public class SCAppConstants { + + /** Filename of jvmrun file */ + public static final String JVM_RUN_FILENAME = "jvmrun"; + + /** Directory jvmrun file is located in */ + public static final String JVM_RUN_DIRECTORY = File.separator + "usr"; + + /** File path for jvmrun file */ + public static final String JVM_RUN_PATH = JVM_RUN_DIRECTORY + File.separator + JVM_RUN_FILENAME; +} diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppManagement.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppManagement.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppManagement.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppManagement.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppRebootWatchdog.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppRebootWatchdog.java similarity index 97% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppRebootWatchdog.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppRebootWatchdog.java index 1c1b4316..800415d9 100644 --- a/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppRebootWatchdog.java +++ b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/application/SCAppRebootWatchdog.java @@ -1,254 +1,254 @@ -package com.hms_networks.americas.sc.extensions.system.application; - -import com.hms_networks.americas.sc.extensions.config.ConfigFileAccessManager; -import com.hms_networks.americas.sc.extensions.json.JSONException; -import com.hms_networks.americas.sc.extensions.json.JSONObject; -import com.hms_networks.americas.sc.extensions.system.time.SCTimeUnit; -import java.io.File; -import java.io.IOException; - -/** - * Utility class for handling cyclic reboots of a Java application running on the Ewon Flexy system. - * At startup the reboot watchdog will count the reboot, once the application is stable and has been - * running for a sufficient amount of time the application should service the watchdog. Servicing - * the watchdog clears the reboot count. If the watchdog is not serviced before another reboot the - * reboot count is again incremented. If the reboot count gets too high the jvmrun file is disabled. - * This functionality helps prevent cyclic reboots in faulty applications. Devices in these reboot - * loops can be difficult to access via http, ftp, or vpn. - * - * @since 1.14.0 - * @author HMS Networks, MU Americas Solution Center - */ -public class SCAppRebootWatchdog { - - /** Path for jvmrun filename when disabled by the watchdog */ - private static final String DISABLED_JVM_RUN_PATH = - SCAppConstants.JVM_RUN_DIRECTORY - + File.separator - + "disabled_" - + SCAppConstants.JVM_RUN_FILENAME; - - /** Path for reboot watchdog data file */ - private static final String REBOOT_WATCHDOG_FILE_PATH = - File.separator + "usr" + File.separator + "rebootWatchdog.json"; - - /** Key in reboot watchdog data file for reboot count */ - private static final String REBOOT_COUNT_KEY = "RebootCount"; - - /** Indent factor for reboot watchdog data file */ - private static final int REBOOT_WATCHDOG_FILE_INDENT_FACTOR = 4; - - /** Max number of reboots before watchdog disables the jvmrun file */ - private static final int MAX_REBOOT_COUNT = 10; - - /** Default time the watchdog has to run before it can be serviced */ - private static final int DEFAULT_WATCHDOG_MIN_SERVICE_TIME_SEC = 0; - - /** Contents of reboot watchdog data file */ - private static JSONObject rebootWatchdogObject; - - /** Status indicator if reboot watchdog is initialized */ - private static boolean isRebootWatchdogInit = false; - - /** Status indicator if reboot watchdog is serviced */ - private static boolean isRebootWatchdogServiced = false; - - /** The time the watchdog will accept servicing */ - private static long watchdogReadyTimeMillis; - - /** - * Enables the reboot watchdog. - * - *

The watchdog will be enabled with a default service time of 0 seconds. This means that when - * using the default service time, the watchdog can be serviced immediately after initialization. - * This ensures compatibility with existing applications that have implemented the reboot - * watchdog, but have not incorporated a sizeable delay between watchdog initialization and - * servicing. - * - *

For new applications, this method should not be used. Instead, the {@link - * #enableRebootWatchdog(int)} method should be used. - * - * @throws IOException If watchdog file cannot be read from filesystem. - * @throws JSONException If watchdog file is not valid JSON or doesn't have the correct structure. - */ - public static void enableRebootWatchdog() throws IOException, JSONException { - enableRebootWatchdog(DEFAULT_WATCHDOG_MIN_SERVICE_TIME_SEC); - } - - /** - * Enables the reboot watchdog. - * - * @param serviceTimeSec The time the watchdog has to run before it can be serviced - * @throws IOException If watchdog file cannot be read from filesystem. - * @throws JSONException If watchdog file is not valid JSON or doesn't have the correct structure. - */ - public static void enableRebootWatchdog(int serviceTimeSec) throws IOException, JSONException { - setWatchdogReadyTime(SCTimeUnit.SECONDS.toMillis(serviceTimeSec)); - initRebootWatchdogFile(); - isRebootWatchdogInit = true; - } - - /** - * Services the reboot watchdog. This should be called when the application is in a stable state - * and successful application and Ewon initialization has been detected by the application. - * - * @throws IOException If watchdog file cannot be read from filesystem. - * @throws JSONException If watchdog file is not valid JSON or doesn't have the correct structure. - * @return If the watchdog was successfully serviced. - */ - public static boolean serviceRebootWatchdog() throws IOException, JSONException { - // Only service the watchdog if its been initialized and not previously serviced - if (!isRebootWatchdogServiced && isRebootWatchdogInit && checkWatchdogWaitTimer()) { - resetRebootWatchdogFile(); - isRebootWatchdogServiced = true; - } - - return isRebootWatchdogServiced; - } - - /** - * Gets the current number of unsuccessful reboots. - * - * @return The current number of unsuccessful reboots. -1 if data file has not been read. - * @throws JSONException If the reboot count could not be read. - */ - public static int getCurrentRebootCount() throws JSONException { - if (rebootWatchdogObject != null) { - return rebootWatchdogObject.getInt(REBOOT_COUNT_KEY); - } else { - final int notInitializedValue = -1; - return notInitializedValue; - } - } - - /** - * Returns if the reboot watchdog has been initialized. - * - * @return Initialization status - */ - public static boolean isInitialized() { - return isRebootWatchdogInit; - } - - /** - * Returns if the reboot watchdog has been serviced. - * - * @return Serviced status - */ - public static boolean isServiced() { - return isRebootWatchdogServiced; - } - - /** - * Returns the time the watchdog will accept servicing - * - * @return the time the watchdog will accept servicing - */ - public static long getWatchdogReadyTimeMillis() { - return watchdogReadyTimeMillis; - } - - /** - * Initializes the reboot watchdog config file. If the file does not exist it is created and the - * reboot count is set to zero. If it exists the reboot count is read and incremented by one. - * - * @throws IOException If watchdog file cannot be read from filesystem. - * @throws JSONException If watchdog file is not valid JSON or doesn't have the correct structure. - */ - private static void initRebootWatchdogFile() throws IOException, JSONException { - int rebootCount; - File rebootWatchdogFile = new File(REBOOT_WATCHDOG_FILE_PATH); - - // Check if reboot watchdog file exists, if not create it - if (!rebootWatchdogFile.isFile()) { - rebootWatchdogObject = getDefaultRebootWatchdogObject(); - rebootCount = rebootWatchdogObject.getInt(REBOOT_COUNT_KEY); - } - // Watchdog file exists, increment the reboot count - else { - rebootWatchdogObject = - ConfigFileAccessManager.getJsonObjectFromFile(REBOOT_WATCHDOG_FILE_PATH); - rebootCount = rebootWatchdogObject.getInt(REBOOT_COUNT_KEY); - rebootCount += 1; - - // Device reboot loop has been detected - if (rebootCount > MAX_REBOOT_COUNT) { - disableJvmRunFile(); - rebootCount = 0; - } - - rebootWatchdogObject.put(REBOOT_COUNT_KEY, rebootCount); - } - - ConfigFileAccessManager.writeJsonObjectToFile( - REBOOT_WATCHDOG_FILE_PATH, REBOOT_WATCHDOG_FILE_INDENT_FACTOR, rebootWatchdogObject); - } - - /** - * Disables the jvmrun file. This is done by modifying the filename as to preserve the contents of - * the file once the system anomaly causing reboots has been corrected. - * - * @throws IOException If watchdog file cannot be read from filesystem. - * @throws JSONException If watchdog file is not valid JSON or doesn't have the correct structure. - * @return If the file was successfully disabled (renamed). - */ - private static boolean disableJvmRunFile() throws IOException, JSONException { - File jvmRunFile = new File(SCAppConstants.JVM_RUN_PATH); - File disabledJvmRunFile = new File(DISABLED_JVM_RUN_PATH); - - boolean isRenamed = jvmRunFile.renameTo(disabledJvmRunFile); - - resetRebootWatchdogFile(); - - return isRenamed; - } - - /** - * Resets the reboot count in the watchdog file. - * - * @throws IOException If watchdog file cannot be read from filesystem. - * @throws JSONException If watchdog file is not valid JSON or doesn't have the correct structure. - */ - private static void resetRebootWatchdogFile() throws IOException, JSONException { - if (isRebootWatchdogInit && rebootWatchdogObject != null) { - final int resetRebootCountValue = 0; - rebootWatchdogObject.put(REBOOT_COUNT_KEY, resetRebootCountValue); - ConfigFileAccessManager.writeJsonObjectToFile( - REBOOT_WATCHDOG_FILE_PATH, REBOOT_WATCHDOG_FILE_INDENT_FACTOR, rebootWatchdogObject); - } - } - - /** - * Generates a default watchdog file contents. - * - * @return A default watchdog file as a JSONObject - * @throws JSONException If the watchdog file object could not be created. - */ - private static JSONObject getDefaultRebootWatchdogObject() throws JSONException { - final int startingRebootCount = 0; - JSONObject defaultRebootWatchdogObject = new JSONObject(); - - defaultRebootWatchdogObject.put(REBOOT_COUNT_KEY, startingRebootCount); - - return defaultRebootWatchdogObject; - } - - /** - * Sets the time the watchdog will accept servicing - * - * @param watchdogWaitTimeMillis the amount of time the watchdog should wait before accepting - * servicing - */ - private static void setWatchdogReadyTime(long watchdogWaitTimeMillis) { - watchdogReadyTimeMillis = System.currentTimeMillis() + watchdogWaitTimeMillis; - } - - /** - * Checks if the watchdog has been running for a sufficient amount of time - * - * @return A boolean indicating if the watchdog has been running for a sufficient amount of time - */ - private static boolean checkWatchdogWaitTimer() { - return System.currentTimeMillis() >= watchdogReadyTimeMillis; - } -} +package com.hms_networks.americas.sc.extensions.system.application; + +import com.hms_networks.americas.sc.extensions.config.ConfigFileAccessManager; +import com.hms_networks.americas.sc.extensions.json.JSONException; +import com.hms_networks.americas.sc.extensions.json.JSONObject; +import com.hms_networks.americas.sc.extensions.system.time.SCTimeUnit; +import java.io.File; +import java.io.IOException; + +/** + * Utility class for handling cyclic reboots of a Java application running on the Ewon Flexy system. + * At startup the reboot watchdog will count the reboot, once the application is stable and has been + * running for a sufficient amount of time the application should service the watchdog. Servicing + * the watchdog clears the reboot count. If the watchdog is not serviced before another reboot the + * reboot count is again incremented. If the reboot count gets too high the jvmrun file is disabled. + * This functionality helps prevent cyclic reboots in faulty applications. Devices in these reboot + * loops can be difficult to access via http, ftp, or vpn. + * + * @since 1.14.0 + * @author HMS Networks, MU Americas Solution Center + */ +public class SCAppRebootWatchdog { + + /** Path for jvmrun filename when disabled by the watchdog */ + private static final String DISABLED_JVM_RUN_PATH = + SCAppConstants.JVM_RUN_DIRECTORY + + File.separator + + "disabled_" + + SCAppConstants.JVM_RUN_FILENAME; + + /** Path for reboot watchdog data file */ + private static final String REBOOT_WATCHDOG_FILE_PATH = + File.separator + "usr" + File.separator + "rebootWatchdog.json"; + + /** Key in reboot watchdog data file for reboot count */ + private static final String REBOOT_COUNT_KEY = "RebootCount"; + + /** Indent factor for reboot watchdog data file */ + private static final int REBOOT_WATCHDOG_FILE_INDENT_FACTOR = 4; + + /** Max number of reboots before watchdog disables the jvmrun file */ + private static final int MAX_REBOOT_COUNT = 10; + + /** Default time the watchdog has to run before it can be serviced */ + private static final int DEFAULT_WATCHDOG_MIN_SERVICE_TIME_SEC = 0; + + /** Contents of reboot watchdog data file */ + private static JSONObject rebootWatchdogObject; + + /** Status indicator if reboot watchdog is initialized */ + private static boolean isRebootWatchdogInit = false; + + /** Status indicator if reboot watchdog is serviced */ + private static boolean isRebootWatchdogServiced = false; + + /** The time the watchdog will accept servicing */ + private static long watchdogReadyTimeMillis; + + /** + * Enables the reboot watchdog. + * + *

The watchdog will be enabled with a default service time of 0 seconds. This means that when + * using the default service time, the watchdog can be serviced immediately after initialization. + * This ensures compatibility with existing applications that have implemented the reboot + * watchdog, but have not incorporated a sizeable delay between watchdog initialization and + * servicing. + * + *

For new applications, this method should not be used. Instead, the {@link + * #enableRebootWatchdog(int)} method should be used. + * + * @throws IOException If watchdog file cannot be read from filesystem. + * @throws JSONException If watchdog file is not valid JSON or doesn't have the correct structure. + */ + public static void enableRebootWatchdog() throws IOException, JSONException { + enableRebootWatchdog(DEFAULT_WATCHDOG_MIN_SERVICE_TIME_SEC); + } + + /** + * Enables the reboot watchdog. + * + * @param serviceTimeSec The time the watchdog has to run before it can be serviced + * @throws IOException If watchdog file cannot be read from filesystem. + * @throws JSONException If watchdog file is not valid JSON or doesn't have the correct structure. + */ + public static void enableRebootWatchdog(int serviceTimeSec) throws IOException, JSONException { + setWatchdogReadyTime(SCTimeUnit.SECONDS.toMillis(serviceTimeSec)); + initRebootWatchdogFile(); + isRebootWatchdogInit = true; + } + + /** + * Services the reboot watchdog. This should be called when the application is in a stable state + * and successful application and Ewon initialization has been detected by the application. + * + * @throws IOException If watchdog file cannot be read from filesystem. + * @throws JSONException If watchdog file is not valid JSON or doesn't have the correct structure. + * @return If the watchdog was successfully serviced. + */ + public static boolean serviceRebootWatchdog() throws IOException, JSONException { + // Only service the watchdog if its been initialized and not previously serviced + if (!isRebootWatchdogServiced && isRebootWatchdogInit && checkWatchdogWaitTimer()) { + resetRebootWatchdogFile(); + isRebootWatchdogServiced = true; + } + + return isRebootWatchdogServiced; + } + + /** + * Gets the current number of unsuccessful reboots. + * + * @return The current number of unsuccessful reboots. -1 if data file has not been read. + * @throws JSONException If the reboot count could not be read. + */ + public static int getCurrentRebootCount() throws JSONException { + if (rebootWatchdogObject != null) { + return rebootWatchdogObject.getInt(REBOOT_COUNT_KEY); + } else { + final int notInitializedValue = -1; + return notInitializedValue; + } + } + + /** + * Returns if the reboot watchdog has been initialized. + * + * @return Initialization status + */ + public static boolean isInitialized() { + return isRebootWatchdogInit; + } + + /** + * Returns if the reboot watchdog has been serviced. + * + * @return Serviced status + */ + public static boolean isServiced() { + return isRebootWatchdogServiced; + } + + /** + * Returns the time the watchdog will accept servicing + * + * @return the time the watchdog will accept servicing + */ + public static long getWatchdogReadyTimeMillis() { + return watchdogReadyTimeMillis; + } + + /** + * Initializes the reboot watchdog config file. If the file does not exist it is created and the + * reboot count is set to zero. If it exists the reboot count is read and incremented by one. + * + * @throws IOException If watchdog file cannot be read from filesystem. + * @throws JSONException If watchdog file is not valid JSON or doesn't have the correct structure. + */ + private static void initRebootWatchdogFile() throws IOException, JSONException { + int rebootCount; + File rebootWatchdogFile = new File(REBOOT_WATCHDOG_FILE_PATH); + + // Check if reboot watchdog file exists, if not create it + if (!rebootWatchdogFile.isFile()) { + rebootWatchdogObject = getDefaultRebootWatchdogObject(); + rebootCount = rebootWatchdogObject.getInt(REBOOT_COUNT_KEY); + } + // Watchdog file exists, increment the reboot count + else { + rebootWatchdogObject = + ConfigFileAccessManager.getJsonObjectFromFile(REBOOT_WATCHDOG_FILE_PATH); + rebootCount = rebootWatchdogObject.getInt(REBOOT_COUNT_KEY); + rebootCount += 1; + + // Device reboot loop has been detected + if (rebootCount > MAX_REBOOT_COUNT) { + disableJvmRunFile(); + rebootCount = 0; + } + + rebootWatchdogObject.put(REBOOT_COUNT_KEY, rebootCount); + } + + ConfigFileAccessManager.writeJsonObjectToFile( + REBOOT_WATCHDOG_FILE_PATH, REBOOT_WATCHDOG_FILE_INDENT_FACTOR, rebootWatchdogObject); + } + + /** + * Disables the jvmrun file. This is done by modifying the filename as to preserve the contents of + * the file once the system anomaly causing reboots has been corrected. + * + * @throws IOException If watchdog file cannot be read from filesystem. + * @throws JSONException If watchdog file is not valid JSON or doesn't have the correct structure. + * @return If the file was successfully disabled (renamed). + */ + private static boolean disableJvmRunFile() throws IOException, JSONException { + File jvmRunFile = new File(SCAppConstants.JVM_RUN_PATH); + File disabledJvmRunFile = new File(DISABLED_JVM_RUN_PATH); + + boolean isRenamed = jvmRunFile.renameTo(disabledJvmRunFile); + + resetRebootWatchdogFile(); + + return isRenamed; + } + + /** + * Resets the reboot count in the watchdog file. + * + * @throws IOException If watchdog file cannot be read from filesystem. + * @throws JSONException If watchdog file is not valid JSON or doesn't have the correct structure. + */ + private static void resetRebootWatchdogFile() throws IOException, JSONException { + if (isRebootWatchdogInit && rebootWatchdogObject != null) { + final int resetRebootCountValue = 0; + rebootWatchdogObject.put(REBOOT_COUNT_KEY, resetRebootCountValue); + ConfigFileAccessManager.writeJsonObjectToFile( + REBOOT_WATCHDOG_FILE_PATH, REBOOT_WATCHDOG_FILE_INDENT_FACTOR, rebootWatchdogObject); + } + } + + /** + * Generates a default watchdog file contents. + * + * @return A default watchdog file as a JSONObject + * @throws JSONException If the watchdog file object could not be created. + */ + private static JSONObject getDefaultRebootWatchdogObject() throws JSONException { + final int startingRebootCount = 0; + JSONObject defaultRebootWatchdogObject = new JSONObject(); + + defaultRebootWatchdogObject.put(REBOOT_COUNT_KEY, startingRebootCount); + + return defaultRebootWatchdogObject; + } + + /** + * Sets the time the watchdog will accept servicing + * + * @param watchdogWaitTimeMillis the amount of time the watchdog should wait before accepting + * servicing + */ + private static void setWatchdogReadyTime(long watchdogWaitTimeMillis) { + watchdogReadyTimeMillis = System.currentTimeMillis() + watchdogWaitTimeMillis; + } + + /** + * Checks if the watchdog has been running for a sufficient amount of time + * + * @return A boolean indicating if the watchdog has been running for a sufficient amount of time + */ + private static boolean checkWatchdogWaitTimer() { + return System.currentTimeMillis() >= watchdogReadyTimeMillis; + } +} diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/application/package.html b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/application/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/application/package.html rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/application/package.html diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpAuthException.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpAuthException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpAuthException.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpAuthException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpConnectionException.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpConnectionException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpConnectionException.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpConnectionException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpEwonException.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpEwonException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpEwonException.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpEwonException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpUnknownException.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpUnknownException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpUnknownException.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpUnknownException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpUtility.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpUtility.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpUtility.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/SCHttpUtility.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/package.html b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/package.html rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/package.html diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpDeleteRequestInfo.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpDeleteRequestInfo.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpDeleteRequestInfo.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpDeleteRequestInfo.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpGetRequestInfo.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpGetRequestInfo.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpGetRequestInfo.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpGetRequestInfo.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpHeadRequestInfo.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpHeadRequestInfo.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpHeadRequestInfo.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpHeadRequestInfo.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpOptionsRequestInfo.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpOptionsRequestInfo.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpOptionsRequestInfo.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpOptionsRequestInfo.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPatchRequestInfo.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPatchRequestInfo.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPatchRequestInfo.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPatchRequestInfo.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPostRequestInfo.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPostRequestInfo.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPostRequestInfo.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPostRequestInfo.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPurgeRequestInfo.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPurgeRequestInfo.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPurgeRequestInfo.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPurgeRequestInfo.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPutRequestInfo.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPutRequestInfo.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPutRequestInfo.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpPutRequestInfo.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpRequestInfo.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpRequestInfo.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpRequestInfo.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/SCHttpRequestInfo.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/package.html b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/package.html rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/http/requests/package.html diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/info/SCSystemInfo.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/info/SCSystemInfo.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/info/SCSystemInfo.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/info/SCSystemInfo.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/info/package.html b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/info/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/info/package.html rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/info/package.html diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/package.html b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/package.html rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/package.html diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/tags/SCTagUtils.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/tags/SCTagUtils.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/tags/SCTagUtils.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/tags/SCTagUtils.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/tags/package.html b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/tags/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/tags/package.html rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/tags/package.html diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/threading/SCCountdownLatch.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/threading/SCCountdownLatch.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/threading/SCCountdownLatch.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/threading/SCCountdownLatch.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/threading/package.html b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/threading/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/threading/package.html rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/threading/package.html diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/time/LocalTimeOffsetCalculator.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/time/LocalTimeOffsetCalculator.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/time/LocalTimeOffsetCalculator.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/time/LocalTimeOffsetCalculator.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeSpan.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeSpan.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeSpan.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeSpan.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeUnit.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeUnit.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeUnit.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeUnit.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeUtils.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeUtils.java similarity index 93% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeUtils.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeUtils.java index bc917984..20514f08 100644 --- a/src/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeUtils.java +++ b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/time/SCTimeUtils.java @@ -1,7 +1,6 @@ package com.hms_networks.americas.sc.extensions.system.time; import com.ewon.ewonitf.SysControlBlock; -import com.hms_networks.americas.sc.extensions.datapoint.DataPoint; import com.hms_networks.americas.sc.extensions.localization.LocalizationManager; import com.hms_networks.americas.sc.extensions.localization.LocalizationManager.DateTimeKey; import java.text.SimpleDateFormat; @@ -209,20 +208,8 @@ public static String getIso8601FormattedTimestampForDate(Date date) throws Excep return formattedTimestamp; } - /** - * Returns an ISO 8601 formatted string representing the timestamp of the specified data point in - * the applicable time zone (UTC or local, depending on the value returned by {@link - * #getTagDataExportedInUtc()}). - * - * @param dataPoint data point to get timestamp for - * @return ISO 8601 formatted string representing the timestamp of the specified data point in the - * applicable time zone - * @throws Exception if unable to get UTC export value - */ - public static String getIso8601FormattedTimestampForDataPoint(DataPoint dataPoint) - throws Exception { - return getIso8601FormattedTimestampForDate(dataPoint.getTimeStampAsDate()); - } + // TODO: GIT HISTORY TRACKING: + // public static String getIso8601FormattedTimestampForDataPoint(DataPoint dataPoint) REMOVED /** * Returns a string representing the specified time span (in milliseconds) in the format of diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/time/TimeLibConstants.java b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/time/TimeLibConstants.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/time/TimeLibConstants.java rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/time/TimeLibConstants.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/system/time/package.html b/system/src/main/java/com/hms_networks/americas/sc/extensions/system/time/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/system/time/package.html rename to system/src/main/java/com/hms_networks/americas/sc/extensions/system/time/package.html diff --git a/taginfo/pom.xml b/taginfo/pom.xml new file mode 100644 index 00000000..dede8431 --- /dev/null +++ b/taginfo/pom.xml @@ -0,0 +1,91 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + taginfo + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + + com.hms_networks.americas.sc + json + 1.15.8 + + + + + com.hms_networks.americas.sc + string + 1.15.8 + + + + + com.hms_networks.americas.sc + fileutils + 1.15.8 + + + + + com.hms_networks.americas.sc + logging + 1.15.8 + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagConstants.java b/taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagConstants.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagConstants.java rename to taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagConstants.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagGroup.java b/taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagGroup.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagGroup.java rename to taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagGroup.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfo.java b/taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfo.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfo.java rename to taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfo.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoBufferException.java b/taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoBufferException.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoBufferException.java rename to taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoBufferException.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoEnumeratedIntToString.java b/taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoEnumeratedIntToString.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoEnumeratedIntToString.java rename to taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoEnumeratedIntToString.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoManager.java b/taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoManager.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoManager.java rename to taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoManager.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagType.java b/taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagType.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagType.java rename to taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagType.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/package.html b/taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/taginfo/package.html rename to taginfo/src/main/java/com/hms_networks/americas/sc/extensions/taginfo/package.html diff --git a/src/test/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoTest.java b/taginfo/src/test/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoTest.java similarity index 97% rename from src/test/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoTest.java rename to taginfo/src/test/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoTest.java index 04da9635..a051fd8a 100644 --- a/src/test/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoTest.java +++ b/taginfo/src/test/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoTest.java @@ -201,10 +201,10 @@ protected void tearDown() throws Exception { } /** - * Basic test method for {@link com.hms_networks.americas.sc.extensions.taginfo.TagInfo} objects. + * Basic test method for {@link TagInfo} objects. * *

This test performs basic checks to ensure that {@link - * com.hms_networks.americas.sc.extensions.taginfo.TagInfo} objects store data properly. + * TagInfo} objects store data properly. * * @since 1.0.0 */ diff --git a/tagupdateservice/pom.xml b/tagupdateservice/pom.xml new file mode 100644 index 00000000..32808d6c --- /dev/null +++ b/tagupdateservice/pom.xml @@ -0,0 +1,84 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + tagupdateservice + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + + + com.hms_networks.americas.sc + json + 1.15.8 + + + + + com.hms_networks.americas.sc + logging + 1.15.8 + + + + + com.hms_networks.americas.sc + taginfo + 1.15.8 + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/tagupdateservice/TagUpdateHandler.java b/tagupdateservice/src/main/java/com/hms_networks/americas/sc/extensions/tagupdateservice/TagUpdateHandler.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/tagupdateservice/TagUpdateHandler.java rename to tagupdateservice/src/main/java/com/hms_networks/americas/sc/extensions/tagupdateservice/TagUpdateHandler.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/tagupdateservice/TagUpdateResult.java b/tagupdateservice/src/main/java/com/hms_networks/americas/sc/extensions/tagupdateservice/TagUpdateResult.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/tagupdateservice/TagUpdateResult.java rename to tagupdateservice/src/main/java/com/hms_networks/americas/sc/extensions/tagupdateservice/TagUpdateResult.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/tagupdateservice/package.html b/tagupdateservice/src/main/java/com/hms_networks/americas/sc/extensions/tagupdateservice/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/tagupdateservice/package.html rename to tagupdateservice/src/main/java/com/hms_networks/americas/sc/extensions/tagupdateservice/package.html diff --git a/util/pom.xml b/util/pom.xml new file mode 100644 index 00000000..b1f5d11c --- /dev/null +++ b/util/pom.xml @@ -0,0 +1,59 @@ + + + + 4.0.0 + + + + com.hms_networks.americas.sc + extensions + 1.15.8 + + + + util + + + + + + + com.igormaznitsa + mvn-jlink-wrapper + + + cache-jdk-for-build + initialize + + cache-jdk + + + ${pom.parent.build.directory}${file.separator}buildJdk + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/util/Base64.java b/util/src/main/java/com/hms_networks/americas/sc/extensions/util/Base64.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/util/Base64.java rename to util/src/main/java/com/hms_networks/americas/sc/extensions/util/Base64.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/util/RawNumberValueUtils.java b/util/src/main/java/com/hms_networks/americas/sc/extensions/util/RawNumberValueUtils.java similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/util/RawNumberValueUtils.java rename to util/src/main/java/com/hms_networks/americas/sc/extensions/util/RawNumberValueUtils.java diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/util/package.html b/util/src/main/java/com/hms_networks/americas/sc/extensions/util/package.html similarity index 100% rename from src/main/java/com/hms_networks/americas/sc/extensions/util/package.html rename to util/src/main/java/com/hms_networks/americas/sc/extensions/util/package.html diff --git a/src/test/java/com/hms_networks/americas/sc/extensions/util/RawNumberValueUtilsTest.java b/util/src/test/java/com/hms_networks/americas/sc/extensions/util/RawNumberValueUtilsTest.java similarity index 99% rename from src/test/java/com/hms_networks/americas/sc/extensions/util/RawNumberValueUtilsTest.java rename to util/src/test/java/com/hms_networks/americas/sc/extensions/util/RawNumberValueUtilsTest.java index 03e32437..f84d9bb9 100644 --- a/src/test/java/com/hms_networks/americas/sc/extensions/util/RawNumberValueUtilsTest.java +++ b/util/src/test/java/com/hms_networks/americas/sc/extensions/util/RawNumberValueUtilsTest.java @@ -5,7 +5,7 @@ /** * Library test class for the {@link - * com.hms_networks.americas.sc.extensions.util.RawNumberValueUtils} class in the Ewon Flexy + * RawNumberValueUtils} class in the Ewon Flexy * Extensions Library. * * @author HMS Networks, MU Americas Solution Center