From 8c7bac15fb29b1dd829c09626bf40743db045312 Mon Sep 17 00:00:00 2001 From: sappenin Date: Fri, 12 Jul 2019 12:43:21 -0600 Subject: [PATCH 1/3] Cleanup project * Remove closed-source references * Add proper licensing * Remove @Author tags * Add CircleCI integration. Signed-off-by: sappenin --- .circleci/config.yml | 59 ++++ LICENSE-APACHE | 201 ------------- pom.xml | 274 +++++++++++++++++- ripple-topology-core/pom.xml | 4 - .../ripple/topology/io/AbstractContent.java | 5 +- .../ripple/topology/io/ClassPathContent.java | 7 +- .../com/ripple/topology/io/ContentUtils.java | 9 +- .../topology/io/DefaultContentLoader.java | 5 +- .../com/ripple/topology/io/UrlContent.java | 5 +- ripple-topology-elements-aws/pom.xml | 12 +- .../ripple/topology/elements/Ec2Resource.java | 21 +- ripple-topology-elements-nomad/pom.xml | 4 - .../topology/elements/SQLConfigurer.java | 18 +- .../topology/elements/SFTPFileTransfer.java | 9 +- .../ripple/topology/spring/LoadTopology.java | 3 - .../spring/LoadTopologyConfigurator.java | 3 - .../TopologySynchronousLifecycleManager.java | 3 - .../LoadTopologyConfiguratorFactoryTest.java | 3 - ...ogyConfiguratorMultipleTopologiesTest.java | 3 - .../LoadTopologyConfiguratorYamlTest.java | 3 - .../topology/spring/SimpleTopology.java | 3 - ripple-topology-ui/pom.xml | 30 +- .../com/ripple/topology/ui/TopologyUI.java | 5 +- .../EmbeddedServerServletContextListener.java | 62 ++++ .../ui/server/config/JacksonConfig.java | 3 - .../topology/ui/server/config/JettyUtils.java | 57 ++++ .../topology/ui/server/config/Server.java | 69 +++++ .../ui/server/config/SpringServer.java | 43 +++ .../ui/server/config/TopologyUIConfig.java | 8 +- .../config/TopologyUIRestEndpointConfig.java | 9 +- .../config/TopologyUIRestWebConfig.java | 7 - .../server/rest/controllers/ResourceInfo.java | 3 - .../rest/controllers/RootController.java | 3 - ...ults.properties => topology-ui.properties} | 0 .../topology/ui/TopologyServerMain.java | 3 - 35 files changed, 628 insertions(+), 328 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 LICENSE-APACHE create mode 100644 ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/EmbeddedServerServletContextListener.java create mode 100644 ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/JettyUtils.java create mode 100644 ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/Server.java create mode 100644 ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/SpringServer.java rename ripple-topology-ui/src/main/resources/{topology-ui-defaults.properties => topology-ui.properties} (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..c193535 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,59 @@ +# Java Maven CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-java/ for more details +# +version: 2 +jobs: + build: + docker: + # specify the version you desire here + - image: circleci/openjdk:8-jdk + + working_directory: ~/repo + + environment: + # Customize the JVM maximum heap limit + MAVEN_OPTS: -Xmx3200m + + steps: + - checkout + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "pom.xml" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: + name: Maven Install + command: mvn dependency:go-offline install + + - save_cache: + paths: + - ~/.m2 + key: v1-dependencies-{{ checksum "pom.xml" }} + + + # save tests + - run: + name: Save test results + command: | + mkdir -p ~/junit/ + find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/junit/ \; + mkdir -p ~/checkstyle/ + find . -type f -regex ".*/target/checkstyle-reports/.*xml" -exec cp {} ~/junit/ \; + + when: always + + - store_test_results: + path: ~/junit + + - store_artifacts: + path: ~/junit + + + # publish the coverage report to codecov.io + - run: bash <(curl -s https://codecov.io/bash) + + diff --git a/LICENSE-APACHE b/LICENSE-APACHE deleted file mode 100644 index 566d81f..0000000 --- a/LICENSE-APACHE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright 2017 Tokio contributors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/pom.xml b/pom.xml index 4f0d0b6..d946131 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 com.ripple.libraries.topology @@ -8,13 +9,34 @@ pom Ripple :: Topology :: Parent + + + MIT License + https://opensource.org/licenses/MIT + repo + + + + + Ripple + https://ripple.com + + + + scm:git:git://github.com/ripple/ripple-topology.git + scm:git:git@github.com:ripple/ripple-topology.git + + - 1.21.0 + 1.8 + 1.8 + UTF-8 1.2.2 2.9.8 27.0.1-jre 2.6 + 1. 1.3 1.7.25 4.3.7.RELEASE @@ -23,7 +45,7 @@ 1.8 - UTF-8 + argLine @@ -91,6 +113,11 @@ guava ${com.google.guava.version} + + com.squareup.okhttp3 + okhttp + 3.14.0 + org.apache.velocity velocity @@ -108,6 +135,24 @@ pom import + + org.eclipse.jetty + jetty-servlets + 9.4.19.v20190610 + compile + + + org.eclipse.jetty + jetty-webapp + 9.4.19.v20190610 + compile + + + org.eclipse.jetty.websocket + websocket-server + 9.4.19.v20190610 + compile + org.hamcrest hamcrest-core @@ -120,6 +165,11 @@ ${org.hamcrest.version} test + + org.postgresql + postgresql + 42.2.5 + org.springframework spring-framework-bom @@ -132,19 +182,17 @@ slf4j-api ${org.slf4j.version} + + org.slf4j + jul-to-slf4j + ${org.slf4j.version} + org.testng testng ${org.testng.version} test - - com.ripple.ripplenet.messaging - ripplenet-messaging-bom - ${com.ripple.ripplenet.messaging.version} - pom - import - @@ -155,6 +203,36 @@ maven-failsafe-plugin 2.20.1 + + + maven-compiler-plugin + + + + maven-source-plugin + + + + maven-javadoc-plugin + + + + maven-checkstyle-plugin + + + + org.jacoco + jacoco-maven-plugin + + + + maven-surefire-plugin + + + + org.sonatype.plugins + nexus-staging-maven-plugin + @@ -164,9 +242,9 @@ 3.6.1 ${jdk} - ${jdk} - ${jdk} - UTF-8 + ${maven.compiler.source} + ${maven.compiler.target} + ${project.build.sourceEncoding} @@ -174,9 +252,179 @@ maven-plugin-plugin 3.3 + + maven-source-plugin + 3.1.0 + + + attach-sources + + jar-no-fork + + + + + + maven-surefire-plugin + 2.22.2 + + + @{argLine} -Xms1024m -Xmx2048m + true + false + + + + maven-checkstyle-plugin + + 3.1.0 + true + + + + com.puppycrawl.tools + checkstyle + 8.21 + + + + + process-sources + + check + + + + + true + false + false + warning + false + + + + maven-javadoc-plugin + 3.1.0 + + + attach-javadocs + + jar + + + + + + org.jacoco + 0.8.4 + jacoco-maven-plugin + + + + prepare-agent + + + + report + test + + report + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + true + + ossrh-snapshots-ripple + https://oss.sonatype.org/ + true + + + + org.codehaus.mojo + license-maven-plugin + 1.20 + + + mit + ========================LICENSE_START================================= + + =========================LICENSE_END================================== + + + + true + + + test + + + **/*.json + + + + + + license-management + + + update-file-header + + + update-project-license + + + add-third-party + + process-sources + + + + + + + org.jacoco + jacoco-maven-plugin + false + + + + report + + + + + + maven-checkstyle-plugin + + + + checkstyle + + + + + + maven-javadoc-plugin + + + + + + + ossrh-snapshots-interledger + https://oss.sonatype.org/content/repositories/snapshots + + + diff --git a/ripple-topology-core/pom.xml b/ripple-topology-core/pom.xml index 2e9bd4e..aefb826 100644 --- a/ripple-topology-core/pom.xml +++ b/ripple-topology-core/pom.xml @@ -12,10 +12,6 @@ Ripple :: Topology :: Core - - com.ripple.libraries - ripple-runtime - com.google.guava guava diff --git a/ripple-topology-core/src/main/java/com/ripple/topology/io/AbstractContent.java b/ripple-topology-core/src/main/java/com/ripple/topology/io/AbstractContent.java index c72ee23..36eaeb6 100644 --- a/ripple-topology-core/src/main/java/com/ripple/topology/io/AbstractContent.java +++ b/ripple-topology-core/src/main/java/com/ripple/topology/io/AbstractContent.java @@ -1,6 +1,7 @@ package com.ripple.topology.io; -import com.ripple.runtime.Assert; +import com.google.common.base.Preconditions; + import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; @@ -52,7 +53,7 @@ public URI getURI() throws IOException { @Override public long contentLength() throws IOException { InputStream is = getInputStream(); - Assert.stateIsTrue(is != null, "Resource InputStream must not be null"); + Preconditions.checkArgument(is != null, "Resource InputStream must not be null"); try { long size = 0; byte[] buf = new byte[255]; diff --git a/ripple-topology-core/src/main/java/com/ripple/topology/io/ClassPathContent.java b/ripple-topology-core/src/main/java/com/ripple/topology/io/ClassPathContent.java index 5050a4d..029d44a 100644 --- a/ripple-topology-core/src/main/java/com/ripple/topology/io/ClassPathContent.java +++ b/ripple-topology-core/src/main/java/com/ripple/topology/io/ClassPathContent.java @@ -1,6 +1,7 @@ package com.ripple.topology.io; -import com.ripple.runtime.Assert; +import com.google.common.base.Preconditions; + import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; @@ -21,7 +22,7 @@ public ClassPathContent(String path) { } public ClassPathContent(String path, ClassLoader classLoader) { - Assert.argumentNotNull(path, "path"); + Preconditions.checkNotNull(path, "path"); String pathToUse = StringUtils.cleanPath(path); if (pathToUse.startsWith("/")) { pathToUse = pathToUse.substring(1); @@ -31,7 +32,7 @@ public ClassPathContent(String path, ClassLoader classLoader) { } public ClassPathContent(String path, Class clazz) { - Assert.argumentNotNull(path, "path"); + Preconditions.checkNotNull(path, "path"); this.path = StringUtils.cleanPath(path); this.clazz = clazz; } diff --git a/ripple-topology-core/src/main/java/com/ripple/topology/io/ContentUtils.java b/ripple-topology-core/src/main/java/com/ripple/topology/io/ContentUtils.java index ab95410..09577fb 100644 --- a/ripple-topology-core/src/main/java/com/ripple/topology/io/ContentUtils.java +++ b/ripple-topology-core/src/main/java/com/ripple/topology/io/ContentUtils.java @@ -1,13 +1,14 @@ package com.ripple.topology.io; -import com.ripple.runtime.Assert; +import com.google.common.base.Preconditions; +import org.apache.commons.lang3.StringUtils; + import java.io.File; import java.io.FileNotFoundException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; -import org.apache.commons.lang3.StringUtils; public abstract class ContentUtils { @@ -16,7 +17,7 @@ public abstract class ContentUtils { public static final String URL_PROTOCOL_FILE = "file"; public static File getFile(URL resourceUrl, String description) throws FileNotFoundException { - Assert.argumentNotNull(resourceUrl, "resourceUrl"); + Preconditions.checkNotNull(resourceUrl, "resourceUrl"); if (!URL_PROTOCOL_FILE.equals(resourceUrl.getProtocol())) { throw new FileNotFoundException( description + " cannot be resolved to absolute file path " + @@ -31,7 +32,7 @@ public static File getFile(URL resourceUrl, String description) throws FileNotFo } public static File getFile(URI resourceUri, String description) throws FileNotFoundException { - Assert.argumentNotNull(resourceUri, "resourceUri"); + Preconditions.checkNotNull(resourceUri, "resourceUri"); if (!URL_PROTOCOL_FILE.equals(resourceUri.getScheme())) { throw new FileNotFoundException( description + " cannot be resolved to absolute file path " + diff --git a/ripple-topology-core/src/main/java/com/ripple/topology/io/DefaultContentLoader.java b/ripple-topology-core/src/main/java/com/ripple/topology/io/DefaultContentLoader.java index 571f538..530854b 100644 --- a/ripple-topology-core/src/main/java/com/ripple/topology/io/DefaultContentLoader.java +++ b/ripple-topology-core/src/main/java/com/ripple/topology/io/DefaultContentLoader.java @@ -1,6 +1,7 @@ package com.ripple.topology.io; -import com.ripple.runtime.Assert; +import com.google.common.base.Preconditions; + import java.net.MalformedURLException; import java.net.URL; @@ -14,7 +15,7 @@ public ClassLoader getClassLoader() { @Override public Content getContent(String location) { - Assert.argumentNotNull(location, "location"); + Preconditions.checkNotNull(location, "location"); if (location.startsWith(CLASSPATH_URL_PREFIX)) { return new ClassPathContent(location.substring(CLASSPATH_URL_PREFIX.length()), getClassLoader()); diff --git a/ripple-topology-core/src/main/java/com/ripple/topology/io/UrlContent.java b/ripple-topology-core/src/main/java/com/ripple/topology/io/UrlContent.java index 0330fc3..cf05190 100644 --- a/ripple-topology-core/src/main/java/com/ripple/topology/io/UrlContent.java +++ b/ripple-topology-core/src/main/java/com/ripple/topology/io/UrlContent.java @@ -16,7 +16,8 @@ package com.ripple.topology.io; -import com.ripple.runtime.Assert; +import com.google.common.base.Preconditions; + import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -35,7 +36,7 @@ public class UrlContent extends AbstractFileResolvingContent { private final URL cleanedUrl; public UrlContent(URL url) { - Assert.argumentNotNull(url, "url"); + Preconditions.checkNotNull(url, "url"); this.url = url; this.cleanedUrl = getCleanedUrl(this.url, url.toString()); this.uri = null; diff --git a/ripple-topology-elements-aws/pom.xml b/ripple-topology-elements-aws/pom.xml index 2f398e6..b01f1a6 100644 --- a/ripple-topology-elements-aws/pom.xml +++ b/ripple-topology-elements-aws/pom.xml @@ -11,10 +11,6 @@ Ripple :: Topology :: Elements :: AWS - - com.ripple.libraries - ripple-runtime - ${project.groupId} ripple-topology-core @@ -28,9 +24,9 @@ software.amazon.awssdk rds - - commons-codec - commons-codec - + + + + diff --git a/ripple-topology-elements-aws/src/main/java/com/ripple/topology/elements/Ec2Resource.java b/ripple-topology-elements-aws/src/main/java/com/ripple/topology/elements/Ec2Resource.java index 043375a..e2ac1ff 100644 --- a/ripple-topology-elements-aws/src/main/java/com/ripple/topology/elements/Ec2Resource.java +++ b/ripple-topology-elements-aws/src/main/java/com/ripple/topology/elements/Ec2Resource.java @@ -8,15 +8,6 @@ import com.ripple.topology.VariableResolver; import com.ripple.topology.VariableResolverAware; import com.ripple.topology.utils.HealthUtils; -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.stream.Collectors; -import org.apache.commons.codec.binary.Base64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import software.amazon.awssdk.regions.Region; @@ -30,6 +21,16 @@ import software.amazon.awssdk.services.ec2.model.RunInstancesResponse; import software.amazon.awssdk.services.ec2.model.TerminateInstancesRequest; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Base64; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.stream.Collectors; + /** * @author jfulton */ @@ -245,7 +246,7 @@ public final String getCalculatedUserData() { @JsonIgnore public final String getCalculatedUserDataBase64() { - return new Base64().encodeAsString(getCalculatedUserData().getBytes()); + return Base64.getEncoder().encodeToString(getCalculatedUserData().getBytes()); } public int getJavaXmx() { diff --git a/ripple-topology-elements-nomad/pom.xml b/ripple-topology-elements-nomad/pom.xml index b483523..ea9625c 100644 --- a/ripple-topology-elements-nomad/pom.xml +++ b/ripple-topology-elements-nomad/pom.xml @@ -22,9 +22,5 @@ nomad-sdk 0.8.6.1 - - com.ripple.libraries - ripple-spring-runtime - diff --git a/ripple-topology-elements-sql/src/main/java/com/ripple/topology/elements/SQLConfigurer.java b/ripple-topology-elements-sql/src/main/java/com/ripple/topology/elements/SQLConfigurer.java index 62744d3..8df1e45 100644 --- a/ripple-topology-elements-sql/src/main/java/com/ripple/topology/elements/SQLConfigurer.java +++ b/ripple-topology-elements-sql/src/main/java/com/ripple/topology/elements/SQLConfigurer.java @@ -1,12 +1,17 @@ package com.ripple.topology.elements; -import com.ripple.runtime.Assert; +import com.google.common.base.Preconditions; import com.ripple.topology.PropertiesAware; import com.ripple.topology.Topology; import com.ripple.topology.VariableResolver; import com.ripple.topology.VariableResolverAware; import com.ripple.topology.io.Content; import com.ripple.topology.utils.HealthUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.datasource.SimpleDriverDataSource; + import java.sql.Driver; import java.time.Duration; import java.util.ArrayList; @@ -14,10 +19,6 @@ import java.util.Objects; import java.util.Properties; import java.util.concurrent.atomic.AtomicReference; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.datasource.SimpleDriverDataSource; /** * @author jfulton @@ -41,9 +42,10 @@ public SQLConfigurer() { public SQLConfigurer(final Class driverClass, final String jdbcUrl, final SQLCredentials credentials) { - this.driverClass = Assert.argumentNotNull(driverClass, "driverClass"); - this.jdbcUrl = Assert.argumentNotBlank(jdbcUrl, "jdbcUrl"); - this.credentials = Assert.argumentNotNull(credentials, "credentials"); + this.driverClass = Preconditions.checkNotNull(driverClass, "driverClass"); + this.jdbcUrl = Preconditions.checkNotNull(jdbcUrl, "jdbcUrl"); + Preconditions.checkArgument(jdbcUrl.length() > 0, "jdbcUrl"); + this.credentials = Preconditions.checkNotNull(credentials, "credentials"); } @Override diff --git a/ripple-topology-elements-ssh/src/main/java/com/ripple/topology/elements/SFTPFileTransfer.java b/ripple-topology-elements-ssh/src/main/java/com/ripple/topology/elements/SFTPFileTransfer.java index 1ca7cf4..97bbdf8 100644 --- a/ripple-topology-elements-ssh/src/main/java/com/ripple/topology/elements/SFTPFileTransfer.java +++ b/ripple-topology-elements-ssh/src/main/java/com/ripple/topology/elements/SFTPFileTransfer.java @@ -1,6 +1,7 @@ package com.ripple.topology.elements; -import com.ripple.runtime.Assert; +import com.google.common.base.Preconditions; + import java.util.Objects; /** @@ -16,8 +17,10 @@ public SFTPFileTransfer() { } public SFTPFileTransfer(final String source, final String destination) { - this.source = Assert.argumentNotBlank(source, "source"); - this.destination = Assert.argumentNotBlank(destination, "destination"); + this.source = Preconditions.checkNotNull(source, "source"); + Preconditions.checkArgument(source.length() > 0); + this.destination = Preconditions.checkNotNull(destination, "destination"); + Preconditions.checkArgument(destination.length() > 0); } public String getSource() { diff --git a/ripple-topology-spring/src/main/java/com/ripple/topology/spring/LoadTopology.java b/ripple-topology-spring/src/main/java/com/ripple/topology/spring/LoadTopology.java index 99301b2..5206ded 100644 --- a/ripple-topology-spring/src/main/java/com/ripple/topology/spring/LoadTopology.java +++ b/ripple-topology-spring/src/main/java/com/ripple/topology/spring/LoadTopology.java @@ -9,9 +9,6 @@ import java.lang.annotation.Target; import org.springframework.context.annotation.Import; -/** - * @author jfulton - */ @Target(ElementType.TYPE) @Repeatable(LoadTopology.List.class) @Retention(RetentionPolicy.RUNTIME) diff --git a/ripple-topology-spring/src/main/java/com/ripple/topology/spring/LoadTopologyConfigurator.java b/ripple-topology-spring/src/main/java/com/ripple/topology/spring/LoadTopologyConfigurator.java index cd251bc..7579bef 100644 --- a/ripple-topology-spring/src/main/java/com/ripple/topology/spring/LoadTopologyConfigurator.java +++ b/ripple-topology-spring/src/main/java/com/ripple/topology/spring/LoadTopologyConfigurator.java @@ -18,9 +18,6 @@ import org.springframework.core.io.ResourceLoader; import org.springframework.core.type.AnnotationMetadata; -/** - * @author jfulton - */ public class LoadTopologyConfigurator implements ImportBeanDefinitionRegistrar, ResourceLoaderAware { private static final Logger logger = LoggerFactory.getLogger(LoadTopologyConfigurator.class); diff --git a/ripple-topology-spring/src/main/java/com/ripple/topology/spring/util/TopologySynchronousLifecycleManager.java b/ripple-topology-spring/src/main/java/com/ripple/topology/spring/util/TopologySynchronousLifecycleManager.java index 2f640fb..66cbf14 100644 --- a/ripple-topology-spring/src/main/java/com/ripple/topology/spring/util/TopologySynchronousLifecycleManager.java +++ b/ripple-topology-spring/src/main/java/com/ripple/topology/spring/util/TopologySynchronousLifecycleManager.java @@ -2,9 +2,6 @@ import com.ripple.topology.Topology; -/** - * @author jfulton - */ public class TopologySynchronousLifecycleManager { private Topology topology; diff --git a/ripple-topology-spring/src/test/java/com/ripple/topology/spring/LoadTopologyConfiguratorFactoryTest.java b/ripple-topology-spring/src/test/java/com/ripple/topology/spring/LoadTopologyConfiguratorFactoryTest.java index 15ab88d..9808fb8 100644 --- a/ripple-topology-spring/src/test/java/com/ripple/topology/spring/LoadTopologyConfiguratorFactoryTest.java +++ b/ripple-topology-spring/src/test/java/com/ripple/topology/spring/LoadTopologyConfiguratorFactoryTest.java @@ -13,9 +13,6 @@ import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.testng.annotations.Test; -/** - * @author jfulton - */ @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") @Configuration @LoadTopology(name = "topology", factory = SimpleTopology.class) diff --git a/ripple-topology-spring/src/test/java/com/ripple/topology/spring/LoadTopologyConfiguratorMultipleTopologiesTest.java b/ripple-topology-spring/src/test/java/com/ripple/topology/spring/LoadTopologyConfiguratorMultipleTopologiesTest.java index 980ffbd..3014b29 100644 --- a/ripple-topology-spring/src/test/java/com/ripple/topology/spring/LoadTopologyConfiguratorMultipleTopologiesTest.java +++ b/ripple-topology-spring/src/test/java/com/ripple/topology/spring/LoadTopologyConfiguratorMultipleTopologiesTest.java @@ -13,9 +13,6 @@ import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.testng.annotations.Test; -/** - * @author jfulton - */ @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") @Configuration @LoadTopology.List({ diff --git a/ripple-topology-spring/src/test/java/com/ripple/topology/spring/LoadTopologyConfiguratorYamlTest.java b/ripple-topology-spring/src/test/java/com/ripple/topology/spring/LoadTopologyConfiguratorYamlTest.java index 7a093d7..f7cb982 100644 --- a/ripple-topology-spring/src/test/java/com/ripple/topology/spring/LoadTopologyConfiguratorYamlTest.java +++ b/ripple-topology-spring/src/test/java/com/ripple/topology/spring/LoadTopologyConfiguratorYamlTest.java @@ -13,9 +13,6 @@ import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.testng.annotations.Test; -/** - * @author jfulton - */ @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") @Configuration @LoadTopology(name = "topology", yaml = "classpath:/simple-topology.yaml") diff --git a/ripple-topology-spring/src/test/java/com/ripple/topology/spring/SimpleTopology.java b/ripple-topology-spring/src/test/java/com/ripple/topology/spring/SimpleTopology.java index 7fc8276..5aee5a4 100644 --- a/ripple-topology-spring/src/test/java/com/ripple/topology/spring/SimpleTopology.java +++ b/ripple-topology-spring/src/test/java/com/ripple/topology/spring/SimpleTopology.java @@ -7,9 +7,6 @@ import com.ripple.topology.elements.StaticHttpUrl; import okhttp3.HttpUrl; -/** - * @author jfulton - */ public class SimpleTopology implements TopologyFactory { @Override diff --git a/ripple-topology-ui/pom.xml b/ripple-topology-ui/pom.xml index 6634761..9b3381b 100644 --- a/ripple-topology-ui/pom.xml +++ b/ripple-topology-ui/pom.xml @@ -21,11 +21,6 @@ ripple-topology-core ${project.version} - - - com.ripple.libraries - ripple-spring-server - com.fasterxml.jackson.core jackson-core @@ -46,12 +41,31 @@ com.fasterxml.jackson.datatype jackson-datatype-guava - + + org.slf4j + jul-to-slf4j + + + org.eclipse.jetty.websocket + websocket-server + 9.4.19.v20190610 + javax.servlet javax.servlet-api - 3.0.1 - compile + 3.1.0 + + + org.springframework + spring-core + + + org.springframework + spring-web + + + org.springframework + spring-webmvc org.thymeleaf diff --git a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/TopologyUI.java b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/TopologyUI.java index e138b17..8b6c0fb 100644 --- a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/TopologyUI.java +++ b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/TopologyUI.java @@ -1,7 +1,7 @@ package com.ripple.topology.ui; +import com.ripple.topology.ui.server.config.SpringServer; import com.ripple.topology.ui.server.config.TopologyUIConfig; -import com.ripple.libraries.server.spring.SpringServer; import com.ripple.topology.Topology; import java.util.Properties; import org.slf4j.Logger; @@ -10,9 +10,6 @@ import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.PropertiesPropertySource; -/** - * @author UI Archetype - */ public class TopologyUI extends SpringServer { private final Topology topology; diff --git a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/EmbeddedServerServletContextListener.java b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/EmbeddedServerServletContextListener.java new file mode 100644 index 0000000..8e743bf --- /dev/null +++ b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/EmbeddedServerServletContextListener.java @@ -0,0 +1,62 @@ +package com.ripple.topology.ui.server.config; + +import javax.servlet.ServletContext; +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.web.context.ContextLoader; +import org.springframework.web.context.ContextLoaderListener; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.GenericWebApplicationContext; + +/** + * This {@link ServletContextListener} is provided for use with embedded web servers, such as Jetty, in Java main + * projects where Spring-based servlets are being used. + *

+ * Spring-based servlets such as DispatcherServlet or Jersey's SpringServlet expect to find a {@link WebApplicationContext} + * registered in the Servlet Context in order to work properly. In a typical Spring war, a WebApplicationContext is + * created by registering a {@link ContextLoaderListener} with the Spring context file to load in the web.xml. While + * this is still possible to do with an embedded web server when configuring the server with Spring, the + * WebApplicationContext will be a new context independent of the one starting the web server, and will not have access + * to any of the Spring beans provided in the main Spring context. This may be OK in some circumstances, but prevents + * the possibility of having two jetty instances running with the same shared beans. + *

+ *

+ * When wired up as a ServletContextLister with a Jetty instance wired together using Spring, this class will create a + * new {@link WebApplicationContext} and set the main {@link ApplicationContext} as its parent, and then register the + * new web context within the Servlet Context. All Spring servlets, provided with their own configuration contexts, will + * now find the requisite WebApplicationContext with access to all beans defined in the main application context. + *

+ * + * @author Jimmie Fulton + */ +public class EmbeddedServerServletContextListener extends ContextLoader implements ServletContextListener, ApplicationContextAware { + + private ApplicationContext parent; + + public EmbeddedServerServletContextListener() { + super(new GenericWebApplicationContext()); + } + + @Override + public void contextInitialized(final ServletContextEvent servletContextEvent) { + initWebApplicationContext(servletContextEvent.getServletContext()); + } + + @Override + public void contextDestroyed(final ServletContextEvent servletContextEvent) { + closeWebApplicationContext(servletContextEvent.getServletContext()); + } + + @Override + public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException { + this.parent = applicationContext; + } + + @Override + protected ApplicationContext loadParentContext(final ServletContext servletContext) { + return parent; + } +} diff --git a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/JacksonConfig.java b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/JacksonConfig.java index 1e2e111..e7fff6d 100644 --- a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/JacksonConfig.java +++ b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/JacksonConfig.java @@ -10,9 +10,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -/** - * @author UI Archetype - */ @Configuration public class JacksonConfig { diff --git a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/JettyUtils.java b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/JettyUtils.java new file mode 100644 index 0000000..9366db0 --- /dev/null +++ b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/JettyUtils.java @@ -0,0 +1,57 @@ +package com.ripple.topology.ui.server.config; + +import javax.servlet.Servlet; +import org.eclipse.jetty.servlet.ServletHolder; +import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; +import org.springframework.web.servlet.DispatcherServlet; + +public class JettyUtils { + + /** + * Creates a Spring-aware Servlet, bootstrapped with a Spring configuration class. This results in a Servlet + * containing it's own private Spring context with the global Application-level context as its parent. + * + * @param name servlet name + * @param servletClass servlet class + * @param configClass Spring config class + * @return Jetty ServletHolder + */ + public static ServletHolder createServlet(String name, Class servletClass, Class configClass) { + final ServletHolder servletHolder = new ServletHolder(); + servletHolder.setName(name); + servletHolder.setClassName(servletClass.getCanonicalName()); + servletHolder.setInitParameter("contextClass", AnnotationConfigWebApplicationContext.class.getCanonicalName()); + servletHolder.setInitParameter("contextConfigLocation", configClass.getCanonicalName()); + servletHolder.setInitOrder(0); // Load on Startup + return servletHolder; + } + + /** + * Creates a DispatcherServlet configured with a Configuration class. + * + * @param name servlet name + * @param configClass Spring config class + * @return Jetty ServletHolder + */ + public static ServletHolder createServlet(String name, Class configClass) { + return createServlet(name, DispatcherServlet.class, configClass); + } + + /** + * Creates configures an instantiated DispatcherServlet with a Configuration class. + * + * @param name servlet name + * @param servlet DispatcherServlet + * @param configClass Spring config class + * @return Jetty ServletHolder + */ + public static ServletHolder createServlet(String name, DispatcherServlet servlet, Class configClass) { + final ServletHolder servletHolder = new ServletHolder(); + servletHolder.setName(name); + servletHolder.setServlet(servlet); + servlet.setContextClass(AnnotationConfigWebApplicationContext.class); + servlet.setContextConfigLocation(configClass.getCanonicalName()); + servletHolder.setInitOrder(0); // Load on Startup + return servletHolder; + } +} diff --git a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/Server.java b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/Server.java new file mode 100644 index 0000000..9010109 --- /dev/null +++ b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/Server.java @@ -0,0 +1,69 @@ +package com.ripple.topology.ui.server.config; + +import org.slf4j.Logger; +import org.slf4j.bridge.SLF4JBridgeHandler; + +import java.util.concurrent.atomic.AtomicBoolean; + +/** + * @deprecated Will be removed once this UI is updated to use SpringBoot. + */ +@Deprecated +public abstract class Server { + private final AtomicBoolean stopping = new AtomicBoolean(false); + private final Thread shutdownThread = new Thread(() -> { + this.stop(true); + }); + + public Server() { + } + + public final Server start() { + this.getLogger().info("Server starting..."); + this.registerShutdownHook(); + this.onBeginStart(); + this.getLogger().info("Server started successfully."); + return this; + } + + public final void stop() { + this.stop(false); + } + + private void stop(boolean initiatedFromHook) { + if (!this.stopping.getAndSet(true)) { + this.getLogger().info("Server shutting down..."); + + try { + this.onBeginShutdown(); + this.getLogger().info("Server shut down successfully"); + if (!initiatedFromHook) { + Runtime.getRuntime().removeShutdownHook(this.shutdownThread); + } + + this.stopping.set(false); + } catch (Exception var3) { + throw new RuntimeException("Server failure during shut down", var3); + } + } + + } + + protected void onBeginShutdown() { + } + + protected void onBeginStart() { + } + + protected abstract Logger getLogger(); + + private void registerShutdownHook() { + Runtime.getRuntime().addShutdownHook(this.shutdownThread); + } + + static { + System.setProperty("user.timezone", "UTC"); + SLF4JBridgeHandler.removeHandlersForRootLogger(); + SLF4JBridgeHandler.install(); + } +} diff --git a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/SpringServer.java b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/SpringServer.java new file mode 100644 index 0000000..1aec858 --- /dev/null +++ b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/SpringServer.java @@ -0,0 +1,43 @@ +package com.ripple.topology.ui.server.config; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; + +import java.util.Objects; + +/** + * @deprecated Will be removed once this UI is updated to use SpringBoot. + */ +@Deprecated +public class SpringServer extends Server { + + private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); + + public SpringServer(Class configuration, Class... configurations) { + this.context.register(Objects.requireNonNull(configuration)); + for (Class config : configurations) { + this.context.register(config); + } + } + + public ApplicationContext getContext() { + return context; + } + + @Override + protected void onBeginStart() { + context.refresh(); + } + + @Override + protected void onBeginShutdown() { + context.close(); + } + + @Override + protected Logger getLogger() { + return LoggerFactory.getLogger(SpringServer.class); + } +} diff --git a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/TopologyUIConfig.java b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/TopologyUIConfig.java index 1d0645a..87d4b1a 100644 --- a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/TopologyUIConfig.java +++ b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/TopologyUIConfig.java @@ -1,18 +1,14 @@ package com.ripple.topology.ui.server.config; -import com.ripple.spring.config.RuntimeModePropertySourceFactory; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.PropertySource; -/** - * @author UI Archetype - */ @Configuration @Import({ - TopologyUIRestEndpointConfig.class, + TopologyUIRestEndpointConfig.class, }) -@PropertySource(value = "classpath:/topology-ui.properties", factory = RuntimeModePropertySourceFactory.class) +@PropertySource(value = "classpath:/topology-ui.properties") public class TopologyUIConfig { } diff --git a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/TopologyUIRestEndpointConfig.java b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/TopologyUIRestEndpointConfig.java index de4507a..55f191a 100644 --- a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/TopologyUIRestEndpointConfig.java +++ b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/TopologyUIRestEndpointConfig.java @@ -1,9 +1,7 @@ package com.ripple.topology.ui.server.config; -import static com.ripple.libraries.server.jetty.JettyUtils.createServlet; +import static com.ripple.topology.ui.server.config.JettyUtils.createServlet; -import com.ripple.libraries.server.spring.EmbeddedServerServletContextListener; -import javax.annotation.PostConstruct; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; @@ -20,9 +18,8 @@ import org.springframework.core.io.ClassPathResource; import org.springframework.web.servlet.DispatcherServlet; -/** - * @author UI Archetype - */ +import javax.annotation.PostConstruct; + @Configuration public class TopologyUIRestEndpointConfig { diff --git a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/TopologyUIRestWebConfig.java b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/TopologyUIRestWebConfig.java index ce7370a..2bf39e0 100644 --- a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/TopologyUIRestWebConfig.java +++ b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/TopologyUIRestWebConfig.java @@ -1,7 +1,6 @@ package com.ripple.topology.ui.server.config; import com.fasterxml.jackson.databind.ObjectMapper; -import com.ripple.runtime.RuntimeMode; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; @@ -23,9 +22,6 @@ import org.thymeleaf.templatemode.TemplateMode; import org.thymeleaf.templateresolver.ITemplateResolver; -/** - * @author UI Archetype - */ @Configuration @EnableWebMvc @ComponentScan("com.ripple.topology.ui.server.rest.controllers") @@ -80,9 +76,6 @@ private ITemplateResolver templateResolver() { resolver.setPrefix("/"); resolver.setSuffix(".html"); resolver.setTemplateMode(TemplateMode.HTML); - if (RuntimeMode.isDevelopmentMode()) { - resolver.setCacheable(false); - } return resolver; } diff --git a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/rest/controllers/ResourceInfo.java b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/rest/controllers/ResourceInfo.java index 4e789b8..6b8059c 100644 --- a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/rest/controllers/ResourceInfo.java +++ b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/rest/controllers/ResourceInfo.java @@ -2,9 +2,6 @@ import java.util.Objects; -/** - * @author jfulton - */ public class ResourceInfo { private String key; diff --git a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/rest/controllers/RootController.java b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/rest/controllers/RootController.java index 4a17132..db28617 100644 --- a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/rest/controllers/RootController.java +++ b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/rest/controllers/RootController.java @@ -12,9 +12,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; -/** - * @author UI Archetype - */ @Controller @RequestMapping("/") public class RootController { diff --git a/ripple-topology-ui/src/main/resources/topology-ui-defaults.properties b/ripple-topology-ui/src/main/resources/topology-ui.properties similarity index 100% rename from ripple-topology-ui/src/main/resources/topology-ui-defaults.properties rename to ripple-topology-ui/src/main/resources/topology-ui.properties diff --git a/ripple-topology-ui/src/test/java/com/ripple/topology/ui/TopologyServerMain.java b/ripple-topology-ui/src/test/java/com/ripple/topology/ui/TopologyServerMain.java index ec4afe3..b1766cd 100644 --- a/ripple-topology-ui/src/test/java/com/ripple/topology/ui/TopologyServerMain.java +++ b/ripple-topology-ui/src/test/java/com/ripple/topology/ui/TopologyServerMain.java @@ -9,9 +9,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * @author jfulton - */ public class TopologyServerMain { private static final Logger logger = LoggerFactory.getLogger(TopologyServerMain.class); From 975a4cad3b7822b60ff80d9bb564a6acf59f9138 Mon Sep 17 00:00:00 2001 From: sappenin Date: Tue, 6 Aug 2019 09:44:38 -0600 Subject: [PATCH 2/3] Remove unused dependency Signed-off-by: sappenin --- ripple-topology-elements-aws/pom.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ripple-topology-elements-aws/pom.xml b/ripple-topology-elements-aws/pom.xml index b01f1a6..0608a4c 100644 --- a/ripple-topology-elements-aws/pom.xml +++ b/ripple-topology-elements-aws/pom.xml @@ -24,9 +24,5 @@ software.amazon.awssdk rds
- - - - From 661d685ca335b0c27566e945c5ecb6e6f7e7bef1 Mon Sep 17 00:00:00 2001 From: MatthewPhinney Date: Fri, 16 Aug 2019 12:36:24 -0700 Subject: [PATCH 3/3] Misc cleanup --- .circleci/config.yml | 10 +++++----- pom.xml | 1 - .../config/EmbeddedServerServletContextListener.java | 1 - 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c193535..6615d23 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,18 +39,18 @@ jobs: - run: name: Save test results command: | - mkdir -p ~/junit/ - find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/junit/ \; + mkdir -p ~/testng/ + find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/testng/ \; mkdir -p ~/checkstyle/ - find . -type f -regex ".*/target/checkstyle-reports/.*xml" -exec cp {} ~/junit/ \; + find . -type f -regex ".*/target/checkstyle-reports/.*xml" -exec cp {} ~/testng/ \; when: always - store_test_results: - path: ~/junit + path: ~/testng - store_artifacts: - path: ~/junit + path: ~/testng # publish the coverage report to codecov.io diff --git a/pom.xml b/pom.xml index d946131..4035335 100644 --- a/pom.xml +++ b/pom.xml @@ -268,7 +268,6 @@ maven-surefire-plugin 2.22.2 - @{argLine} -Xms1024m -Xmx2048m true false diff --git a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/EmbeddedServerServletContextListener.java b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/EmbeddedServerServletContextListener.java index 8e743bf..89588ac 100644 --- a/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/EmbeddedServerServletContextListener.java +++ b/ripple-topology-ui/src/main/java/com/ripple/topology/ui/server/config/EmbeddedServerServletContextListener.java @@ -30,7 +30,6 @@ * now find the requisite WebApplicationContext with access to all beans defined in the main application context. *

* - * @author Jimmie Fulton */ public class EmbeddedServerServletContextListener extends ContextLoader implements ServletContextListener, ApplicationContextAware {