diff --git a/samples/aws-s3/README.md b/samples/aws-s3/README.md deleted file mode 100644 index 36cf57d..0000000 --- a/samples/aws-s3/README.md +++ /dev/null @@ -1,62 +0,0 @@ -Spring Integration - Amazon S3 Sample -===================================== - -## Introduction - -This sample demonstrate the usage of the *Spring Integration* support for -[Amazon Simple Storage Service][] (Amazon S3). The sample covers 2 use-cases: - -* **Upload** a file to Amazon S3 using the *s3-outbound-channel-adapter* -* **Poll** files from Amazon S3 using the *s3-inbound-channel-adapter* - -## How to Run the Sample - -You can execute this sample simply via [Maven][]: - - $ mvn clean package exec:java - -Once executed you should see the following screen: - - ========================================================= - - Welcome to the Spring Integration Amazon S3 Sample - - For more information please visit: - https://github.com/SpringSource/spring-integration-extensions - - ========================================================= - What would you like to do? - 1. Upload a file to Amazon S3 - 2. Poll files from Amazon S3 - q. Quit the application - > - -Once you have selected either **Option 1** or **Option 2**, you will be asked to -provide the **Access Key ID** and the **Secret Access Key** for *Amazon Web Services*. - -You may also consider providing the **Access Key ID** and the **Secret Access Key** -via the command line: - - $ mvn clean package exec:java -DaccessKey=12345 -DsecretKey=12345 - -In that case you will not be asked to provide that information again. - -## s3-outbound-channel-adapter - -When you selected the option to upload a file you will be asked to specify the file you would like to upload: - - Please enter the path to the file you want to upload: - -Enter a path such as `/demo/data/myfile.txt`. - -## s3-inbound-channel-adapter - -The polled files will be stored under `s3-local-storage`. - --------------------------------------------------------------------------------- - -For help please take a look at the [Spring Integration documentation][] - -[Amazon Simple Storage Service]: https://aws.amazon.com/s3/ -[Maven]: https://maven.apache.org/ -[Spring Integration documentation]: https://www.springsource.org/spring-integration diff --git a/samples/aws-s3/pom.xml b/samples/aws-s3/pom.xml deleted file mode 100644 index 20142a1..0000000 --- a/samples/aws-s3/pom.xml +++ /dev/null @@ -1,112 +0,0 @@ - - 4.0.0 - - org.springframework.integration.samples - aws-s3 - 1.0.0.BUILD-SNAPSHOT - jar - - aws-s3 - https://www.springsource.org/spring-integration - - - 2.2.1 - - - - UTF-8 - 2.2.1.RELEASE - 0.5.0.BUILD-SNAPSHOT - 1.2.17 - 4.11 - - - - - repo.springsource.org.milestone - Spring Framework Maven Milestone Repository - https://repo.springsource.org/libs-snapshot - - - - - - - maven-eclipse-plugin - 2.9 - - - org.springframework.ide.eclipse.core.springnature - - - org.springframework.ide.eclipse.core.springbuilder - - true - true - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.0 - - 1.6 - 1.6 - -Xlint:all - true - true - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - org.springframework.integration.samples.aws.s3.Main - - - - - - - - - - - junit - junit - ${junit.version} - test - - - - - - org.springframework.integration - spring-integration-core - ${spring.integration.version} - - - - org.springframework.integration - spring-integration-file - ${spring.integration.version} - - - - org.springframework.integration - spring-integration-aws - ${spring.integration.aws.version} - - - - - - log4j - log4j - ${log4j.version} - - - - diff --git a/samples/aws-s3/s3-local-storage/polled_files_go_here.txt b/samples/aws-s3/s3-local-storage/polled_files_go_here.txt deleted file mode 100644 index e69de29..0000000 diff --git a/samples/aws-s3/src/main/java/org/springframework/integration/samples/aws/s3/Main.java b/samples/aws-s3/src/main/java/org/springframework/integration/samples/aws/s3/Main.java deleted file mode 100644 index 55f1dbc..0000000 --- a/samples/aws-s3/src/main/java/org/springframework/integration/samples/aws/s3/Main.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2002-2013 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration.samples.aws.s3; - -import java.io.File; -import java.util.Scanner; - -import org.apache.log4j.Logger; -import org.springframework.context.support.GenericXmlApplicationContext; -import org.springframework.core.env.ConfigurableEnvironment; -import org.springframework.integration.MessageChannel; -import org.springframework.integration.support.MessageBuilder; - -/** - * Starts the Spring Context and will initialize the Spring Integration routes. - * - * @author Gunnar Hillert - * @since 1.0 - * - */ -public final class Main { - - private static final Logger LOGGER = Logger.getLogger(Main.class); - - private static final String HORIZONTAL_LINE = "\n========================================================="; - - private Main() { } - - /** - * Load the Spring Integration Application Context - * - * @param args - command line arguments - */ - public static void main(final String... args) { - - final Scanner scanner = new Scanner(System.in); - - if (LOGGER.isInfoEnabled()) { - LOGGER.info(HORIZONTAL_LINE - + "\n " - + "\n Welcome to the Spring Integration Amazon S3 Sample " - + "\n " - + "\n For more information please visit: " - + "\nhttps://github.com/SpringSource/spring-integration-extensions" - + "\n " - + HORIZONTAL_LINE ); - } - - final GenericXmlApplicationContext context = new GenericXmlApplicationContext(); - final ConfigurableEnvironment environment = context.getEnvironment(); - - System.out.println("What would you like to do?"); - System.out.println("\t1. Upload a file to Amazon S3"); - System.out.println("\t2. Poll files from Amazon S3"); - System.out.println("\tq. Quit the application"); - System.out.print(" > "); - - String filePath; - - while (true) { - final String input = scanner.nextLine(); - - if("1".equals(input.trim())) { - - System.out.println("Uploading to Amazon S3..."); - - environment.setActiveProfiles("upload-to-s3"); - setupCredentials(environment, scanner); - setupS3info(environment, scanner); - - context.load("classpath:META-INF/spring/integration/*-context.xml"); - context.registerShutdownHook(); - context.refresh(); - - System.out.print("\nPlease enter the path to the file you want to upload: "); - filePath = scanner.nextLine(); - - final MessageChannel messageChannel = context.getBean("s3channel", MessageChannel.class); - messageChannel.send(MessageBuilder.withPayload(new File(filePath)).build()); - - break; - - } - else if("2".equals(input.trim())) { - - System.out.println("Polling files from Amazon S3..."); - environment.setActiveProfiles("poll-s3"); - setupCredentials(environment, scanner); - setupS3info(environment, scanner); - - context.load("classpath:META-INF/spring/integration/*-context.xml"); - context.registerShutdownHook(); - context.refresh(); - - } - else if("q".equals(input.trim())) { - System.out.println("Exiting application...bye."); - System.exit(0); - } - else { - System.out.println("Invalid choice\n\n"); - System.out.print("Enter you choice: "); - } - } - - - if (LOGGER.isInfoEnabled()) { - LOGGER.info("Exiting application...bye."); - } - - System.exit(0); - - } - - private static void setupCredentials(ConfigurableEnvironment environment, Scanner scanner) { - if (!environment.containsProperty("accessKey")) { - System.out.print("\nPlease enter your Access Key ID: "); - final String accessKey = scanner.nextLine(); - environment.getSystemProperties().put("accessKey", accessKey); - } - - if (!environment.containsProperty("secretKey")) { - System.out.print("\nPlease enter your Secret Access Key: "); - final String secretKey = scanner.nextLine(); - environment.getSystemProperties().put("secretKey", secretKey); - } - } - - private static void setupS3info(ConfigurableEnvironment environment, Scanner scanner) { - if (!environment.containsProperty("bucket")) { - System.out.print("\nWhich bucket do you want to use? "); - final String bucket = scanner.nextLine(); - environment.getSystemProperties().put("bucket", bucket); - } - - if (!environment.containsProperty("remoteDirectory")) { - System.out.print("\nPlease enter the S3 remote directory to use: "); - final String remoteDirectory = scanner.nextLine(); - environment.getSystemProperties().put("remoteDirectory", remoteDirectory); - } - } -} diff --git a/samples/aws-s3/src/main/resources/META-INF/spring/integration/spring-integration-context.xml b/samples/aws-s3/src/main/resources/META-INF/spring/integration/spring-integration-context.xml deleted file mode 100644 index 1ca39bb..0000000 --- a/samples/aws-s3/src/main/resources/META-INF/spring/integration/spring-integration-context.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/aws-s3/src/main/resources/log4j.xml b/samples/aws-s3/src/main/resources/log4j.xml deleted file mode 100644 index 5ae5943..0000000 --- a/samples/aws-s3/src/main/resources/log4j.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/kafka/.gitignore b/samples/kafka/.gitignore deleted file mode 100644 index 38b0df2..0000000 --- a/samples/kafka/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -derby.log - diff --git a/samples/kafka/README.md b/samples/kafka/README.md deleted file mode 100644 index d4cb9b3..0000000 --- a/samples/kafka/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Spring Integration Kafka Sample -================================ - -This sample demonstrates the usage of the *[Spring Integration Kafka][]* adapters. - diff --git a/samples/kafka/build.gradle b/samples/kafka/build.gradle deleted file mode 100644 index 9c2f052..0000000 --- a/samples/kafka/build.gradle +++ /dev/null @@ -1,92 +0,0 @@ -description = 'Spring Integration Kafka Sample' - -buildscript { - repositories { - maven { url 'https://repo.maven.apache.org/maven2/' } - //mavenLocal() - maven { url 'https://repo.spring.io/simple/ext-release-local' } - } - dependencies { - classpath 'org.apache.maven:maven-artifact:2.2.1' // 3.x won't work - classpath 'org.apache.avro:avro-compiler:1.7.3' // use Avro 1.7.4 to compile the Avro files - //classpath 'org.clojars.miguno:avro-gradle-plugin:1.7.2' - classpath "org.apache.avro:avro-gradle-plugin:1.7.2" - } -} - -apply plugin: 'base' -apply plugin: 'java' -apply plugin: 'eclipse' -apply plugin: 'application' -apply plugin: 'idea' -apply plugin: 'maven' -apply plugin: 'avro-gradle-plugin' - -ext { - avroTaskGroup = "Avro" - avroSource = "schemas" - avroDest = "target/generated-avro-sources/main/java" -} - -repositories { - maven { - url 'https://repository.apache.org/content/groups/public' - } - maven { url 'https://repo.springsource.org/libs-milestone' } - mavenLocal() -} - -dependencies { - compile "org.springframework.integration:spring-integration-stream:$springIntegrationVersion" - compile("org.springframework.integration:spring-integration-kafka:$springIntegrationKafkaVersion") { - exclude module: 'log4j' - exclude module: 'jms' - exclude module: 'jmxtools' - exclude module: 'jmxri' - } - compile("log4j:log4j:1.2.15") { - exclude module: 'mail' - exclude module: 'jms' - exclude module: 'jmx' - exclude module: 'jmxtools' - exclude module: 'jmxri' - } - compile "commons-logging:commons-logging:1.1.1" -} - -compileAvro.group = avroTaskGroup -compileAvro.description = "Generates Java code from avro schema" -compileAvro.source = avroSource -compileAvro.destinationDir = file(avroDest) - -task cleanAvro(type: Delete) { - group = avroTaskGroup - description = "deletes generated avro code" - delete avroDest -} - -compileJava.dependsOn compileAvro - -sourceSets { - main { - java { - srcDir avroDest - } - resources { - srcDir avroSource - } - } -} - -task wrapper(type: Wrapper) { - description = 'Generates gradlew[.bat] scripts' - gradleVersion = '1.8' -} - -eclipse { - project { - name = "spring-integration-kafka-sample" - } -} - -defaultTasks 'clean', 'build' diff --git a/samples/kafka/gradle.properties b/samples/kafka/gradle.properties deleted file mode 100644 index d1a04db..0000000 --- a/samples/kafka/gradle.properties +++ /dev/null @@ -1,6 +0,0 @@ -springIntegrationVersion = 4.0.3.RELEASE -springIntegrationKafkaVersion = 1.0.0.BUILD-SNAPSHOT -version = 1.0.0.BUILD-SNAPSHOT - - - diff --git a/samples/kafka/gradle/wrapper/gradle-wrapper.jar b/samples/kafka/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 667288a..0000000 Binary files a/samples/kafka/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/samples/kafka/gradle/wrapper/gradle-wrapper.properties b/samples/kafka/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index dc5de8b..0000000 --- a/samples/kafka/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Tue Jul 22 17:46:28 EEST 2014 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-all.zip diff --git a/samples/kafka/gradlew b/samples/kafka/gradlew deleted file mode 100755 index 91a7e26..0000000 --- a/samples/kafka/gradlew +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/samples/kafka/gradlew.bat b/samples/kafka/gradlew.bat deleted file mode 100644 index aec9973..0000000 --- a/samples/kafka/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/samples/kafka/schemas/user.avdl b/samples/kafka/schemas/user.avdl deleted file mode 100644 index f8f9e8b..0000000 --- a/samples/kafka/schemas/user.avdl +++ /dev/null @@ -1,7 +0,0 @@ -@namespace("org.springframework.integration.samples.kafka.user") -protocol UserProtocol{ -record User { - string firstName; - string lastName; -} -} \ No newline at end of file diff --git a/samples/kafka/src/main/java/org/springframework/integration/samples/kafka/inbound/InboundRunner.java b/samples/kafka/src/main/java/org/springframework/integration/samples/kafka/inbound/InboundRunner.java deleted file mode 100644 index e00aece..0000000 --- a/samples/kafka/src/main/java/org/springframework/integration/samples/kafka/inbound/InboundRunner.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2002-2013 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration.samples.kafka.inbound; - -import org.springframework.context.support.ClassPathXmlApplicationContext; - -public class InboundRunner { - private static final String CONFIG = "kafkaInboundAdapterParserTests-context.xml"; - - public static void main(final String args[]) { - final ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(CONFIG, InboundRunner.class); - ctx.start(); - } -} diff --git a/samples/kafka/src/main/java/org/springframework/integration/samples/kafka/outbound/CustomPartitioner.java b/samples/kafka/src/main/java/org/springframework/integration/samples/kafka/outbound/CustomPartitioner.java deleted file mode 100644 index 07c948e..0000000 --- a/samples/kafka/src/main/java/org/springframework/integration/samples/kafka/outbound/CustomPartitioner.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2002-2013 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration.samples.kafka.outbound; - -import kafka.producer.Partitioner; - -/** - * @author Soby Chacko - * - * This class is for internal use only and therefore is at default access level - */ -class CustomPartitioner implements Partitioner { - /** - * Uses the key to calculate a partition bucket id for routing - * the data to the appropriate broker partition - * @return an integer between 0 and numPartitions-1 - */ - @Override - public int partition(final Object key, final int numPartitions) { - final String s = (String) key; - final Integer i = Integer.parseInt(s); - return i % numPartitions; - } -} diff --git a/samples/kafka/src/main/java/org/springframework/integration/samples/kafka/outbound/OutboundRunner.java b/samples/kafka/src/main/java/org/springframework/integration/samples/kafka/outbound/OutboundRunner.java deleted file mode 100644 index 468ae7a..0000000 --- a/samples/kafka/src/main/java/org/springframework/integration/samples/kafka/outbound/OutboundRunner.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2002-2013 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration.samples.kafka.outbound; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.integration.samples.kafka.user.User; -import org.springframework.integration.support.MessageBuilder; -import org.springframework.messaging.MessageChannel; - -public class OutboundRunner { - private static final String CONFIG = "kafkaOutboundAdapterParserTests-context.xml"; - private static final Log LOG = LogFactory.getLog(OutboundRunner.class); - - public static void main(final String args[]) { - final ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(CONFIG, OutboundRunner.class); - ctx.start(); - - final MessageChannel channel = ctx.getBean("inputToKafka", MessageChannel.class); - LOG.info(channel.getClass()); - - //sending 100,000 messages to Kafka server for topic test1 - for (int i = 0; i < 500; i++) { - final User user = new User(); - user.setFirstName("fname" + i); - user.setLastName("lname" + i); - channel.send( - MessageBuilder.withPayload(user) - .setHeader("messageKey", String.valueOf(i)) - .setHeader("topic", "test1").build()); - - LOG.info("message sent " + i); - } - - //sending 5,000 messages to kafka server for topic test2 - for (int i = 0; i < 50; i++) { - channel.send( - MessageBuilder.withPayload("hello Fom ob adapter test2 - " + i) - .setHeader("messageKey", String.valueOf(i)) - .setHeader("topic", "test2").build()); - - LOG.info("message sent " + i); - } - - //Send some messages to multiple topics matching regex. - for (int i = 0; i < 10; i++) { - channel.send( - MessageBuilder.withPayload("hello Fom ob adapter regextopic1 - " + i) - .setHeader("messageKey", String.valueOf(i)) - .setHeader("topic", "regextopic1").build()); - - LOG.info("message sent " + i); - } - for (int i = 0; i < 10; i++) { - channel.send( - MessageBuilder.withPayload("hello Fom ob adapter regextopic2 - " + i) - .setHeader("messageKey", String.valueOf(i)) - .setHeader("topic", "regextopic2").build()); - - LOG.info("message sent " + i); - } - } -} diff --git a/samples/kafka/src/main/java/org/springframework/integration/samples/kafka/outbound/PartitionlessTransformer.java b/samples/kafka/src/main/java/org/springframework/integration/samples/kafka/outbound/PartitionlessTransformer.java deleted file mode 100644 index 7da06c4..0000000 --- a/samples/kafka/src/main/java/org/springframework/integration/samples/kafka/outbound/PartitionlessTransformer.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2002-2013 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration.samples.kafka.outbound; - -import org.springframework.integration.support.MessageBuilder; -import org.springframework.integration.transformer.Transformer; -import org.springframework.messaging.Message; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @author Soby Chacko - */ -public class PartitionlessTransformer implements Transformer { - @Override - @SuppressWarnings("unchecked") - public Message transform(final Message message) { - - final Map>> origData = - (Map>>) message.getPayload(); - - final Map> nonPartitionedData = new HashMap<>(); - - for(final String topic : origData.keySet()) { - final Map> partitionedData = origData.get(topic); - final Collection> nonPartitionedDataFromTopic = partitionedData.values(); - - final List mergedList = new ArrayList<>(); - - for (final List l : nonPartitionedDataFromTopic){ - mergedList.addAll(l); - } - - nonPartitionedData.put(topic, mergedList); - } - - return MessageBuilder.withPayload(nonPartitionedData).build(); - } -} diff --git a/samples/kafka/src/main/java/org/springframework/integration/samples/kafka/outbound/UserTransformer.java b/samples/kafka/src/main/java/org/springframework/integration/samples/kafka/outbound/UserTransformer.java deleted file mode 100644 index 093bbcb..0000000 --- a/samples/kafka/src/main/java/org/springframework/integration/samples/kafka/outbound/UserTransformer.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.springframework.integration.samples.kafka.outbound; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.integration.samples.kafka.user.User; -import org.springframework.integration.support.MessageBuilder; -import org.springframework.integration.transformer.Transformer; -import org.springframework.messaging.Message; - -/** - * @author Soby Chacko - */ -public class UserTransformer implements Transformer { - - Log logger = LogFactory.getLog(getClass()); - - @Override - public Message transform(Message message) { - if(message.getPayload().getClass().isAssignableFrom(User.class)) { - User user = (User) message.getPayload(); - user.setFirstName(user.getFirstName().toString()+user.getFirstName()); - logger.info("user confirmed " + user.getFirstName()); - return MessageBuilder.withPayload(user).copyHeaders(message.getHeaders()).build(); - } - return message; - } -} diff --git a/samples/kafka/src/main/resources/log4j.properties b/samples/kafka/src/main/resources/log4j.properties deleted file mode 100644 index 3c84b67..0000000 --- a/samples/kafka/src/main/resources/log4j.properties +++ /dev/null @@ -1,10 +0,0 @@ -log4j.rootCategory=WARN, stdout - -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss.SSS} %-5p [%t][%c] %m%n - -#log4j.category.org.springframework.integration=WARN -log4j.category.org.springframework.integration.kafka=INFO -log4j.category.org.springframework.integration.samples.kafka=INFO -log4j.category.kafka.consumer=ERROR diff --git a/samples/kafka/src/main/resources/org/springframework/integration/samples/kafka/inbound/kafkaInboundAdapterParserTests-context.xml b/samples/kafka/src/main/resources/org/springframework/integration/samples/kafka/inbound/kafkaInboundAdapterParserTests-context.xml deleted file mode 100644 index ae8d96e..0000000 --- a/samples/kafka/src/main/resources/org/springframework/integration/samples/kafka/inbound/kafkaInboundAdapterParserTests-context.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - smallest - 10485760 - 5242880 - 1000 - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/kafka/src/main/resources/org/springframework/integration/samples/kafka/outbound/kafkaOutboundAdapterParserTests-context.xml b/samples/kafka/src/main/resources/org/springframework/integration/samples/kafka/outbound/kafkaOutboundAdapterParserTests-context.xml deleted file mode 100644 index a22c8ae..0000000 --- a/samples/kafka/src/main/resources/org/springframework/integration/samples/kafka/outbound/kafkaOutboundAdapterParserTests-context.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3600000 - 5 - 5242880 - - - - - - - - - - - - diff --git a/samples/mail-ses-integration/README.md b/samples/mail-ses-integration/README.md deleted file mode 100644 index 667fb78..0000000 --- a/samples/mail-ses-integration/README.md +++ /dev/null @@ -1,4 +0,0 @@ -AWS SES Spring Integration Sample -========================= - - diff --git a/samples/mail-ses-integration/pom.xml b/samples/mail-ses-integration/pom.xml deleted file mode 100644 index c00cf9a..0000000 --- a/samples/mail-ses-integration/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ - - 4.0.0 - org.springframework.integration.samples - mail-ses-integration - AWS SES Mail Demo - 1.0.0.BUILD-SNAPSHOT - - - 2.2.1 - - - - UTF-8 - 2.2.0.RELEASE - 1.2.17 - 4.10 - - - - org.springframework.integration - spring-integration-mail - ${spring.integration.version} - - - org.springframework.integration - spring-integration-test - ${spring.integration.version} - - - org.springframework.integration - spring-integration-aws - 0.5.0.BUILD-SNAPSHOT - - - log4j - log4j - ${log4j.version} - - - - junit - junit - ${junit.version} - test - - - org.subethamail - subethasmtp-wiser - 1.2 - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.5.1 - - 1.6 - 1.6 - -Xlint:all - true - true - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - org.springframework.integration.samples.mailses.Main - - - - - - - repo.springsource.org.milestone - SpringSource Maven Milestone Repository - https://repo.springsource.org/libs-milestone - - - \ No newline at end of file diff --git a/samples/mail-ses-integration/src/main/java/org/springframework/integration/samples/mailses/EmailService.java b/samples/mail-ses-integration/src/main/java/org/springframework/integration/samples/mailses/EmailService.java deleted file mode 100644 index a3a4050..0000000 --- a/samples/mail-ses-integration/src/main/java/org/springframework/integration/samples/mailses/EmailService.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.springframework.integration.samples.mailses; - -import org.springframework.integration.annotation.Header; -import org.springframework.integration.annotation.Payload; -import org.springframework.integration.mail.MailHeaders; - -public interface EmailService { - - - void send( - - @Header(MailHeaders.FROM) - String fromEmail, - - @Header(MailHeaders.TO) - String toEmail, - - @Header(MailHeaders.SUBJECT) - String subject, - - @Payload - String body); - -} diff --git a/samples/mail-ses-integration/src/main/java/org/springframework/integration/samples/mailses/Main.java b/samples/mail-ses-integration/src/main/java/org/springframework/integration/samples/mailses/Main.java deleted file mode 100644 index 1a0dded..0000000 --- a/samples/mail-ses-integration/src/main/java/org/springframework/integration/samples/mailses/Main.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2002-2013 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration.samples.mailses; - -import java.util.Scanner; - -import org.apache.log4j.Logger; -import org.springframework.context.support.GenericXmlApplicationContext; -import org.springframework.core.env.ConfigurableEnvironment; - -/** - * Starts the Spring Context and will initialize the Spring Integration routes. - * - * @author Gunnar Hillert - * @since 1.0 - * - */ -public final class Main { - - private static final Logger LOGGER = Logger.getLogger(Main.class); - - private static final String HORIZONTAL_LINE = "\n========================================================="; - - private Main() { - } - - /** - * Load the Spring Integration Application Context - * - * @param args - command line arguments - */ - public static void main(final String... args) { - - final Scanner scanner = new Scanner(System.in); - - LOGGER.info(HORIZONTAL_LINE + "\n" - + "\n Welcome to Spring Integration! " - + "\n" - + "\n For more information please visit: " - + "\n https://www.springsource.org/spring-integration " - + "\n" + HORIZONTAL_LINE); - - final GenericXmlApplicationContext context = new GenericXmlApplicationContext(); - final ConfigurableEnvironment environment = context.getEnvironment(); - - final String fromEmailAddress; - final String toEmailAddress; - final String subject; - final String body; - - System.out.print("\nFrom which email address would you like to send a message?: "); - fromEmailAddress = scanner.nextLine(); - - System.out.print("To which email address would you like to send a message?: "); - toEmailAddress = scanner.nextLine(); - - System.out.print("What is the subject line?: "); - subject = scanner.nextLine(); - - System.out.print("What is the body of the message?: "); - body = scanner.nextLine(); - - if (!environment.containsProperty("accessKey")) { - System.out.print("Please enter your access key: "); - final String accessKey = scanner.nextLine(); - environment.getSystemProperties().put("accessKey", accessKey); - } - - if (!environment.containsProperty("secretKey")) { - System.out.print("Please enter your secret key: "); - final String secretKey = scanner.nextLine(); - environment.getSystemProperties().put("secretKey", secretKey); - } - - context.load("classpath:META-INF/spring/integration/*-context.xml"); - context.registerShutdownHook(); - context.refresh(); - - final EmailService emailService = context.getBean(EmailService.class); - - emailService.send(fromEmailAddress, toEmailAddress, subject, body); - - System.out.println(String.format("The email to '%s' was sent successfully.", toEmailAddress)); - - System.exit(0); - - } -} diff --git a/samples/mail-ses-integration/src/main/resources/META-INF/spring/integration/spring-integration-context.xml b/samples/mail-ses-integration/src/main/resources/META-INF/spring/integration/spring-integration-context.xml deleted file mode 100644 index 0b30ba1..0000000 --- a/samples/mail-ses-integration/src/main/resources/META-INF/spring/integration/spring-integration-context.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/samples/mail-ses-integration/src/main/resources/log4j.xml b/samples/mail-ses-integration/src/main/resources/log4j.xml deleted file mode 100644 index 364cd81..0000000 --- a/samples/mail-ses-integration/src/main/resources/log4j.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/mail-ses/README.md b/samples/mail-ses/README.md deleted file mode 100644 index 35a1138..0000000 --- a/samples/mail-ses/README.md +++ /dev/null @@ -1,5 +0,0 @@ -AWS SES MailSender sample -========================= - -This sample uses a Spring-provided *JavaMailSender* to send emails. This application demonstrates that by only replacing the *JavaMailSender* XML bean declaration with the *DefaultAmazonSESMailSender*, existing applications can send emails using Amazon SES without changing application code. The *DefaultAmazonSESMailSender* is provided by the *Spring Integration Extensions AWS Module*. - diff --git a/samples/mail-ses/pom.xml b/samples/mail-ses/pom.xml deleted file mode 100644 index 1bebe16..0000000 --- a/samples/mail-ses/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ - - 4.0.0 - org.springframework.integration.samples - mail-ses - AWS SES Mail Demo - 1.0.0.BUILD-SNAPSHOT - - - 2.2.1 - - - - UTF-8 - 2.2.0.RELEASE - 1.2.17 - 4.10 - - - - org.springframework.integration - spring-integration-mail - ${spring.integration.version} - - - org.springframework.integration - spring-integration-test - ${spring.integration.version} - - - org.springframework.integration - spring-integration-aws - 0.5.0.BUILD-SNAPSHOT - - - log4j - log4j - ${log4j.version} - - - - junit - junit - ${junit.version} - test - - - org.subethamail - subethasmtp-wiser - 1.2 - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.5.1 - - 1.6 - 1.6 - -Xlint:all - true - true - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - org.springframework.integration.samples.mailses.Main - - - - - - - repo.springsource.org.milestone - SpringSource Maven Milestone Repository - https://repo.springsource.org/libs-milestone - - - \ No newline at end of file diff --git a/samples/mail-ses/src/main/java/org/springframework/integration/samples/mailses/Main.java b/samples/mail-ses/src/main/java/org/springframework/integration/samples/mailses/Main.java deleted file mode 100644 index f53b0e8..0000000 --- a/samples/mail-ses/src/main/java/org/springframework/integration/samples/mailses/Main.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright 2002-2012 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration.samples.mailses; - -import java.util.List; -import java.util.Scanner; - -import javax.mail.Message; -import javax.mail.MessagingException; -import javax.mail.internet.InternetAddress; -import javax.mail.internet.MimeMessage; - -import org.apache.log4j.Logger; -import org.springframework.context.support.GenericXmlApplicationContext; -import org.springframework.core.env.ConfigurableEnvironment; -import org.springframework.mail.MailException; -import org.springframework.mail.javamail.JavaMailSender; -import org.springframework.mail.javamail.MimeMessagePreparator; -import org.subethamail.wiser.Wiser; -import org.subethamail.wiser.WiserMessage; - -/** - * Starts the Spring Context and will initialize the Spring Integration routes. - * - * @author Gunnar Hillert - * @since 2.2 - * - */ -public final class Main { - - private static final Logger LOGGER = Logger.getLogger(Main.class); - - private static final String HORIZONTAL_LINE = "\n========================================================="; - - private Main() { - } - - /** - * Load the Spring Integration Application Context - * - * @param args - command line arguments - */ - public static void main(final String... args) { - - final Scanner scanner = new Scanner(System.in); - - LOGGER.info(HORIZONTAL_LINE + "\n" - + "\n Welcome to Spring Integration! " - + "\n" - + "\n For more information please visit: " - + "\n https://www.springsource.org/spring-integration " - + "\n" + HORIZONTAL_LINE); - - System.out.println("Please enter a choice and press : "); - System.out.println("\t1. Use Embedded SMTP Server (Wiser)"); - System.out.println("\t2. Use Amazon SES"); - - System.out.println("\tq. Quit the application"); - System.out.print("Enter your choice: "); - - final GenericXmlApplicationContext context = new GenericXmlApplicationContext(); - final ConfigurableEnvironment environment = context.getEnvironment(); - - boolean usingWiser = false; - - String toEmailAddress; - - while (true) { - final String input = scanner.nextLine(); - - if("1".equals(input.trim())) { - environment.setActiveProfiles("default"); - usingWiser = true; - - System.out.print("\nTo which email address would you like to send a message?: "); - toEmailAddress = scanner.nextLine(); - - break; - } else if("2".equals(input.trim())) { - environment.setActiveProfiles("aws"); - - if (!environment.containsProperty("accessKey")) { - System.out.print("\nPlease enter your access key: "); - final String accessKey = scanner.nextLine(); - environment.getSystemProperties().put("accessKey", accessKey); - } - - if (!environment.containsProperty("secretKey")) { - System.out.print("\nPlease enter your secret key: "); - final String secretKey = scanner.nextLine(); - environment.getSystemProperties().put("secretKey", secretKey); - } - System.out.print("\nTo which email address would you like to send a message?: "); - toEmailAddress = scanner.nextLine(); - - break; - } else if("q".equals(input.trim())) { - System.out.println("Exiting application...bye."); - System.exit(0); - } else { - System.out.println("Invalid choice\n\n"); - System.out.print("Enter you choice: "); - } - } - - context.load("classpath:META-INF/spring/integration/*-context.xml"); - context.registerShutdownHook(); - context.refresh(); - - final JavaMailSender ms = context.getBean(JavaMailSender.class); - final String toEmailAddressToUse = toEmailAddress; - final MimeMessagePreparator preparator = new MimeMessagePreparator() { - - public void prepare(MimeMessage mimeMessage) throws Exception { - - mimeMessage.setRecipient(Message.RecipientType.TO, - new InternetAddress(toEmailAddressToUse)); - mimeMessage.setFrom(new InternetAddress(toEmailAddressToUse)); - mimeMessage.setSubject("Testing Email - Subject"); - mimeMessage.setText("Hello World"); - } - - }; - - try { - ms.send(preparator); - } catch (MailException e) { - throw new IllegalStateException(e); - } - - System.out.println(String.format("The email to '%s' was sent successfully.", toEmailAddress)); - - if (usingWiser) { - Wiser wiser = context.getBean(Wiser.class); - List messages = wiser.getMessages(); - - final String from; - final String subject; - try { - from = messages.get(0).getMimeMessage().getFrom()[0].toString(); - subject = messages.get(0).getMimeMessage().getSubject(); - } catch (MessagingException e) { - throw new IllegalStateException(e); - } - - System.out.println(String.format("Wiser received an email from '%s' with subject '%s'", from, subject)); - } - - System.exit(0); - - } -} diff --git a/samples/mail-ses/src/main/resources/META-INF/spring/integration/spring-integration-context.xml b/samples/mail-ses/src/main/resources/META-INF/spring/integration/spring-integration-context.xml deleted file mode 100644 index d70bf05..0000000 --- a/samples/mail-ses/src/main/resources/META-INF/spring/integration/spring-integration-context.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/mail-ses/src/main/resources/log4j.xml b/samples/mail-ses/src/main/resources/log4j.xml deleted file mode 100644 index 364cd81..0000000 --- a/samples/mail-ses/src/main/resources/log4j.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/splunk/.gitignore b/samples/splunk/.gitignore deleted file mode 100644 index 38b0df2..0000000 --- a/samples/splunk/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -derby.log - diff --git a/samples/splunk/README.md b/samples/splunk/README.md deleted file mode 100644 index b1c4189..0000000 --- a/samples/splunk/README.md +++ /dev/null @@ -1,65 +0,0 @@ -Spring Integration Splunk Sample -================================ - -This sample demonstrates the usage of the *[Spring Integration Splunk][]* adapters. - -## Requirements - -### Splunk Server - -You need to install or have access to a [Splunk][] Server. You can download [Splunk][] from: - -* https://www.splunk.com/download - -#### Data Inputs - -Depending on your Splunk Server installation, you may have to open up a TCP by adding an additional *data input*. E.g. the sample uses TCP port **9999**. - -For instructions please see: - -* https://docs.splunk.com/Documentation/Splunk/latest/Data/Monitornetworkports - -### Spring Integration Splunk dependencies - -The sample application depends on the [Spring Integration Splunk][] support. As of Oct 1, 2012, the dependencies for *Spring Integration Splunk* are available through the [SpringSource Maven Repository][]: - -* https://repo.springsource.org/simple/libs-snapshot-local/org/springframework/integration/spring-integration-splunk/0.5.0.BUILD-SNAPSHOT - -However, if you prefer, you can manually build the *Spring Integration Splunk* project. In order order to do so, follow the following steps: - -1. Change to folder `spring-integration-extensions/spring-integration-splunk` -2. Execute `./gradlew publish` - -This should install the [Spring Integration Splunk] jar files to your local Maven repository. Please see the [Spring Integration Splunk][] project for further information. - -## Generate the Eclipse project: - -Now you can generate the Eclipse project for the provided sample: - -1. Change to folder `samples/splunk` -2. Execute `./gradlew eclipse` - -## Run the example applications - -1. Update the [Splunk][] server info in `src/main/resources/org/springframework/integration/samples/splunk/SplunkCommon-context.xml` -2. Run the main classes. - -You may want to run the *Outbound Channel Adapter* application first in order to push some data into [Splunk][]. After that, run the *Inbound Channel Adapter* application to read the data. - -### Outbound Channel Adapter - -* **Submit**: SplunkOutboundChannelAdapterSubmitSample -* **Tcp**: SplunkOutboundChannelAdapterTcpSample -* **Stream**: SplunkOutboundChannelAdapterStreamSample - -### Inbound Channel Adapter - -* **Blocking search**: SplunkInboundChannelAdapterBlockingSample -* **Non blocking search**: SplunkInboundChannelAdapterNonBlockingSample -* **Realtime search**: SplunkInboundChannelAdapterRealtimeSample -* **Export search**: SplunkInboundChannelAdapterExportSample -* **Saved search**: SplunkInboundChannelAdapterSavedSample - -[Splunk]: https://www.splunk.com/ -[Spring Integration Splunk]: https://github.com/SpringSource/spring-integration-extensions/tree/master/spring-integration-splunk -[SpringSource Maven Repository]: https://repo.springsource.org/ diff --git a/samples/splunk/build.gradle b/samples/splunk/build.gradle deleted file mode 100644 index d17e0b1..0000000 --- a/samples/splunk/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -description = 'Spring Integration Splunk Sample' -apply plugin: 'base' -apply plugin: 'java' -apply plugin: 'eclipse' -apply plugin: 'application' - -repositories { - mavenLocal() - maven { url "https://repo.springsource.org/libs-snapshot" } -} - -dependencies { - compile "org.springframework.integration:spring-integration-splunk:$springIntegrationSplunkVersion" - compile "org.springframework.integration:spring-integration-jdbc:$springIntegrationVersion" - compile "org.springframework:spring-jdbc:$springVersion" - compile "org.apache.derby:derby:$derbyVersion" -} - -task wrapper(type: Wrapper) { - description = 'Generates gradlew[.bat] scripts' - gradleVersion = '1.2' -} - -eclipse { - project { - name = "spring-integration-splunk-sample" - } -} - -defaultTasks 'clean', 'build' diff --git a/samples/splunk/gradle.properties b/samples/splunk/gradle.properties deleted file mode 100644 index 51566e1..0000000 --- a/samples/splunk/gradle.properties +++ /dev/null @@ -1,8 +0,0 @@ -springVersion = 3.1.2.RELEASE -springIntegrationVersion = 2.1.2.RELEASE -derbyVersion = 10.9.1.0 -springIntegrationSplunkVersion = 0.5.0.BUILD-SNAPSHOT -version = 0.5.0.BUILD-SNAPSHOT - - - diff --git a/samples/splunk/gradle/wrapper/gradle-wrapper.jar b/samples/splunk/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index e3b3376..0000000 Binary files a/samples/splunk/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/samples/splunk/gradle/wrapper/gradle-wrapper.properties b/samples/splunk/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index a2f8098..0000000 --- a/samples/splunk/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Sep 28 16:40:22 CST 2012 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-1.2-bin.zip diff --git a/samples/splunk/gradlew b/samples/splunk/gradlew deleted file mode 100644 index cf12650..0000000 --- a/samples/splunk/gradlew +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" -APP_HOME="`pwd -P`" -cd "$SAVED" - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query businessSystem maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/samples/splunk/gradlew.bat b/samples/splunk/gradlew.bat deleted file mode 100644 index 8a0b282..0000000 --- a/samples/splunk/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkDataHandler.java b/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkDataHandler.java deleted file mode 100644 index 6c9bbb4..0000000 --- a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkDataHandler.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2011-2012 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration.samples.splunk.inbound; - -import java.util.List; - -import org.springframework.integration.annotation.ServiceActivator; -import org.springframework.integration.splunk.entity.SplunkData; -import org.springframework.stereotype.Component; - -/** - * @author Jarred Li - * @since 1.0 - * - */ -@Component -public class SplunkDataHandler { - - @ServiceActivator - public void handle(List data) { - for (SplunkData sd : data) { - System.out.println("splunk data:" + sd.toString()); - } - } -} diff --git a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterBlockingSample.java b/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterBlockingSample.java deleted file mode 100644 index 3635a05..0000000 --- a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterBlockingSample.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2011-2012 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration.samples.splunk.inbound; - -import org.springframework.context.support.ClassPathXmlApplicationContext; - -/** - * @author Jarred Li - * @since 1.0 - * - */ -public class SplunkInboundChannelAdapterBlockingSample { - - public static void main(String args[]) { - ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext( - "SplunkInboundChannelAdapterBlockingSample-context.xml", SplunkInboundChannelAdapterBlockingSample.class); - ctx.start(); - } -} diff --git a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterExportSample.java b/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterExportSample.java deleted file mode 100644 index eedec88..0000000 --- a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterExportSample.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2011-2012 the original author or authors. - * - * 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 - * - * https://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. - */ - -package org.springframework.integration.samples.splunk.inbound; - -import org.springframework.context.support.ClassPathXmlApplicationContext; - -/** - * @author Jarred Li - * @since 1.0 - * - */ -public class SplunkInboundChannelAdapterExportSample { - - public static void main(String args[]) { - ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext( - "SplunkInboundChannelAdapterExportSample-context.xml", SplunkInboundChannelAdapterExportSample.class); - ctx.start(); - } -} diff --git a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterNonBlockingSample.java b/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterNonBlockingSample.java deleted file mode 100644 index 302ba2f..0000000 --- a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterNonBlockingSample.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2011-2012 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration.samples.splunk.inbound; - -import org.springframework.context.support.ClassPathXmlApplicationContext; - -/** - * @author Jarred Li - * @since 1.0 - * - */ -public class SplunkInboundChannelAdapterNonBlockingSample { - - public static void main(String args[]) { - ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext( - "SplunkInboundChannelAdapterNonBlockingSample-context.xml", - SplunkInboundChannelAdapterNonBlockingSample.class); - ctx.start(); - } -} diff --git a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterRealtimeSample.java b/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterRealtimeSample.java deleted file mode 100644 index 5353fae..0000000 --- a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterRealtimeSample.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2011-2012 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration.samples.splunk.inbound; - -import org.springframework.context.support.ClassPathXmlApplicationContext; - -/** - * @author Jarred Li - * @since 1.0 - * - */ -public class SplunkInboundChannelAdapterRealtimeSample { - - public static void main(String args[]) { - ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext( - "SplunkInboundChannelAdapterRealtimeSample-context.xml", SplunkInboundChannelAdapterRealtimeSample.class); - ctx.start(); - } -} diff --git a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterSavedSample.java b/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterSavedSample.java deleted file mode 100644 index 095809b..0000000 --- a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterSavedSample.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2011-2012 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration.samples.splunk.inbound; - -import org.springframework.context.support.ClassPathXmlApplicationContext; - -/** - * @author Jarred Li - * @since 1.0 - * - */ -public class SplunkInboundChannelAdapterSavedSample { - - public static void main(String args[]) { - ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext( - "SplunkInboundChannelAdapterSavedSample-context.xml", SplunkInboundChannelAdapterSavedSample.class); - ctx.start(); - } -} diff --git a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterStreamSample.java b/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterStreamSample.java deleted file mode 100644 index 4d75dc7..0000000 --- a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterStreamSample.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2011-2012 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration.samples.splunk.outbound; - -import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.integration.Message; -import org.springframework.integration.core.SubscribableChannel; -import org.springframework.integration.splunk.entity.SplunkData; -import org.springframework.integration.support.MessageBuilder; - - -/** - * @author Jarred Li - * @since 1.0 - * - */ -public class SplunkOutboundChannelAdapterStreamSample { - - public static void main(String args[]) { - ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext( - "SplunkOutboundChannelAdapterStreamSample-context.xml", SplunkOutboundChannelAdapterStreamSample.class); - ctx.start(); - - SubscribableChannel channel = ctx.getBean("outputToSplunk", SubscribableChannel.class); - - SplunkData data = new SplunkData("spring", "spring:example"); - data.setCommonDesc("description"); - - Message msg = MessageBuilder.withPayload(data).build(); - channel.send(msg); - - - } -} diff --git a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterSubmitSample.java b/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterSubmitSample.java deleted file mode 100644 index 400cf5d..0000000 --- a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterSubmitSample.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2011-2012 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration.samples.splunk.outbound; - - -import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.integration.Message; -import org.springframework.integration.channel.QueueChannel; -import org.springframework.integration.splunk.entity.SplunkData; -import org.springframework.integration.support.MessageBuilder; - - -/** - * @author Jarred Li - * @since 1.0 - * - */ -public class SplunkOutboundChannelAdapterSubmitSample { - - public static void main(String args[]) { - ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext( - "SplunkOutboundChannelAdapterSubmitSample-context.xml", SplunkOutboundChannelAdapterSubmitSample.class); - ctx.start(); - - generateMessage(ctx); - } - - private static void generateMessage(ClassPathXmlApplicationContext ctx) { - QueueChannel channel = ctx.getBean("outputToSplunkWithMessageStore", QueueChannel.class); - - SplunkData data = new SplunkData("spring", "spring:example"); - data.setCommonDesc("description"); - - Message msg = MessageBuilder.withPayload(data).build(); - channel.send(msg); - msg = MessageBuilder.withPayload(data).build(); - channel.send(msg); - } - -} diff --git a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterTcpSample.java b/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterTcpSample.java deleted file mode 100644 index cb7d2c8..0000000 --- a/samples/splunk/src/main/java/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterTcpSample.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2011-2012 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration.samples.splunk.outbound; - -import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.integration.Message; -import org.springframework.integration.core.SubscribableChannel; -import org.springframework.integration.splunk.entity.SplunkData; -import org.springframework.integration.support.MessageBuilder; - - -/** - * @author Jarred Li - * @since 1.0 - * - */ -public class SplunkOutboundChannelAdapterTcpSample { - - public static void main(String args[]) { - ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext( - "SplunkOutboundChannelAdapterTcpSample-context.xml", SplunkOutboundChannelAdapterTcpSample.class); - ctx.start(); - - SubscribableChannel channel = ctx.getBean("outputToSplunk", SubscribableChannel.class); - - SplunkData data = new SplunkData("spring", "spring:example"); - data.setCommonDesc("description"); - - Message msg = MessageBuilder.withPayload(data).build(); - channel.send(msg); - - - } -} diff --git a/samples/splunk/src/main/resources/log4j.properties b/samples/splunk/src/main/resources/log4j.properties deleted file mode 100644 index 03b2bc0..0000000 --- a/samples/splunk/src/main/resources/log4j.properties +++ /dev/null @@ -1,6 +0,0 @@ -log4j.rootCategory=DEBUG, stdout - -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss.SSS} %-5p [%t][%c] %m%n - diff --git a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/SplunkCommon-context.xml b/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/SplunkCommon-context.xml deleted file mode 100644 index bb3ba24..0000000 --- a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/SplunkCommon-context.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - diff --git a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterBlockingSample-context.xml b/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterBlockingSample-context.xml deleted file mode 100644 index 95fabaa..0000000 --- a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterBlockingSample-context.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - diff --git a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterCommon-context.xml b/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterCommon-context.xml deleted file mode 100644 index e06717b..0000000 --- a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterCommon-context.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - diff --git a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterExportSample-context.xml b/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterExportSample-context.xml deleted file mode 100644 index cc56b56..0000000 --- a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterExportSample-context.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - diff --git a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterNonBlockingSample-context.xml b/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterNonBlockingSample-context.xml deleted file mode 100644 index 04281da..0000000 --- a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterNonBlockingSample-context.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - diff --git a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterRealtimeSample-context.xml b/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterRealtimeSample-context.xml deleted file mode 100644 index 08ffea3..0000000 --- a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterRealtimeSample-context.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - diff --git a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterSavedSample-context.xml b/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterSavedSample-context.xml deleted file mode 100644 index 317c8b4..0000000 --- a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/inbound/SplunkInboundChannelAdapterSavedSample-context.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - diff --git a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterCommon-context.xml b/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterCommon-context.xml deleted file mode 100644 index 247a7a9..0000000 --- a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterCommon-context.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterStreamSample-context.xml b/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterStreamSample-context.xml deleted file mode 100644 index 6424e83..0000000 --- a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterStreamSample-context.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterSubmitSample-context.xml b/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterSubmitSample-context.xml deleted file mode 100644 index 6494406..0000000 --- a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterSubmitSample-context.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - diff --git a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterTcpSample-context.xml b/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterTcpSample-context.xml deleted file mode 100644 index 8dc028f..0000000 --- a/samples/splunk/src/main/resources/org/springframework/integration/samples/splunk/outbound/SplunkOutboundChannelAdapterTcpSample-context.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - diff --git a/samples/voldemort/pom.xml b/samples/voldemort/pom.xml index f9df767..818ccd2 100644 --- a/samples/voldemort/pom.xml +++ b/samples/voldemort/pom.xml @@ -8,47 +8,29 @@ jar voldemort-sample - https://www.springsource.org/spring-integration - - - 2.2.1 - + https://www.spring.io/spring-integration UTF-8 1.0.0.BUILD-SNAPSHOT - 1.2.17 - 4.11 + 2.13.0 + 4.12 repo.springsource.org.milestone Spring Framework Maven Milestone Repository - https://repo.springsource.org/libs-milestone + https://repo.spring.io/libs-milestone - - maven-eclipse-plugin - 2.9 - - - org.springframework.ide.eclipse.core.springnature - - - org.springframework.ide.eclipse.core.springbuilder - - true - true - - org.apache.maven.plugins maven-compiler-plugin - 3.0 + 3.8.1 1.6 1.6 @@ -60,7 +42,7 @@ org.codehaus.mojo exec-maven-plugin - 1.2.1 + 1.6.0 org.springframework.integration.samples.voldemort.Main @@ -90,8 +72,8 @@ - log4j - log4j + org.apache.logging.log4j + log4j-jcl ${log4j.version} diff --git a/samples/voldemort/src/main/java/org/springframework/integration/samples/voldemort/Main.java b/samples/voldemort/src/main/java/org/springframework/integration/samples/voldemort/Main.java index a2056f5..83bf139 100644 --- a/samples/voldemort/src/main/java/org/springframework/integration/samples/voldemort/Main.java +++ b/samples/voldemort/src/main/java/org/springframework/integration/samples/voldemort/Main.java @@ -13,14 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.integration.samples.voldemort; import java.util.Scanner; -import org.apache.log4j.Logger; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; - import org.springframework.integration.samples.voldemort.service.BusinessService; @@ -28,14 +30,16 @@ import org.springframework.integration.samples.voldemort.service.BusinessService * Starts the Spring Context and will initialize the Spring Integration routes. * * @author Gunnar Hillert + * * @since 1.0 * */ public final class Main { - private static final Logger LOGGER = Logger.getLogger(Main.class); + private static final Log LOGGER = LogFactory.getLog(Main.class); - private Main() { } + private Main() { + } /** * Load the Spring Integration Application Context @@ -46,13 +50,13 @@ public final class Main { if (LOGGER.isInfoEnabled()) { LOGGER.info("\n=========================================================" - + "\n " - + "\n Welcome to Spring Integration! " - + "\n " - + "\n For more information please visit: " - + "\n https://www.springsource.org/spring-integration " - + "\n " - + "\n=========================================================" ); + + "\n " + + "\n Welcome to Spring Integration! " + + "\n " + + "\n For more information please visit: " + + "\n https://www.springsource.org/spring-integration " + + "\n " + + "\n========================================================="); } final AbstractApplicationContext context = @@ -66,10 +70,10 @@ public final class Main { if (LOGGER.isInfoEnabled()) { LOGGER.info("\n=========================================================" - + "\n " - + "\n Please press 'q + Enter' to quit the application. " - + "\n " - + "\n=========================================================" ); + + "\n " + + "\n Please press 'q + Enter' to quit the application. " + + "\n " + + "\n========================================================="); } System.out.print("Please enter a string and press : "); @@ -80,7 +84,7 @@ public final class Main { final String data = scanner.nextLine(); - if("q".equals(data.trim())) { + if ("q".equals(data.trim())) { break; } @@ -89,7 +93,8 @@ public final class Main { System.out.println(String.format("Persisting String: '%s' with key '%s'.", data, key)); service.saveData(key, data); - } catch (Exception e) { + } + catch (Exception e) { LOGGER.error("An exception was caught: " + e); } @@ -104,4 +109,5 @@ public final class Main { System.exit(0); } + } diff --git a/samples/voldemort/src/main/resources/META-INF/spring/integration/spring-integration-context.xml b/samples/voldemort/src/main/resources/META-INF/spring/integration/spring-integration-context.xml index 3722b6c..503adea 100644 --- a/samples/voldemort/src/main/resources/META-INF/spring/integration/spring-integration-context.xml +++ b/samples/voldemort/src/main/resources/META-INF/spring/integration/spring-integration-context.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration" xmlns:int-voldemort="http://www.springframework.org/schema/integration/voldemort" - xsi:schemaLocation="http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration-2.2.xsd + xsi:schemaLocation="http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/integration/voldemort https://www.springframework.org/schema/integration/voldemort/spring-integration-voldemort.xsd"> diff --git a/samples/voldemort/src/main/resources/log4j.xml b/samples/voldemort/src/main/resources/log4j.xml deleted file mode 100644 index dfe6fcf..0000000 --- a/samples/voldemort/src/main/resources/log4j.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/voldemort/src/main/resources/log4j2.xml b/samples/voldemort/src/main/resources/log4j2.xml new file mode 100644 index 0000000..1af817e --- /dev/null +++ b/samples/voldemort/src/main/resources/log4j2.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/samples/xquery/README.md b/samples/xquery/README.md deleted file mode 100644 index 8d4ef67..0000000 --- a/samples/xquery/README.md +++ /dev/null @@ -1,103 +0,0 @@ -Spring Integration - XQuery Sample -================================== - -## Overview - -This sample executes a simple [XQuery][] script. It uses the *[Spring Integration XQuery][]* module, which is part of the [Spring Integration Extensions][] project. The sample uses one of the following 3 XQuery processors: - -* [Saxon][] -* [Sedna][] -* [BaseX][] - -The example for [Saxon][] will work out of the box. [Sedna][] and [BaseX][] are in fact [XML Databases][], which run as external processes. For [Sedna][]- and [BaseX][]-specific setup instructions, please visit: - -* http://xqj.net/sedna/ -* http://xqj.net/basex/ - -## Running the Sample - -From the command line execute: - - $ mvn clean package - -followed by: - - $ mvn exec:java - -The application should start up and you will see the following screen on which you can choose which XQuery processor to use: - - ========================================================= - - Welcome to the Spring Integration XQuery Sample! - - For more information please visit: - https://www.springsource.org/spring-integration/ - - ========================================================= - Which XQuery Processor would you like to use? : - 1. Use Saxon - 2. Use Sedna - 3. Use BaseX - q. Quit the application - Enter you choice: - -### Note regarding BaseX - -The [BaseX][] dependency conflicts with [Sedna][]. Therefore, this sample applies a separate Maven profile for [BaseX][]. If not triggering that special profile when you try to execute the [BaseX][] example, you may encounter the following error message: - - Detected the Sedna library to be present. This conflicts with BaseX. Please start the application from the command line using: - - mvn exec:java -Dbasex - -Consequently, execute from the command line: - - $ mvn exec:java -Dbasex - -The [BaseX][] sample will now execute successfully. - -## Details - -The used XQuery Script, located under `src/main/resources/data/xquery.xql`, is quite simple: - - - { //customers/customer/name } - - -All it does is extracting the customer names from the following XML document: - - - - Foo Industries - Chemical - Glowing City - - - Bar Refreshments - Beverage - Desert Town - - - Hello World Services - Travel - Coral Sands - - - - -The XML document is located at `src/main/resources/data/customers.xml`. - -The resulting XML document should look like: - - - Foo Industries - Bar Refreshments - Hello World Services - - -[Saxon]: https://sourceforge.net/projects/saxon/ -[Sedna]: https://www.sedna.org/ -[BaseX]: https://basex.org/ -[Spring Integration XQuery]: https://github.com/SpringSource/spring-integration-extensions/tree/master/spring-integration-xquery -[Spring Integration Extensions]: https://github.com/SpringSource/spring-integration-extensions -[XML Databases]: https://en.wikipedia.org/wiki/XML_database -[XQuery]: https://en.wikipedia.org/wiki/XQuery \ No newline at end of file diff --git a/samples/xquery/pom.xml b/samples/xquery/pom.xml deleted file mode 100644 index e4ef4f2..0000000 --- a/samples/xquery/pom.xml +++ /dev/null @@ -1,153 +0,0 @@ - - 4.0.0 - - org.springframework.integration.samples - xquery - 1.0.0.BUILD-SNAPSHOT - jar - - Samples (Basic) - XQuery Sample - https://www.springsource.org/spring-integration - - - 2.2.1 - - - - UTF-8 - 4.3.19.RELEASE - 1.2.17 - 4.10 - - - - - repo.springsource.org.milestone - Spring Framework Maven Snapshot Repository - https://repo.springsource.org/libs-snapshot - true - - - - - - - maven-eclipse-plugin - 2.9 - - - org.springframework.ide.eclipse.core.springnature - - - org.springframework.ide.eclipse.core.springbuilder - - true - true - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.5.1 - - 1.6 - 1.6 - -Xlint:all - true - true - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - org.springframework.integration.Main - - - - - - - - - - - junit - junit - ${junit.version} - test - - - - - - org.springframework.integration - spring-integration-core - ${spring.integration.version} - - - - org.springframework.integration - spring-integration-xml - ${spring.integration.version} - - - - org.springframework.integration - spring-integration-xquery - 1.0.0.BUILD-SNAPSHOT - - - - - - log4j - log4j - ${log4j.version} - - - - - - net.sf.saxon - Saxon-HE - 9.4 - - - - - default - - !basex - - - - net.xqj.sedna - sedna-xqj - 1.0.0 - - - com.xqj2 - xqj2 - 0.1.0 - - - - - basex - - basex - - - - net.xqj - basex-xqj - 1.2.3 - - - - - - diff --git a/samples/xquery/src/main/java/org/springframework/integration/Main.java b/samples/xquery/src/main/java/org/springframework/integration/Main.java deleted file mode 100644 index 559bd8a..0000000 --- a/samples/xquery/src/main/java/org/springframework/integration/Main.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2002-2012 the original author or authors. - * - * 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 - * - * https://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. - */ -package org.springframework.integration; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Scanner; - -import org.apache.log4j.Logger; -import org.springframework.context.support.GenericXmlApplicationContext; -import org.springframework.core.io.Resource; -import org.springframework.integration.service.CustomerService; -import org.springframework.util.ClassUtils; -import org.springframework.util.FileCopyUtils; - - -/** - * Starts the Spring Context and will initialize the Spring Integration routes. - * - * @author Gunnar Hillert - * @version 1.0 - * - */ -public final class Main { - - private static final Logger LOGGER = Logger.getLogger(Main.class); - - private static final String HORIZONTAL_LINE = "=========================================================\n"; - - private Main() { } - - /** - * Load the Spring Integration Application Context - * - * @param args - command line arguments - * @throws IOException - */ - public static void main(final String... args) throws IOException { - - final Scanner scanner = new Scanner(System.in); - - System.out.println("\n" - + HORIZONTAL_LINE - + "\n " - + "\n Welcome to the Spring Integration XQuery Sample! " - + "\n " - + "\n For more information please visit: " - + "\n https://www.springsource.org/spring-integration/ " - + "\n " - + "\n" - + HORIZONTAL_LINE); - - System.out.println("Which XQuery Processor would you like to use? : "); - System.out.println("\t1. Use Saxon"); - System.out.println("\t2. Use Sedna"); - System.out.println("\t3. Use BaseX"); - - System.out.println("\tq. Quit the application"); - System.out.print("Enter your choice: "); - - final GenericXmlApplicationContext context = new GenericXmlApplicationContext(); - - while (true) { - final String input = scanner.nextLine(); - - if("1".equals(input.trim())) { - context.getEnvironment().setActiveProfiles("saxon"); - System.out.println("\nUsing Saxon..."); - break; - } else if("2".equals(input.trim())) { - context.getEnvironment().setActiveProfiles("sedna"); - System.out.println("\nUsing Sedna..."); - break; - } else if("3".equals(input.trim())) { - context.getEnvironment().setActiveProfiles("basex"); - System.out.println("\nUsing BaseX..."); - - if(ClassUtils.isPresent("net.xqj.sedna.SednaXQDataSource", ClassUtils.getDefaultClassLoader())) { - LOGGER.error("Detected the Sedna library to be present. This " - + "conflicts with BaseX. Please start the application " - + "from the command line using:\n\n" - + "mvn exec:java -Dbasex\n\nExiting..."); - System.exit(1); - } - - break; - } else if("q".equals(input.trim())) { - System.out.println("Exiting application...bye."); - System.exit(0); - } else { - System.out.println("Invalid choice\n\n"); - System.out.print("Enter you choice: "); - } - } - - context.load("classpath:META-INF/spring/integration/*-context.xml"); - context.registerShutdownHook(); - context.refresh(); - - final CustomerService service = context.getBean(CustomerService.class); - - final Resource resource = context.getResource("classpath:data/customers.xml"); - final InputStream is = resource.getInputStream(); - final String customers = new String(FileCopyUtils.copyToByteArray(is)); - - System.out.println("\n\nExtracting Customer Names from:\n" - + HORIZONTAL_LINE - + customers + "\n" - + HORIZONTAL_LINE - + "\n"); - final String customernames = service.getCustomerNames(customers); - System.out.println("Extracted Customer Names: \n" - + HORIZONTAL_LINE - + customernames + "\n" - + HORIZONTAL_LINE - + "\n"); - - } - -} \ No newline at end of file diff --git a/samples/xquery/src/main/java/org/springframework/integration/service/CustomerService.java b/samples/xquery/src/main/java/org/springframework/integration/service/CustomerService.java deleted file mode 100644 index 2120703..0000000 --- a/samples/xquery/src/main/java/org/springframework/integration/service/CustomerService.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2012 the original author or authors - * - * 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 - * - * https://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. - */ -package org.springframework.integration.service; - -/** - * XML Extraction Service. - * - * @author Gunnar Hillert - * @version 1.0 - * - */ -public interface CustomerService { - - /** - * For a given customer XML file, this method extracts all customer names and - * returns them as a new XML document. - * - * @param sourceXml The source XML file to extract the customer names from - * @return The String-based XML document containing the customer names - */ - String getCustomerNames(String sourceXml); - -} diff --git a/samples/xquery/src/main/resources/META-INF/spring/integration/spring-integration-context.xml b/samples/xquery/src/main/resources/META-INF/spring/integration/spring-integration-context.xml deleted file mode 100644 index ff5ee76..0000000 --- a/samples/xquery/src/main/resources/META-INF/spring/integration/spring-integration-context.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/xquery/src/main/resources/data/customers.xml b/samples/xquery/src/main/resources/data/customers.xml deleted file mode 100644 index 741689c..0000000 --- a/samples/xquery/src/main/resources/data/customers.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - Foo Industries - Chemical - Glowing City - - - Bar Refreshments - Beverage - Desert Town - - - Hello World Services - Travel - Coral Sands - - \ No newline at end of file diff --git a/samples/xquery/src/main/resources/data/xquery.xql b/samples/xquery/src/main/resources/data/xquery.xql deleted file mode 100644 index 841a537..0000000 --- a/samples/xquery/src/main/resources/data/xquery.xql +++ /dev/null @@ -1,4 +0,0 @@ - (: The XQuery Script that will extract the customer names from the source XML file :) - - { //customers/customer/name } - \ No newline at end of file diff --git a/samples/xquery/src/main/resources/log4j.xml b/samples/xquery/src/main/resources/log4j.xml deleted file mode 100644 index 739aaa4..0000000 --- a/samples/xquery/src/main/resources/log4j.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/xquery/src/main/resources/log4j2.xml b/samples/xquery/src/main/resources/log4j2.xml new file mode 100644 index 0000000..138645e --- /dev/null +++ b/samples/xquery/src/main/resources/log4j2.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/samples/xquery/src/test/java/org/springframework/integration/CustomerServiceTest.java b/samples/xquery/src/test/java/org/springframework/integration/CustomerServiceTest.java deleted file mode 100644 index 0266984..0000000 --- a/samples/xquery/src/test/java/org/springframework/integration/CustomerServiceTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2002-2012 the original author or authors. - * - * 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 - * - * https://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. - */ - -package org.springframework.integration; - -import junit.framework.Assert; - -import org.junit.Test; -import org.springframework.context.ApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.integration.service.CustomerService; - -/** - * Verify that the Spring Integration Application Context starts successfully. - * - * @author Gunnar Hillert - * @since 1.0 - * - */ -public class CustomerServiceTest { - - @Test - public void testStartupOfSpringInegrationContext() throws Exception{ - new ClassPathXmlApplicationContext("/META-INF/spring/integration/spring-integration-context.xml", - CustomerServiceTest.class); - Thread.sleep(2000); - } - - @Test - public void testExtractCustomerNames() { - final ApplicationContext context - = new ClassPathXmlApplicationContext("/META-INF/spring/integration/spring-integration-context.xml", - CustomerServiceTest.class); - - final CustomerService service = context.getBean(CustomerService.class); - - final String sourceXml = "Foo Industries" - + "ChemicalGlowing City"; - final String expectedResult = "\n" - + "\n" - + " Foo Industries\n" - + "\n"; - - final String extractedCustomerNames = service.getCustomerNames(sourceXml); - - System.out.println(">>" + expectedResult + "<<"); - System.out.println(">>" + extractedCustomerNames + "<<"); - - Assert.assertEquals("The expected list of customer names did not match.", - expectedResult, extractedCustomerNames); - - } - -} diff --git a/samples/zip/pom.xml b/samples/zip/pom.xml index c4f005d..6a3113f 100644 --- a/samples/zip/pom.xml +++ b/samples/zip/pom.xml @@ -10,15 +10,11 @@ zip-sample https://projects.spring.io/spring-integration/ - - 2.2.1 - - UTF-8 - 1.0.1.RELEASE - 1.2.17 - 4.11 + 1.0.2.RELEASE + 2.13.0 + 4.12 @@ -31,24 +27,10 @@ - - maven-eclipse-plugin - 2.9 - - - org.springframework.ide.eclipse.core.springnature - - - org.springframework.ide.eclipse.core.springbuilder - - true - true - - org.apache.maven.plugins maven-compiler-plugin - 3.0 + 3.8.1 1.6 1.6 @@ -60,7 +42,7 @@ org.codehaus.mojo exec-maven-plugin - 1.2.1 + 1.6.0 org.springframework.integration.samples.zip.Main @@ -87,17 +69,17 @@ ${spring.integration.zip.version} - - org.springframework.integration - spring-integration-core - 4.3.17.RELEASE - - - log4j - log4j + org.apache.logging.log4j + log4j-jcl + ${log4j.version} + + + + org.apache.logging.log4j + log4j-slf4j-impl ${log4j.version} @@ -109,11 +91,5 @@ 2.4 - - org.slf4j - slf4j-jcl - 1.7.12 - - diff --git a/samples/zip/src/main/java/org/springframework/integration/samples/zip/Main.java b/samples/zip/src/main/java/org/springframework/integration/samples/zip/Main.java index d7ad856..054e2db 100644 --- a/samples/zip/src/main/java/org/springframework/integration/samples/zip/Main.java +++ b/samples/zip/src/main/java/org/springframework/integration/samples/zip/Main.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 the original author or authors. + * Copyright 2015-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,11 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.integration.samples.zip; import java.util.Scanner; -import org.apache.log4j.Logger; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -28,12 +30,14 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; * * @author Gunnar Hillert * @author Gary Russell + * @author Artem Bilan + * * @since 1.0 * */ public final class Main { - private static final Logger LOGGER = Logger.getLogger(Main.class); + private static final Log LOGGER = LogFactory.getLog(Main.class); private Main() { } diff --git a/samples/zip/src/main/java/org/springframework/integration/samples/zip/SpringIntegrationUtils.java b/samples/zip/src/main/java/org/springframework/integration/samples/zip/SpringIntegrationUtils.java index 74e7806..7d09102 100644 --- a/samples/zip/src/main/java/org/springframework/integration/samples/zip/SpringIntegrationUtils.java +++ b/samples/zip/src/main/java/org/springframework/integration/samples/zip/SpringIntegrationUtils.java @@ -75,7 +75,7 @@ public final class SpringIntegrationUtils { stringBuilder.append("\n"); for (final String inputDirectory : inputDirectories) { - stringBuilder.append("\n Intput directory is: '" + inputDirectory + "'"); + stringBuilder.append("\n Input directory is: '" + inputDirectory + "'"); } for (final String outputDirectory : outputDirectories) { diff --git a/samples/zip/src/main/java/org/springframework/integration/samples/zip/TransformationHandler.java b/samples/zip/src/main/java/org/springframework/integration/samples/zip/TransformationHandler.java index 024a3cf..bd21924 100644 --- a/samples/zip/src/main/java/org/springframework/integration/samples/zip/TransformationHandler.java +++ b/samples/zip/src/main/java/org/springframework/integration/samples/zip/TransformationHandler.java @@ -58,13 +58,11 @@ public class TransformationHandler { throw new IllegalStateException(e); } - final Message message = MessageBuilder.withPayload(inputAsString.toUpperCase(Locale.ENGLISH)) + return MessageBuilder.withPayload(inputAsString.toUpperCase(Locale.ENGLISH)) .setHeader(FileHeaders.FILENAME, filename) .setHeader(FileHeaders.ORIGINAL_FILE, inputFile) .setHeader("file_size", inputFile.length()) .setHeader("file_extension", fileExtension) .build(); - - return message; } } diff --git a/samples/zip/src/main/resources/log4j.xml b/samples/zip/src/main/resources/log4j.xml deleted file mode 100644 index f4d8379..0000000 --- a/samples/zip/src/main/resources/log4j.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/zip/src/main/resources/log4j2.xml b/samples/zip/src/main/resources/log4j2.xml new file mode 100644 index 0000000..138645e --- /dev/null +++ b/samples/zip/src/main/resources/log4j2.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +