├── README.md ├── mqtt-spy-common ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.m2e.core.prefs ├── pom.xml └── src │ ├── main │ ├── java │ │ ├── .gitignore │ │ └── pl │ │ │ └── baczkowicz │ │ │ └── mqttspy │ │ │ ├── audit │ │ │ └── MqttAuditReplay.java │ │ │ ├── common │ │ │ └── generated │ │ │ │ ├── LoggedMqttMessage.java │ │ │ │ ├── MessageLog.java │ │ │ │ ├── MessageLogEnum.java │ │ │ │ ├── MqttConnectionDetails.java │ │ │ │ ├── ObjectFactory.java │ │ │ │ ├── ProtocolVersionEnum.java │ │ │ │ ├── PublicationDetails.java │ │ │ │ ├── SecureSocketSettings.java │ │ │ │ ├── SimpleMqttMessage.java │ │ │ │ ├── SubscriptionDetails.java │ │ │ │ └── package-info.java │ │ │ ├── connectivity │ │ │ ├── BaseMqttConnection.java │ │ │ ├── BaseMqttSubscription.java │ │ │ ├── IMqttConnection.java │ │ │ ├── MqttConnectionDetailsWithOptions.java │ │ │ ├── MqttConnectionWithReconnection.java │ │ │ ├── SimpleMqttConnection.java │ │ │ └── topicmatching │ │ │ │ ├── MapBasedSubscriptionStore.java │ │ │ │ └── TopicMatcher.java │ │ │ ├── kura │ │ │ └── KuraPayloadFormatter.java │ │ │ ├── logger │ │ │ ├── IMqttMessageLogIO.java │ │ │ ├── MqttMessageLogIO.java │ │ │ ├── MqttMessageLogParser.java │ │ │ ├── MqttMessageLogParserUtils.java │ │ │ ├── MqttMessageLogger.java │ │ │ └── SimpleMqttMessageLogComposer.java │ │ │ ├── messages │ │ │ ├── BaseMqttMessage.java │ │ │ ├── FormattedMqttMessage.java │ │ │ ├── IBaseMqttMessage.java │ │ │ └── SimpleMqttMessageWrapper.java │ │ │ ├── scripts │ │ │ ├── IMqttScriptIO.java │ │ │ ├── MqttScriptIO.java │ │ │ └── MqttScriptManager.java │ │ │ └── utils │ │ │ ├── ConnectionUtils.java │ │ │ ├── MqttConfigurationUtils.java │ │ │ ├── MqttUtils.java │ │ │ └── Utils.java │ └── resources │ │ ├── certificates │ │ ├── certificate_authority_files │ │ │ ├── iot.eclipse.org.crt │ │ │ └── mosquitto.org.crt │ │ ├── public_brokers.bks │ │ ├── public_brokers.jceks │ │ └── public_brokers.jks │ │ ├── formatters │ │ ├── eclipseKura.js │ │ ├── prettyJson.js │ │ └── prettyXml.js │ │ ├── mqtt-spy-common-bindings.xjb │ │ ├── mqtt-spy-common.catalog │ │ └── mqtt-spy-common.xsd │ └── test │ ├── java │ └── pl │ │ └── baczkowicz │ │ └── mqttspy │ │ ├── connectivity │ │ └── ConnectionTestingWithMosquitto.java │ │ ├── formatting │ │ └── FormattingPerformanceTest.java │ │ ├── kura │ │ └── KuraFormatterTest.java │ │ └── logger │ │ └── SimpleMessageLogComposerTest.java │ └── resources │ ├── kura │ ├── formatter.js │ ├── kura.birth │ └── kura.messages │ ├── log4j.xml │ ├── mosquitto │ ├── mosquitto_allow_anon.conf │ ├── mosquitto_specified_users.conf │ ├── mosquitto_ssl_server_and_client.conf │ ├── mosquitto_ssl_server_only.conf │ ├── mosquitto_users.txt │ └── ssl │ │ ├── bouncy_castle │ │ ├── client.crt │ │ ├── client.csr │ │ ├── client.key │ │ └── generate-client.sh │ │ ├── ca.crt │ │ ├── ca.key │ │ ├── ca.srl │ │ ├── mosquitto_sub │ │ ├── client.crt │ │ ├── client.csr │ │ ├── client.key │ │ └── generate-client.sh │ │ ├── mqtt-spy-test.crt │ │ ├── mqtt-spy-test.csr │ │ └── mqtt-spy-test.key │ └── scripts │ └── base64-body-decoder.js ├── mqtt-spy-daemon ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.m2e.core.prefs ├── buildNumber.properties ├── pom.xml └── src │ ├── main │ ├── java │ │ ├── META-INF │ │ │ └── sun-jaxb.episode │ │ └── pl │ │ │ └── baczkowicz │ │ │ └── mqttspy │ │ │ └── daemon │ │ │ ├── Main.java │ │ │ ├── MqttSpyDaemon.java │ │ │ ├── configuration │ │ │ ├── MqttSpyDaemonConfigLoader.java │ │ │ ├── MqttSpyDaemonConstants.java │ │ │ └── generated │ │ │ │ ├── DaemonMqttConnectionDetails.java │ │ │ │ ├── MqttSpyDaemonConfiguration.java │ │ │ │ ├── ObjectFactory.java │ │ │ │ └── package-info.java │ │ │ └── connectivity │ │ │ ├── MqttCallbackHandler.java │ │ │ └── SimpleMqttConnectionRunnable.java │ └── resources │ │ ├── log4j.properties │ │ ├── mqtt-spy-daemon-configuration.xsd │ │ ├── mqtt-spy-daemon.catalog │ │ ├── mqtt-spy-daemon.properties │ │ ├── sample-configuration.xml │ │ └── sample-publish.js │ └── test │ ├── java │ └── pl │ │ └── baczkowicz │ │ └── mqttspy │ │ └── daemon │ │ └── MqttSpyDaemonTest.java │ └── resources │ ├── bedroom.js │ ├── mqtt-spy-daemon.messages │ ├── publish_time.js │ ├── replay.js │ ├── reply.js │ ├── test_cases │ ├── sample1 │ │ └── tc.js │ └── test3 │ │ └── tc3.js │ └── test_configurations │ ├── basic-configuration.xml │ ├── localhost-configuration.xml │ ├── mosquitto-org.xml │ └── test-cases-iot-eclipse.xml ├── mqtt-spy ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.m2e.core.prefs ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ ├── .gitignore │ │ └── pl │ │ │ └── baczkowicz │ │ │ └── mqttspy │ │ │ ├── Main.java │ │ │ ├── configuration │ │ │ ├── ConfigurationUtils.java │ │ │ ├── ConfiguredMqttConnectionDetails.java │ │ │ ├── MqttConfigurationManager.java │ │ │ └── generated │ │ │ │ ├── BaseMqttMessage.java │ │ │ │ ├── Connectivity.java │ │ │ │ ├── MqttSpyConfiguration.java │ │ │ │ ├── ObjectFactory.java │ │ │ │ ├── TabbedSubscriptionDetails.java │ │ │ │ ├── UI.java │ │ │ │ ├── UserAuthentication.java │ │ │ │ ├── UserAuthenticationOptions.java │ │ │ │ ├── UserInterfaceMqttConnectionDetails.java │ │ │ │ └── package-info.java │ │ │ ├── connectivity │ │ │ ├── MqttAsyncConnection.java │ │ │ ├── MqttAsyncConnectionRunnable.java │ │ │ ├── MqttConnectionFactory.java │ │ │ ├── MqttRuntimeConnectionProperties.java │ │ │ ├── MqttSubscription.java │ │ │ └── handlers │ │ │ │ ├── MqttCallbackHandler.java │ │ │ │ ├── MqttConnectionResultHandler.java │ │ │ │ ├── MqttDisconnectionResultHandler.java │ │ │ │ ├── MqttEventHandler.java │ │ │ │ └── MqttMessageHandler.java │ │ │ ├── stats │ │ │ └── generated │ │ │ │ ├── MqttSpyStats.java │ │ │ │ ├── ObjectFactory.java │ │ │ │ └── package-info.java │ │ │ └── ui │ │ │ ├── MqttConnectionViewManager.java │ │ │ ├── MqttSubscriptionViewManager.java │ │ │ ├── MqttViewManager.java │ │ │ ├── controllers │ │ │ ├── EditMqttConnectionController.java │ │ │ ├── MessageController.java │ │ │ ├── MessageListTableController.java │ │ │ ├── MessageNavigationController.java │ │ │ ├── MqttConnectionController.java │ │ │ ├── MqttSpyMainController.java │ │ │ ├── NewPublicationController.java │ │ │ ├── NewSubscriptionController.java │ │ │ ├── PublicationScriptsController.java │ │ │ ├── SearchPaneController.java │ │ │ ├── SearchWindowController.java │ │ │ ├── SubscriptionController.java │ │ │ ├── SubscriptionSummaryTableController.java │ │ │ ├── SubscriptionsController.java │ │ │ └── edit │ │ │ │ ├── EditConnectionConnectivityController.java │ │ │ │ ├── EditConnectionLastWillController.java │ │ │ │ ├── EditConnectionMessageLogController.java │ │ │ │ ├── EditConnectionOtherController.java │ │ │ │ ├── EditConnectionPublicationsController.java │ │ │ │ ├── EditConnectionSecurityController.java │ │ │ │ ├── EditConnectionSecurityTlsCertificatesController.java │ │ │ │ ├── EditConnectionSecurityTlsKeyStoresController.java │ │ │ │ ├── EditConnectionSecurityTlsPropertiesController.java │ │ │ │ ├── EditConnectionSubscriptionsController.java │ │ │ │ └── IEditConnectionSubController.java │ │ │ ├── controlpanel │ │ │ ├── MqttConfigControlPanelItem.java │ │ │ └── MqttStatsControlPanelItem.java │ │ │ ├── events │ │ │ ├── ShowNewMqttSubscriptionWindowEvent.java │ │ │ ├── SubscriptionStatusChangeEvent.java │ │ │ └── queuable │ │ │ │ ├── UIEventHandler.java │ │ │ │ └── connectivity │ │ │ │ ├── MqttConnectionAttemptFailureEvent.java │ │ │ │ ├── MqttConnectionAttemptSuccessEvent.java │ │ │ │ ├── MqttConnectionFailureEvent.java │ │ │ │ ├── MqttConnectionLostEvent.java │ │ │ │ ├── MqttConnectionSuccessEvent.java │ │ │ │ ├── MqttDisconnectionAttemptFailureEvent.java │ │ │ │ └── MqttDisconnectionAttemptSuccessEvent.java │ │ │ ├── messagelog │ │ │ ├── LogReaderTask.java │ │ │ ├── MessageLogUtils.java │ │ │ └── TaskWithProgressUpdater.java │ │ │ ├── scripts │ │ │ └── InteractiveScriptManager.java │ │ │ ├── stats │ │ │ └── MqttStatsFileIO.java │ │ │ └── utils │ │ │ ├── ConnectivityUtils.java │ │ │ ├── ContextMenuUtils.java │ │ │ ├── DialogUtils.java │ │ │ └── MqttStylingUtils.java │ └── resources │ │ ├── log4j.properties │ │ ├── mqtt-spy-configuration-bindings.xjb │ │ ├── mqtt-spy-configuration.xsd │ │ ├── mqtt-spy-stats.xsd │ │ ├── mqtt-spy.catalog │ │ ├── mqtt-spy.properties │ │ ├── samples │ │ ├── empty-mqtt-spy-configuration.xml │ │ ├── mqtt-spy-ui.properties │ │ ├── sample-mqtt-spy-configuration.xml │ │ └── template-script.js │ │ └── ui │ │ ├── css │ │ └── application.css │ │ ├── fxml │ │ ├── ConnectionTab.fxml │ │ ├── EditConnectionConnectivityPane.fxml │ │ ├── EditConnectionLastWillPane.fxml │ │ ├── EditConnectionMessageLogPane.fxml │ │ ├── EditConnectionOtherPane.fxml │ │ ├── EditConnectionPublicationsPane.fxml │ │ ├── EditConnectionSecurityPane.fxml │ │ ├── EditConnectionSecurityTlsCertificatesPane.fxml │ │ ├── EditConnectionSecurityTlsKeyStoresPane.fxml │ │ ├── EditConnectionSecurityTlsPropertiesPane.fxml │ │ ├── EditConnectionSubscriptionsPane.fxml │ │ ├── EditMqttConnectionPane.fxml │ │ ├── MessageListTablePane.fxml │ │ ├── MessageNavigationPane.fxml │ │ ├── MessagePane.fxml │ │ ├── MqttSpyMainWindow.fxml │ │ ├── NewPublicationPane.fxml │ │ ├── NewSubscriptionPane.fxml │ │ ├── PublicationScriptsPane.fxml │ │ ├── SearchPane.fxml │ │ ├── SearchWindow.fxml │ │ ├── SubscriptionPane.fxml │ │ └── SubscriptionSummaryTablePane.fxml │ │ └── images │ │ ├── mqtt-icon.png │ │ └── mqtt-spy-logo.png │ └── test │ ├── java │ └── pl │ │ └── baczkowicz │ │ ├── mqtt │ │ └── spy │ │ │ └── versions │ │ │ └── VersionComparison.java │ │ └── mqttspy │ │ ├── connectivity │ │ ├── MqttConnectionTest.java │ │ └── messagestore │ │ │ └── ObservableMessageStoreWithFilteringTest.java │ │ ├── stats │ │ └── StatisticsManagerTest.java │ │ ├── ui │ │ └── utils │ │ │ └── FormattingUtilsTest.java │ │ └── xml │ │ └── XMLParserTest.java │ └── resources │ ├── mqtt-spy-versions.xml │ ├── mqtt_toolbox_samples │ ├── post3_pub_sample1.js │ ├── post3_pub_sample2.js │ ├── post3_pub_sample3.js │ ├── post3_search_sample1.js │ ├── post3_sub_sample1.js │ └── tc_post3.js │ ├── pre_scripts │ └── bedroom.js │ ├── sample_log4j.xml │ ├── scripts │ ├── audit_replay.js │ ├── bedroom.js │ ├── floor1_json.js │ ├── floor1_xml.js │ ├── kitchen.js │ ├── msg1.js │ ├── office.js │ ├── other │ │ ├── loop1.js │ │ ├── loop2.js │ │ └── loop3.js │ ├── publish_image.js │ ├── publish_time.js │ ├── replay_message_log.js │ ├── single_message.js │ └── with_parameters.js │ ├── search_scripts │ └── temp.js │ ├── sub_scripts │ └── reply.js │ ├── test-mqtt-spy-configuration-no-formatting.xml │ ├── test-mqtt-spy-configuration.xml │ ├── test_cases │ ├── test1 │ │ └── tc.js │ ├── test2 │ │ └── tc.js │ ├── test3 │ │ └── tc.js │ └── test4 │ │ └── tc.js │ └── virtual_iot_meetup_samples │ ├── audit_replay.js │ ├── bedrooms.messages │ ├── inline_json_search.txt │ ├── kura.messages │ ├── publish_time.js │ ├── room_bedroom1.js │ ├── room_bedroom2.js │ ├── room_kitchen.js │ ├── room_living.js │ ├── socket_all.js │ ├── socket_lights.js │ ├── socket_tv.js │ ├── subscription_auto-reply.js │ └── with_parameters.js ├── pom.xml ├── spy-common-ui ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ ├── .gitignore │ │ └── pl │ │ │ └── baczkowicz │ │ │ └── spy │ │ │ └── ui │ │ │ ├── BaseViewManager.java │ │ │ ├── IConnectionViewManager.java │ │ │ ├── charts │ │ │ ├── ChartFactory.java │ │ │ ├── ChartMode.java │ │ │ ├── ChartSeriesStatusEnum.java │ │ │ └── ChartSeriesTypeEnum.java │ │ │ ├── configuration │ │ │ ├── BaseConfigurationManager.java │ │ │ ├── ConfiguredConnectionGroupDetails.java │ │ │ ├── IConfigurationManager.java │ │ │ └── UiProperties.java │ │ │ ├── connections │ │ │ ├── IConnectionFactory.java │ │ │ └── IUiConnection.java │ │ │ ├── controllers │ │ │ ├── AboutController.java │ │ │ ├── ControlPanelController.java │ │ │ ├── ControlPanelItemController.java │ │ │ ├── EditChartSeriesController.java │ │ │ ├── EditConnectionGroupController.java │ │ │ ├── EditConnectionsController.java │ │ │ ├── FormattersController.java │ │ │ ├── IConnectionController.java │ │ │ ├── LineChartPaneController.java │ │ │ ├── PieChartPaneController.java │ │ │ ├── TestCaseExecutionController.java │ │ │ └── TestCasesExecutionController.java │ │ │ ├── controlpanel │ │ │ ├── ConnectionsControlPanelItem.java │ │ │ ├── ControlPanelStatsUpdater.java │ │ │ ├── IControlPanelItem.java │ │ │ └── ItemStatus.java │ │ │ ├── controls │ │ │ ├── CommandLinksDialog.java │ │ │ ├── DialogAction.java │ │ │ ├── DragAndDropTreeViewCell.java │ │ │ ├── GettingInvolvedTooltip.java │ │ │ ├── StyledTextAreaWrapper.java │ │ │ ├── TextAreaInterface.java │ │ │ ├── TextAreaWrapper.java │ │ │ └── WorkerProgressPane.java │ │ │ ├── events │ │ │ ├── AddConnectionTabEvent.java │ │ │ ├── ClearTabEvent.java │ │ │ ├── ConfigurationLoadedEvent.java │ │ │ ├── ConnectionNameChangedEvent.java │ │ │ ├── ConnectionStatusChangeEvent.java │ │ │ ├── ConnectionsChangedEvent.java │ │ │ ├── CreateNewConnectionEvent.java │ │ │ ├── FormattersChangedEvent.java │ │ │ ├── LoadConfigurationFileEvent.java │ │ │ ├── MessageAddedEvent.java │ │ │ ├── MessageFormatChangeEvent.java │ │ │ ├── MessageIndexChangeEvent.java │ │ │ ├── MessageIndexIncrementEvent.java │ │ │ ├── MessageIndexToFirstEvent.java │ │ │ ├── MessageListChangedEvent.java │ │ │ ├── MessageRemovedEvent.java │ │ │ ├── NewPerspectiveSelectedEvent.java │ │ │ ├── SaveChartSeriesEvent.java │ │ │ ├── ShowAboutWindowEvent.java │ │ │ ├── ShowEditChartSeriesWindowEvent.java │ │ │ ├── ShowEditConnectionsWindowEvent.java │ │ │ ├── ShowExternalWebPageEvent.java │ │ │ ├── ShowFormattersWindowEvent.java │ │ │ ├── ShowMessageLogEvent.java │ │ │ ├── ShowTestCasesWindowEvent.java │ │ │ ├── VersionInfoErrorEvent.java │ │ │ ├── VersionInfoReceivedEvent.java │ │ │ ├── observers │ │ │ │ └── ItemsReorderedObserver.java │ │ │ └── queuable │ │ │ │ ├── EventQueueManager.java │ │ │ │ └── ui │ │ │ │ ├── BrowseReceivedMessageEvent.java │ │ │ │ ├── BrowseRemovedMessageEvent.java │ │ │ │ ├── SpyUIEvent.java │ │ │ │ ├── TopicSummaryNewMessageEvent.java │ │ │ │ └── TopicSummaryRemovedMessageEvent.java │ │ │ ├── generated │ │ │ └── versions │ │ │ │ ├── LatestRelease.java │ │ │ │ ├── LatestReleases.java │ │ │ │ ├── ObjectFactory.java │ │ │ │ ├── ReleaseStatus.java │ │ │ │ ├── ReleaseStatuses.java │ │ │ │ ├── SpyVersions.java │ │ │ │ ├── UpdateStatus.java │ │ │ │ └── package-info.java │ │ │ ├── keyboard │ │ │ ├── KeyboardUtils.java │ │ │ └── TimeBasedKeyEventFilter.java │ │ │ ├── panes │ │ │ ├── PaneStatus.java │ │ │ ├── PaneVisibilityManager.java │ │ │ ├── PaneVisibilityStatus.java │ │ │ ├── SpyPerspective.java │ │ │ ├── TabController.java │ │ │ ├── TabStatus.java │ │ │ ├── TitledPaneController.java │ │ │ └── TitledPaneStatus.java │ │ │ ├── properties │ │ │ ├── BackgroundScriptProperties.java │ │ │ ├── BaseTopicProperty.java │ │ │ ├── ChartSeriesProperties.java │ │ │ ├── ConnectionListItemProperties.java │ │ │ ├── ConnectionTreeItemProperties.java │ │ │ ├── KeyValueProperty.java │ │ │ ├── MessageContentProperties.java │ │ │ ├── MessageLimitProperties.java │ │ │ ├── ModifiableConnection.java │ │ │ ├── PublicationScriptProperties.java │ │ │ ├── SubscriptionTopicProperties.java │ │ │ ├── SubscriptionTopicSummaryProperties.java │ │ │ ├── TestCaseProperties.java │ │ │ ├── TestCaseStepProperties.java │ │ │ └── VersionInfoProperties.java │ │ │ ├── scripts │ │ │ ├── ScriptTypeEnum.java │ │ │ └── events │ │ │ │ └── ScriptListChangeEvent.java │ │ │ ├── search │ │ │ ├── InlineScriptMatcher.java │ │ │ ├── MessageFilter.java │ │ │ ├── ScriptMatcher.java │ │ │ ├── SearchMatcher.java │ │ │ ├── SearchOptions.java │ │ │ ├── SimplePayloadMatcher.java │ │ │ └── UniqueContentOnlyFilter.java │ │ │ ├── stats │ │ │ ├── ConnectionIntervalStats.java │ │ │ ├── ConnectionStats.java │ │ │ ├── ConnectionStatsUpdater.java │ │ │ ├── SpyStats.java │ │ │ ├── StatisticsManager.java │ │ │ └── StatsIO.java │ │ │ ├── storage │ │ │ ├── BasicMessageStoreWithSummary.java │ │ │ ├── FilteredMessageStore.java │ │ │ ├── ManagedMessageStoreWithFiltering.java │ │ │ ├── MessageListWithObservableTopicSummary.java │ │ │ ├── MessageStoreGarbageCollector.java │ │ │ └── summary │ │ │ │ ├── ObservableTopicSummary.java │ │ │ │ ├── TopicMessageCount.java │ │ │ │ └── TopicSummary.java │ │ │ ├── testcases │ │ │ └── InteractiveTestCaseManager.java │ │ │ ├── threading │ │ │ ├── SimplePlatformRunLaterOrAsynchronousExecutor.java │ │ │ ├── SimpleRunLaterExecutor.java │ │ │ └── SimpleRunLaterIfRequiredExecutor.java │ │ │ ├── utils │ │ │ ├── DialogFactory.java │ │ │ ├── FxmlUtils.java │ │ │ ├── ImageUtils.java │ │ │ ├── ResourcePaths.java │ │ │ ├── RunLaterExecutor.java │ │ │ ├── StylingUtils.java │ │ │ ├── TabUtils.java │ │ │ ├── TextUtils.java │ │ │ ├── TooltipFactory.java │ │ │ └── UiUtils.java │ │ │ └── versions │ │ │ └── VersionManager.java │ └── resources │ │ ├── spy-versions.xsd │ │ └── ui │ │ ├── fxml │ │ ├── AboutWindow.fxml │ │ ├── ControlPanelItem.fxml │ │ ├── ControlPanelPane.fxml │ │ ├── EditChartSeries.fxml │ │ ├── EditConnectionGroupPane.fxml │ │ ├── EditConnectionsWindow.fxml │ │ ├── FormattersWindow.fxml │ │ ├── LineChartPane.fxml │ │ ├── PieChartPane.fxml │ │ ├── TestCaseExecutionPane.fxml │ │ └── TestCasesExecutionPane.fxml │ │ └── images │ │ ├── applications-internet.png │ │ ├── auth-none.png │ │ ├── auth-yes.png │ │ ├── button-add.png │ │ ├── button-apply.png │ │ ├── button-connect.png │ │ ├── button-copy.png │ │ ├── button-delete.png │ │ ├── button-undo.png │ │ ├── dialog-error-large.png │ │ ├── dialog-information-large.png │ │ ├── dialog-ok-apply-large.png │ │ ├── dialog-password-large.png │ │ ├── dialog-warning-large.png │ │ ├── document-save-all.png │ │ ├── edit-find-mail.png │ │ ├── feed-subscribe.png │ │ ├── filter.png │ │ ├── folder-grey.png │ │ ├── folder-new.png │ │ ├── folder-yellow.png │ │ ├── go-first.png │ │ ├── go-last.png │ │ ├── go-next-green.png │ │ ├── go-next.png │ │ ├── go-previous.png │ │ ├── help-hint.png │ │ ├── lock-no.png │ │ ├── lock-yes.png │ │ ├── login.png │ │ ├── mail-forward-6.png │ │ ├── mail-receive-2.png │ │ ├── mail-unread.png │ │ ├── pause.png │ │ ├── play.png │ │ ├── preferences-desktop-user-password-large.png │ │ ├── rating-large.png │ │ ├── refresh.png │ │ ├── save.png │ │ ├── settings.png │ │ ├── system-run.png │ │ ├── tab-close.png │ │ ├── tab-detach.png │ │ ├── tab-new.png │ │ ├── testcase_actioned.png │ │ ├── testcase_error.png │ │ ├── testcase_fail.png │ │ ├── testcase_pass.png │ │ ├── testcase_play.png │ │ ├── testcase_repeat.png │ │ ├── testcase_skipped.png │ │ ├── testcase_stop.png │ │ ├── tools-wizard.png │ │ └── tools.png │ └── test │ └── java │ └── pl │ └── baczkowicz │ └── spy │ └── xpath │ └── XPathTest.java ├── spy-common ├── pom.xml └── src │ ├── main │ ├── java │ │ ├── .gitignore │ │ └── pl │ │ │ └── baczkowicz │ │ │ └── spy │ │ │ ├── audit │ │ │ ├── AuditReplay.java │ │ │ ├── IAuditReplayIO.java │ │ │ └── StreamedAuditReader.java │ │ │ ├── common │ │ │ └── generated │ │ │ │ ├── BaseSpyConfiguration.java │ │ │ │ ├── CharacterReplaceFormatterDetails.java │ │ │ │ ├── ConnectionDetails.java │ │ │ │ ├── ConnectionGroup.java │ │ │ │ ├── ConnectionGroupReference.java │ │ │ │ ├── ConnectionReference.java │ │ │ │ ├── ConversionFormatterDetails.java │ │ │ │ ├── ConversionMethod.java │ │ │ │ ├── FormatterDetails.java │ │ │ │ ├── FormatterFunction.java │ │ │ │ ├── Formatting.java │ │ │ │ ├── KeyStoreTypeEnum.java │ │ │ │ ├── ObjectFactory.java │ │ │ │ ├── Property.java │ │ │ │ ├── ReconnectionSettings.java │ │ │ │ ├── RunningMode.java │ │ │ │ ├── ScriptDetails.java │ │ │ │ ├── ScriptExecutionDetails.java │ │ │ │ ├── ScriptedSubscriptionDetails.java │ │ │ │ ├── SecureSocketModeEnum.java │ │ │ │ ├── SubstringConversionFormatterDetails.java │ │ │ │ ├── SubstringExtractFormatterDetails.java │ │ │ │ ├── SubstringFormatterDetails.java │ │ │ │ ├── SubstringReplaceFormatterDetails.java │ │ │ │ ├── Task.java │ │ │ │ ├── TestCasesSettings.java │ │ │ │ ├── UserCredentials.java │ │ │ │ └── package-info.java │ │ │ ├── configuration │ │ │ ├── BaseConfigurationUtils.java │ │ │ ├── BasePropertyNames.java │ │ │ └── PropertyFileLoader.java │ │ │ ├── connectivity │ │ │ ├── BaseSubscription.java │ │ │ ├── ConnectionStatus.java │ │ │ ├── IConnection.java │ │ │ ├── IConnectionWithReconnect.java │ │ │ └── ReconnectionManager.java │ │ │ ├── daemon │ │ │ ├── BaseDaemon.java │ │ │ └── IDaemon.java │ │ │ ├── eventbus │ │ │ ├── FilterableEvent.java │ │ │ ├── IFilterableEvent.java │ │ │ ├── IKBus.java │ │ │ └── KBus.java │ │ │ ├── events │ │ │ └── SpyEvent.java │ │ │ ├── exceptions │ │ │ ├── ConfigurationException.java │ │ │ ├── ConversionException.java │ │ │ ├── CriticalException.java │ │ │ ├── ExceptionUtils.java │ │ │ ├── SpyException.java │ │ │ ├── SpyUncaughtExceptionHandler.java │ │ │ └── XMLException.java │ │ │ ├── files │ │ │ ├── FileUtils.java │ │ │ └── StreamedFileReader.java │ │ │ ├── formatting │ │ │ ├── FormattingManager.java │ │ │ ├── FormattingUtils.java │ │ │ └── ScriptBasedFormatter.java │ │ │ ├── messages │ │ │ ├── BaseMessage.java │ │ │ ├── FormattedMessage.java │ │ │ ├── IBaseMessage.java │ │ │ └── MessageIdGenerator.java │ │ │ ├── scripts │ │ │ ├── BaseScriptManager.java │ │ │ ├── BasicScriptProperties.java │ │ │ ├── IScriptIO.java │ │ │ ├── Script.java │ │ │ ├── ScriptChangeObserver.java │ │ │ ├── ScriptHealthDetector.java │ │ │ ├── ScriptIO.java │ │ │ ├── ScriptRunner.java │ │ │ ├── ScriptRunningState.java │ │ │ └── events │ │ │ │ └── ScriptStateChangeEvent.java │ │ │ ├── security │ │ │ ├── SecureSocketFactoryBuilder.java │ │ │ └── SecureSocketUtils.java │ │ │ ├── storage │ │ │ ├── BasicMessageStore.java │ │ │ ├── MessageList.java │ │ │ └── MessageStore.java │ │ │ ├── testcases │ │ │ ├── ITestCaseEventManager.java │ │ │ ├── TestCase.java │ │ │ ├── TestCaseInfo.java │ │ │ ├── TestCaseManager.java │ │ │ ├── TestCaseOptions.java │ │ │ ├── TestCaseResult.java │ │ │ ├── TestCaseStatus.java │ │ │ ├── TestCaseStep.java │ │ │ └── TestCaseStepResult.java │ │ │ ├── threading │ │ │ ├── SimpleAsynchronousExecutor.java │ │ │ └── SimpleSynchronousExecutor.java │ │ │ ├── utils │ │ │ ├── ConversionUtils.java │ │ │ ├── ThreadingUtils.java │ │ │ ├── TimeUtils.java │ │ │ └── tasks │ │ │ │ ├── ProgressUpdater.java │ │ │ │ ├── SimpleExecutor.java │ │ │ │ └── StoppableTask.java │ │ │ └── xml │ │ │ ├── XMLParser.java │ │ │ └── XMLSchemaUtils.java │ └── resources │ │ ├── spy-bindings.xjb │ │ ├── spy-common.catalog │ │ └── spy-common.xsd │ └── test │ ├── java │ └── pl │ │ └── baczkowicz │ │ └── spy │ │ ├── eventbus │ │ ├── KBusTest.java │ │ └── sample │ │ │ ├── ISampleSubscriber.java │ │ │ ├── SampleCountChangeEvent.java │ │ │ ├── SampleInfoChangeEvent.java │ │ │ └── SampleSubscriber.java │ │ └── security │ │ └── SecureSocketUtilsTest.java │ └── resources │ ├── keystores │ ├── public_brokers.bks │ ├── public_brokers.jceks │ ├── public_brokers.jks │ └── public_brokers.p12 │ └── log4j.xml └── spy-design ├── .project ├── model.di ├── model.notation └── model.uml /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | Welcome to the mqtt-spy source code repository. 4 | 5 | For more information on the available functionality, see the project's wiki at https://github.com/kamilfb/mqtt-spy/wiki. 6 | 7 | The branching model (not fully in place yet) is as follows*: 8 | 9 | * master branch - where all the official releases live; tag for each release 10 | * development branch - where all the work is actually taking place 11 | * feature and release branches - used when required; for experimenting with new features and for major releases respectively 12 | 13 | \* - this has been heavily influenced by http://nvie.com/posts/a-successful-git-branching-model/. 14 | 15 | The eclipse_paho tags is what was submitted to the Eclipse Paho project in https://bugs.eclipse.org/bugs/show_bug.cgi?id=458899. 16 | -------------------------------------------------------------------------------- /mqtt-spy-common/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /mqtt-spy-common/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /target/ 3 | -------------------------------------------------------------------------------- /mqtt-spy-common/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | mqtt-spy-common 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.m2e.core.maven2Nature 21 | org.eclipse.jdt.core.javanature 22 | 23 | 24 | -------------------------------------------------------------------------------- /mqtt-spy-common/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.8 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 13 | org.eclipse.jdt.core.compiler.source=1.8 14 | -------------------------------------------------------------------------------- /mqtt-spy-common/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/main/java/.gitignore: -------------------------------------------------------------------------------- 1 | /META-INF/ 2 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/main/java/pl/baczkowicz/mqttspy/common/generated/MessageLogEnum.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2016.06.21 at 12:16:14 AM BST 6 | // 7 | 8 | 9 | package pl.baczkowicz.mqttspy.common.generated; 10 | 11 | import javax.xml.bind.annotation.XmlEnum; 12 | import javax.xml.bind.annotation.XmlType; 13 | 14 | 15 | /** 16 | *

Java class for MessageLogEnum. 17 | * 18 | *

The following schema fragment specifies the expected content contained within this class. 19 | *

20 | *

21 |  * <simpleType name="MessageLogEnum">
22 |  *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
23 |  *     <enumeration value="DISABLED"/>
24 |  *     <enumeration value="XML_WITH_ENCODED_PAYLOAD"/>
25 |  *     <enumeration value="XML_WITH_PLAIN_PAYLOAD"/>
26 |  *   </restriction>
27 |  * </simpleType>
28 |  * 
29 | * 30 | */ 31 | @XmlType(name = "MessageLogEnum") 32 | @XmlEnum 33 | public enum MessageLogEnum { 34 | 35 | DISABLED, 36 | XML_WITH_ENCODED_PAYLOAD, 37 | XML_WITH_PLAIN_PAYLOAD; 38 | 39 | public String value() { 40 | return name(); 41 | } 42 | 43 | public static MessageLogEnum fromValue(String v) { 44 | return valueOf(v); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/main/java/pl/baczkowicz/mqttspy/common/generated/package-info.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2016.06.21 at 12:16:14 AM BST 6 | // 7 | 8 | @javax.xml.bind.annotation.XmlSchema(namespace = "http://baczkowicz.pl/mqtt-spy/common") 9 | package pl.baczkowicz.mqttspy.common.generated; 10 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/main/java/pl/baczkowicz/mqttspy/utils/Utils.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.mqttspy.utils; 21 | 22 | import org.slf4j.Logger; 23 | import org.slf4j.LoggerFactory; 24 | 25 | /** 26 | * General purpose utilities. 27 | */ 28 | public class Utils 29 | { 30 | public final static Logger logger = LoggerFactory.getLogger(Utils.class); 31 | } 32 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/main/resources/certificates/certificate_authority_files/iot.eclipse.org.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/ 3 | MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT 4 | DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow 5 | PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD 6 | Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB 7 | AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O 8 | rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq 9 | OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b 10 | xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw 11 | 7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD 12 | aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV 13 | HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG 14 | SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69 15 | ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr 16 | AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz 17 | R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5 18 | JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo 19 | Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/main/resources/certificates/certificate_authority_files/mosquitto.org.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIC8DCCAlmgAwIBAgIJAOD63PlXjJi8MA0GCSqGSIb3DQEBBQUAMIGQMQswCQYD 3 | VQQGEwJHQjEXMBUGA1UECAwOVW5pdGVkIEtpbmdkb20xDjAMBgNVBAcMBURlcmJ5 4 | MRIwEAYDVQQKDAlNb3NxdWl0dG8xCzAJBgNVBAsMAkNBMRYwFAYDVQQDDA1tb3Nx 5 | dWl0dG8ub3JnMR8wHQYJKoZIhvcNAQkBFhByb2dlckBhdGNob28ub3JnMB4XDTEy 6 | MDYyOTIyMTE1OVoXDTIyMDYyNzIyMTE1OVowgZAxCzAJBgNVBAYTAkdCMRcwFQYD 7 | VQQIDA5Vbml0ZWQgS2luZ2RvbTEOMAwGA1UEBwwFRGVyYnkxEjAQBgNVBAoMCU1v 8 | c3F1aXR0bzELMAkGA1UECwwCQ0ExFjAUBgNVBAMMDW1vc3F1aXR0by5vcmcxHzAd 9 | BgkqhkiG9w0BCQEWEHJvZ2VyQGF0Y2hvby5vcmcwgZ8wDQYJKoZIhvcNAQEBBQAD 10 | gY0AMIGJAoGBAMYkLmX7SqOT/jJCZoQ1NWdCrr/pq47m3xxyXcI+FLEmwbE3R9vM 11 | rE6sRbP2S89pfrCt7iuITXPKycpUcIU0mtcT1OqxGBV2lb6RaOT2gC5pxyGaFJ+h 12 | A+GIbdYKO3JprPxSBoRponZJvDGEZuM3N7p3S/lRoi7G5wG5mvUmaE5RAgMBAAGj 13 | UDBOMB0GA1UdDgQWBBTad2QneVztIPQzRRGj6ZHKqJTv5jAfBgNVHSMEGDAWgBTa 14 | d2QneVztIPQzRRGj6ZHKqJTv5jAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA 15 | A4GBAAqw1rK4NlRUCUBLhEFUQasjP7xfFqlVbE2cRy0Rs4o3KS0JwzQVBwG85xge 16 | REyPOFdGdhBY2P1FNRy0MDr6xr+D2ZOwxs63dG1nnAnWZg7qwoLgpZ4fESPD3PkA 17 | 1ZgKJc2zbSQ9fCPxt2W3mdVav66c6fsb7els2W2Iz7gERJSX 18 | -----END CERTIFICATE----- 19 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/main/resources/certificates/public_brokers.bks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/mqtt-spy-common/src/main/resources/certificates/public_brokers.bks -------------------------------------------------------------------------------- /mqtt-spy-common/src/main/resources/certificates/public_brokers.jceks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/mqtt-spy-common/src/main/resources/certificates/public_brokers.jceks -------------------------------------------------------------------------------- /mqtt-spy-common/src/main/resources/certificates/public_brokers.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/mqtt-spy-common/src/main/resources/certificates/public_brokers.jks -------------------------------------------------------------------------------- /mqtt-spy-common/src/main/resources/formatters/eclipseKura.js: -------------------------------------------------------------------------------- 1 | function pretty() 2 | { 3 | var JSONObject = Java.type("org.json.JSONObject"); 4 | var json = new JSONObject(format()); 5 | return json.toString(10); 6 | } 7 | 8 | function format() 9 | { 10 | var KuraPayloadFormatter = Java.type("pl.baczkowicz.mqttspy.kura.KuraPayloadFormatter"); 11 | return KuraPayloadFormatter.format(receivedMessage.getRawPayload()); 12 | } -------------------------------------------------------------------------------- /mqtt-spy-common/src/main/resources/formatters/prettyJson.js: -------------------------------------------------------------------------------- 1 | function pretty() 2 | { 3 | var JSONObject = Java.type("org.json.JSONObject"); 4 | var json = new JSONObject(receivedMessage.getPayload()); 5 | return json.toString(10); 6 | } 7 | 8 | function format() 9 | { 10 | return receivedMessage.getPayload(); 11 | } 12 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/main/resources/formatters/prettyXml.js: -------------------------------------------------------------------------------- 1 | function pretty() 2 | { 3 | var Utils = Java.type("pl.baczkowicz.spy.formatting.FormattingUtils"); 4 | return Utils.prettyXml(receivedMessage.getPayload(), 10); 5 | } 6 | 7 | function format() 8 | { 9 | return receivedMessage.getPayload(); 10 | } 11 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/main/resources/mqtt-spy-common-bindings.xjb: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/main/resources/mqtt-spy-common.catalog: -------------------------------------------------------------------------------- 1 | PUBLIC "http://baczkowicz.pl/mqtt-spy/common" "maven:pl.baczkowicz.mqttspy:mqtt-spy-common!/mqtt-spy-common.xsd" -------------------------------------------------------------------------------- /mqtt-spy-common/src/test/java/pl/baczkowicz/mqttspy/kura/KuraFormatterTest.java: -------------------------------------------------------------------------------- 1 | package pl.baczkowicz.mqttspy.kura; 2 | 3 | import java.io.IOException; 4 | import java.nio.file.Files; 5 | import java.nio.file.Path; 6 | import java.nio.file.Paths; 7 | 8 | import org.eclipse.kura.KuraInvalidMessageException; 9 | import org.junit.Test; 10 | import org.slf4j.Logger; 11 | import org.slf4j.LoggerFactory; 12 | 13 | public class KuraFormatterTest 14 | { 15 | /** Diagnostic logger. */ 16 | private static final Logger logger = LoggerFactory.getLogger(KuraFormatterTest.class); 17 | 18 | @Test 19 | public void testKuraPayloadFormatting() throws KuraInvalidMessageException, IOException 20 | { 21 | final Path path = Paths.get("src/test/resources/kura/kura.birth"); 22 | byte[] data = Files.readAllBytes(path); 23 | 24 | logger.info(KuraPayloadFormatter.format(data)); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/test/resources/kura/formatter.js: -------------------------------------------------------------------------------- 1 | function format() 2 | { 3 | var KuraPayloadFormatter = Java.type("pl.baczkowicz.mqttspy.kura.KuraPayloadFormatter"); 4 | return KuraPayloadFormatter.format(receivedMessage.getRawBinaryPayload()); 5 | } 6 | 7 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/test/resources/kura/kura.birth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/mqtt-spy-common/src/test/resources/kura/kura.birth -------------------------------------------------------------------------------- /mqtt-spy-common/src/test/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/test/resources/mosquitto/mosquitto_users.txt: -------------------------------------------------------------------------------- 1 | test1:$6$AJdihgdnx7hpJk9P$4jTSVrNlcxsnAQEExQ7og20tParQBRqbl+rmSPkC4x44VkcS8oKZX5fZu6/93QCmyW6JAzvkHYlMGm+mg44ngw== 2 | test2:$6$XeQO19Aq6PzIocmf$mEr+FNNXKgp/3KUC0Hmh205YBfP7/Jr1NXeuY4T/qWBkpdwjhW6+hkQUrbzMgk8YxDHWN6eMA2n29hU4P407aA== 3 | nopassword: -------------------------------------------------------------------------------- /mqtt-spy-common/src/test/resources/mosquitto/ssl/bouncy_castle/client.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIC8jCCAdoCCQCsMU36mNZU5DANBgkqhkiG9w0BAQsFADBPMRcwFQYDVQQDDA5B 3 | biBNUVRUIGJyb2tlcjERMA8GA1UECgwIbXF0dC1zcHkxITAfBgkqhkiG9w0BCQEW 4 | Em5vYm9keUBleGFtcGxlLm5ldDAeFw0xNTA0MjgyMzE0MzJaFw0yNTA0MjUyMzE0 5 | MzJaMCcxDzANBgNVBAMMBmNsaWVudDEUMBIGA1UECgwLZXhhbXBsZS5jb20wggEi 6 | MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCwJ0AFg9MHCsy+CBoBurwbjEPQ 7 | QYAG8rDJ1E9uzpR+XZ1fHRV5LA9SYOO8oH996HJHMr+dqDT6abDk4E0BtQ56rsIL 8 | r7MAfC0wFUT5lzQTOhJa1/EuS0tNHgtSUzQUm1d3j4VCSxGSlLuhHcjhHsF1HCoE 9 | I0JgnXFbDl7g79jzxo0GMTs+3HPtRFgqJF7KnVHRqrPvDSbxdInm7Z/SFD9BXW6B 10 | hDwks5s0MfvrgXLQiMgUnA7OCekMVofBJuyFqcZW/ea8z81hGpZwP8SdK1QINJ9B 11 | P9nR3jpEgeaGanaf6JS05vZxEFoTCdiEKwGcV72w9HDa7O8UtGKr5YOoafARAgMB 12 | AAEwDQYJKoZIhvcNAQELBQADggEBAGDiujFROA7oTVIsJbaRaS2BG3r24VBGcF7s 13 | 5agtU17QLPZmhL5ij/sQcRKnniK7AKQxDfytYePFifuSh1lOtPNLIn9mrdZazChT 14 | cZQOWdYbX5OOOyy2183UCRRFkxmSEG6aJxF8AOfUQ6u/OZYwLmzMCGxSOs1WtUpk 15 | D450HVMeCL6/Wp+CCjKYMAhIeAiD2qwWDg58R+qtwZW8rF/Vy9+4r2t7nu3Y5GE3 16 | Rh3eaR6Bc/4+vPBP3eYIEYQ1tgQVXQ845CbYrGJRK9/Ass++g3l9eNOhpcbJJ6gp 17 | OQhG6lNRozF5oX5t7ZjlAxDI6pFR0tmDzM94ZHjtzrxhvUo/Vzs= 18 | -----END CERTIFICATE----- 19 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/test/resources/mosquitto/ssl/bouncy_castle/client.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICbDCCAVQCAQAwJzEPMA0GA1UEAwwGY2xpZW50MRQwEgYDVQQKDAtleGFtcGxl 3 | LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALAnQAWD0wcKzL4I 4 | GgG6vBuMQ9BBgAbysMnUT27OlH5dnV8dFXksD1Jg47ygf33ockcyv52oNPppsOTg 5 | TQG1DnquwguvswB8LTAVRPmXNBM6ElrX8S5LS00eC1JTNBSbV3ePhUJLEZKUu6Ed 6 | yOEewXUcKgQjQmCdcVsOXuDv2PPGjQYxOz7cc+1EWCokXsqdUdGqs+8NJvF0iebt 7 | n9IUP0FdboGEPCSzmzQx++uBctCIyBScDs4J6QxWh8Em7IWpxlb95rzPzWEalnA/ 8 | xJ0rVAg0n0E/2dHeOkSB5oZqdp/olLTm9nEQWhMJ2IQrAZxXvbD0cNrs7xS0Yqvl 9 | g6hp8BECAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQBdwSUVBGuUajLZkhsk83Tp 10 | ubsQmlEUeRrk0GqKWky37WU/f4zgjRNnf8Wh2fKPBjC/vtMoFOZWMNQWKHyZexkx 11 | Vf8amdZQpoanLNOKsVgT8hp0gXiNRy0JGvkFtfpOD6e6MFUEqcHV4m0FbH8JtMDp 12 | ZWl3qWZ7HpjNDl19/blIWR1sM1oHa2By8bAFuh+EgC7I3AV3uz8uUOWYQiGnU4zL 13 | rs3xLGpT6XPxkeTbU3XViIYjlW5wyRR2myNqkiRIp/K7uJe5y1xX6NnQ213iKf+O 14 | 0M09aMkKnDs3WZsnKwCNp7YgoQTzUvPzZhHLTiKQ8DYNOPPj/hJP7f+NjxI7k2VA 15 | -----END CERTIFICATE REQUEST----- 16 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/test/resources/mosquitto/ssl/bouncy_castle/generate-client.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | openssl genrsa -out client.key 2048 4 | openssl req -new -out client.csr \ 5 | -key client.key -subj "/CN=client/O=example.com" 6 | openssl x509 -req -in client.csr -CA ca.crt \ 7 | -CAkey ca.key -CAserial ca.srl -out client.crt \ 8 | -days 3650 9 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/test/resources/mosquitto/ssl/ca.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDcTCCAlmgAwIBAgIJAOxeKOKIzfG8MA0GCSqGSIb3DQEBCwUAME8xFzAVBgNV 3 | BAMMDkFuIE1RVFQgYnJva2VyMREwDwYDVQQKDAhtcXR0LXNweTEhMB8GCSqGSIb3 4 | DQEJARYSbm9ib2R5QGV4YW1wbGUubmV0MB4XDTE1MDQyNzIyMzA1N1oXDTMyMDQy 5 | MjIyMzA1N1owTzEXMBUGA1UEAwwOQW4gTVFUVCBicm9rZXIxETAPBgNVBAoMCG1x 6 | dHQtc3B5MSEwHwYJKoZIhvcNAQkBFhJub2JvZHlAZXhhbXBsZS5uZXQwggEiMA0G 7 | CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDYDwAf+hyiP7SLyJBWlmhAcBJCVCqR 8 | 7mmRgMNVy3y8TKhzSq1JSqpkK48NSrh2RmJWlwRSVreQawuGTmGAyTjHlgtaao8F 9 | ky/8QkAwbb7NRNRvmfZeBx5m/86pTJAVG+U/guU0oAapK7GqDuuTyjZwV6FV4qTo 10 | WQ8xI/31UFtOsTiCCefjpVIpl/FtJlnwKhwpEP1C9x2sW6XWZODbeCN9sgn92YDx 11 | xRgkohq5eB4CIwydFRYNS2J7XmDCPgTYio3MUspZ4MxZ3bFoV/HA7VN07bO1jBQh 12 | OFyCoQ7GLCXImaTfGn1RWTurVaKXjZztLOt9W7/oNwftHz8gUYBB8S0DAgMBAAGj 13 | UDBOMB0GA1UdDgQWBBQheT8LY3jeFhsMgBEBOk04yZ1VWjAfBgNVHSMEGDAWgBQh 14 | eT8LY3jeFhsMgBEBOk04yZ1VWjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUA 15 | A4IBAQBdulRDurNLvLcsfBJ+s35bmnWUsWkrMqjiaz4dNEVCIpBwKc4vKEzom6zk 16 | c9Qo9bGLAh8PAhMzytxAwpWld02LNH/tDh2te1YJ5tybmb8Dm+co4KYRgwlFc3gN 17 | 8A0iWfqkYz2Tm6RAXOEE5FBnZC0rltQsOic44jJvSwZh+9f3HD6wPGXrDfCGZV1m 18 | LePr765VYkmS6w7nFtvXHURTkHAaS+1NK8OedLl9bwPwAKiT4tPNNLpgTsycVVxG 19 | adbLQ9f/VSjTXXkdEG2poVOYJtiV+fMBsLmspBVNMCHNEa3ybm05vkMcxaFwlmOn 20 | /2SuTBz4fdeYDysv9u+ynDrQJnmS 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/test/resources/mosquitto/ssl/ca.srl: -------------------------------------------------------------------------------- 1 | AC314DFA98D654E2 2 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/test/resources/mosquitto/ssl/mosquitto_sub/client.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN TRUSTED CERTIFICATE----- 2 | MIIC8jCCAdoCCQCsMU36mNZU5TANBgkqhkiG9w0BAQsFADBPMRcwFQYDVQQDDA5B 3 | biBNUVRUIGJyb2tlcjERMA8GA1UECgwIbXF0dC1zcHkxITAfBgkqhkiG9w0BCQEW 4 | Em5vYm9keUBleGFtcGxlLm5ldDAeFw0xNTA0MjgyMzI0MDdaFw0yNTA0MjUyMzI0 5 | MDdaMCcxDzANBgNVBAMMBmNsaWVudDEUMBIGA1UECgwLZXhhbXBsZS5jb20wggEi 6 | MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDk+3UFNmgOZBbfcH17HEupy2z0 7 | KPvbH30u6ALYjVHxp2vEu6yKGsRzDvDaVqxvcshQHUeIPD4GBT9lbAihh+HWo4ey 8 | wtjwLEgxrcqB9EXKMf41yDbfBaOmxGMt2fBp4YII6z8hH0JKMl4Ix6FGH/qIBPxD 9 | ifqJkdPa+Wmzdaqcj8qx43N80b+cFHPddO1O+3BD940oIovZVWIayoGycSFmJ8Ql 10 | yNTeDwPez6fDF+Gwnpt7Rkm6A0viQY0raG0YvAuKtXGM8PD6TmI3TTm7bkllkA4S 11 | 7AEedZQKfQ+TV7GqPwTInR0JAR3Sm57HD1LuNRuH4pweo+ezNLd5TUhxLW7dAgMB 12 | AAEwDQYJKoZIhvcNAQELBQADggEBAKXYZiykUEdX4F+bVY4a2ZxklRZAzsPznHYE 13 | vIKuXZeBmcYzivkAS7yqV92R+fzDsdcJF6dT5ajHdGCMokT9AThP2KTDeJ45yM1H 14 | Op5oF+MPITHGrWIVJY9Ax10nhwfO2clf1v6yw7Xktl3Uu0br6nvNLLUhUdDT2vTH 15 | MpBUiVqETjmhnhpmiLlG0FnQHEPd101154L8JLqfp+y1gAhPDWmo3iA9aqyQt6Ww 16 | LBy/Kc5VPwrwxapMByffJi8PT5AGLTqLLZNfL5QH2Y6ZO77ZA1sDO4OZOuJc4I1P 17 | l80RNtlSHUrr4rmxFf+b5N/Gc+yfwTjyTjMPPscQZlIKcRCV3F0wDDAKBggrBgEF 18 | BQcDAg== 19 | -----END TRUSTED CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/test/resources/mosquitto/ssl/mosquitto_sub/client.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICbDCCAVQCAQAwJzEPMA0GA1UEAwwGY2xpZW50MRQwEgYDVQQKDAtleGFtcGxl 3 | LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOT7dQU2aA5kFt9w 4 | fXscS6nLbPQo+9sffS7oAtiNUfGna8S7rIoaxHMO8NpWrG9yyFAdR4g8PgYFP2Vs 5 | CKGH4dajh7LC2PAsSDGtyoH0Rcox/jXINt8Fo6bEYy3Z8GnhggjrPyEfQkoyXgjH 6 | oUYf+ogE/EOJ+omR09r5abN1qpyPyrHjc3zRv5wUc9107U77cEP3jSgii9lVYhrK 7 | gbJxIWYnxCXI1N4PA97Pp8MX4bCem3tGSboDS+JBjStobRi8C4q1cYzw8PpOYjdN 8 | ObtuSWWQDhLsAR51lAp9D5NXsao/BMidHQkBHdKbnscPUu41G4finB6j57M0t3lN 9 | SHEtbt0CAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQByzF/x/1WLVmryH7qmoT6/ 10 | t1mwOXgsFKM+C0fx7EFgMRWWHDxc38qb7m71dmYTAL4Z/XrJicQNxNVImnzMnT5P 11 | fiZdBZ/BmLkMoh70/Tz3McTo4e+OioxAL7xj0aPCO0uF4FnDyPTVEIxp5lUKG2Sz 12 | 7SAmg4O0PfgpRrsjo/hVZosamCgWYI0cHKxE9XSVwK79P6jtjub6kD2VwBe88En5 13 | w+cxEkFaLT3GBO2Ssg3z5FIphp6xyEmEiaYAcu7OcjhJOcJ29diTCoFifTbzN0rh 14 | MNl43t2PPgTuAj3TwMUEgw4nuizE4D65RL3fq26odfg78UzUSsKxXDxaV7F6ZQ2I 15 | -----END CERTIFICATE REQUEST----- 16 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/test/resources/mosquitto/ssl/mosquitto_sub/generate-client.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | openssl genrsa -out client.key 2048 4 | openssl req -new -out client.csr \ 5 | -key client.key -subj "/CN=client/O=example.com" 6 | openssl x509 -req -in client.csr -CA ca.crt \ 7 | -CAkey ca.key -CAserial ca.srl -out client.crt \ 8 | -days 3650 -addtrust clientAuth 9 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/test/resources/mosquitto/ssl/mqtt-spy-test.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICkzCCAXsCAQAwTjEWMBQGA1UEAwwNbXF0dC1zcHktdGVzdDERMA8GA1UECgwI 3 | bXF0dC1zcHkxITAfBgkqhkiG9w0BCQEWEm5vYm9keUBleGFtcGxlLm5ldDCCASIw 4 | DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL+gGasuxGFx7YvBCoGR7W5KgvKr 5 | ypzQWKxQkUg7j2rPH/gKJpl53ovQ5MOX4+lAo9SraTqf8KfM7246sMRng6bOolNE 6 | xnIhhwhu1VIYGODRhmxQlL4Kpvv16WM2JwidG5RLP2Tfm4TlDBwp3zAeHtUrG15W 7 | /8VUN9YcYZE1Gt2BwnbiRbeX2i1lQbWUrjsjsron0EXi7iEbjx7R/rDgrfTGQeYS 8 | doMFcg1C5+1LiYyNpfRWsfhpNMAsj5dP+HJOG6LSlNN+HCBS4tb9zI/v6C8I89zF 9 | +ry3kWnDqYVnwzGqeBoi+MBWjRnRpvkaEJPx9gsyBP5EU2hjXphP3iwpHPUCAwEA 10 | AaAAMA0GCSqGSIb3DQEBCwUAA4IBAQBHzpd9RZXQVlGgUQ+tft2EpPnEfT3PC+4X 11 | wmEb+uDMz+BAwxgQ8TzlM5CLWfBZo/Yc19XcWmJGrO8/vo27imx/oLzkSanYdenQ 12 | ODjRCi6pAh7JJUcN+so6oRTZzenpIdMdWG/4UQ0SvWqTYRHOApytQQZbdC8CJPDt 13 | TtiEmwAIu2euVQOYq9KBP2QQSQpvx6ze2toqaFGuYeQsq/Fzz4qDNDweUQ2bzERF 14 | yqDHIssmJ1/LftYDF7MSH0w58RnmqdgMVo0BSbhmc2NOX6wldVhfS5syatHMwN4l 15 | FMw1CcQDjajL9TmfIzg5NqzeGs7rU4uyhRfU2YYUOJW9GnPYcWoU 16 | -----END CERTIFICATE REQUEST----- 17 | -------------------------------------------------------------------------------- /mqtt-spy-common/src/test/resources/scripts/base64-body-decoder.js: -------------------------------------------------------------------------------- 1 | function formatPayload() 2 | { 3 | receivedMessage.setPayload("" + receivedMessage.getPayload() + "- modified :)"); 4 | 5 | return true; 6 | } 7 | 8 | formatPayload(); -------------------------------------------------------------------------------- /mqtt-spy-daemon/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /mqtt-spy-daemon/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /target/ 3 | /mqtt-spy-daemon.messages 4 | /mqtt-spy-daemon.log 5 | /mqtt-spy-daemon.log.1 6 | /.settings/ 7 | /.classpath 8 | /.gitignore 9 | /.project 10 | -------------------------------------------------------------------------------- /mqtt-spy-daemon/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | mqtt-spy-daemon 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.m2e.core.maven2Nature 21 | org.eclipse.jdt.core.javanature 22 | 23 | 24 | -------------------------------------------------------------------------------- /mqtt-spy-daemon/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.8 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 13 | org.eclipse.jdt.core.compiler.source=1.8 14 | -------------------------------------------------------------------------------- /mqtt-spy-daemon/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /mqtt-spy-daemon/buildNumber.properties: -------------------------------------------------------------------------------- 1 | #maven.buildNumber.plugin properties file 2 | #Mon Apr 04 23:38:26 BST 2016 3 | buildNumber=5 4 | -------------------------------------------------------------------------------- /mqtt-spy-daemon/src/main/java/META-INF/sun-jaxb.episode: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /mqtt-spy-daemon/src/main/java/pl/baczkowicz/mqttspy/daemon/configuration/MqttSpyDaemonConstants.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.mqttspy.daemon.configuration; 21 | 22 | 23 | /** 24 | * Constants for loading the configuration. 25 | */ 26 | public final class MqttSpyDaemonConstants 27 | { 28 | /** Configuration package. */ 29 | public static final String PACKAGE = "pl.baczkowicz.mqttspy.daemon.configuration.generated"; 30 | 31 | /** Configuration schema. */ 32 | public static final String SCHEMA = "/mqtt-spy-daemon-configuration.xsd"; 33 | 34 | /** Location of the properties file. */ 35 | public static final String DEFAULT_PROPERTIES_FILE_NAME = "/mqtt-spy-daemon.properties"; 36 | } 37 | -------------------------------------------------------------------------------- /mqtt-spy-daemon/src/main/java/pl/baczkowicz/mqttspy/daemon/configuration/generated/package-info.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2016.06.06 at 10:45:17 PM BST 6 | // 7 | 8 | @javax.xml.bind.annotation.XmlSchema(namespace = "http://baczkowicz.pl/mqtt-spy/daemon/configuration") 9 | package pl.baczkowicz.mqttspy.daemon.configuration.generated; 10 | -------------------------------------------------------------------------------- /mqtt-spy-daemon/src/main/resources/mqtt-spy-daemon.catalog: -------------------------------------------------------------------------------- 1 | PUBLIC "http://baczkowicz.pl/mqtt-spy/daemon/configuration" "maven:pl.baczkowicz.mqttspy:mqtt-spy-daemon!/mqtt-spy-daemon-configuration.xsd" -------------------------------------------------------------------------------- /mqtt-spy-daemon/src/main/resources/mqtt-spy-daemon.properties: -------------------------------------------------------------------------------- 1 | # application properties 2 | application.version=${project.version} 3 | application.build=${project.build.number} 4 | application.download.url=http://kamilfb.github.io/mqtt-spy/ -------------------------------------------------------------------------------- /mqtt-spy-daemon/src/main/resources/sample-configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | localhost 8 | 9 | 10 | 11 | 12 | DISABLED 13 | 14 | 15 | 16 | 17 | 18 | 19 | /sample-publish.js 20 | 21 | 22 | 23 | SCRIPTS_ONLY 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /mqtt-spy-daemon/src/main/resources/sample-publish.js: -------------------------------------------------------------------------------- 1 | // Wrap the script in a method, so that you can do "return false;" in case of an error or stop request 2 | function publish() 3 | { 4 | mqttspy.publish("mqtt-spy-daemon/test1", "hello"); 5 | 6 | mqttspy.publish("mqtt-spy-daemon/test2", "from"); 7 | 8 | mqttspy.publish("mqtt-spy-daemon/test3", "mqtt-spy-daemon!"); 9 | 10 | // This means all OK, script has completed without any issues and as expected 11 | return true; 12 | } 13 | 14 | publish(); -------------------------------------------------------------------------------- /mqtt-spy-daemon/src/test/resources/bedroom.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 5; i++) 6 | { 7 | mqttspy.publish("/home/bedroom/current", "" + (20 + Math.floor((Math.random() * 10) + 1) / 10) + "" + (100 + Math.floor((Math.random() * 10) + 1)) + "", 0, false); 8 | 9 | try 10 | { 11 | Thread.sleep(1000); 12 | } 13 | catch(err) 14 | { 15 | return false; 16 | } 17 | } 18 | 19 | return true; 20 | } 21 | 22 | publish(); 23 | -------------------------------------------------------------------------------- /mqtt-spy-daemon/src/test/resources/publish_time.js: -------------------------------------------------------------------------------- 1 | function publishTime() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | var Date = Java.type("java.util.Date"); 5 | var SimpleDateFormat = Java.type("java.text.SimpleDateFormat"); 6 | 7 | var TIME_FORMAT_WITH_SECONDS = "HH:mm:ss"; 8 | var TIME_WITH_SECONDS_SDF = new SimpleDateFormat(TIME_FORMAT_WITH_SECONDS); 9 | 10 | while (true) 11 | { 12 | var currentTime = TIME_WITH_SECONDS_SDF.format(new Date()); 13 | 14 | mqttspy.publish("/time/", currentTime, 0, false); 15 | 16 | // Sleep for 1 second and handle a stop request 17 | try 18 | { 19 | Thread.sleep(1000); 20 | } 21 | catch(err) 22 | { 23 | return false; 24 | } 25 | 26 | // Keep mqtt-spy informed the script is still running 27 | mqttspy.touch(); 28 | } 29 | 30 | return true; 31 | } 32 | 33 | publishTime(); 34 | -------------------------------------------------------------------------------- /mqtt-spy-daemon/src/test/resources/replay.js: -------------------------------------------------------------------------------- 1 | function replay() 2 | { 3 | // Get the number of available messages (0 when run for the first time) 4 | var messageCount = messageLog.getMessageCount(); 5 | 6 | // If repeat = true, only read the message log once 7 | if (messageCount == 0) 8 | { 9 | messageCount = messageLog.readFromFile("/home/kamil/Programming/Git/mqtt-spy-logger/src/test/resources/mqtt-spy-daemon.messages"); 10 | messageLog.setSpeed(2); 11 | } 12 | 13 | // If there are messages to replay... 14 | if (messageCount > 0) 15 | { 16 | // Start the message log time updater... 17 | messageLog.start(); 18 | 19 | var Thread = Java.type("java.lang.Thread"); 20 | 21 | // For all messages 22 | for (i = 0; i < messageCount; i++) 23 | { 24 | // Wait until this message is ready to be published 25 | while (!messageLog.isReadyToPublish(i)) 26 | { 27 | try 28 | { 29 | Thread.sleep(10); 30 | } 31 | catch(err) 32 | { 33 | return false; 34 | } 35 | } 36 | 37 | // When ready, publish the message 38 | mqttspy.publish(messageLog.getMessage(i).getTopic(), messageLog.getMessage(i).getMessage(), 0, false); 39 | } 40 | } 41 | else 42 | { 43 | logger.warn("No messages available"); 44 | } 45 | 46 | return true; 47 | } 48 | 49 | replay(); 50 | -------------------------------------------------------------------------------- /mqtt-spy-daemon/src/test/resources/reply.js: -------------------------------------------------------------------------------- 1 | function onMessage() 2 | { 3 | mqtt.publish( 4 | "/reply", "" + receivedMessage.getTopic() + "" 5 | + "" 6 | + "", 0, false); 7 | 8 | receivedMessage.setPayload("" + receivedMessage.getPayload() + "- modified :)"); 9 | 10 | return true; 11 | } 12 | -------------------------------------------------------------------------------- /mqtt-spy-daemon/src/test/resources/test_configurations/basic-configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | localhost 8 | 9 | 10 | 11 | 12 | DISABLED 13 | 14 | 15 | 16 | 17 | 18 | 19 | /sample-publish.js 20 | 21 | 22 | 23 | SCRIPTS_ONLY 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /mqtt-spy-daemon/src/test/resources/test_configurations/test-cases-iot-eclipse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | iot.eclipse.org 7 | 8 | mqtt-spy-daemon 9 | 10 | true 11 | 10 12 | 10 13 | 14 | 15 | SERVER_ONLY 16 | TLSv1.2 17 | /certificates/certificate_authority_files/iot.eclipse.org.crt 18 | 19 | 20 | 21 | 22 | 5000 23 | 24 | true 25 | 26 | 27 | DISABLED 28 | 29 | 30 | 31 | src/test/resources/test_cases/ 32 | true 33 | 34 | 35 | 36 | SCRIPTS_ONLY 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /mqtt-spy/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /mqtt-spy/.gitignore: -------------------------------------------------------------------------------- 1 | # ignore all bin directories 2 | # matches "bin" in any subfolder 3 | bin/ 4 | 5 | # ignore all target directories 6 | target/ 7 | 8 | # ignore all files ending with ~ 9 | *~ 10 | /mqtt-spy.log 11 | /log1.messages 12 | /mqtt-spy-daemon.messages 13 | /mqtt-spy.messages 14 | /log2.messages 15 | /mqtt-spy.log.1 16 | /mqtt-spy.log.2 17 | -------------------------------------------------------------------------------- /mqtt-spy/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | mqtt-spy 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.m2e.core.maven2Nature 22 | 23 | 24 | -------------------------------------------------------------------------------- /mqtt-spy/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/test/java=UTF-8 5 | encoding//src/test/resources=UTF-8 6 | encoding/=UTF-8 7 | -------------------------------------------------------------------------------- /mqtt-spy/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 3 | org.eclipse.jdt.core.compiler.compliance=1.8 4 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 5 | org.eclipse.jdt.core.compiler.source=1.8 6 | -------------------------------------------------------------------------------- /mqtt-spy/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /mqtt-spy/README.md: -------------------------------------------------------------------------------- 1 | The following files use non-EPL/EDP licensing: 2 | 3 | * LineChartPaneController.java (origin: JFXUtils; Apache License Version 2.0) 4 | * CommandLinksDialog (origin: ControlsFX; BSD 3-Clause License) 5 | 6 | The following documents the origin of all graphics (images/icons) used in mqtt-spy. All can be found in src/main/resources/images. 7 | 8 | MQTT.org 9 | 10 | * mqtt-icon.png 11 | 12 | Authored by Kamil Baczkowicz: 13 | 14 | * mqtt-spy-logo.png -------------------------------------------------------------------------------- /mqtt-spy/src/main/java/.gitignore: -------------------------------------------------------------------------------- 1 | /META-INF/ 2 | -------------------------------------------------------------------------------- /mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/configuration/generated/package-info.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Kamil Baczkowicz 3 | // 4 | // CSOFF: a.* 5 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 6 | // See http://java.sun.com/xml/jaxb 7 | // Any modifications to this file will be lost upon recompilation of the source schema. 8 | // Timestamp removed by maven-replacer-plugin to avoid detecting changes - see the project POM for details 9 | // 10 | 11 | @javax.xml.bind.annotation.XmlSchema(namespace = "http://baczkowicz.pl/mqtt-spy-configuration") 12 | package pl.baczkowicz.mqttspy.configuration.generated; 13 | -------------------------------------------------------------------------------- /mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/stats/generated/package-info.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Kamil Baczkowicz 3 | // 4 | // CSOFF: a.* 5 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 6 | // See http://java.sun.com/xml/jaxb 7 | // Any modifications to this file will be lost upon recompilation of the source schema. 8 | // Timestamp removed by maven-replacer-plugin to avoid detecting changes - see the project POM for details 9 | // 10 | 11 | @javax.xml.bind.annotation.XmlSchema(namespace = "http://baczkowicz.pl/mqtt-spy-stats") 12 | package pl.baczkowicz.mqttspy.stats.generated; 13 | -------------------------------------------------------------------------------- /mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/controllers/edit/IEditConnectionSubController.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.mqttspy.ui.controllers.edit; 21 | 22 | import pl.baczkowicz.mqttspy.configuration.ConfiguredMqttConnectionDetails; 23 | import pl.baczkowicz.mqttspy.configuration.generated.UserInterfaceMqttConnectionDetails; 24 | import pl.baczkowicz.mqttspy.ui.controllers.EditMqttConnectionController; 25 | 26 | public interface IEditConnectionSubController 27 | { 28 | void displayConnectionDetails(final ConfiguredMqttConnectionDetails connection); 29 | 30 | UserInterfaceMqttConnectionDetails readValues(final UserInterfaceMqttConnectionDetails connection); 31 | 32 | void setParent(final EditMqttConnectionController controller); 33 | } 34 | -------------------------------------------------------------------------------- /mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/events/SubscriptionStatusChangeEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.mqttspy.ui.events; 22 | 23 | import pl.baczkowicz.mqttspy.connectivity.MqttSubscription; 24 | import pl.baczkowicz.spy.eventbus.FilterableEvent; 25 | 26 | public class SubscriptionStatusChangeEvent extends FilterableEvent 27 | { 28 | private final MqttSubscription changedSubscription; 29 | 30 | public SubscriptionStatusChangeEvent(final MqttSubscription changedSubscription) 31 | { 32 | this.setFilter(changedSubscription); 33 | this.changedSubscription = changedSubscription; 34 | } 35 | 36 | /** 37 | * @return the changedSubscription 38 | */ 39 | public MqttSubscription getChangedSubscription() 40 | { 41 | return changedSubscription; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/events/queuable/connectivity/MqttConnectionAttemptFailureEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.mqttspy.ui.events.queuable.connectivity; 21 | 22 | import pl.baczkowicz.mqttspy.connectivity.MqttAsyncConnection; 23 | 24 | public class MqttConnectionAttemptFailureEvent extends MqttConnectionFailureEvent 25 | { 26 | public MqttConnectionAttemptFailureEvent(final MqttAsyncConnection connection, final Throwable cause) 27 | { 28 | super(connection, cause); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/events/queuable/connectivity/MqttConnectionAttemptSuccessEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.mqttspy.ui.events.queuable.connectivity; 21 | 22 | import pl.baczkowicz.mqttspy.connectivity.MqttAsyncConnection; 23 | 24 | public class MqttConnectionAttemptSuccessEvent extends MqttConnectionSuccessEvent 25 | { 26 | public MqttConnectionAttemptSuccessEvent(final MqttAsyncConnection connection) 27 | { 28 | super(connection); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/events/queuable/connectivity/MqttConnectionFailureEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.mqttspy.ui.events.queuable.connectivity; 21 | 22 | import pl.baczkowicz.mqttspy.connectivity.MqttAsyncConnection; 23 | import pl.baczkowicz.spy.events.SpyEvent; 24 | 25 | public class MqttConnectionFailureEvent implements SpyEvent 26 | { 27 | private final MqttAsyncConnection connection; 28 | private final Throwable cause; 29 | 30 | public MqttConnectionFailureEvent(final MqttAsyncConnection connection, final Throwable cause) 31 | { 32 | this.connection = connection; 33 | this.cause = cause; 34 | } 35 | 36 | public MqttAsyncConnection getConnection() 37 | { 38 | return connection; 39 | } 40 | 41 | public Throwable getCause() 42 | { 43 | return cause; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/events/queuable/connectivity/MqttConnectionLostEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.mqttspy.ui.events.queuable.connectivity; 21 | 22 | import pl.baczkowicz.mqttspy.connectivity.MqttAsyncConnection; 23 | 24 | public class MqttConnectionLostEvent extends MqttConnectionFailureEvent 25 | { 26 | public MqttConnectionLostEvent(final MqttAsyncConnection connection, final Throwable cause) 27 | { 28 | super(connection, cause); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/events/queuable/connectivity/MqttConnectionSuccessEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.mqttspy.ui.events.queuable.connectivity; 21 | 22 | import pl.baczkowicz.mqttspy.connectivity.MqttAsyncConnection; 23 | import pl.baczkowicz.spy.events.SpyEvent; 24 | 25 | public class MqttConnectionSuccessEvent implements SpyEvent 26 | { 27 | private final MqttAsyncConnection connection; 28 | 29 | public MqttConnectionSuccessEvent(final MqttAsyncConnection connection) 30 | { 31 | this.connection = connection; 32 | } 33 | 34 | public MqttAsyncConnection getConnection() 35 | { 36 | return connection; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/events/queuable/connectivity/MqttDisconnectionAttemptFailureEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.mqttspy.ui.events.queuable.connectivity; 21 | 22 | import pl.baczkowicz.mqttspy.connectivity.MqttAsyncConnection; 23 | 24 | public class MqttDisconnectionAttemptFailureEvent extends MqttConnectionFailureEvent 25 | { 26 | public MqttDisconnectionAttemptFailureEvent(final MqttAsyncConnection connection, final Throwable cause) 27 | { 28 | super(connection, cause); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/events/queuable/connectivity/MqttDisconnectionAttemptSuccessEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.mqttspy.ui.events.queuable.connectivity; 21 | 22 | import pl.baczkowicz.mqttspy.connectivity.MqttAsyncConnection; 23 | 24 | public class MqttDisconnectionAttemptSuccessEvent extends MqttConnectionSuccessEvent 25 | { 26 | public MqttDisconnectionAttemptSuccessEvent(final MqttAsyncConnection connection) 27 | { 28 | super(connection); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/messagelog/TaskWithProgressUpdater.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.mqttspy.ui.messagelog; 21 | 22 | import pl.baczkowicz.spy.utils.tasks.ProgressUpdater; 23 | import javafx.concurrent.Task; 24 | 25 | /** 26 | * Base class for updating task's progress. 27 | * 28 | * @param Type of the task 29 | */ 30 | public abstract class TaskWithProgressUpdater extends Task implements ProgressUpdater 31 | { 32 | @Override 33 | public void update(long current, long max) 34 | { 35 | super.updateProgress(current, max); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /mqtt-spy/src/main/resources/mqtt-spy-configuration-bindings.xjb: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 22 | -------------------------------------------------------------------------------- /mqtt-spy/src/main/resources/mqtt-spy.catalog: -------------------------------------------------------------------------------- 1 | PUBLIC "http://baczkowicz.pl/mqtt-spy-configuration" "maven:pl.baczkowicz.mqttspy:mqtt-spy!/mqtt-spy-configuration.xsd" -------------------------------------------------------------------------------- /mqtt-spy/src/main/resources/mqtt-spy.properties: -------------------------------------------------------------------------------- 1 | # application properties 2 | application.version=${project.version} 3 | application.name=mqtt-spy 4 | application.logo=mqtt-spy-logo 5 | application.build=${project.build.number} 6 | application.update.url=http://baczkowicz.pl/mqtt-spy/version_0_6_0.xml 7 | application.download.url=http://kamilfb.github.io/mqtt-spy/ 8 | application.wiki.url=https://github.com/kamilfb/mqtt-spy/wiki/ -------------------------------------------------------------------------------- /mqtt-spy/src/main/resources/samples/mqtt-spy-ui.properties: -------------------------------------------------------------------------------- 1 | # application UI properties 2 | application.width=800 3 | application.height=600 4 | application.perspective=DEFAULT -------------------------------------------------------------------------------- /mqtt-spy/src/main/resources/samples/template-script.js: -------------------------------------------------------------------------------- 1 | // Wrap the script in a method, so that you can do "return false;" in case of an error or stop request 2 | function publish() 3 | { 4 | mqttspy.publish("topic", "payload"); 5 | 6 | // This means all OK, script has completed without any issues and as expected 7 | return true; 8 | } 9 | 10 | publish(); -------------------------------------------------------------------------------- /mqtt-spy/src/main/resources/ui/images/mqtt-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/mqtt-spy/src/main/resources/ui/images/mqtt-icon.png -------------------------------------------------------------------------------- /mqtt-spy/src/main/resources/ui/images/mqtt-spy-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/mqtt-spy/src/main/resources/ui/images/mqtt-spy-logo.png -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/mqtt_toolbox_samples/post3_pub_sample1.js: -------------------------------------------------------------------------------- 1 | mqttspy.publish("mqtt-spy/test1", "my first scripted publication"); -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/mqtt_toolbox_samples/post3_pub_sample2.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | for (i = 0; i < 10; i++) 4 | { 5 | mqttspy.publish("mqtt-spy/test2", "hello " + i + ": " + new java.util.Date()); 6 | java.lang.Thread.sleep(1000); 7 | } 8 | return true; 9 | } 10 | publish(); -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/mqtt_toolbox_samples/post3_pub_sample3.js: -------------------------------------------------------------------------------- 1 | mqttspy.publish(message.getTopic(), message.getPayload() + " - " + new java.util.Date()); -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/mqtt_toolbox_samples/post3_search_sample1.js: -------------------------------------------------------------------------------- 1 | function search() 2 | { 3 | if (message.getTopic().contains("test") && message.getPayload().contains("temp")) 4 | { 5 | return true; 6 | } 7 | return false; 8 | } 9 | search(); -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/mqtt_toolbox_samples/post3_sub_sample1.js: -------------------------------------------------------------------------------- 1 | function onMessage() 2 | { 3 | mqttspy.publish( 4 | // Topic 5 | "reply", 6 | // Payload 7 | "" + 8 | "" + 9 | receivedMessage.getPayload() + 10 | ”" + 11 | "", 12 | // QoS 13 | 0, 14 | // Retained 15 | false); 16 | 17 | return true; 18 | } -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/mqtt_toolbox_samples/tc_post3.js: -------------------------------------------------------------------------------- 1 | var TestCaseStepResult = Java.type("pl.baczkowicz.spy.testcases.TestCaseStepResult"); 2 | var TestCaseStatus = Java.type("pl.baczkowicz.spy.testcases.TestCaseStatus"); 3 | 4 | var getInfo = function () 5 | { 6 | var TestCaseInfo = Java.type("pl.baczkowicz.spy.testcases.TestCaseInfo"); 7 | var info = new TestCaseInfo(); 8 | info.setName("Pub/sub test"); 9 | info.getSteps().add("Subscribe to test topic"); 10 | info.getSteps().add("Publish a sample message"); 11 | info.getSteps().add("Verify if received the correct message"); 12 | 13 | return info; 14 | }; 15 | 16 | var step1 = function () 17 | { 18 | // Subscribe to messages 19 | mqttspy.subscribe("testcase/#", 0); 20 | return new TestCaseStepResult(TestCaseStatus.ACTIONED, "Subscribed"); 21 | }; 22 | 23 | var step2 = function () 24 | { 25 | mqttspy.publish("testcase/step2", "sample message 1", 0, false); 26 | return new TestCaseStepResult(TestCaseStatus.ACTIONED, "Message published"); 27 | }; 28 | 29 | var step3 = function () 30 | { 31 | // Wait up to a second to received the expected message 32 | java.lang.Thread.sleep(1000); 33 | 34 | // Check if received 35 | var messages = mqttspy.getMessages("testcase/#"); 36 | 37 | var lastMessage = messages.size() > 0 ? messages.get(0).getPayload() : ""; 38 | 39 | if ("sample message 1".equals(lastMessage)) 40 | { 41 | return new TestCaseStepResult(TestCaseStatus.PASSED, "Correct message received"); 42 | } 43 | 44 | return new TestCaseStepResult(TestCaseStatus.FAILED, "Incorrect message received"); 45 | }; 46 | 47 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/pre_scripts/bedroom.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 20; i++) 6 | { 7 | mqttspy.publish("/home/bedroom/current", "" + (20 + Math.floor((Math.random() * 10) + 1) / 10) + "" + (100 + Math.floor((Math.random() * 10) + 1)) + "", 0, false); 8 | 9 | if (i == 10) 10 | { 11 | Thread.sleep(10000); 12 | } 13 | 14 | try 15 | { 16 | Thread.sleep(1000); 17 | } 18 | catch(err) 19 | { 20 | return false; 21 | } 22 | } 23 | 24 | return true; 25 | } 26 | 27 | publish(); 28 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/sample_log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/scripts/audit_replay.js: -------------------------------------------------------------------------------- 1 | function replay() 2 | { 3 | // Get the number of available messages (0 when run for the first time) 4 | var messageCount = auditReplay.getMessageCount(); 5 | 6 | // If repeat = true, only read the message log once 7 | if (messageCount == 0) 8 | { 9 | messageCount = auditReplay.readFromFile("/home/kamil/Programming/Source/mqtt-spy/mqtt-spy-daemon/src/test/resources/mqtt-spy-daemon.messages"); 10 | auditReplay.setSpeed(2); 11 | } 12 | 13 | // If there are messages to replay... 14 | if (messageCount > 0) 15 | { 16 | // Start the message log time updater... 17 | auditReplay.start(); 18 | 19 | var Thread = Java.type("java.lang.Thread"); 20 | 21 | // For all messages 22 | for (i = 0; i < messageCount; i++) 23 | { 24 | // Wait until this message is ready to be published 25 | while (!auditReplay.isReadyToPublish()) 26 | { 27 | try 28 | { 29 | Thread.sleep(10); 30 | } 31 | catch(err) 32 | { 33 | return false; 34 | } 35 | } 36 | 37 | var message = auditReplay.getNextMessage(); 38 | 39 | // When ready, publish the message 40 | mqttspy.publish(message.getTopic(), message.getRawMessage(), 0, false); 41 | } 42 | } 43 | else 44 | { 45 | logger.warn("No messages available"); 46 | } 47 | 48 | return true; 49 | } 50 | 51 | replay(); 52 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/scripts/bedroom.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 20; i++) 6 | { 7 | mqttspy.publish("home/bedroom/current", (19 + Math.floor((Math.random() * 10) + 1) / 10), 0, false); 8 | 9 | if (i == 10) 10 | { 11 | Thread.sleep(1000); 12 | } 13 | 14 | try 15 | { 16 | Thread.sleep(1000); 17 | } 18 | catch(err) 19 | { 20 | return false; 21 | } 22 | } 23 | 24 | return true; 25 | } 26 | 27 | publish(); 28 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/scripts/floor1_json.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 20; i++) 6 | { 7 | mqttspy.publish("/home/floor1/average", "{ temp: " + (20 + Math.floor((Math.random() * 10) + 1) / 10) + ", " + "energy: " + (40 + Math.floor((Math.random() * 10) + 1)) + "}", 0, false); 8 | 9 | try 10 | { 11 | Thread.sleep(1000); 12 | } 13 | catch(err) 14 | { 15 | return false; 16 | } 17 | } 18 | 19 | return true; 20 | } 21 | 22 | publish(); 23 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/scripts/floor1_xml.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 20; i++) 6 | { 7 | mqttspy.publish("/home/floor1/average", "" + (20 + Math.floor((Math.random() * 10) + 1) / 10) + "" + "" + (100 + Math.floor((Math.random() * 10) + 1)) + "", 0, false); 8 | 9 | try 10 | { 11 | Thread.sleep(1000); 12 | } 13 | catch(err) 14 | { 15 | return false; 16 | } 17 | } 18 | 19 | return true; 20 | } 21 | 22 | publish(); 23 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/scripts/kitchen.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 20; i++) 6 | { 7 | mqttspy.publish("home/kitchen/current", (20 + Math.floor((Math.random() * 10) + 1) / 10), 0, false); 8 | 9 | if (i == 10) 10 | { 11 | Thread.sleep(10000); 12 | } 13 | 14 | try 15 | { 16 | Thread.sleep(1000); 17 | } 18 | catch(err) 19 | { 20 | return false; 21 | } 22 | } 23 | 24 | return true; 25 | } 26 | 27 | publish(); 28 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/scripts/msg1.js: -------------------------------------------------------------------------------- 1 | // Wrap the script in a method, so that you can do "return false;" in case of an error or stop request 2 | function publish() 3 | { 4 | mqttspy.publish("/home/bedroom/12", "12", 0, false); 5 | 6 | // This means all OK, script has completed without any issues and as expected 7 | return true; 8 | } 9 | 10 | publish(); -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/scripts/office.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 20; i++) 6 | { 7 | // "" + 8 | mqttspy.publish("home/office/current", (21 + Math.floor((Math.random() * 20) + 1) / 10), 0, false); 9 | // + "" 10 | 11 | if (i == 10) 12 | { 13 | Thread.sleep(1000); 14 | } 15 | 16 | try 17 | { 18 | Thread.sleep(1000); 19 | } 20 | catch(err) 21 | { 22 | return false; 23 | } 24 | } 25 | 26 | return true; 27 | } 28 | 29 | publish(); 30 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/scripts/other/loop1.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 20; i++) 6 | { 7 | mqttspy.publish("/mqtt-spy/script/test1/", "hello" + i, 0, false); 8 | 9 | if (i == 10) 10 | { 11 | Thread.sleep(10000); 12 | } 13 | 14 | try 15 | { 16 | Thread.sleep(1000); 17 | } 18 | catch(err) 19 | { 20 | return false; 21 | } 22 | } 23 | 24 | return true; 25 | } 26 | 27 | publish(); 28 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/scripts/other/loop2.js: -------------------------------------------------------------------------------- 1 | var Thread = Java.type("java.lang.Thread"); 2 | 3 | for (i = 0; i < 200; i++) 4 | { 5 | mqttspy.publish("/mqtt-spy/script/test2/", "hello" + i, 0, false); 6 | 7 | try 8 | { 9 | Thread.sleep(30); 10 | } 11 | catch(err) 12 | { 13 | break; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/scripts/other/loop3.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | mqttspy.setScriptTimeout(11000); 4 | 5 | var Thread = Java.type("java.lang.Thread"); 6 | 7 | for (i = 0; i < 20; i++) 8 | { 9 | mqttspy.publish("/mqtt-spy/script/test3/", "hello" + i, 0, false); 10 | 11 | if (i == 10) 12 | { 13 | Thread.sleep(10000); 14 | } 15 | 16 | try 17 | { 18 | Thread.sleep(1000); 19 | } 20 | catch(err) 21 | { 22 | return false; 23 | } 24 | } 25 | 26 | return true; 27 | } 28 | 29 | publish(); 30 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/scripts/publish_image.js: -------------------------------------------------------------------------------- 1 | function publishImage() 2 | { 3 | var Files = Java.type("java.nio.file.Files"); 4 | var Paths = Java.type("java.nio.file.Paths"); 5 | var Path = Java.type("java.nio.file.Path"); 6 | 7 | var path = Paths.get("/home/kamil/Desktop/image2.png"); 8 | var data = Files.readAllBytes(path); 9 | 10 | mqttspy.publish(message.getTopic(), data, 0, false); 11 | 12 | return true; 13 | } 14 | 15 | publishImage(); 16 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/scripts/publish_time.js: -------------------------------------------------------------------------------- 1 | function publishTime() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | var Date = Java.type("java.util.Date"); 5 | var SimpleDateFormat = Java.type("java.text.SimpleDateFormat"); 6 | 7 | var TIME_FORMAT_WITH_SECONDS = "HH:mm:ss"; 8 | var TIME_WITH_SECONDS_SDF = new SimpleDateFormat(TIME_FORMAT_WITH_SECONDS); 9 | 10 | while (true) 11 | { 12 | var currentTime = TIME_WITH_SECONDS_SDF.format(new Date()); 13 | 14 | mqttspy.publish("time/", currentTime, 0, false); 15 | 16 | // Sleep for 1 second and handle a stop request 17 | try 18 | { 19 | Thread.sleep(1000); 20 | } 21 | catch(err) 22 | { 23 | return false; 24 | } 25 | 26 | // Keep mqtt-spy informed the script is still running 27 | mqttspy.touch(); 28 | } 29 | 30 | return true; 31 | } 32 | 33 | publishTime(); 34 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/scripts/replay_message_log.js: -------------------------------------------------------------------------------- 1 | function replay() 2 | { 3 | // Get the number of available messages (0 when run for the first time) 4 | var messageCount = messageLog.getMessageCount(); 5 | 6 | // If repeat = true, only read the message log once 7 | if (messageCount == 0) 8 | { 9 | messageCount = messageLog.readFromFile("/home/kamil/Programming/Source/mqtt-spy/mqtt-spy-daemon/src/test/resources/mqtt-spy-daemon.messages"); 10 | messageLog.setSpeed(2); 11 | } 12 | 13 | // If there are messages to replay... 14 | if (messageCount > 0) 15 | { 16 | // Start the message log time updater... 17 | messageLog.start(); 18 | 19 | var Thread = Java.type("java.lang.Thread"); 20 | 21 | // For all messages 22 | for (i = 0; i < messageCount; i++) 23 | { 24 | // Wait until this message is ready to be published 25 | while (!messageLog.isReadyToPublish(i)) 26 | { 27 | try 28 | { 29 | Thread.sleep(10); 30 | } 31 | catch(err) 32 | { 33 | return false; 34 | } 35 | } 36 | 37 | // When ready, publish the message 38 | mqttspy.publish(messageLog.getMessage(i).getTopic(), messageLog.getMessage(i).getRawMessage(), 0, false); 39 | } 40 | } 41 | else 42 | { 43 | logger.warn("No messages available"); 44 | } 45 | 46 | return true; 47 | } 48 | 49 | replay(); 50 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/scripts/single_message.js: -------------------------------------------------------------------------------- 1 | mqttspy.publish("mqtt-spy/script/test3/", "hello :)", 0, false); 2 | 3 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/scripts/with_parameters.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 20; i++) 6 | { 7 | mqttspy.publish(message.getTopic(), message.getPayload() + i, 0, false); 8 | 9 | try 10 | { 11 | Thread.sleep(1000); 12 | } 13 | catch(err) 14 | { 15 | return false; 16 | } 17 | } 18 | 19 | return true; 20 | } 21 | 22 | publish(); 23 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/search_scripts/temp.js: -------------------------------------------------------------------------------- 1 | function search() 2 | { 3 | if (message.getTopic().contains("test") && message.getPayload().contains("temp")) 4 | { 5 | return true; 6 | } 7 | 8 | return false; 9 | } 10 | 11 | search(); 12 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/sub_scripts/reply.js: -------------------------------------------------------------------------------- 1 | function before() 2 | { 3 | logger.info("Runing the 'before' function..."); 4 | } 5 | 6 | function onMessage() 7 | { 8 | if (!receivedMessage.getTopic().equals("reply")) 9 | { 10 | mqttspy.publish( 11 | "reply", "" + receivedMessage.getTopic() + "" 12 | + "" 13 | + "", 0, false); 14 | 15 | receivedMessage.setPayload("" + receivedMessage.getPayload() + "- modified :)"); 16 | } 17 | else 18 | { 19 | receivedMessage.setPayload("" + receivedMessage.getPayload() + "- modified :)"); 20 | } 21 | 22 | return true; 23 | } 24 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/test-mqtt-spy-configuration-no-formatting.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | user1@localhost 10 | tcp://127.0.0.1:1883 11 | user1 12 | false 13 | 14 | 15 | 16 | user2@localhost 17 | tcp://localhost 18 | user2 19 | true 20 | true 21 | 5 22 | 10 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/test_cases/test2/tc.js: -------------------------------------------------------------------------------- 1 | var TestCaseStepResult = Java.type("pl.baczkowicz.spy.testcases.TestCaseStepResult"); 2 | var TestCaseStatus = Java.type("pl.baczkowicz.spy.testcases.TestCaseStatus"); 3 | 4 | var getInfo = function () 5 | { 6 | var TestCaseInfo = Java.type("pl.baczkowicz.spy.testcases.TestCaseInfo"); 7 | var info = new TestCaseInfo(); 8 | info.setName("Sample test case 2"); 9 | info.getSteps().add("Step 1"); 10 | info.getSteps().add("Step 2"); 11 | info.getSteps().add("Step 3"); 12 | 13 | return info; 14 | }; 15 | 16 | var step1 = function () 17 | { 18 | return new TestCaseStepResult(TestCaseStatus.PASSED, "All fine in step 1"); 19 | }; 20 | 21 | var step2 = function () 22 | { 23 | return new TestCaseStepResult(TestCaseStatus.ACTIONED, "All fine in step 2"); 24 | }; 25 | 26 | var step3 = function () 27 | { 28 | return new TestCaseStepResult(TestCaseStatus.SKIPPED, "Step 3 skipped"); 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/test_cases/test3/tc.js: -------------------------------------------------------------------------------- 1 | var TestCaseStepResult = Java.type("pl.baczkowicz.spy.testcases.TestCaseStepResult"); 2 | var TestCaseStatus = Java.type("pl.baczkowicz.spy.testcases.TestCaseStatus"); 3 | 4 | var getInfo = function () 5 | { 6 | var TestCaseInfo = Java.type("pl.baczkowicz.spy.testcases.TestCaseInfo"); 7 | var info = new TestCaseInfo(); 8 | info.setName("Pub/sub test"); 9 | info.getSteps().add("Subscribe to test topic"); 10 | info.getSteps().add("Publish a sample message"); 11 | info.getSteps().add("Verify if received the correct message"); 12 | 13 | return info; 14 | }; 15 | 16 | var step1 = function () 17 | { 18 | // Subscribe to messages 19 | mqttspy.subscribe("testcase/3/#", 0); 20 | return new TestCaseStepResult(TestCaseStatus.ACTIONED, "Subscribed"); 21 | }; 22 | 23 | var step2 = function () 24 | { 25 | mqttspy.publish("testcase/3/step2", "sample message 1", 0, false); 26 | return new TestCaseStepResult(TestCaseStatus.ACTIONED, "Message published"); 27 | }; 28 | 29 | var step3 = function () 30 | { 31 | var messages = mqttspy.getMessages("testcase/3/#"); 32 | 33 | var lastMessage = messages.size() > 0 ? messages.get(0).getPayload() : ""; 34 | 35 | if ("sample message 1".equals(lastMessage)) 36 | { 37 | return new TestCaseStepResult(TestCaseStatus.PASSED, "Correct message received"); 38 | } 39 | 40 | return new TestCaseStepResult(TestCaseStatus.FAILED, "Incorrect message received"); 41 | }; 42 | 43 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/virtual_iot_meetup_samples/audit_replay.js: -------------------------------------------------------------------------------- 1 | function replay() 2 | { 3 | // Get the number of available messages (0 when run for the first time) 4 | var messageCount = auditReplay.getMessageCount(); 5 | 6 | // If repeat = true, only read the message log once 7 | if (messageCount == 0) 8 | { 9 | messageCount = auditReplay.readFromFile("/home/kamil/Programming/Source/mqtt-spy/mqtt-spy/src/test/resources/scripts/virtual_iot_meetup_samples/bedrooms.messages"); 10 | auditReplay.setSpeed(20); 11 | } 12 | 13 | // If there are messages to replay... 14 | if (messageCount > 0) 15 | { 16 | // Start the message log time updater... 17 | auditReplay.start(); 18 | 19 | var Thread = Java.type("java.lang.Thread"); 20 | 21 | // For all messages 22 | for (i = 0; i < messageCount; i++) 23 | { 24 | // Wait until this message is ready to be published 25 | while (!auditReplay.isReadyToPublish()) 26 | { 27 | try 28 | { 29 | Thread.sleep(10); 30 | } 31 | catch(err) 32 | { 33 | return false; 34 | } 35 | } 36 | 37 | var message = auditReplay.getNextMessage(); 38 | 39 | // When ready, publish the message 40 | mqttspy.publish(message.getTopic(), message.getRawMessage(), 0, false); 41 | } 42 | } 43 | else 44 | { 45 | logger.warn("No messages available"); 46 | } 47 | 48 | return true; 49 | } 50 | 51 | replay(); 52 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/virtual_iot_meetup_samples/inline_json_search.txt: -------------------------------------------------------------------------------- 1 | java.lang.Double.valueOf(com.jayway.jsonpath.JsonPath.read(content, "$.humidity")) >= 61.9 -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/virtual_iot_meetup_samples/publish_time.js: -------------------------------------------------------------------------------- 1 | function publishTime() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | var Date = Java.type("java.util.Date"); 5 | var SimpleDateFormat = Java.type("java.text.SimpleDateFormat"); 6 | 7 | var TIME_FORMAT_WITH_SECONDS = "HH:mm:ss"; 8 | var TIME_WITH_SECONDS_SDF = new SimpleDateFormat(TIME_FORMAT_WITH_SECONDS); 9 | 10 | while (true) 11 | { 12 | var currentTime = TIME_WITH_SECONDS_SDF.format(new Date()); 13 | 14 | mqttspy.publish("time", currentTime, 0, false); 15 | 16 | // Sleep for 1 second and handle a stop request 17 | try 18 | { 19 | Thread.sleep(1000); 20 | } 21 | catch(err) 22 | { 23 | return false; 24 | } 25 | 26 | // Keep mqtt-spy informed the script is still running 27 | mqttspy.touch(); 28 | } 29 | 30 | return true; 31 | } 32 | 33 | publishTime(); 34 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/virtual_iot_meetup_samples/room_bedroom1.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 20; i++) 6 | { 7 | mqttspy.publish("home/rooms/bedroom1", 8 | "{ " + 9 | "temp: " + (19 + Math.floor((Math.random() * 10) + 1) / 10) + ", " + 10 | "humidity: " + (59 + Math.floor((Math.random() * 10) + 1) / 10) + ", " + 11 | //"energy: " + (40 + Math.floor((Math.random() * 10) + 1)) + 12 | "}", 0, false); 13 | 14 | try 15 | { 16 | Thread.sleep(1000); 17 | } 18 | catch(err) 19 | { 20 | return false; 21 | } 22 | } 23 | 24 | return true; 25 | } 26 | 27 | publish(); 28 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/virtual_iot_meetup_samples/room_bedroom2.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 20; i++) 6 | { 7 | mqttspy.publish("home/rooms/bedroom2", 8 | "{ " + 9 | "temp: " + (19 + Math.floor((Math.random() * 10) + 1) / 10) + ", " + 10 | "humidity: " + (61 + Math.floor((Math.random() * 10) + 1) / 10) + ", " + 11 | //"energy: " + (40 + Math.floor((Math.random() * 10) + 1)) + 12 | "}", 0, false); 13 | 14 | try 15 | { 16 | Thread.sleep(1000); 17 | } 18 | catch(err) 19 | { 20 | return false; 21 | } 22 | } 23 | 24 | return true; 25 | } 26 | 27 | publish(); 28 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/virtual_iot_meetup_samples/room_kitchen.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 20; i++) 6 | { 7 | mqttspy.publish("home/rooms/kitchen", 8 | "{ " + 9 | "temp: " + (21 + Math.floor((Math.random() * 10) + 1) / 10) + ", " + 10 | "humidity: " + (65 + Math.floor((Math.random() * 10) + 1) / 10) + ", " + 11 | //"energy: " + (40 + Math.floor((Math.random() * 10) + 1)) + 12 | "}", 0, false); 13 | 14 | try 15 | { 16 | Thread.sleep(1000); 17 | } 18 | catch(err) 19 | { 20 | return false; 21 | } 22 | } 23 | 24 | return true; 25 | } 26 | 27 | publish(); 28 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/virtual_iot_meetup_samples/room_living.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 20; i++) 6 | { 7 | mqttspy.publish("home/rooms/living", 8 | "{ " + 9 | "temp: " + (20 + Math.floor((Math.random() * 10) + 1) / 10) + ", " + 10 | "humidity: " + (60 + Math.floor((Math.random() * 10) + 1) / 10) + ", " + 11 | //"energy: " + (40 + Math.floor((Math.random() * 10) + 1)) + 12 | "}", 0, false); 13 | 14 | try 15 | { 16 | Thread.sleep(1000); 17 | } 18 | catch(err) 19 | { 20 | return false; 21 | } 22 | } 23 | 24 | return true; 25 | } 26 | 27 | publish(); 28 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/virtual_iot_meetup_samples/socket_all.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 20; i++) 6 | { 7 | mqttspy.publish("home/sockets/all", 8 | "{ " + 9 | "energy: " + (240 + Math.floor((Math.random() * 70) + 1)) + 10 | "}", 0, false); 11 | 12 | try 13 | { 14 | Thread.sleep(1000); 15 | } 16 | catch(err) 17 | { 18 | return false; 19 | } 20 | } 21 | 22 | return true; 23 | } 24 | 25 | publish(); 26 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/virtual_iot_meetup_samples/socket_lights.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 20; i++) 6 | { 7 | mqttspy.publish("home/sockets/lights", 8 | "{ " + 9 | "energy: " + (40 + Math.floor((Math.random() * 5) + 1)) + 10 | "}", 0, false); 11 | 12 | try 13 | { 14 | Thread.sleep(1000); 15 | } 16 | catch(err) 17 | { 18 | return false; 19 | } 20 | } 21 | 22 | return true; 23 | } 24 | 25 | publish(); 26 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/virtual_iot_meetup_samples/socket_tv.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | var Thread = Java.type("java.lang.Thread"); 4 | 5 | for (i = 0; i < 20; i++) 6 | { 7 | mqttspy.publish("home/sockets/tvset", 8 | "{ " + 9 | "energy: " + (140 + Math.floor((Math.random() * 10) + 1)) + 10 | "}", 0, false); 11 | 12 | try 13 | { 14 | Thread.sleep(1000); 15 | } 16 | catch(err) 17 | { 18 | return false; 19 | } 20 | } 21 | 22 | return true; 23 | } 24 | 25 | publish(); 26 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/virtual_iot_meetup_samples/subscription_auto-reply.js: -------------------------------------------------------------------------------- 1 | function before() 2 | { 3 | logger.info("Runing the 'before' function..."); 4 | } 5 | 6 | function onMessage() 7 | { 8 | if (!receivedMessage.getTopic().contains("reply")) 9 | { 10 | mqttspy.publish( 11 | "mqtt-spy/auto-reply", "" + receivedMessage.getTopic() + "" 12 | + "" 13 | + "", 0, false); 14 | 15 | receivedMessage.setPayload("" + receivedMessage.getPayload() + "- modified :)"); 16 | } 17 | else 18 | { 19 | receivedMessage.setPayload("" + receivedMessage.getPayload() + "- modified :)"); 20 | } 21 | 22 | return true; 23 | } 24 | -------------------------------------------------------------------------------- /mqtt-spy/src/test/resources/virtual_iot_meetup_samples/with_parameters.js: -------------------------------------------------------------------------------- 1 | function publish() 2 | { 3 | mqttspy.publish(message.getTopic(), "{ payload: \"" + message.getPayload() + "\", timestamp: \"" + (new Date()) + "\"}", 0, false); 4 | 5 | return true; 6 | } 7 | 8 | publish(); 9 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | mqtt-spy project 7 | pl.baczkowicz.mqttspy 8 | mqtt-spy-pom 9 | 10 | pom 11 | 0.0.1-SNAPSHOT 12 | 13 | 14 | ${project.basedir} 15 | 16 | 17 | 18 | 19 | spy-common 20 | spy-common-ui 21 | mqtt-spy-common 22 | mqtt-spy-daemon 23 | mqtt-spy 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/.gitignore: -------------------------------------------------------------------------------- 1 | /META-INF/ 2 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/IConnectionViewManager.java: -------------------------------------------------------------------------------- 1 | package pl.baczkowicz.spy.ui; 2 | 3 | import java.util.Collection; 4 | 5 | import javafx.scene.control.Tab; 6 | import pl.baczkowicz.spy.exceptions.ConfigurationException; 7 | import pl.baczkowicz.spy.ui.connections.IUiConnection; 8 | import pl.baczkowicz.spy.ui.controllers.IConnectionController; 9 | import pl.baczkowicz.spy.ui.properties.ModifiableConnection; 10 | 11 | public interface IConnectionViewManager 12 | { 13 | IConnectionController getControllerForTab(final Tab selectedTab); 14 | 15 | Collection getConnectionControllers(); 16 | 17 | void disconnectAll(); 18 | 19 | void disconnectAndCloseAll(); 20 | 21 | void autoOpenConnections(); 22 | 23 | //void disconnectAndCloseTab(IUiConnection connection); 24 | 25 | //void disconnectFromBroker(IUiConnection connection); 26 | 27 | //boolean connectToBroker(IUiConnection connection); 28 | 29 | void openConnection(ModifiableConnection connectionDetails) throws ConfigurationException; 30 | 31 | Collection getConnections(); 32 | 33 | // void connectToBroker(IUiConnection connection); 34 | } 35 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/charts/ChartMode.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.ui.charts; 21 | 22 | public enum ChartMode 23 | { 24 | USER_DRIVEN_MSG_PAYLOAD, USER_DRIVEN_MSG_SIZE 25 | } 26 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/charts/ChartSeriesStatusEnum.java: -------------------------------------------------------------------------------- 1 | package pl.baczkowicz.spy.ui.charts; 2 | 3 | public enum ChartSeriesStatusEnum 4 | { 5 | NO_MESSAGES("No messages"), 6 | OK("OK"), 7 | ERROR("Error"); 8 | 9 | private final String value; 10 | 11 | ChartSeriesStatusEnum(String v) 12 | { 13 | value = v; 14 | } 15 | 16 | public String value() 17 | { 18 | return value; 19 | } 20 | 21 | public static ChartSeriesStatusEnum fromValue(final String v) 22 | { 23 | for (ChartSeriesStatusEnum c : ChartSeriesStatusEnum.values()) 24 | { 25 | if (c.value.equals(v)) 26 | { 27 | return c; 28 | } 29 | } 30 | throw new IllegalArgumentException(v); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/charts/ChartSeriesTypeEnum.java: -------------------------------------------------------------------------------- 1 | package pl.baczkowicz.spy.ui.charts; 2 | 3 | public enum ChartSeriesTypeEnum 4 | { 5 | PAYLOAD_PLAIN("Payload"), 6 | 7 | PAYLOAD_XML("XPath"), 8 | 9 | PAYLOAD_JSON("JSONPath"), 10 | 11 | // PAYLOAD_JAVASCRIPT("JavaScript"), 12 | 13 | SIZE("Message size"); 14 | 15 | private final String value; 16 | 17 | ChartSeriesTypeEnum(String v) 18 | { 19 | value = v; 20 | } 21 | 22 | public String value() 23 | { 24 | return value; 25 | } 26 | 27 | public static ChartSeriesTypeEnum fromValue(final String v) 28 | { 29 | for (ChartSeriesTypeEnum c : ChartSeriesTypeEnum.values()) 30 | { 31 | if (c.value.equals(v)) 32 | { 33 | return c; 34 | } 35 | } 36 | throw new IllegalArgumentException(v); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/connections/IUiConnection.java: -------------------------------------------------------------------------------- 1 | package pl.baczkowicz.spy.ui.connections; 2 | 3 | import pl.baczkowicz.spy.connectivity.ConnectionStatus; 4 | import pl.baczkowicz.spy.connectivity.IConnection; 5 | 6 | public interface IUiConnection extends IConnection 7 | { 8 | // Boolean isAutoOpen(); 9 | 10 | String getId(); 11 | 12 | boolean isOpening(); 13 | 14 | boolean isOpened(); 15 | 16 | ConnectionStatus getConnectionStatus(); 17 | 18 | String getName(); 19 | } 20 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/controllers/IConnectionController.java: -------------------------------------------------------------------------------- 1 | package pl.baczkowicz.spy.ui.controllers; 2 | 3 | public interface IConnectionController 4 | { 5 | void updateConnectionStats(); 6 | } 7 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/controlpanel/IControlPanelItem.java: -------------------------------------------------------------------------------- 1 | package pl.baczkowicz.spy.ui.controlpanel; 2 | 3 | import javafx.scene.control.Button; 4 | import pl.baczkowicz.spy.ui.controllers.ControlPanelItemController; 5 | 6 | public interface IControlPanelItem 7 | { 8 | void update(final ControlPanelItemController controlPanelItemController, final Button button); 9 | } 10 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/controlpanel/ItemStatus.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.ui.controlpanel; 21 | 22 | /** 23 | * Status of the control panel element (e.g. green tick or stats icon). 24 | */ 25 | public enum ItemStatus 26 | { 27 | OK, INFO, WARN, ERROR, STATS 28 | } 29 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/controls/TextAreaInterface.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.controls; 22 | 23 | import javafx.beans.value.ObservableValue; 24 | import javafx.scene.control.Tooltip; 25 | 26 | /** 27 | * A common interface for accessing text areas (standard and styled). 28 | */ 29 | public interface TextAreaInterface 30 | { 31 | void setEditable(boolean editable); 32 | 33 | void setWrapText(boolean wrapText); 34 | 35 | ObservableValue selectedTextProperty(); 36 | 37 | void setTooltip(Tooltip tooltip); 38 | 39 | void clear(); 40 | 41 | void appendText(String text); 42 | 43 | void positionCaret(int position); 44 | 45 | String getSelectedText(); 46 | 47 | String getText(); 48 | } 49 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/AddConnectionTabEvent.java: -------------------------------------------------------------------------------- 1 | package pl.baczkowicz.spy.ui.events; 2 | 3 | import javafx.scene.control.Tab; 4 | 5 | public class AddConnectionTabEvent 6 | { 7 | private final Tab tab; 8 | 9 | public AddConnectionTabEvent(final Tab tab) 10 | { 11 | this.tab = tab; 12 | } 13 | 14 | /** 15 | * @return the tab 16 | */ 17 | public Tab getTab() 18 | { 19 | return tab; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/ClearTabEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import pl.baczkowicz.spy.eventbus.FilterableEvent; 24 | 25 | public class ClearTabEvent extends FilterableEvent 26 | { 27 | public ClearTabEvent(final Object filter) 28 | { 29 | super.setFilter(filter); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/ConfigurationLoadedEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | 24 | public class ConfigurationLoadedEvent 25 | { 26 | // Empty 27 | } 28 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/ConnectionNameChangedEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | 24 | public class ConnectionNameChangedEvent 25 | { 26 | private final String name; 27 | 28 | public ConnectionNameChangedEvent(final String name) 29 | { 30 | this.name = name; 31 | } 32 | 33 | /** 34 | * @return the changed name 35 | */ 36 | public String getName() 37 | { 38 | return name; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/ConnectionStatusChangeEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import pl.baczkowicz.spy.connectivity.ConnectionStatus; 24 | import pl.baczkowicz.spy.eventbus.FilterableEvent; 25 | 26 | public class ConnectionStatusChangeEvent extends FilterableEvent 27 | { 28 | private String name; 29 | 30 | private ConnectionStatus status; 31 | 32 | public ConnectionStatusChangeEvent(final Object changedConnection, final String name, final ConnectionStatus status) 33 | { 34 | this.setFilter(changedConnection); 35 | 36 | this.name = name; 37 | this.status = status; 38 | } 39 | 40 | public String getName() 41 | { 42 | return name; 43 | } 44 | 45 | public ConnectionStatus getConnectionStatus() 46 | { 47 | return status; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/ConnectionsChangedEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | 24 | public class ConnectionsChangedEvent 25 | { 26 | // Empty 27 | } 28 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/CreateNewConnectionEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | 24 | public class CreateNewConnectionEvent 25 | { 26 | private final String protocol; 27 | 28 | public CreateNewConnectionEvent(final String protocol) 29 | { 30 | this.protocol = protocol; 31 | } 32 | 33 | /** 34 | * @return the protocol 35 | */ 36 | public String getProtocol() 37 | { 38 | return protocol; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/FormattersChangedEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | 24 | public class FormattersChangedEvent 25 | { 26 | // Empty 27 | } 28 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/LoadConfigurationFileEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import java.io.File; 24 | 25 | public class LoadConfigurationFileEvent 26 | { 27 | private final File file; 28 | 29 | public LoadConfigurationFileEvent(final File file) 30 | { 31 | this.file = file; 32 | } 33 | 34 | /** 35 | * @return the changedSubscription 36 | */ 37 | public File getFile() 38 | { 39 | return file; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/MessageFormatChangeEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import pl.baczkowicz.spy.eventbus.FilterableEvent; 24 | 25 | public class MessageFormatChangeEvent extends FilterableEvent 26 | { 27 | public MessageFormatChangeEvent(final Object filter) 28 | { 29 | super.setFilter(filter); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/MessageIndexChangeEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import pl.baczkowicz.spy.eventbus.FilterableEvent; 24 | 25 | public class MessageIndexChangeEvent extends FilterableEvent 26 | { 27 | private final int index; 28 | 29 | private final Object dispatcher; 30 | 31 | public MessageIndexChangeEvent(final int index, final Object filter, final Object dispatcher) 32 | { 33 | this.index = index; 34 | this.dispatcher = dispatcher; 35 | super.setFilter(filter); 36 | } 37 | 38 | /** 39 | * @return the index 40 | */ 41 | public int getIndex() 42 | { 43 | return index; 44 | } 45 | 46 | /** 47 | * @return the dispatcher 48 | */ 49 | public Object getDispatcher() 50 | { 51 | return dispatcher; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/MessageIndexIncrementEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import pl.baczkowicz.spy.eventbus.FilterableEvent; 24 | 25 | public class MessageIndexIncrementEvent extends FilterableEvent 26 | { 27 | private final int increment; 28 | 29 | public MessageIndexIncrementEvent(final int increment, final Object filter) 30 | { 31 | this.increment = increment; 32 | super.setFilter(filter); 33 | } 34 | 35 | /** 36 | * @return the index 37 | */ 38 | public int getIncrement() 39 | { 40 | return increment; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/MessageIndexToFirstEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import pl.baczkowicz.spy.eventbus.FilterableEvent; 24 | 25 | public class MessageIndexToFirstEvent extends FilterableEvent 26 | { 27 | public MessageIndexToFirstEvent(final Object filter) 28 | { 29 | super.setFilter(filter); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/MessageListChangedEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import pl.baczkowicz.spy.eventbus.FilterableEvent; 24 | 25 | public class MessageListChangedEvent extends FilterableEvent 26 | { 27 | public MessageListChangedEvent(final Object filter) 28 | { 29 | super.setFilter(filter); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/NewPerspectiveSelectedEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import pl.baczkowicz.spy.ui.panes.SpyPerspective; 24 | 25 | public class NewPerspectiveSelectedEvent 26 | { 27 | private final SpyPerspective perspective; 28 | 29 | public NewPerspectiveSelectedEvent(final SpyPerspective perspective) 30 | { 31 | this.perspective = perspective; 32 | } 33 | 34 | /** 35 | * @return the perspective 36 | */ 37 | public SpyPerspective getPerspective() 38 | { 39 | return perspective; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/SaveChartSeriesEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import pl.baczkowicz.spy.ui.properties.ChartSeriesProperties; 24 | 25 | public class SaveChartSeriesEvent 26 | { 27 | private ChartSeriesProperties editedProperties; 28 | 29 | private boolean isNew; 30 | 31 | public SaveChartSeriesEvent(final ChartSeriesProperties editedProperties, final boolean isNew) 32 | { 33 | this.editedProperties = editedProperties; 34 | this.isNew = isNew; 35 | } 36 | 37 | /** 38 | * @return the editedProperties 39 | */ 40 | public ChartSeriesProperties getEditedProperties() 41 | { 42 | return editedProperties; 43 | } 44 | 45 | public boolean isNew() 46 | { 47 | return isNew; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/ShowAboutWindowEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import javafx.stage.Window; 24 | 25 | public class ShowAboutWindowEvent 26 | { 27 | private final Window parent; 28 | 29 | public ShowAboutWindowEvent(final Window parent) 30 | { 31 | this.parent = parent; 32 | } 33 | 34 | /** 35 | * @return the changedSubscription 36 | */ 37 | public Window getParent() 38 | { 39 | return parent; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/ShowEditChartSeriesWindowEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import pl.baczkowicz.spy.ui.properties.ChartSeriesProperties; 24 | import javafx.stage.Window; 25 | 26 | public class ShowEditChartSeriesWindowEvent 27 | { 28 | private final Window parent; 29 | private ChartSeriesProperties editedProperties; 30 | 31 | public ShowEditChartSeriesWindowEvent(final Window parent, final ChartSeriesProperties editedProperties) 32 | { 33 | this.parent = parent; 34 | this.editedProperties = editedProperties; 35 | } 36 | 37 | public Window getParent() 38 | { 39 | return parent; 40 | } 41 | 42 | /** 43 | * @return the editedProperties 44 | */ 45 | public ChartSeriesProperties getEditedProperties() 46 | { 47 | return editedProperties; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/ShowExternalWebPageEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | public class ShowExternalWebPageEvent 24 | { 25 | private final String webpage; 26 | 27 | public ShowExternalWebPageEvent(final String webpage) 28 | { 29 | this.webpage = webpage; 30 | } 31 | 32 | /** 33 | * @return the changedSubscription 34 | */ 35 | public String getWebpage() 36 | { 37 | return webpage; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/ShowFormattersWindowEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import javafx.stage.Window; 24 | 25 | public class ShowFormattersWindowEvent 26 | { 27 | private final Window parent; 28 | 29 | private boolean showAndWait; 30 | 31 | public ShowFormattersWindowEvent(final Window parent, final boolean showAndWait) 32 | { 33 | this.parent = parent; 34 | this.showAndWait = showAndWait; 35 | } 36 | 37 | /** 38 | * @return the changedSubscription 39 | */ 40 | public Window getParent() 41 | { 42 | return parent; 43 | } 44 | 45 | public boolean isShowAndWait() 46 | { 47 | return showAndWait; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/ShowMessageLogEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import javafx.stage.Window; 24 | 25 | public class ShowMessageLogEvent 26 | { 27 | private final Window parent; 28 | 29 | public ShowMessageLogEvent(final Window parent) 30 | { 31 | this.parent = parent; 32 | } 33 | 34 | /** 35 | * @return the changedSubscription 36 | */ 37 | public Window getParent() 38 | { 39 | return parent; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/ShowTestCasesWindowEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import javafx.stage.Window; 24 | 25 | public class ShowTestCasesWindowEvent 26 | { 27 | private final Window parent; 28 | 29 | public ShowTestCasesWindowEvent(final Window parent) 30 | { 31 | this.parent = parent; 32 | } 33 | 34 | /** 35 | * @return the changedSubscription 36 | */ 37 | public Window getParent() 38 | { 39 | return parent; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/VersionInfoErrorEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | public class VersionInfoErrorEvent 24 | { 25 | private final Exception exception; 26 | 27 | public VersionInfoErrorEvent(final Exception e) 28 | { 29 | this.exception = e; 30 | } 31 | 32 | /** 33 | * @return the exception 34 | */ 35 | public Exception getException() 36 | { 37 | return exception; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/VersionInfoReceivedEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.events; 22 | 23 | import pl.baczkowicz.spy.ui.generated.versions.SpyVersions; 24 | 25 | public class VersionInfoReceivedEvent 26 | { 27 | private final SpyVersions versions; 28 | 29 | public VersionInfoReceivedEvent(final SpyVersions versions) 30 | { 31 | this.versions = versions; 32 | } 33 | 34 | /** 35 | * @return the versions 36 | */ 37 | public SpyVersions getVersions() 38 | { 39 | return versions; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/observers/ItemsReorderedObserver.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.ui.events.observers; 21 | 22 | public interface ItemsReorderedObserver 23 | { 24 | void onItemsReordered(); 25 | } 26 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/events/queuable/ui/SpyUIEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.ui.events.queuable.ui; 21 | 22 | import pl.baczkowicz.spy.events.SpyEvent; 23 | import pl.baczkowicz.spy.messages.FormattedMessage; 24 | import pl.baczkowicz.spy.storage.MessageList; 25 | 26 | /** 27 | * Base UI event object. 28 | */ 29 | public interface SpyUIEvent extends SpyEvent 30 | { 31 | MessageList getList(); 32 | } 33 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/generated/versions/UpdateStatus.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2016.06.21 at 12:15:29 AM BST 6 | // 7 | 8 | 9 | package pl.baczkowicz.spy.ui.generated.versions; 10 | 11 | import javax.xml.bind.annotation.XmlEnum; 12 | import javax.xml.bind.annotation.XmlType; 13 | 14 | 15 | /** 16 | *

Java class for UpdateStatus. 17 | * 18 | *

The following schema fragment specifies the expected content contained within this class. 19 | *

20 | *

21 |  * <simpleType name="UpdateStatus">
22 |  *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
23 |  *     <enumeration value="ON_LATEST"/>
24 |  *     <enumeration value="NEW_AVAILABLE"/>
25 |  *     <enumeration value="UPDATE_RECOMMENDED"/>
26 |  *     <enumeration value="CRITICAL"/>
27 |  *   </restriction>
28 |  * </simpleType>
29 |  * 
30 | * 31 | */ 32 | @XmlType(name = "UpdateStatus") 33 | @XmlEnum 34 | public enum UpdateStatus { 35 | 36 | ON_LATEST, 37 | NEW_AVAILABLE, 38 | UPDATE_RECOMMENDED, 39 | CRITICAL; 40 | 41 | public String value() { 42 | return name(); 43 | } 44 | 45 | public static UpdateStatus fromValue(String v) { 46 | return valueOf(v); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/generated/versions/package-info.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2016.06.21 at 12:15:29 AM BST 6 | // 7 | 8 | @javax.xml.bind.annotation.XmlSchema(namespace = "http://baczkowicz.pl/spy-versions") 9 | package pl.baczkowicz.spy.ui.generated.versions; 10 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/keyboard/KeyboardUtils.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.ui.keyboard; 21 | 22 | import javafx.event.EventHandler; 23 | import javafx.scene.input.KeyEvent; 24 | 25 | /** 26 | * Keyboard-related utilities. 27 | */ 28 | public class KeyboardUtils 29 | { 30 | /** Non-numeric key consumer - consumes any non-number characters. */ 31 | public static final EventHandler nonNumericKeyConsumer = new EventHandler() 32 | { 33 | public void handle(KeyEvent t) 34 | { 35 | char ar[] = t.getCharacter().toCharArray(); 36 | char ch = ar[t.getCharacter().toCharArray().length - 1]; 37 | if (!(ch >= '0' && ch <= '9')) 38 | { 39 | t.consume(); 40 | } 41 | } 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/panes/PaneVisibilityManager.java: -------------------------------------------------------------------------------- 1 | package pl.baczkowicz.spy.ui.panes; 2 | 3 | import java.util.Map; 4 | 5 | import javafx.scene.control.TitledPane; 6 | 7 | public interface PaneVisibilityManager 8 | { 9 | Map getPaneToStatusMapping(); 10 | 11 | void setPaneVisiblity(TitledPaneStatus titledPaneStatus, PaneVisibilityStatus detached); 12 | } 13 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/panes/PaneVisibilityStatus.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.ui.panes; 21 | 22 | public enum PaneVisibilityStatus 23 | { 24 | NOT_LOADED, NOT_VISIBLE, ATTACHED, DETACHED 25 | } 26 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/panes/SpyPerspective.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.ui.panes; 21 | 22 | public enum SpyPerspective 23 | { 24 | BASIC, DEFAULT, DETAILED, SPY, SUPER_SPY 25 | } 26 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/panes/TabController.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.ui.panes; 21 | 22 | import javafx.scene.control.Tab; 23 | 24 | public interface TabController 25 | { 26 | Tab getTab(); 27 | 28 | void setTab(Tab tab); 29 | 30 | TabStatus getTabStatus(); 31 | 32 | void setTabStatus(TabStatus status); 33 | 34 | void refreshStatus(); 35 | } 36 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/panes/TabStatus.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.ui.panes; 21 | 22 | import javafx.scene.control.TabPane; 23 | 24 | public class TabStatus extends PaneStatus 25 | { 26 | private TabPane parentWhenAttached; 27 | 28 | /** 29 | * Gets the parent object. 30 | * 31 | * @return the parent 32 | */ 33 | public TabPane getParentWhenAttached() 34 | { 35 | return parentWhenAttached; 36 | } 37 | 38 | /** 39 | * Sets the parent object. 40 | * 41 | * @param parent the parent to set 42 | */ 43 | public void setParent(TabPane parent) 44 | { 45 | this.parentWhenAttached = parent; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/panes/TitledPaneController.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.ui.panes; 21 | 22 | import javafx.scene.control.Label; 23 | import javafx.scene.control.TitledPane; 24 | 25 | public interface TitledPaneController 26 | { 27 | TitledPane getTitledPane(); 28 | 29 | void setTitledPane(TitledPane pane); 30 | 31 | void updatePane(PaneVisibilityStatus attached); 32 | 33 | Label getTitleLabel(); 34 | 35 | //void setTitle(final String title); 36 | } 37 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/properties/ModifiableConnection.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.ui.properties; 21 | 22 | import pl.baczkowicz.spy.common.generated.ConnectionGroupReference; 23 | 24 | public interface ModifiableConnection 25 | { 26 | boolean isModified(); 27 | 28 | String getName(); 29 | 30 | String getID(); 31 | 32 | void apply(); 33 | 34 | void setName(final String newName); 35 | 36 | void setGroupingModified(boolean modified); 37 | 38 | void setGroup(ConnectionGroupReference connectionGroupReference); 39 | 40 | boolean isNew(); 41 | 42 | void removeFromGroup(); 43 | 44 | void undoAll(); 45 | 46 | void setDeleted(boolean value); 47 | 48 | boolean isGroupingModified(); 49 | 50 | ConnectionGroupReference getGroup(); 51 | 52 | boolean isBeingCreated(); 53 | } 54 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/scripts/ScriptTypeEnum.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.ui.scripts; 21 | 22 | /** 23 | * This defines the type of script. 24 | */ 25 | public enum ScriptTypeEnum 26 | { 27 | PUBLICATION("Script folder"), SUBSCRIPTION("Subscription"), BACKGROUND("Predefined"); 28 | 29 | private final String name; 30 | 31 | private ScriptTypeEnum(String s) 32 | { 33 | name = s; 34 | } 35 | 36 | public boolean equalsName(String otherName) 37 | { 38 | return (otherName == null) ? false : name.equals(otherName); 39 | } 40 | 41 | public String toString() 42 | { 43 | return name; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/scripts/events/ScriptListChangeEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.scripts.events; 22 | 23 | import pl.baczkowicz.spy.eventbus.FilterableEvent; 24 | 25 | public class ScriptListChangeEvent extends FilterableEvent 26 | { 27 | public ScriptListChangeEvent(final Object filter) 28 | { 29 | super.setFilter(filter); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/search/MessageFilter.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.ui.search; 21 | 22 | import pl.baczkowicz.spy.messages.FormattedMessage; 23 | import pl.baczkowicz.spy.storage.MessageList; 24 | 25 | public interface MessageFilter 26 | { 27 | /** 28 | * Checks if the given message should be filtered out. 29 | * 30 | * @param message The message to be checked 31 | * @param store The message store (could be modified) 32 | * @param updateUi Whether to update the UI 33 | * 34 | * @return True if to filter the message out. 35 | */ 36 | boolean filter(final T message, final MessageList messageList, final boolean updateUi); 37 | 38 | void reset(); 39 | 40 | boolean isActive(); 41 | } 42 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/search/SearchMatcher.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.ui.search; 21 | 22 | import pl.baczkowicz.spy.messages.FormattedMessage; 23 | 24 | public interface SearchMatcher 25 | { 26 | boolean matches(final FormattedMessage message); 27 | 28 | boolean isValid(); 29 | } 30 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/stats/StatsIO.java: -------------------------------------------------------------------------------- 1 | package pl.baczkowicz.spy.ui.stats; 2 | 3 | 4 | public interface StatsIO 5 | { 6 | SpyStats loadStats(); 7 | 8 | boolean saveStats(final SpyStats stats); 9 | } -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/threading/SimplePlatformRunLaterOrAsynchronousExecutor.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.threading; 22 | 23 | import java.util.concurrent.Executor; 24 | 25 | import javafx.application.Platform; 26 | 27 | /** 28 | * Simple JavaFX Platform.runLater executor if not on FX thread, otherwise asynchronous. 29 | */ 30 | public class SimplePlatformRunLaterOrAsynchronousExecutor implements Executor 31 | { 32 | /** 33 | * {@inheritDoc} 34 | */ 35 | @Override 36 | public void execute(final Runnable command) 37 | { 38 | if (Platform.isFxApplicationThread()) 39 | { 40 | new Thread(command).start(); 41 | } 42 | else 43 | { 44 | Platform.runLater(command); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/threading/SimpleRunLaterExecutor.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.threading; 22 | 23 | import java.util.concurrent.Executor; 24 | import javafx.application.Platform; 25 | 26 | /** 27 | * Simple JavaFX Platform.runLater executor. 28 | */ 29 | public class SimpleRunLaterExecutor implements Executor 30 | { 31 | /** 32 | * {@inheritDoc} 33 | */ 34 | @Override 35 | public void execute(final Runnable command) 36 | { 37 | Platform.runLater(command); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/threading/SimpleRunLaterIfRequiredExecutor.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.ui.threading; 22 | 23 | import java.util.concurrent.Executor; 24 | 25 | import javafx.application.Platform; 26 | 27 | /** 28 | * Simple JavaFX Platform.runLater executor if not on FX thread, otherwise synchronous. 29 | */ 30 | public class SimpleRunLaterIfRequiredExecutor implements Executor 31 | { 32 | /** 33 | * {@inheritDoc} 34 | */ 35 | @Override 36 | public void execute(final Runnable command) 37 | { 38 | if (Platform.isFxApplicationThread()) 39 | { 40 | command.run(); 41 | } 42 | else 43 | { 44 | Platform.runLater(command); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/utils/ResourcePaths.java: -------------------------------------------------------------------------------- 1 | package pl.baczkowicz.spy.ui.utils; 2 | 3 | public class ResourcePaths 4 | { 5 | /** Package with all UI stuff. */ 6 | public static final String UI_PACKAGE = "/ui/"; 7 | 8 | private static final String IMAGES_FOLDER = "images/"; 9 | 10 | /** Folder with all FXML files. */ 11 | private static final String FXML_FOLDER = "fxml/"; 12 | 13 | public static final String IMAGES_PATH = UI_PACKAGE + IMAGES_FOLDER; 14 | 15 | public static final String FXML_PATH = UI_PACKAGE + FXML_FOLDER; 16 | } 17 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/java/pl/baczkowicz/spy/ui/utils/RunLaterExecutor.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.ui.utils; 21 | 22 | import java.util.concurrent.Executor; 23 | 24 | import javafx.application.Platform; 25 | 26 | /** 27 | * Simple 'run later' executor. 28 | */ 29 | public class RunLaterExecutor implements Executor 30 | { 31 | @Override 32 | public void execute(final Runnable command) 33 | { 34 | Platform.runLater(command); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/applications-internet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/applications-internet.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/auth-none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/auth-none.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/auth-yes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/auth-yes.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/button-add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/button-add.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/button-apply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/button-apply.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/button-connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/button-connect.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/button-copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/button-copy.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/button-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/button-delete.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/button-undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/button-undo.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/dialog-error-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/dialog-error-large.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/dialog-information-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/dialog-information-large.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/dialog-ok-apply-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/dialog-ok-apply-large.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/dialog-password-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/dialog-password-large.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/dialog-warning-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/dialog-warning-large.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/document-save-all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/document-save-all.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/edit-find-mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/edit-find-mail.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/feed-subscribe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/feed-subscribe.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/filter.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/folder-grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/folder-grey.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/folder-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/folder-new.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/folder-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/folder-yellow.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/go-first.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/go-first.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/go-last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/go-last.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/go-next-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/go-next-green.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/go-next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/go-next.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/go-previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/go-previous.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/help-hint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/help-hint.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/lock-no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/lock-no.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/lock-yes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/lock-yes.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/login.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/mail-forward-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/mail-forward-6.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/mail-receive-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/mail-receive-2.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/mail-unread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/mail-unread.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/pause.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/play.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/preferences-desktop-user-password-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/preferences-desktop-user-password-large.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/rating-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/rating-large.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/refresh.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/save.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/settings.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/system-run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/system-run.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/tab-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/tab-close.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/tab-detach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/tab-detach.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/tab-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/tab-new.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/testcase_actioned.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/testcase_actioned.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/testcase_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/testcase_error.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/testcase_fail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/testcase_fail.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/testcase_pass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/testcase_pass.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/testcase_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/testcase_play.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/testcase_repeat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/testcase_repeat.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/testcase_skipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/testcase_skipped.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/testcase_stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/testcase_stop.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/tools-wizard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/tools-wizard.png -------------------------------------------------------------------------------- /spy-common-ui/src/main/resources/ui/images/tools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common-ui/src/main/resources/ui/images/tools.png -------------------------------------------------------------------------------- /spy-common-ui/src/test/java/pl/baczkowicz/spy/xpath/XPathTest.java: -------------------------------------------------------------------------------- 1 | package pl.baczkowicz.spy.xpath; 2 | 3 | import java.io.StringReader; 4 | 5 | import javax.xml.xpath.XPath; 6 | import javax.xml.xpath.XPathConstants; 7 | import javax.xml.xpath.XPathExpression; 8 | import javax.xml.xpath.XPathExpressionException; 9 | import javax.xml.xpath.XPathFactory; 10 | 11 | import org.junit.Test; 12 | import org.xml.sax.InputSource; 13 | 14 | import junit.framework.TestCase; 15 | 16 | public class XPathTest extends TestCase 17 | { 18 | 19 | @Test 20 | public void test() 21 | { 22 | final String message = "" + 23 | 24 | " 2005 30.00 "; 25 | 26 | assertEquals(evaluateXPath("/book/price", message), 30.0); 27 | } 28 | 29 | protected Double evaluateXPath(final String expression, final String message) 30 | { 31 | Double value = 0.0; 32 | final XPath xpath = XPathFactory.newInstance().newXPath(); 33 | final InputSource inputSource = new InputSource(new StringReader(message)); 34 | 35 | try 36 | { 37 | final XPathExpression exp = xpath.compile(expression); 38 | value = (Double) exp.evaluate(inputSource, XPathConstants.NUMBER); 39 | } 40 | catch (XPathExpressionException e) 41 | { 42 | // TODO 43 | } 44 | 45 | return value; 46 | } 47 | } -------------------------------------------------------------------------------- /spy-common/src/main/java/.gitignore: -------------------------------------------------------------------------------- 1 | /META-INF/ 2 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/common/generated/RunningMode.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2016.06.21 at 12:16:12 AM BST 6 | // 7 | 8 | 9 | package pl.baczkowicz.spy.common.generated; 10 | 11 | import javax.xml.bind.annotation.XmlEnum; 12 | import javax.xml.bind.annotation.XmlType; 13 | 14 | 15 | /** 16 | *

Java class for RunningMode. 17 | * 18 | *

The following schema fragment specifies the expected content contained within this class. 19 | *

20 | *

21 |  * <simpleType name="RunningMode">
22 |  *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
23 |  *     <enumeration value="CONTINUOUS"/>
24 |  *     <enumeration value="SCRIPTS_ONLY"/>
25 |  *   </restriction>
26 |  * </simpleType>
27 |  * 
28 | * 29 | */ 30 | @XmlType(name = "RunningMode") 31 | @XmlEnum 32 | public enum RunningMode { 33 | 34 | CONTINUOUS, 35 | SCRIPTS_ONLY; 36 | 37 | public String value() { 38 | return name(); 39 | } 40 | 41 | public static RunningMode fromValue(String v) { 42 | return valueOf(v); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/common/generated/package-info.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2016.06.21 at 12:16:12 AM BST 6 | // 7 | 8 | @javax.xml.bind.annotation.XmlSchema(namespace = "http://baczkowicz.pl/spy/common") 9 | package pl.baczkowicz.spy.common.generated; 10 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/connectivity/ConnectionStatus.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.connectivity; 21 | 22 | /** 23 | * Indicates the status of the connection. 24 | */ 25 | public enum ConnectionStatus 26 | { 27 | /** No attempt made yet. */ 28 | NOT_CONNECTED, 29 | 30 | /** Trying to connect. */ 31 | CONNECTING, 32 | 33 | /** Connected. */ 34 | CONNECTED, 35 | 36 | /** Trying to disconnect. */ 37 | DISCONNECTING, 38 | 39 | /** Disconnected. */ 40 | DISCONNECTED 41 | } 42 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/connectivity/IConnection.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.connectivity; 21 | 22 | /** 23 | * Basic interface for interacting with a connection. 24 | */ 25 | public interface IConnection 26 | { 27 | /** 28 | * Checks if a message can be published (e.g. client is connected). 29 | * 30 | * @return True if publication is possible 31 | */ 32 | boolean canPublish(); 33 | } 34 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/connectivity/IConnectionWithReconnect.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.connectivity; 21 | 22 | import pl.baczkowicz.spy.common.generated.ReconnectionSettings; 23 | 24 | /** 25 | * Basic interface for interacting with a connection. 26 | */ 27 | public interface IConnectionWithReconnect extends IConnection 28 | { 29 | ReconnectionSettings getReconnectionSettings(); 30 | 31 | ConnectionStatus getConnectionStatus(); 32 | 33 | long getLastConnectionAttemptTimestamp(); 34 | 35 | String getName(); 36 | } 37 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/eventbus/FilterableEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.eventbus; 21 | 22 | /** 23 | * Base event object. 24 | */ 25 | public abstract class FilterableEvent implements IFilterableEvent 26 | { 27 | private Object filter; 28 | 29 | public Object getFilter() 30 | { 31 | return filter; 32 | } 33 | 34 | public void setFilter(final Object filter) 35 | { 36 | this.filter = filter; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/eventbus/IFilterableEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.eventbus; 21 | 22 | /** 23 | * Base filter-able event object. 24 | */ 25 | public interface IFilterableEvent 26 | { 27 | Object getFilter(); 28 | } 29 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/events/SpyEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.events; 21 | 22 | /** 23 | * Base event object. 24 | */ 25 | public interface SpyEvent 26 | { 27 | // Base event 28 | } 29 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/exceptions/ConfigurationException.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.exceptions; 21 | 22 | /** 23 | * Represents an exception during configuration loading. 24 | */ 25 | public class ConfigurationException extends XMLException 26 | { 27 | /** serialVersionUID. */ 28 | private static final long serialVersionUID = 5880158442069517297L; 29 | 30 | public ConfigurationException(String error) 31 | { 32 | super(error); 33 | } 34 | 35 | public ConfigurationException(String error, Throwable e) 36 | { 37 | super(error, e); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/exceptions/ConversionException.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.exceptions; 21 | 22 | /** 23 | * Represents an exception during text conversion. 24 | */ 25 | public class ConversionException extends Exception 26 | { 27 | /** serialVersionUID. */ 28 | private static final long serialVersionUID = 5880158442069517297L; 29 | 30 | public ConversionException(String error) 31 | { 32 | super(error); 33 | } 34 | 35 | public ConversionException(String error, Throwable e) 36 | { 37 | super(error, e); 38 | } 39 | } -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/exceptions/CriticalException.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.exceptions; 21 | 22 | /** 23 | * Represents an exception during loading - very bad :) 24 | */ 25 | public class CriticalException extends RuntimeException 26 | { 27 | /** serialVersionUID. */ 28 | private static final long serialVersionUID = 5880158442069517297L; 29 | 30 | public CriticalException(String error) 31 | { 32 | super(error); 33 | } 34 | 35 | public CriticalException(String error, Throwable e) 36 | { 37 | super(error, e); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/exceptions/SpyException.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.exceptions; 21 | 22 | /** 23 | * Represents a base exception. 24 | */ 25 | public class SpyException extends Exception 26 | { 27 | /** Generated serialVersionUID */ 28 | private static final long serialVersionUID = -1041373917140441043L; 29 | 30 | public SpyException(String error) 31 | { 32 | super(error); 33 | } 34 | 35 | public SpyException(String error, Throwable e) 36 | { 37 | super(error, e); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/exceptions/SpyUncaughtExceptionHandler.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.exceptions; 21 | 22 | import java.lang.Thread.UncaughtExceptionHandler; 23 | 24 | import org.slf4j.Logger; 25 | import org.slf4j.LoggerFactory; 26 | 27 | /** 28 | * Used for catching any uncaught exceptions. 29 | */ 30 | public class SpyUncaughtExceptionHandler implements UncaughtExceptionHandler 31 | { 32 | private final static Logger logger = LoggerFactory.getLogger(SpyUncaughtExceptionHandler.class); 33 | 34 | @Override 35 | public void uncaughtException(Thread t, Throwable e) 36 | { 37 | logger.error("Thread " + t + " failed with " + e, e); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/exceptions/XMLException.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.exceptions; 21 | 22 | 23 | /** 24 | * Represents an exception during configuration loading. 25 | */ 26 | public class XMLException extends SpyException 27 | { 28 | /** serialVersionUID. */ 29 | private static final long serialVersionUID = 7600725489860423132L; 30 | 31 | public XMLException(String error) 32 | { 33 | super(error); 34 | } 35 | 36 | public XMLException(String error, Throwable e) 37 | { 38 | super(error, e); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/messages/IBaseMessage.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.messages; 21 | 22 | import java.util.Date; 23 | 24 | /** 25 | * Basic interface for a message (e.g. used by scripts accessing received or to be published messages. 26 | */ 27 | public interface IBaseMessage 28 | { 29 | long getId(); 30 | 31 | Date getDate(); 32 | 33 | /** 34 | * Gets the message's topic. 35 | * 36 | * @return The topic string 37 | */ 38 | String getTopic(); 39 | 40 | /** 41 | * Gets the message's payload. 42 | * 43 | * @return The payload string 44 | */ 45 | String getPayload(); 46 | 47 | /** 48 | * Sets the payload on the message. 49 | * 50 | * @param payload The new payload 51 | */ 52 | void setPayload(final String payload); 53 | } 54 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/messages/MessageIdGenerator.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.messages; 21 | 22 | public class MessageIdGenerator 23 | { 24 | private static long id = 0; 25 | 26 | public static long getNewId() 27 | { 28 | id++; 29 | return id; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/scripts/ScriptChangeObserver.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.scripts; 21 | 22 | /** 23 | * Simple interface for observing changes to script properties. 24 | */ 25 | public interface ScriptChangeObserver 26 | { 27 | void onChange(); 28 | } 29 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/scripts/ScriptRunningState.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.scripts; 21 | 22 | /** 23 | * Indicates the running state of a script. 24 | */ 25 | public enum ScriptRunningState 26 | { 27 | NOT_STARTED("Not started"), FAILED("Failed"), RUNNING("Running"), STOPPED("Stopped"), 28 | FINISHED("Finished"), FROZEN("Not responding"); 29 | 30 | private final String name; 31 | 32 | private ScriptRunningState(final String s) 33 | { 34 | name = s; 35 | } 36 | 37 | public boolean equalsName(String otherName) 38 | { 39 | return (otherName == null) ? false : name.equals(otherName); 40 | } 41 | 42 | public String toString() 43 | { 44 | return name; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/scripts/events/ScriptStateChangeEvent.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.scripts.events; 22 | 23 | import pl.baczkowicz.spy.scripts.ScriptRunningState; 24 | 25 | public class ScriptStateChangeEvent 26 | { 27 | private String scriptName; 28 | 29 | private ScriptRunningState state; 30 | 31 | public ScriptStateChangeEvent(final String scriptName, final ScriptRunningState state) 32 | { 33 | this.scriptName = scriptName; 34 | this.state = state; 35 | } 36 | 37 | /** 38 | * @return the scriptName 39 | */ 40 | public String getScriptName() 41 | { 42 | return scriptName; 43 | } 44 | 45 | /** 46 | * @return the state 47 | */ 48 | public ScriptRunningState getState() 49 | { 50 | return state; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/storage/MessageStore.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.storage; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * Simple interface for access to a message store. 26 | * 27 | * TODO: needs completing. 28 | */ 29 | public interface MessageStore 30 | { 31 | /** 32 | * Gets all messages stored in the store. 33 | * 34 | * @return List of messages 35 | */ 36 | List getMessages(); 37 | 38 | /** 39 | * Checks if browsing filters are enabled. 40 | * 41 | * @return True if filters are enabled 42 | */ 43 | boolean browsingFiltersEnabled(); 44 | 45 | /** 46 | * Checks if message filters are enabled. 47 | * 48 | * @return True if filters are enabled 49 | */ 50 | boolean messageFiltersEnabled(); 51 | } 52 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/testcases/ITestCaseEventManager.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.testcases; 21 | 22 | /** 23 | * Interface for notifying test cases's state changes. 24 | */ 25 | public interface ITestCaseEventManager 26 | { 27 | void notifyTestCaseChange(); 28 | 29 | void notifyTestCaseStepChange(); 30 | } 31 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/testcases/TestCaseResult.java: -------------------------------------------------------------------------------- 1 | package pl.baczkowicz.spy.testcases; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class TestCaseResult 7 | { 8 | private TestCaseInfo info; 9 | 10 | private TestCaseStatus result; 11 | 12 | private List stepResults = new ArrayList<>(); 13 | 14 | public TestCaseStatus getResult() 15 | { 16 | return result; 17 | } 18 | 19 | public void setResult(TestCaseStatus result) 20 | { 21 | this.result = result; 22 | } 23 | 24 | public List getStepResults() 25 | { 26 | return stepResults; 27 | } 28 | 29 | public void setStepResults(List stepResults) 30 | { 31 | this.stepResults = stepResults; 32 | } 33 | 34 | public TestCaseInfo getInfo() 35 | { 36 | return info; 37 | } 38 | 39 | public void setInfo(TestCaseInfo info) 40 | { 41 | this.info = info; 42 | } 43 | 44 | @Override 45 | public String toString() 46 | { 47 | return "TestCaseResult [info=" + info + ", result=" + result + ", stepResults=" + stepResults + "]"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/testcases/TestCaseStatus.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.testcases; 21 | 22 | public enum TestCaseStatus 23 | { 24 | NOT_RUN, IN_PROGRESS, PASSED, FAILED, ACTIONED, SKIPPED, ERROR 25 | } 26 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/threading/SimpleAsynchronousExecutor.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.threading; 22 | 23 | import java.util.concurrent.Executor; 24 | 25 | /** 26 | * Simple asynchronous executor. 27 | */ 28 | public class SimpleAsynchronousExecutor implements Executor 29 | { 30 | /** 31 | * {@inheritDoc} 32 | */ 33 | @Override 34 | public void execute(final Runnable command) 35 | { 36 | new Thread(command).start(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/threading/SimpleSynchronousExecutor.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | 21 | package pl.baczkowicz.spy.threading; 22 | 23 | import java.util.concurrent.Executor; 24 | 25 | /** 26 | * Simple asynchronous executor. 27 | */ 28 | public class SimpleSynchronousExecutor implements Executor 29 | { 30 | /** 31 | * {@inheritDoc} 32 | */ 33 | @Override 34 | public void execute(final Runnable command) 35 | { 36 | command.run(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/utils/tasks/ProgressUpdater.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.utils.tasks; 21 | 22 | /** 23 | * Simple interface for updating progress of a task. 24 | */ 25 | public interface ProgressUpdater 26 | { 27 | /** 28 | * Updates the progress of a task. 29 | * 30 | * @param current Current progress 31 | * @param max Maximum progress value 32 | */ 33 | void update(final long current, final long max); 34 | 35 | boolean isCancelled(); 36 | } 37 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/utils/tasks/SimpleExecutor.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2014 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.utils.tasks; 21 | 22 | import java.util.concurrent.Executor; 23 | 24 | /** 25 | * Simple runnable executor. 26 | */ 27 | public class SimpleExecutor implements Executor 28 | { 29 | /** 30 | * Starts a new thread for the given runnable. 31 | */ 32 | public void execute(final Runnable runnable) 33 | { 34 | new Thread(runnable).start(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /spy-common/src/main/java/pl/baczkowicz/spy/utils/tasks/StoppableTask.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.utils.tasks; 21 | 22 | public interface StoppableTask 23 | { 24 | void stop(); 25 | } 26 | -------------------------------------------------------------------------------- /spy-common/src/main/resources/spy-bindings.xjb: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spy-common/src/main/resources/spy-common.catalog: -------------------------------------------------------------------------------- 1 | PUBLIC "http://baczkowicz.pl/spy/common" "maven:pl.baczkowicz.spy:spy-common!/spy-common.xsd" -------------------------------------------------------------------------------- /spy-common/src/test/java/pl/baczkowicz/spy/eventbus/sample/ISampleSubscriber.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2015 Kamil Baczkowicz 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * and Eclipse Distribution License v1.0 which accompany this distribution. 8 | * 9 | * The Eclipse Public License is available at 10 | * http://www.eclipse.org/legal/epl-v10.html 11 | * 12 | * The Eclipse Distribution License is available at 13 | * http://www.eclipse.org/org/documents/edl-v10.php. 14 | * 15 | * Contributors: 16 | * 17 | * Kamil Baczkowicz - initial API and implementation and/or initial documentation 18 | * 19 | */ 20 | package pl.baczkowicz.spy.eventbus.sample; 21 | 22 | import pl.baczkowicz.spy.eventbus.FilterableEvent; 23 | 24 | public interface ISampleSubscriber 25 | { 26 | public void onInfoChange(final FilterableEvent event); 27 | 28 | public void onCountChange(final SampleCountChangeEvent event); 29 | } 30 | -------------------------------------------------------------------------------- /spy-common/src/test/resources/keystores/public_brokers.bks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common/src/test/resources/keystores/public_brokers.bks -------------------------------------------------------------------------------- /spy-common/src/test/resources/keystores/public_brokers.jceks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common/src/test/resources/keystores/public_brokers.jceks -------------------------------------------------------------------------------- /spy-common/src/test/resources/keystores/public_brokers.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common/src/test/resources/keystores/public_brokers.jks -------------------------------------------------------------------------------- /spy-common/src/test/resources/keystores/public_brokers.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamilfb/mqtt-spy/bf8615dcc1f41fd481d3394404de45cb6c90865d/spy-common/src/test/resources/keystores/public_brokers.p12 -------------------------------------------------------------------------------- /spy-common/src/test/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /spy-design/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | spy-design 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /spy-design/model.di: -------------------------------------------------------------------------------- 1 | 2 | 3 | --------------------------------------------------------------------------------