From e20a83b570685f8e9ef2c55f43390189c2439255 Mon Sep 17 00:00:00 2001 From: Jie Kang Date: Oct 10 2018 20:22:50 +0000 Subject: [PATCH 1/3] Fix spacing in jmc-core spec --- diff --git a/jmc-core/jmc-core.spec b/jmc-core/jmc-core.spec index 03b6edf..194f31f 100644 --- a/jmc-core/jmc-core.spec +++ b/jmc-core/jmc-core.spec @@ -22,7 +22,6 @@ Requires: java-openjdk Provides: jmc-core = %{version} - %description Java Mission Control is an advanced set of tools that enables efficient and detailed analysis of the extensive data collected by Java Flight Recorder. @@ -36,15 +35,12 @@ from Java applications running locally or deployed in production environments. %pom_remove_plugin :nexus-staging-maven-plugin - %build %mvn_build - %install %mvn_install - %files /usr/share/java/%{name} /usr/share/javadoc/%{name} From efc85b93e5eb1a878fe4e5714ed69473f4d8eae3 Mon Sep 17 00:00:00 2001 From: Jie Kang Date: Oct 10 2018 20:23:05 +0000 Subject: [PATCH 2/3] Update jmc spec and patches --- diff --git a/jmc/0_remove_twitter.patch b/jmc/0_remove_twitter.patch index ec1a406..68dba91 100644 --- a/jmc/0_remove_twitter.patch +++ b/jmc/0_remove_twitter.patch @@ -1,6 +1,87 @@ -diff -Nur jmc-7.0.0-orig/application/org.openjdk.jmc.console.twitter/build.properties jmc-7.0.0/application/org.openjdk.jmc.console.twitter/build.properties ---- jmc-7.0.0-orig/application/org.openjdk.jmc.console.twitter/build.properties 2018-10-02 14:13:12.842624647 -0400 -+++ jmc-7.0.0/application/org.openjdk.jmc.console.twitter/build.properties 1969-12-31 19:00:00.000000000 -0500 +diff --git a/application/org.openjdk.jmc.console.twitter/.classpath b/application/org.openjdk.jmc.console.twitter/.classpath +deleted file mode 100644 +--- a/application/org.openjdk.jmc.console.twitter/.classpath ++++ /dev/null +@@ -1,7 +0,0 @@ +- +- +- +- +- +- +- +diff --git a/application/org.openjdk.jmc.console.twitter/.project b/application/org.openjdk.jmc.console.twitter/.project +deleted file mode 100644 +--- a/application/org.openjdk.jmc.console.twitter/.project ++++ /dev/null +@@ -1,34 +0,0 @@ +- +- +- org.openjdk.jmc.console.twitter +- +- +- +- +- +- org.eclipse.jdt.core.javabuilder +- +- +- +- +- org.eclipse.pde.ManifestBuilder +- +- +- +- +- org.eclipse.pde.SchemaBuilder +- +- +- +- +- org.eclipse.m2e.core.maven2Builder +- +- +- +- +- +- org.eclipse.m2e.core.maven2Nature +- org.eclipse.pde.PluginNature +- org.eclipse.jdt.core.javanature +- +- +diff --git a/application/org.openjdk.jmc.console.twitter/.settings/org.eclipse.jdt.core.prefs b/application/org.openjdk.jmc.console.twitter/.settings/org.eclipse.jdt.core.prefs +deleted file mode 100644 +--- a/application/org.openjdk.jmc.console.twitter/.settings/org.eclipse.jdt.core.prefs ++++ /dev/null +@@ -1,2 +0,0 @@ +-eclipse.preferences.version=1 +-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +diff --git a/application/org.openjdk.jmc.console.twitter/META-INF/MANIFEST.MF b/application/org.openjdk.jmc.console.twitter/META-INF/MANIFEST.MF +deleted file mode 100644 +--- a/application/org.openjdk.jmc.console.twitter/META-INF/MANIFEST.MF ++++ /dev/null +@@ -1,17 +0,0 @@ +-Manifest-Version: 1.0 +-Bundle-ManifestVersion: 2 +-Bundle-Name: Twitter +-Bundle-SymbolicName: org.openjdk.jmc.console.twitter;singleton:=true +-Bundle-Version: 1.0.2.qualifier +-Bundle-Activator: org.openjdk.jmc.console.twitter.TwitterPlugin +-Bundle-Vendor: Oracle Corporation +-Require-Bundle: org.openjdk.jmc.rjmx, +- org.openjdk.jmc.ui, +- org.eclipse.core.net +-Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +-Bundle-ActivationPolicy: lazy +-Import-Package: twitter4j, +- twitter4j.auth, +- twitter4j.conf, +- twitter4j.api +-Automatic-Module-Name: org.openjdk.jmc.console.twitter +diff --git a/application/org.openjdk.jmc.console.twitter/build.properties b/application/org.openjdk.jmc.console.twitter/build.properties +deleted file mode 100644 +--- a/application/org.openjdk.jmc.console.twitter/build.properties ++++ /dev/null @@ -1,39 +0,0 @@ -# -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. @@ -41,42 +122,17 @@ diff -Nur jmc-7.0.0-orig/application/org.openjdk.jmc.console.twitter/build.prope - plugin.xml,\ - icons/ -pde.match.rule.bundle=compatible -diff -Nur jmc-7.0.0-orig/application/org.openjdk.jmc.console.twitter/.classpath jmc-7.0.0/application/org.openjdk.jmc.console.twitter/.classpath ---- jmc-7.0.0-orig/application/org.openjdk.jmc.console.twitter/.classpath 2018-10-02 14:13:12.842624647 -0400 -+++ jmc-7.0.0/application/org.openjdk.jmc.console.twitter/.classpath 1969-12-31 19:00:00.000000000 -0500 -@@ -1,7 +0,0 @@ -- -- -- -- -- -- -- -Binary files jmc-7.0.0-orig/application/org.openjdk.jmc.console.twitter/icons/twitter.png and jmc-7.0.0/application/org.openjdk.jmc.console.twitter/icons/twitter.png differ -diff -Nur jmc-7.0.0-orig/application/org.openjdk.jmc.console.twitter/META-INF/MANIFEST.MF jmc-7.0.0/application/org.openjdk.jmc.console.twitter/META-INF/MANIFEST.MF ---- jmc-7.0.0-orig/application/org.openjdk.jmc.console.twitter/META-INF/MANIFEST.MF 2018-10-02 14:13:12.842624647 -0400 -+++ jmc-7.0.0/application/org.openjdk.jmc.console.twitter/META-INF/MANIFEST.MF 1969-12-31 19:00:00.000000000 -0500 -@@ -1,17 +0,0 @@ --Manifest-Version: 1.0 --Bundle-ManifestVersion: 2 --Bundle-Name: Twitter --Bundle-SymbolicName: org.openjdk.jmc.console.twitter;singleton:=true --Bundle-Version: 1.0.2.qualifier --Bundle-Activator: org.openjdk.jmc.console.twitter.TwitterPlugin --Bundle-Vendor: Oracle Corporation --Require-Bundle: org.openjdk.jmc.rjmx, -- org.openjdk.jmc.ui, -- org.eclipse.core.net --Bundle-RequiredExecutionEnvironment: JavaSE-1.8 --Bundle-ActivationPolicy: lazy --Import-Package: twitter4j, -- twitter4j.auth, -- twitter4j.conf, -- twitter4j.api --Automatic-Module-Name: org.openjdk.jmc.console.twitter -diff -Nur jmc-7.0.0-orig/application/org.openjdk.jmc.console.twitter/plugin.xml jmc-7.0.0/application/org.openjdk.jmc.console.twitter/plugin.xml ---- jmc-7.0.0-orig/application/org.openjdk.jmc.console.twitter/plugin.xml 2018-10-02 14:13:12.842624647 -0400 -+++ jmc-7.0.0/application/org.openjdk.jmc.console.twitter/plugin.xml 1969-12-31 19:00:00.000000000 -0500 +diff --git a/application/org.openjdk.jmc.console.twitter/icons/twitter.png b/application/org.openjdk.jmc.console.twitter/icons/twitter.png +deleted file mode 100644 +index ae9422266f23c66835d513b0203818fed7b07465..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 +GIT binary patch +literal 0 +Hc$@ - diff --git a/jmc/1_javamail.patch b/jmc/1_javamail.patch new file mode 100644 index 0000000..a3de447 --- /dev/null +++ b/jmc/1_javamail.patch @@ -0,0 +1,36 @@ +diff --git a/application/org.openjdk.jmc.feature.core/feature.xml b/application/org.openjdk.jmc.feature.core/feature.xml +--- a/application/org.openjdk.jmc.feature.core/feature.xml ++++ b/application/org.openjdk.jmc.feature.core/feature.xml +@@ -168,28 +168,28 @@ + unpack="false"/> + + + + + + + + - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - -diff -Nur jmc-7.0.0-orig/releng/platform-definitions/platform-definition-photon/platform-definition-photon.target jmc-7.0.0/releng/platform-definitions/platform-definition-photon/platform-definition-photon.target ---- jmc-7.0.0-orig/releng/platform-definitions/platform-definition-photon/platform-definition-photon.target 2018-10-02 14:19:19.006594689 -0400 -+++ jmc-7.0.0/releng/platform-definitions/platform-definition-photon/platform-definition-photon.target 2018-10-02 14:22:51.447416561 -0400 -@@ -32,28 +32,5 @@ - WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - --> - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - diff --git a/jmc/2_javamail.patch b/jmc/2_javamail.patch deleted file mode 100644 index 7a0e145..0000000 --- a/jmc/2_javamail.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff -Nur jmc-7.0.0-orig/application/org.openjdk.jmc.feature.core/feature.xml jmc-7.0.0/application/org.openjdk.jmc.feature.core/feature.xml ---- jmc-7.0.0-orig/application/org.openjdk.jmc.feature.core/feature.xml 2018-10-02 14:24:20.879920610 -0400 -+++ jmc-7.0.0/application/org.openjdk.jmc.feature.core/feature.xml 2018-10-02 14:26:28.039215412 -0400 -@@ -161,38 +161,38 @@ - unpack="false"/> - - - - - - - - - - - -- -\ No newline at end of file -+ -diff -Nur jmc-7.0.0-orig/releng/third-party/pom.xml jmc-7.0.0/releng/third-party/pom.xml ---- jmc-7.0.0-orig/releng/third-party/pom.xml 2018-10-02 14:24:20.790921103 -0400 -+++ jmc-7.0.0/releng/third-party/pom.xml 2018-10-02 14:28:21.894584017 -0400 -@@ -61,16 +61,16 @@ - - - -- javax.mail:imap:1.4 -+ com.sun.mail:imap:1.4 - - -- javax.mail:pop3:1.4 -+ com.sun.mail:pop3:1.4 - - -- javax.mail:smtp:1.4 -+ com.sun.mail:smtp:1.4 - - -- javax.mail:dsn:1.4 -+ com.sun.mail:dsn:1.4 - - - org.owasp.encoder:encoder:1.2.1 diff --git a/jmc/2_javax.patch b/jmc/2_javax.patch new file mode 100644 index 0000000..b1525fa --- /dev/null +++ b/jmc/2_javax.patch @@ -0,0 +1,20 @@ +diff --git a/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF b/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF +--- a/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF ++++ b/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF +@@ -10,8 +10,6 @@ + Require-Bundle: org.openjdk.jmc.rjmx.ui;visibility:=reexport, + org.eclipse.e4.core.contexts;bundle-version="1.3.0", + org.eclipse.e4.core.di;bundle-version="1.3.0";visibility:=reexport, +- javax.annotation;bundle-version="1.0.0";visibility:=reexport, +- javax.inject;bundle-version="1.0.0";visibility:=reexport, + org.openjdk.jmc.commands + Bundle-ActivationPolicy: lazy + Export-Package: org.openjdk.jmc.console.ui.actions; +@@ -22,7 +20,5 @@ + org.openjdk.jmc.console.ui.editor, + org.openjdk.jmc.console.ui.editor.internal;x-friends:="org.openjdk.jmc.console.ui.mbeanbrowser,org.openjdk.jmc.rcp.intro" + Bundle-ClassPath: . +-Import-Package: javax.annotation;version="1.0.0", +- javax.inject;version="1.0.0" + Automatic-Module-Name: org.openjdk.jmc.console.ui + diff --git a/jmc/3_remove_profiles.patch b/jmc/3_remove_profiles.patch new file mode 100644 index 0000000..70be804 --- /dev/null +++ b/jmc/3_remove_profiles.patch @@ -0,0 +1,57 @@ +diff --git a/pom.xml b/pom.xml +--- a/pom.xml ++++ b/pom.xml +@@ -88,53 +88,6 @@ + ${snapshot.repo} + + +- +- +- photon +- +- true +- +- +- +- +- org.eclipse.tycho +- target-platform-configuration +- ${tycho-version} +- +- +- +- org.openjdk.jmc +- platform-definition-photon +- 7.0.0-SNAPSHOT +- +- +- +- +- +- +- +- +- oxygen +- +- +- +- org.eclipse.tycho +- target-platform-configuration +- ${tycho-version} +- +- +- +- org.openjdk.jmc +- platform-definition-oxygen +- 7.0.0-SNAPSHOT +- +- +- +- +- +- +- +- + + + diff --git a/jmc/generate_jmc_tarball.sh b/jmc/generate_jmc_tarball.sh old mode 100644 new mode 100755 index 13f0eba..b2e5c6d --- a/jmc/generate_jmc_tarball.sh +++ b/jmc/generate_jmc_tarball.sh @@ -1,8 +1,9 @@ #!/bin/sh -wget http://hg.openjdk.java.net/jmc/jmc/archive/ba12bfb55277.tar.gz -tar xzf ba12bfb55277.tar.gz -rm ba12bfb55277.tar.gz -mv jmc-ba12bfb55277/ jmc-7.0.0/ -tar czf jmc-7.0.0.tar.gz jmc-7.0.0/ +wget http://hg.openjdk.java.net/jmc/jmc/archive/2177c12e7894.tar.gz +tar xzf 2177c12e7894.tar.gz +rm 2177c12e7894.tar.gz +mv jmc-2177c12e7894/ jmc-7.0.0/ rm -r jmc-7.0.0/core/ +tar czf jmc-7.0.0.tar.gz jmc-7.0.0/ +rm -r jmc-7.0.0 diff --git a/jmc/jmc.spec b/jmc/jmc.spec index 25916c0..ae3fe6b 100644 --- a/jmc/jmc.spec +++ b/jmc/jmc.spec @@ -1,10 +1,10 @@ -Name: jmc -Version: 7.0.0 -Release: 1%{?dist} -Summary: Java Mission Control is a profiling and diagnostics tool +Name: jmc +Version: 7.0.0 +Release: 1%{?dist} +Summary: Java Mission Control is a profiling and diagnostics tool -License: UPL -URL: http://openjdk.java.net/projects/jmc/ +License: UPL +URL: http://openjdk.java.net/projects/jmc/ # original source: http://hg.openjdk.java.net/jmc/jmc/archive/tip.tar.gz # wget http://hg.openjdk.java.net/jmc/jmc/archive/tip.tar.gz @@ -12,15 +12,26 @@ URL: http://openjdk.java.net/projects/jmc/ # mv jmc-tip/ jmc-7.0.0/ # # rm -r jmc-7.0.0/core/ # tar czf jmc-7.0.0.tar.gz jmc-7.0.0/ -Source0: jmc-7.0.0.tar.gz +Source0: jmc-7.0.0.tar.gz -Patch0: 0_remove_twitter.patch -Patch1: 1_local_osgi.patch -Patch2: 2_javamail.patch +Patch0: 0_remove_twitter.patch +Patch1: 1_javamail.patch +Patch2: 2_javax.patch +Patch3: 3_remove_profiles.patch -BuildRequires: maven-local java-openjdk tycho openjfx icu glassfish-el glassfish-annotation-api atinject glassfish-jsp-api glassfish-jsp ant batik batik-css apache-commons-codec apache-commons-io apache-commons-jxpath apache-commons-logging felix-gogo-command felix-gogo-runtime felix-gogo-shell felix-scr httpcomponents-client httpcomponents-core lucene-analysis lucene-analyzers-smartcn lucene apiguardian eclipse-jdt eclipse-nls-ja eclipse-nls-zh eclipse-platform eclipse-ecf-core eclipse-emf-core eclipse-pde jetty-continuation jetty-http jetty-io jetty-security jetty-server jetty-servlet jetty-util eclipse-equinox-osgi eclipse-swt hamcrest-core junit junit5 opentest4j sat4j sac xml-commons-apis xz-java tycho javamail owasp-java-encoder jmc-core +BuildRequires: ant maven-local javapackages-tools java-openjdk tycho tycho-extras openjfx icu +BuildRequires: maven-deploy-plugin buildnumber-maven-plugin maven-enforcer-plugin maven-install-plugin maven-site-plugin +BuildRequires: glassfish-el glassfish-annotation-api atinject glassfish-jsp-api glassfish-jsp batik batik-css +BuildRequires: apache-commons-codec apache-commons-io apache-commons-jxpath apache-commons-logging +BuildRequires: felix-gogo-command felix-gogo-runtime felix-gogo-shell felix-scr +BuildRequires: httpcomponents-client httpcomponents-core +BuildRequires: lucene-analysis lucene-analyzers-smartcn lucene apiguardian +BuildRequires: eclipse-jdt eclipse-nls-ja eclipse-nls-zh eclipse-platform eclipse-ecf-core eclipse-emf-core eclipse-pde +BuildRequires: jetty-continuation jetty-http jetty-io jetty-security jetty-server jetty-servlet jetty-util +BuildRequires: eclipse-equinox-osgi eclipse-swt hamcrest-core junit junit5 opentest4j sat4j sac xml-commons-apis xz-java +BuildRequires: javamail owasp-java-encoder jmc-core -Requires: java-openjdk +Requires: java-openjdk %description @@ -37,6 +48,11 @@ from Java applications running locally or deployed in production environments. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 + +%pom_disable_module releng + +%pom_remove_plugin com.github.spotbugs:spotbugs-maven-plugin %build %mvn_build From 6c13b450f6f2ac35bb10fff303b56ec71638eab7 Mon Sep 17 00:00:00 2001 From: Jie Kang Date: Oct 10 2018 20:51:30 +0000 Subject: [PATCH 3/3] Update jmc patch: remove twitter --- diff --git a/jmc/0_remove_twitter.patch b/jmc/0_remove_twitter.patch index 68dba91..545e843 100644 --- a/jmc/0_remove_twitter.patch +++ b/jmc/0_remove_twitter.patch @@ -1,1388 +1,3 @@ -diff --git a/application/org.openjdk.jmc.console.twitter/.classpath b/application/org.openjdk.jmc.console.twitter/.classpath -deleted file mode 100644 ---- a/application/org.openjdk.jmc.console.twitter/.classpath -+++ /dev/null -@@ -1,7 +0,0 @@ -- -- -- -- -- -- -- -diff --git a/application/org.openjdk.jmc.console.twitter/.project b/application/org.openjdk.jmc.console.twitter/.project -deleted file mode 100644 ---- a/application/org.openjdk.jmc.console.twitter/.project -+++ /dev/null -@@ -1,34 +0,0 @@ -- -- -- org.openjdk.jmc.console.twitter -- -- -- -- -- -- org.eclipse.jdt.core.javabuilder -- -- -- -- -- org.eclipse.pde.ManifestBuilder -- -- -- -- -- org.eclipse.pde.SchemaBuilder -- -- -- -- -- org.eclipse.m2e.core.maven2Builder -- -- -- -- -- -- org.eclipse.m2e.core.maven2Nature -- org.eclipse.pde.PluginNature -- org.eclipse.jdt.core.javanature -- -- -diff --git a/application/org.openjdk.jmc.console.twitter/.settings/org.eclipse.jdt.core.prefs b/application/org.openjdk.jmc.console.twitter/.settings/org.eclipse.jdt.core.prefs -deleted file mode 100644 ---- a/application/org.openjdk.jmc.console.twitter/.settings/org.eclipse.jdt.core.prefs -+++ /dev/null -@@ -1,2 +0,0 @@ --eclipse.preferences.version=1 --org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -diff --git a/application/org.openjdk.jmc.console.twitter/META-INF/MANIFEST.MF b/application/org.openjdk.jmc.console.twitter/META-INF/MANIFEST.MF -deleted file mode 100644 ---- a/application/org.openjdk.jmc.console.twitter/META-INF/MANIFEST.MF -+++ /dev/null -@@ -1,17 +0,0 @@ --Manifest-Version: 1.0 --Bundle-ManifestVersion: 2 --Bundle-Name: Twitter --Bundle-SymbolicName: org.openjdk.jmc.console.twitter;singleton:=true --Bundle-Version: 1.0.2.qualifier --Bundle-Activator: org.openjdk.jmc.console.twitter.TwitterPlugin --Bundle-Vendor: Oracle Corporation --Require-Bundle: org.openjdk.jmc.rjmx, -- org.openjdk.jmc.ui, -- org.eclipse.core.net --Bundle-RequiredExecutionEnvironment: JavaSE-1.8 --Bundle-ActivationPolicy: lazy --Import-Package: twitter4j, -- twitter4j.auth, -- twitter4j.conf, -- twitter4j.api --Automatic-Module-Name: org.openjdk.jmc.console.twitter -diff --git a/application/org.openjdk.jmc.console.twitter/build.properties b/application/org.openjdk.jmc.console.twitter/build.properties -deleted file mode 100644 ---- a/application/org.openjdk.jmc.console.twitter/build.properties -+++ /dev/null -@@ -1,39 +0,0 @@ --# --# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. --# --# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. --# --# The contents of this file are subject to the terms of either the Universal Permissive License --# v 1.0 as shown at http://oss.oracle.com/licenses/upl --# --# or the following license: --# --# Redistribution and use in source and binary forms, with or without modification, are permitted --# provided that the following conditions are met: --# --# 1. Redistributions of source code must retain the above copyright notice, this list of conditions --# and the following disclaimer. --# --# 2. Redistributions in binary form must reproduce the above copyright notice, this list of --# conditions and the following disclaimer in the documentation and/or other materials provided with --# the distribution. --# --# 3. Neither the name of the copyright holder nor the names of its contributors may be used to --# endorse or promote products derived from this software without specific prior written permission. --# --# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR --# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND --# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR --# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL --# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, --# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY --# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --# --source.. = src/main/java/ --output.. = target/classes/ --bin.includes = META-INF/,\ -- .,\ -- plugin.xml,\ -- icons/ --pde.match.rule.bundle=compatible -diff --git a/application/org.openjdk.jmc.console.twitter/icons/twitter.png b/application/org.openjdk.jmc.console.twitter/icons/twitter.png -deleted file mode 100644 -index ae9422266f23c66835d513b0203818fed7b07465..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 -GIT binary patch -literal 0 -Hc$@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -\ No newline at end of file -diff --git a/application/org.openjdk.jmc.console.twitter/pom.xml b/application/org.openjdk.jmc.console.twitter/pom.xml -deleted file mode 100644 ---- a/application/org.openjdk.jmc.console.twitter/pom.xml -+++ /dev/null -@@ -1,44 +0,0 @@ -- -- -- -- 4.0.0 -- -- org.openjdk.jmc -- missioncontrol.application -- 7.0.0-SNAPSHOT -- -- org.openjdk.jmc.console.twitter -- 1.0.2-SNAPSHOT -- eclipse-plugin -- -diff --git a/application/org.openjdk.jmc.console.twitter/src/main/java/org/openjdk/jmc/console/twitter/SendMessage.java b/application/org.openjdk.jmc.console.twitter/src/main/java/org/openjdk/jmc/console/twitter/SendMessage.java -deleted file mode 100644 ---- a/application/org.openjdk.jmc.console.twitter/src/main/java/org/openjdk/jmc/console/twitter/SendMessage.java -+++ /dev/null -@@ -1,71 +0,0 @@ --/* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -- * -- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -- * -- * The contents of this file are subject to the terms of either the Universal Permissive License -- * v 1.0 as shown at http://oss.oracle.com/licenses/upl -- * -- * or the following license: -- * -- * Redistribution and use in source and binary forms, with or without modification, are permitted -- * provided that the following conditions are met: -- * -- * 1. Redistributions of source code must retain the above copyright notice, this list of conditions -- * and the following disclaimer. -- * -- * 2. Redistributions in binary form must reproduce the above copyright notice, this list of -- * conditions and the following disclaimer in the documentation and/or other materials provided with -- * the distribution. -- * -- * 3. Neither the name of the copyright holder nor the names of its contributors may be used to -- * endorse or promote products derived from this software without specific prior written permission. -- * -- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -- * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- */ --package org.openjdk.jmc.console.twitter; -- --import org.openjdk.jmc.rjmx.IConnectionHandle; --import org.openjdk.jmc.rjmx.triggers.IActivatableTriggerAction; --import org.openjdk.jmc.rjmx.triggers.TriggerAction; --import org.openjdk.jmc.rjmx.triggers.TriggerEvent; -- --/** -- * Sends a direct message from one user to another -- */ --public class SendMessage extends TriggerAction implements IActivatableTriggerAction { -- private static final String FROM_FIELD = "from"; //$NON-NLS-1$ -- private static final String TO_FIELD = "to"; //$NON-NLS-1$ -- private static final String MESSAGE_FIELD = "message"; //$NON-NLS-1$ -- -- public SendMessage() { -- -- } -- -- @Override -- public void handleNotificationEvent(TriggerEvent event) throws Exception { -- String from = getSetting(FROM_FIELD).getString(); -- String to = getSetting(TO_FIELD).getString(); -- String message = TwitterPlugin.createMessage(getSetting(MESSAGE_FIELD).getString(), event); -- -- if (from != null && to != null && message != null) { -- send(from, to, message); -- } -- } -- -- private void send(String from, String to, String message) throws Exception { -- TwitterPlugin.getDefault().sendDirectMessage(from, to, message); -- } -- -- @Override -- public boolean isActivatable(IConnectionHandle handle) { -- return TwitterPlugin.getDefault().verifyAuthorizedUser(getSetting(FROM_FIELD).getString()); -- } --} -diff --git a/application/org.openjdk.jmc.console.twitter/src/main/java/org/openjdk/jmc/console/twitter/Tweeter.java b/application/org.openjdk.jmc.console.twitter/src/main/java/org/openjdk/jmc/console/twitter/Tweeter.java -deleted file mode 100644 ---- a/application/org.openjdk.jmc.console.twitter/src/main/java/org/openjdk/jmc/console/twitter/Tweeter.java -+++ /dev/null -@@ -1,96 +0,0 @@ --/* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -- * -- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -- * -- * The contents of this file are subject to the terms of either the Universal Permissive License -- * v 1.0 as shown at http://oss.oracle.com/licenses/upl -- * -- * or the following license: -- * -- * Redistribution and use in source and binary forms, with or without modification, are permitted -- * provided that the following conditions are met: -- * -- * 1. Redistributions of source code must retain the above copyright notice, this list of conditions -- * and the following disclaimer. -- * -- * 2. Redistributions in binary form must reproduce the above copyright notice, this list of -- * conditions and the following disclaimer in the documentation and/or other materials provided with -- * the distribution. -- * -- * 3. Neither the name of the copyright holder nor the names of its contributors may be used to -- * endorse or promote products derived from this software without specific prior written permission. -- * -- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -- * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- */ --package org.openjdk.jmc.console.twitter; -- --import org.eclipse.ui.IMemento; -- --/** -- * Holds information about a user and it's access credentials. -- */ --public final class Tweeter { -- -- private static final String TOKEN = "token"; //$NON-NLS-1$ -- private static final String TOKEN_SECRET = "tokenSecret"; //$NON-NLS-1$ -- private static final String USERNAME = "username"; //$NON-NLS-1$ -- -- private final String username; -- private final String token; -- private final String tokenSecret; -- -- public Tweeter(IMemento memento) { -- this(memento.getString(USERNAME), memento.getString(TOKEN), memento.getString(TOKEN_SECRET)); -- } -- -- public Tweeter(String username, String token, String tokenSecret) { -- this.username = username; -- this.token = token; -- this.tokenSecret = tokenSecret; -- } -- -- public String getUsername() { -- return username; -- } -- -- public String getToken() { -- return token; -- } -- -- public String getTokenSecret() { -- return tokenSecret; -- } -- -- public void saveState(IMemento memento) { -- memento.putString(USERNAME, username); -- memento.putString(TOKEN, token); -- memento.putString(TOKEN_SECRET, tokenSecret); -- } -- -- @Override -- public boolean equals(Object o) { -- if (o instanceof Tweeter) { -- Tweeter that = (Tweeter) o; -- return that.username.equals(username); -- } -- return false; -- } -- -- @Override -- public int hashCode() { -- return username.hashCode(); -- } -- -- @Override -- public String toString() { -- return username; -- } --} -diff --git a/application/org.openjdk.jmc.console.twitter/src/main/java/org/openjdk/jmc/console/twitter/TwitterPlugin.java b/application/org.openjdk.jmc.console.twitter/src/main/java/org/openjdk/jmc/console/twitter/TwitterPlugin.java -deleted file mode 100644 ---- a/application/org.openjdk.jmc.console.twitter/src/main/java/org/openjdk/jmc/console/twitter/TwitterPlugin.java -+++ /dev/null -@@ -1,347 +0,0 @@ --/* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -- * -- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -- * -- * The contents of this file are subject to the terms of either the Universal Permissive License -- * v 1.0 as shown at http://oss.oracle.com/licenses/upl -- * -- * or the following license: -- * -- * Redistribution and use in source and binary forms, with or without modification, are permitted -- * provided that the following conditions are met: -- * -- * 1. Redistributions of source code must retain the above copyright notice, this list of conditions -- * and the following disclaimer. -- * -- * 2. Redistributions in binary form must reproduce the above copyright notice, this list of -- * conditions and the following disclaimer in the documentation and/or other materials provided with -- * the distribution. -- * -- * 3. Neither the name of the copyright holder nor the names of its contributors may be used to -- * endorse or promote products derived from this software without specific prior written permission. -- * -- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -- * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- */ --package org.openjdk.jmc.console.twitter; -- --import java.net.URI; --import java.net.URISyntaxException; --import java.util.ArrayList; --import java.util.List; --import java.util.logging.Level; --import java.util.logging.Logger; -- --import org.eclipse.core.net.proxy.IProxyChangeEvent; --import org.eclipse.core.net.proxy.IProxyChangeListener; --import org.eclipse.core.net.proxy.IProxyData; --import org.eclipse.core.net.proxy.IProxyService; --import org.eclipse.core.runtime.preferences.InstanceScope; --import org.eclipse.jface.dialogs.MessageDialog; --import org.eclipse.swt.program.Program; --import org.eclipse.ui.IMemento; --import org.eclipse.ui.XMLMemento; --import org.eclipse.ui.plugin.AbstractUIPlugin; --import org.osgi.framework.BundleContext; --import org.osgi.service.prefs.BackingStoreException; -- --import org.openjdk.jmc.rjmx.triggers.TriggerEvent; --import org.openjdk.jmc.ui.misc.DialogToolkit; --import org.openjdk.jmc.ui.misc.MementoToolkit; -- --import twitter4j.Twitter; --import twitter4j.TwitterException; --import twitter4j.TwitterFactory; --import twitter4j.auth.AccessToken; --import twitter4j.auth.RequestToken; --import twitter4j.conf.ConfigurationBuilder; -- --/** -- * The activator class controls the plug-in life cycle for the Twitter plug-in.- -- */ --public class TwitterPlugin extends AbstractUIPlugin { -- private static final String VARIABLE_VALUE = "{value}"; -- private static final String VARIABLE_STATE = "{state}"; -- -- private static final String TWEETERS_PREF_KEY = "tweeters"; -- private static final String TWEETER_TAG = "tweeter"; -- -- private static final String CONSUMER_KEY_PREF_KEY = "consumer_key"; -- private static final String CONSUMER_SECRET_PREF_KEY = "consumer_secret"; -- -- // The plug-in ID -- public static final String PLUGIN_ID = "org.openjdk.jmc.twitter"; //$NON-NLS-1$ -- -- final static Logger LOGGER = Logger.getLogger(PLUGIN_ID); -- -- // The shared instance -- private static TwitterPlugin plugin; -- -- private String consumerKey; -- private String consumerSecret; -- private List tweeters = new ArrayList<>(); -- private TwitterFactory twitterFactory; -- -- private final IProxyChangeListener proxyListener; -- private IProxyService proxyService; -- -- /** -- * The constructor -- */ -- public TwitterPlugin() { -- proxyListener = new IProxyChangeListener() { -- @Override -- public void proxyInfoChanged(IProxyChangeEvent event) { -- recreateFactory(); -- } -- }; -- } -- -- @Override -- public void start(BundleContext context) throws Exception { -- super.start(context); -- proxyService = setupProxyService(context); -- plugin = this; -- consumerKey = InstanceScope.INSTANCE.getNode(PLUGIN_ID).get(CONSUMER_KEY_PREF_KEY, null); -- consumerSecret = InstanceScope.INSTANCE.getNode(PLUGIN_ID).get(CONSUMER_SECRET_PREF_KEY, null); -- -- IMemento state = MementoToolkit -- .fromString(InstanceScope.INSTANCE.getNode(PLUGIN_ID).get(TWEETERS_PREF_KEY, null)); -- if (state != null) { -- for (IMemento tweeter : state.getChildren(TWEETER_TAG)) { -- tweeters.add(new Tweeter(tweeter)); -- } -- } -- twitterFactory = createTwitterFactory(); -- } -- -- private IProxyService setupProxyService(BundleContext context) { -- IProxyService service = context.getService(context.getServiceReference(IProxyService.class)); -- service.addProxyChangeListener(proxyListener); -- return service; -- } -- -- private TwitterFactory createTwitterFactory() { -- ConfigurationBuilder cb = new ConfigurationBuilder(); -- try { -- IProxyData[] data = proxyService.select(new URI("http://api.twitter.com")); //$NON-NLS-1$ -- String host = null; -- int port = -1; -- for (IProxyData proxyData : data) { -- if (proxyData.getHost() != null) { -- host = proxyData.getHost(); -- port = proxyData.getPort(); -- break; -- } -- } -- if (host != null) { -- cb.setHttpProxyHost(host); -- } -- if (port != -1) { -- -- cb.setHttpProxyPort(port); -- } else { -- cb.setHttpProxyPort(80); -- } -- } catch (URISyntaxException e) { -- // Should never happen... -- e.printStackTrace(); -- } -- return new TwitterFactory(cb.build()); -- } -- -- @Override -- public void stop(BundleContext context) throws Exception { -- try { -- plugin = null; -- proxyService.removeProxyChangeListener(proxyListener); -- proxyService = null; -- storeStateToPreferences(); -- } finally { -- // Implicitly stores preference store. -- super.stop(context); -- } -- } -- -- private void storeStateToPreferences() { -- XMLMemento tweeterState = XMLMemento.createWriteRoot("root"); -- for (Tweeter t : tweeters) { -- t.saveState(tweeterState.createChild(TWEETER_TAG)); -- } -- InstanceScope.INSTANCE.getNode(PLUGIN_ID).put(TWEETERS_PREF_KEY, MementoToolkit.asString(tweeterState)); -- if (consumerKey != null) { -- InstanceScope.INSTANCE.getNode(PLUGIN_ID).put(CONSUMER_KEY_PREF_KEY, consumerKey); -- } -- if (consumerSecret != null) { -- InstanceScope.INSTANCE.getNode(PLUGIN_ID).put(CONSUMER_SECRET_PREF_KEY, consumerSecret); -- } -- } -- -- /** -- * Returns the shared instance -- * -- * @return the shared instance -- */ -- public static TwitterPlugin getDefault() { -- return plugin; -- } -- -- public RequestToken authorize(Twitter twitter) { -- try { -- twitter.setOAuthConsumer(consumerKey, consumerSecret); -- } catch (IllegalStateException e) { -- // Using log level info, since it's probably only since this was done before. -- TwitterPlugin.LOGGER.log(Level.INFO, -- "Could not set OAuth Consumer. Most likely this has already been done before.", e); -- } -- RequestToken requestToken; -- try { -- requestToken = twitter.getOAuthRequestToken(); -- Program.launch(requestToken.getAuthorizationURL()); -- return requestToken; -- } catch (TwitterException e) { -- TwitterPlugin.LOGGER.log(Level.SEVERE, "Could not request token!", e); -- DialogToolkit.showException(null, "Problem when Authorizing", -- "Problem when trying to connect to Twitter for authorization. Check your network and proxy settings. If you make any changes, a restart may be required. \n\nException message: " -- + e.getMessage(), -- e); -- } -- return null; -- } -- -- public Tweeter getAuthorizedTweeter(String username) { -- for (Tweeter tweeter : tweeters) { -- if (username.equals(tweeter.getUsername())) { -- return tweeter; -- } -- } -- return null; -- } -- -- public void updateStatus(String username, String message) throws TwitterException { -- Tweeter tweeter = getAuthorizedTweeter(username); -- if (tweeter != null) { -- AccessToken at = createAccessToken(tweeter); -- Twitter twitter = twitterFactory.getInstance(); -- twitter.setOAuthConsumer(consumerKey, consumerSecret); -- twitter.setOAuthAccessToken(at); -- twitter.updateStatus(message); -- return; -- } else { -- throw new TwitterException(String.format( -- "Attempted to update status for an account not defined in the preferences. Please set up the account (%s) in preferences first.", -- username)); -- } -- } -- -- private AccessToken createAccessToken(Tweeter tweeter) { -- return new AccessToken(tweeter.getToken(), tweeter.getTokenSecret()); -- } -- -- public void addTweeter(Twitter twitter, RequestToken rt, String pin) { -- try { -- AccessToken accessToken; -- if (pin.length() > 0) { -- accessToken = twitter.getOAuthAccessToken(rt, pin); -- } else { -- accessToken = twitter.getOAuthAccessToken(); -- } -- -- String screenName = accessToken.getScreenName(); -- if (screenName != null && screenName.length() > 0) { -- Tweeter tweeter = new Tweeter(accessToken.getScreenName(), accessToken.getToken(), -- accessToken.getTokenSecret()); -- if (!tweeters.contains(tweeter)) { -- tweeters.add(tweeter); -- } -- storeAndSavePrefs(); -- } else { -- DialogToolkit.showError(null, "Invalid User", "The authorized user is invalid."); -- } -- MessageDialog.openInformation(null, "Twitter Authorization", -- "Access credentials created successfully for user " + screenName + "."); -- } catch (TwitterException ex) { -- DialogToolkit.showException(null, "Error storing access token", ex); -- } -- } -- -- private void storeAndSavePrefs() { -- storeStateToPreferences(); -- try { -- InstanceScope.INSTANCE.getNode(PLUGIN_ID).flush(); -- } catch (BackingStoreException e) { -- getLogger().log(Level.WARNING, "Failed to store to preferences!", e); -- } -- } -- -- public void setConsumerKeyAndSecret(String consumerKey, String consumerSecret) { -- this.consumerKey = consumerKey; -- this.consumerSecret = consumerSecret; -- storeAndSavePrefs(); -- } -- -- public void removeTweeter(Tweeter tweeter) { -- tweeters.remove(tweeter); -- } -- -- public List getTweeters() { -- return tweeters; -- } -- -- public Twitter getTwitter() { -- return twitterFactory.getInstance(); -- } -- -- public Logger getLogger() { -- return LOGGER; -- } -- -- public void sendDirectMessage(String from, String to, String message) throws Exception { -- Tweeter tweeter = getAuthorizedTweeter(from); -- if (tweeter != null) { -- AccessToken at = createAccessToken(tweeter); -- Twitter twitter = twitterFactory.getInstance(); -- twitter.setOAuthConsumer(consumerKey, consumerSecret); -- twitter.setOAuthAccessToken(at); -- twitter.sendDirectMessage(to, message); -- } else { -- throw new Exception(String.format( -- "Attempted to send direct message from account not defined in the preferences. Please set up the account (%s) in preferences first.", -- from)); -- } -- } -- -- private void recreateFactory() { -- twitterFactory = createTwitterFactory(); -- } -- -- public static String createMessage(String msg, TriggerEvent event) { -- String result = msg.replace(VARIABLE_STATE, getStateString(event)); -- result = result.replace(VARIABLE_VALUE, String.valueOf(event.getTriggerValue())); -- if (result.length() > 140) { -- result = result.substring(0, 137) + "..."; -- } -- return result; -- } -- -- private static String getStateString(TriggerEvent event) { -- return event.wasTriggered() ? "triggered" : "recovered"; -- } -- -- public boolean verifyAuthorizedUser(String username) { -- if (getAuthorizedTweeter(username) != null) { -- return true; -- } else { -- DialogToolkit.showError(null, "Unauthorized Twitter User", -- "User " + username + " has not been authorized in Preferences"); -- return false; -- } -- } --} -diff --git a/application/org.openjdk.jmc.console.twitter/src/main/java/org/openjdk/jmc/console/twitter/TwitterPreferencePage.java b/application/org.openjdk.jmc.console.twitter/src/main/java/org/openjdk/jmc/console/twitter/TwitterPreferencePage.java -deleted file mode 100644 ---- a/application/org.openjdk.jmc.console.twitter/src/main/java/org/openjdk/jmc/console/twitter/TwitterPreferencePage.java -+++ /dev/null -@@ -1,259 +0,0 @@ --/* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -- * -- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -- * -- * The contents of this file are subject to the terms of either the Universal Permissive License -- * v 1.0 as shown at http://oss.oracle.com/licenses/upl -- * -- * or the following license: -- * -- * Redistribution and use in source and binary forms, with or without modification, are permitted -- * provided that the following conditions are met: -- * -- * 1. Redistributions of source code must retain the above copyright notice, this list of conditions -- * and the following disclaimer. -- * -- * 2. Redistributions in binary form must reproduce the above copyright notice, this list of -- * conditions and the following disclaimer in the documentation and/or other materials provided with -- * the distribution. -- * -- * 3. Neither the name of the copyright holder nor the names of its contributors may be used to -- * endorse or promote products derived from this software without specific prior written permission. -- * -- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -- * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- */ --package org.openjdk.jmc.console.twitter; -- --import org.eclipse.jface.preference.PreferencePage; --import org.eclipse.jface.resource.ImageDescriptor; --import org.eclipse.jface.viewers.ArrayContentProvider; --import org.eclipse.jface.viewers.ColumnWeightData; --import org.eclipse.jface.viewers.ISelectionChangedListener; --import org.eclipse.jface.viewers.IStructuredSelection; --import org.eclipse.jface.viewers.SelectionChangedEvent; --import org.eclipse.jface.viewers.TableLayout; --import org.eclipse.jface.viewers.TableViewer; --import org.eclipse.swt.SWT; --import org.eclipse.swt.events.ModifyEvent; --import org.eclipse.swt.events.ModifyListener; --import org.eclipse.swt.events.SelectionAdapter; --import org.eclipse.swt.events.SelectionEvent; --import org.eclipse.swt.layout.GridData; --import org.eclipse.swt.layout.GridLayout; --import org.eclipse.swt.widgets.Button; --import org.eclipse.swt.widgets.Composite; --import org.eclipse.swt.widgets.Control; --import org.eclipse.swt.widgets.Label; --import org.eclipse.swt.widgets.Table; --import org.eclipse.swt.widgets.TableColumn; --import org.eclipse.swt.widgets.Text; --import org.eclipse.ui.IWorkbench; --import org.eclipse.ui.IWorkbenchPreferencePage; -- --import twitter4j.Twitter; --import twitter4j.auth.RequestToken; -- --/** -- * Preference page that configures {@link TwitterPlugin} -- */ --public class TwitterPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { -- private Text m_pin; -- private Text m_consumerKey; -- private Text m_consumerSecret; -- private Button finishButton; -- private RequestToken m_requestToken; -- private Control m_authorizationButton; -- private Twitter m_twitter; -- private TableViewer m_viewer; -- private Control m_removeButton; -- -- public TwitterPreferencePage() { -- -- } -- -- public TwitterPreferencePage(String title) { -- super(title); -- } -- -- public TwitterPreferencePage(String title, ImageDescriptor image) { -- super(title, image); -- } -- -- @Override -- public void init(IWorkbench workbench) { -- -- } -- -- @Override -- protected Control createContents(Composite parent) { -- resetTwitter(); -- -- Composite container = new Composite(parent, SWT.NONE); -- container.setLayout(new GridLayout(3, false)); -- -- writeText(container, -- "Before an application, like JDK Mission Control, is allowed to tweet, the application needs to be authorized."); -- writeText(container, -- "You must first set up your own new 'Application' in Twitter (apps.twitter.com) which Mission Control will use to post from. Enter the Consumer Key and Secret for your application below."); -- writeText(container, -- "Finally click Authorize to start authorization. A web browser will appear where you will grant Mission Control permission. The Twitter user you log in as in the web browser will be the one you can use from within Mission Control."); -- -- m_consumerKey = createMandatoryTextField(container, "Consumer Key:", 2); -- m_consumerSecret = createMandatoryTextField(container, "Consumer Secret:", 2); -- -- GridData gd2 = new GridData(SWT.FILL, SWT.FILL, false, false); -- m_authorizationButton = createAuthorizeButton(container); -- m_authorizationButton.setLayoutData(gd2); -- -- writeText(container, "Then enter the PIN that is shown in the web browser and click Add."); -- -- m_pin = createMandatoryTextField(container, "PIN:", 1); -- m_pin.setEnabled(false); -- GridData gd4 = new GridData(SWT.FILL, SWT.FILL, false, false); -- finishButton = createAddButton(container); -- finishButton.setLayoutData(gd4); -- finishButton.setEnabled(false); -- -- writeText(container, "Authorized Users:"); -- GridData gd10 = new GridData(SWT.FILL, SWT.FILL, true, true); -- gd10.horizontalSpan = 2; -- gd10.verticalSpan = 2; -- m_viewer = createTableViewer(container); -- m_viewer.getControl().setLayoutData(gd10); -- -- GridData gd11 = new GridData(SWT.FILL, SWT.BEGINNING, false, false); -- gd11.verticalSpan = 2; -- m_removeButton = createRemoveButton(container); -- m_removeButton.setLayoutData(gd11); -- m_removeButton.setEnabled(false); -- hookViewerRefresh(); -- -- return container; -- } -- -- private Text createMandatoryTextField(Composite container, String caption, int textSpan) { -- GridData gdLabel = new GridData(SWT.FILL, SWT.CENTER, false, false); -- Label label = new Label(container, SWT.NONE); -- label.setText(caption); -- label.setLayoutData(gdLabel); -- GridData gdField = new GridData(SWT.FILL, SWT.FILL, true, false); -- gdField.horizontalSpan = textSpan; -- Text field = createTextField(container); -- field.setLayoutData(gdField); -- return field; -- } -- -- private void resetTwitter() { -- m_twitter = TwitterPlugin.getDefault().getTwitter(); -- m_requestToken = null; -- } -- -- void updateEnablement() { -- m_removeButton.setEnabled(TwitterPlugin.getDefault().getTweeters().size() > 0); -- } -- -- private void hookViewerRefresh() { -- m_viewer.addSelectionChangedListener(new ISelectionChangedListener() { -- @Override -- public void selectionChanged(SelectionChangedEvent event) { -- updateEnablement(); -- } -- }); -- } -- -- private Button createRemoveButton(Composite container) { -- Button b = new Button(container, SWT.NONE); -- b.setText("Remove"); -- b.addSelectionListener(new SelectionAdapter() { -- @Override -- public void widgetSelected(SelectionEvent e) { -- IStructuredSelection ss = (IStructuredSelection) m_viewer.getSelection(); -- if (!ss.isEmpty()) { -- TwitterPlugin.getDefault().removeTweeter((Tweeter) ss.getFirstElement()); -- m_viewer.refresh(); -- } -- } -- }); -- return b; -- } -- -- private TableViewer createTableViewer(Composite parent) { -- Table table = new Table(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.SINGLE); -- table.setLinesVisible(true); -- -- final TableViewer viewer = new TableViewer(table); -- new TableColumn(table, SWT.NONE); -- TableLayout tl = new TableLayout(); -- tl.addColumnData(new ColumnWeightData(1)); -- table.setLayout(tl); -- viewer.setContentProvider(new ArrayContentProvider()); -- viewer.setInput(TwitterPlugin.getDefault().getTweeters()); -- return viewer; -- } -- -- @Override -- public boolean performOk() { -- return true; -- } -- -- private void writeText(Composite parent, String text) { -- GridData gd0 = new GridData(SWT.FILL, SWT.FILL, false, false); -- gd0.horizontalSpan = 3; -- gd0.widthHint = 200; -- Label desc = new Label(parent, SWT.WRAP); -- desc.setText(text); -- desc.setLayoutData(gd0); -- } -- -- private Text createTextField(Composite container) { -- final Text t = new Text(container, SWT.BORDER); -- t.addModifyListener(new ModifyListener() { -- -- @Override -- public void modifyText(ModifyEvent e) { -- finishButton.setEnabled(t.getText().length() > 0); -- } -- }); -- return t; -- } -- -- private Button createAddButton(final Composite container) { -- Button b = new Button(container, SWT.NONE); -- b.setText("Add"); -- b.addSelectionListener(new SelectionAdapter() { -- @Override -- public void widgetSelected(SelectionEvent e) { -- TwitterPlugin.getDefault().addTweeter(m_twitter, m_requestToken, m_pin.getText().trim()); -- m_pin.setText(""); -- m_viewer.refresh(); -- } -- }); -- return b; -- } -- -- private Button createAuthorizeButton(Composite container) { -- Button b = new Button(container, SWT.NONE); -- b.setText("Authorize"); -- b.addSelectionListener(new SelectionAdapter() { -- @Override -- public void widgetSelected(SelectionEvent e) { -- resetTwitter(); -- TwitterPlugin.getDefault().setConsumerKeyAndSecret(m_consumerKey.getText().trim(), -- m_consumerSecret.getText().trim()); -- m_requestToken = TwitterPlugin.getDefault().authorize(m_twitter); -- boolean enabled = m_requestToken != null; -- finishButton.setEnabled(enabled); -- m_pin.setEnabled(enabled); -- } -- }); -- return b; -- } --} -diff --git a/application/org.openjdk.jmc.console.twitter/src/main/java/org/openjdk/jmc/console/twitter/UpdateStatus.java b/application/org.openjdk.jmc.console.twitter/src/main/java/org/openjdk/jmc/console/twitter/UpdateStatus.java -deleted file mode 100644 ---- a/application/org.openjdk.jmc.console.twitter/src/main/java/org/openjdk/jmc/console/twitter/UpdateStatus.java -+++ /dev/null -@@ -1,70 +0,0 @@ --/* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -- * -- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -- * -- * The contents of this file are subject to the terms of either the Universal Permissive License -- * v 1.0 as shown at http://oss.oracle.com/licenses/upl -- * -- * or the following license: -- * -- * Redistribution and use in source and binary forms, with or without modification, are permitted -- * provided that the following conditions are met: -- * -- * 1. Redistributions of source code must retain the above copyright notice, this list of conditions -- * and the following disclaimer. -- * -- * 2. Redistributions in binary form must reproduce the above copyright notice, this list of -- * conditions and the following disclaimer in the documentation and/or other materials provided with -- * the distribution. -- * -- * 3. Neither the name of the copyright holder nor the names of its contributors may be used to -- * endorse or promote products derived from this software without specific prior written permission. -- * -- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -- * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- */ --package org.openjdk.jmc.console.twitter; -- --import org.openjdk.jmc.rjmx.IConnectionHandle; --import org.openjdk.jmc.rjmx.triggers.IActivatableTriggerAction; --import org.openjdk.jmc.rjmx.triggers.TriggerAction; --import org.openjdk.jmc.rjmx.triggers.TriggerEvent; -- --import twitter4j.TwitterException; -- --/** -- * Action that updates the status. -- */ --public class UpdateStatus extends TriggerAction implements IActivatableTriggerAction { -- private static final String USERNAME_FIELD = "username"; //$NON-NLS-1$ -- private static final String MESSAGE_FIELD = "message"; //$NON-NLS-1$ -- -- public UpdateStatus() { -- // Do nothing -- } -- -- @Override -- public void handleNotificationEvent(TriggerEvent event) throws TwitterException { -- String username = getSetting(USERNAME_FIELD).getString(); -- String message = TwitterPlugin.createMessage(getSetting(MESSAGE_FIELD).getString(), event); -- if (username != null && message != null) { -- updateStatus(username, message); -- } -- } -- -- private void updateStatus(String username, String message) throws TwitterException { -- TwitterPlugin.getDefault().updateStatus(username, message); -- } -- -- @Override -- public boolean isActivatable(IConnectionHandle handle) { -- return TwitterPlugin.getDefault().verifyAuthorizedUser(getSetting(USERNAME_FIELD).getString()); -- } --} -diff --git a/application/org.openjdk.jmc.feature.twitter/.project b/application/org.openjdk.jmc.feature.twitter/.project -deleted file mode 100644 ---- a/application/org.openjdk.jmc.feature.twitter/.project -+++ /dev/null -@@ -1,23 +0,0 @@ -- -- -- org.openjdk.jmc.feature.twitter -- -- -- -- -- -- org.eclipse.pde.FeatureBuilder -- -- -- -- -- org.eclipse.m2e.core.maven2Builder -- -- -- -- -- -- org.eclipse.m2e.core.maven2Nature -- org.eclipse.pde.FeatureNature -- -- -diff --git a/application/org.openjdk.jmc.feature.twitter/build.properties b/application/org.openjdk.jmc.feature.twitter/build.properties -deleted file mode 100644 ---- a/application/org.openjdk.jmc.feature.twitter/build.properties -+++ /dev/null -@@ -1,36 +0,0 @@ --# --# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. --# --# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. --# --# The contents of this file are subject to the terms of either the Universal Permissive License --# v 1.0 as shown at http://oss.oracle.com/licenses/upl --# --# or the following license: --# --# Redistribution and use in source and binary forms, with or without modification, are permitted --# provided that the following conditions are met: --# --# 1. Redistributions of source code must retain the above copyright notice, this list of conditions --# and the following disclaimer. --# --# 2. Redistributions in binary form must reproduce the above copyright notice, this list of --# conditions and the following disclaimer in the documentation and/or other materials provided with --# the distribution. --# --# 3. Neither the name of the copyright holder nor the names of its contributors may be used to --# endorse or promote products derived from this software without specific prior written permission. --# --# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR --# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND --# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR --# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL --# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, --# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY --# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --# --bin.includes = feature.xml,\ -- feature.properties --pde.match.rule.feature=compatible --pde.match.rule.bundle=compatible -diff --git a/application/org.openjdk.jmc.feature.twitter/feature.properties b/application/org.openjdk.jmc.feature.twitter/feature.properties -deleted file mode 100644 ---- a/application/org.openjdk.jmc.feature.twitter/feature.properties -+++ /dev/null -@@ -1,37 +0,0 @@ --# --# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. --# --# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. --# --# The contents of this file are subject to the terms of either the Universal Permissive License --# v 1.0 as shown at http://oss.oracle.com/licenses/upl --# --# or the following license: --# --# Redistribution and use in source and binary forms, with or without modification, are permitted --# provided that the following conditions are met: --# --# 1. Redistributions of source code must retain the above copyright notice, this list of conditions --# and the following disclaimer. --# --# 2. Redistributions in binary form must reproduce the above copyright notice, this list of --# conditions and the following disclaimer in the documentation and/or other materials provided with --# the distribution. --# --# 3. Neither the name of the copyright holder nor the names of its contributors may be used to --# endorse or promote products derived from this software without specific prior written permission. --# --# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR --# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND --# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR --# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL --# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, --# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY --# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --# --name=Twitter Action --provider=Oracle Corporation --copyright=Copyright \u00A9 2018, Oracle and/or its affiliates. All rights reserved. --description=This feature makes a twitter action available among the trigger actions. A user defined message will be tweeted whenever a rule with this action triggers. --descriptionUrl=http://www.oracle.com/missioncontrol -diff --git a/application/org.openjdk.jmc.feature.twitter/feature.xml b/application/org.openjdk.jmc.feature.twitter/feature.xml -deleted file mode 100644 ---- a/application/org.openjdk.jmc.feature.twitter/feature.xml -+++ /dev/null -@@ -1,73 +0,0 @@ -- -- -- -- -- -- %description -- -- -- -- %copyright -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -\ No newline at end of file -diff --git a/application/org.openjdk.jmc.feature.twitter/pom.xml b/application/org.openjdk.jmc.feature.twitter/pom.xml -deleted file mode 100644 ---- a/application/org.openjdk.jmc.feature.twitter/pom.xml -+++ /dev/null -@@ -1,44 +0,0 @@ -- -- -- -- 4.0.0 -- -- org.openjdk.jmc -- missioncontrol.application -- 7.0.0-SNAPSHOT -- -- org.openjdk.jmc.feature.twitter -- 1.0.2-SNAPSHOT -- eclipse-feature -- diff --git a/application/org.openjdk.jmc.rjmx/META-INF/MANIFEST.MF b/application/org.openjdk.jmc.rjmx/META-INF/MANIFEST.MF --- a/application/org.openjdk.jmc.rjmx/META-INF/MANIFEST.MF +++ b/application/org.openjdk.jmc.rjmx/META-INF/MANIFEST.MF @@ -1469,40 +84,6 @@ diff --git a/application/pom.xml b/application/pom.xml org.openjdk.jmc.flightrecorder.configuration org.openjdk.jmc.flightrecorder.controlpanel.ui org.openjdk.jmc.flightrecorder.controlpanel.ui.configuration -diff --git a/configuration/ide/eclipse/launchers/JMC Eclipse plug-ins.launch b/configuration/ide/eclipse/launchers/JMC Eclipse plug-ins.launch ---- a/configuration/ide/eclipse/launchers/JMC Eclipse plug-ins.launch -+++ b/configuration/ide/eclipse/launchers/JMC Eclipse plug-ins.launch -@@ -105,7 +105,6 @@ - - - -- - - - -diff --git a/configuration/ide/eclipse/launchers/JMC RCP plug-ins.launch b/configuration/ide/eclipse/launchers/JMC RCP plug-ins.launch ---- a/configuration/ide/eclipse/launchers/JMC RCP plug-ins.launch -+++ b/configuration/ide/eclipse/launchers/JMC RCP plug-ins.launch -@@ -86,7 +86,6 @@ - - - -- - - - -diff --git a/configuration/ide/eclipse/launchers/Remote RCP Debugging.launch b/configuration/ide/eclipse/launchers/Remote RCP Debugging.launch ---- a/configuration/ide/eclipse/launchers/Remote RCP Debugging.launch -+++ b/configuration/ide/eclipse/launchers/Remote RCP Debugging.launch -@@ -39,7 +39,7 @@ - - - -- -+ - - - diff --git a/license/THIRDPARTYREADME.txt b/license/THIRDPARTYREADME.txt --- a/license/THIRDPARTYREADME.txt +++ b/license/THIRDPARTYREADME.txt @@ -1694,38 +275,3 @@ diff --git a/license/THIRDPARTYREADME.txt b/license/THIRDPARTYREADME.txt -Twitter4J SUBCOMPONENTS: - -Twitter4J includes software from JSON.org to parse JSON response from the Twitter API. You can see the license term at http://www.JSON.org/license.html -diff --git a/releng/platform-definitions/platform-definition-oxygen/platform-definition-oxygen.target b/releng/platform-definitions/platform-definition-oxygen/platform-definition-oxygen.target ---- a/releng/platform-definitions/platform-definition-oxygen/platform-definition-oxygen.target -+++ b/releng/platform-definitions/platform-definition-oxygen/platform-definition-oxygen.target -@@ -40,7 +40,6 @@ - - - -- - - - -diff --git a/releng/platform-definitions/platform-definition-photon/platform-definition-photon.target b/releng/platform-definitions/platform-definition-photon/platform-definition-photon.target ---- a/releng/platform-definitions/platform-definition-photon/platform-definition-photon.target -+++ b/releng/platform-definitions/platform-definition-photon/platform-definition-photon.target -@@ -40,7 +40,6 @@ - - - -- - - - -diff --git a/releng/third-party/pom.xml b/releng/third-party/pom.xml ---- a/releng/third-party/pom.xml -+++ b/releng/third-party/pom.xml -@@ -53,9 +53,6 @@ - - - -- org.twitter4j:twitter4j-core:4.0.6 -- -- - javax.mail:mailapi:1.4 - true -