--------------------------------------------------------------------------------
/vxms-rest-base/src/test/resources/webroot/payload.xml:
--------------------------------------------------------------------------------
1 | dfgdfg
--------------------------------------------------------------------------------
/vxms-rest-rs/src/test/resources/webroot/payload.xml:
--------------------------------------------------------------------------------
1 | dfgdfg
--------------------------------------------------------------------------------
/vxms-testing/src/test/resources/webroot/payload.xml:
--------------------------------------------------------------------------------
1 | dfgdfg
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-read/local.json:
--------------------------------------------------------------------------------
1 | {
2 | "local": true
3 | }
4 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-write/local.json:
--------------------------------------------------------------------------------
1 | {
2 | "local": true
3 | }
4 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-core-demo/app-cds.jsa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amoAHCP/vxms/HEAD/vxms-demos/vxms-core-demo/app-cds.jsa
--------------------------------------------------------------------------------
/vxms-demos/vxms-secure-spa-demo/.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amoAHCP/vxms/HEAD/vxms-demos/vxms-secure-spa-demo/.keystore
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-frontend/local.json:
--------------------------------------------------------------------------------
1 | {
2 | "local": true,
3 | "host": "0.0.0.0",
4 | "port": 8080
5 | }
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-write/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM maven:3.3-jdk-8
2 | COPY . /usr/src/app
3 |
4 | CMD ["java", "-jar", "/usr/src/app/target/vxms-write-1.1-fat.jar","-cluster"]
5 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-secure-spa-demo/securityConf.json:
--------------------------------------------------------------------------------
1 | {
2 | "clientID":"0cacb114b5067c843c43",
3 | "clientSecret":"5ad8e3b89a4e00dcdfa94b59cbf642bb63ecf0e3",
4 | "host":"localhost",
5 | "port":8443
6 | }
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-read/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM maven:3.3-jdk-8
2 | COPY . /usr/src/app
3 |
4 |
5 | CMD ["java", "-jar", "/usr/src/app/target/vxms-read-1.2-SNAPSHOT-fat.jar","-cluster"]
6 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-read/src/main/fabric8/configmap.yml:
--------------------------------------------------------------------------------
1 | metadata:
2 | name: springconfig
3 | data:
4 | application.properties: |
5 | mongodb://mongo:27017
6 | mongo.database=demo
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-frontend/src/main/fabric8/configmap.yml:
--------------------------------------------------------------------------------
1 | metadata:
2 | name: frontendconfig
3 | data:
4 | READ_NAME: vxms-k8s-read
5 | READ_VERSION: 1.2-SNAPSHOT
6 | WRITE_NAME: vxms-k8s-write
7 | WRITE_VERSION: 1.2-SNAPSHOT
8 | NAMESPACE: myproject
--------------------------------------------------------------------------------
/vxms-demos/vxms-rest-demo/README.MD:
--------------------------------------------------------------------------------
1 | # A (simple) vxms REST endpoint
2 | It defines a HTTP endpoint on port 9090 and two REST (Get) endpoints, using vxms-rest. Start the *main* method in *SimpleREST* class, or build with *mvn clean package* and execute *java -jar target/vxms-demo-verticle-one-XXX.jar*
3 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/kube/mongo-service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | labels:
5 | name: mongo
6 | visualize: "false"
7 | name: mongo
8 | spec:
9 | ports:
10 | - port: 27017
11 | targetPort: 27017
12 | selector:
13 | name: mongo
14 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/kube/mongo-service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | labels:
5 | name: mongo
6 | visualize: "false"
7 | name: mongo
8 | spec:
9 | ports:
10 | - port: 27017
11 | targetPort: 27017
12 | selector:
13 | name: mongo
14 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-read/src/main/fabric8/service.yml:
--------------------------------------------------------------------------------
1 | kind: Service
2 | apiVersion: v1
3 | metadata:
4 | labels:
5 | expose: true
6 | name: ${project.artifactId}
7 | version: ${project.parent.version}
8 | spec:
9 | ports:
10 | - port: 80
11 | targetPort: 7070
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-write/src/main/fabric8/service.yml:
--------------------------------------------------------------------------------
1 | kind: Service
2 | apiVersion: v1
3 | metadata:
4 | labels:
5 | expose: true
6 | name: ${project.artifactId}
7 | version: ${project.parent.version}
8 | spec:
9 | ports:
10 | - port: 80
11 | targetPort: 9090
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-frontend/src/main/fabric8/service.yml:
--------------------------------------------------------------------------------
1 | kind: Service
2 | apiVersion: v1
3 | metadata:
4 | labels:
5 | expose: true
6 | name: ${project.artifactId}
7 | version: ${project.parent.version}
8 | spec:
9 | type: LoadBalancer
10 | ports:
11 | - port: 80
12 | targetPort: 8181
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 |
3 | # Mobile Tools for Java (J2ME)
4 | .mtj.tmp/
5 |
6 | # Package Files #
7 | *.jar
8 | *.war
9 | *.ear
10 | *.iml
11 | target/
12 | .DS_Store
13 | .vertx
14 |
15 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
16 | hs_err_pid*
17 | .idea
18 | .idea/*
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-frontend/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM maven:3.3-jdk-8
2 | COPY . /usr/src/app
3 |
4 | ENV httpPort 8181
5 | EXPOSE $httpPort
6 | # CMD ["java", "-jar", "/usr/src/app/target/vxms-frontend-1.0-SNAPSHOT-fat.jar","-instances","8","-d64","-server","-XX:+AggressiveOpts"]
7 | CMD ["java", "-jar", "/usr/src/app/target/vxms-frontend-1.2-SNAPSHOT-fat.jar","-cluster"]
8 |
--------------------------------------------------------------------------------
/scripts/run_etcd.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [ $# -gt 0 ] ; then
4 | ETCD_VERSION="$1"
5 | else
6 | ETCD_VERSION="2.2.0"
7 | fi
8 |
9 | curl -L https://github.com/coreos/etcd/releases/download/v$ETCD_VERSION/etcd-v$ETCD_VERSION-linux-amd64.tar.gz -o etcd-v$ETCD_VERSION-linux-amd64.tar.gz
10 | tar xzvf etcd-v$ETCD_VERSION-linux-amd64.tar.gz
11 | mv etcd-v$ETCD_VERSION-linux-amd64 etcd
--------------------------------------------------------------------------------
/vxms-demos/vxms-core-demo/reflectconfigs/netty.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name" : "io.netty.channel.socket.nio.NioSocketChannel",
4 | "methods" : [
5 | { "name" : "", "parameterTypes" : [] }
6 | ]
7 | },
8 | {
9 | "name" : "io.netty.channel.socket.nio.NioServerSocketChannel",
10 | "methods" : [
11 | { "name" : "", "parameterTypes" : [] }
12 | ]
13 | }
14 | ]
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-read/src/main/fabric8/service.yml:
--------------------------------------------------------------------------------
1 | kind: Service
2 | apiVersion: v1
3 | metadata:
4 | labels:
5 | expose: true
6 | name: ${project.artifactId}
7 | version: ${project.parent.version}
8 | service-label-name: cluster01
9 | service-label-value: true
10 |
11 | spec:
12 | type: LoadBalancer
13 | ports:
14 | - port: 80
15 | targetPort: 8181
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-write/src/main/fabric8/service.yml:
--------------------------------------------------------------------------------
1 | kind: Service
2 | apiVersion: v1
3 | metadata:
4 | labels:
5 | expose: true
6 | name: ${project.artifactId}
7 | version: ${project.parent.version}
8 | service-label-name: cluster01
9 | service-label-value: true
10 |
11 | spec:
12 | type: LoadBalancer
13 | ports:
14 | - port: 80
15 | targetPort: 8181
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-frontend/src/main/fabric8/service.yml:
--------------------------------------------------------------------------------
1 | kind: Service
2 | apiVersion: v1
3 | metadata:
4 | labels:
5 | expose: true
6 | name: ${project.artifactId}
7 | version: ${project.parent.version}
8 | service-label-name: cluster01
9 | service-label-value: true
10 |
11 | spec:
12 | type: LoadBalancer
13 | ports:
14 | - port: 80
15 | targetPort: 8181
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-frontend/src/main/fabric8/deployment.yml:
--------------------------------------------------------------------------------
1 | metadata:
2 | annotations:
3 | configmap.fabric8.io/update-on-change: frontendconfig
4 | spec:
5 | replicas: 1
6 | template:
7 | spec:
8 | containers:
9 | - name: vertx
10 | envFrom:
11 | - configMapRef:
12 | name: frontendconfig
13 | ports:
14 | - containerPort: 8181
--------------------------------------------------------------------------------
/vxms-rest/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | import org.jacpfx.vxms.rest.RestBaseHandler;
2 |
3 | module vxms.rest {
4 | requires vxms.core;
5 | requires vertx.core;
6 | requires vertx.web;
7 | requires io.netty.codec;
8 | requires io.netty.codec.http;
9 | requires java.logging;
10 | requires java.management;
11 | requires vxms.rest.base;
12 |
13 | provides org.jacpfx.vxms.spi.RESThandlerSPI with
14 | RestBaseHandler;
15 | }
16 |
--------------------------------------------------------------------------------
/scripts/startETCD.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 --name etcd quay.io/coreos/etcd:v2.2.0 -name etcd0 -advertise-client-urls http://${HostIP}:2379,http://${HostIP}:4001 -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 -initial-advertise-peer-urls http://${HostIP}:2380 -listen-peer-urls http://0.0.0.0:2380 -initial-cluster etcd0=http://${HostIP}:2380 -initial-cluster-state new
--------------------------------------------------------------------------------
/vxms-demos/vxms-secure-spa-demo/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 |
3 | # Mobile Tools for Java (J2ME)
4 | .mtj.tmp/
5 |
6 | # Package Files #
7 | *.jar
8 | *.war
9 | *.ear
10 | .DS_Store
11 | .gradle
12 | .idea
13 | *.iml
14 | build
15 | target
16 | file-uploads
17 | .vertx
18 | vxms-demos/vxms-petshop
19 | out
20 | mod
21 | etcd-ca
22 | .keystore
23 | securityConfPrivate.json
24 |
25 |
26 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
27 | hs_err_pid*
28 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/docker-compose.yml:
--------------------------------------------------------------------------------
1 | mongodb:
2 | image: mongo
3 | ports:
4 | - "27017:27017"
5 | read:
6 | build: vxms-read
7 | hostname: read
8 | links:
9 | - mongodb:mongodb
10 | write:
11 | build: vxms-write
12 | hostname: write
13 | links:
14 | - mongodb:mongodb
15 | frontend-verticle:
16 | build: vxms-frontend
17 | hostname: frontend-verticle
18 | links:
19 | - mongodb:mongodb
20 | - read:read
21 | - write:write
22 | ports:
23 | - "8181:8181"
24 |
--------------------------------------------------------------------------------
/vxms-rest-rs/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | import org.jacpfx.vxms.rest.RestRsHandler;
2 |
3 | module vxms.rest.rs {
4 | requires vxms.core;
5 | requires vertx.core;
6 | requires vertx.web;
7 | requires io.netty.codec;
8 | requires io.netty.codec.http;
9 | requires java.logging;
10 | requires java.management;
11 | requires java.ws.rs;
12 |
13 | requires vxms.rest.base;
14 | uses org.jacpfx.vxms.spi.RESThandlerSPI;
15 | provides org.jacpfx.vxms.spi.RESThandlerSPI with
16 | RestRsHandler;
17 | }
18 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-core-demo/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 |
3 | # Mobile Tools for Java (J2ME)
4 | .mtj.tmp/
5 |
6 | # Package Files #
7 | *.jar
8 | *.war
9 | *.ear
10 | .DS_Store
11 | .gradle
12 | .idea
13 | *.iml
14 | build
15 | target
16 | file-uploads
17 | .vertx
18 | docker-compose.yml
19 |
20 |
21 | Backup/*
22 |
23 |
24 | out
25 | mod
26 | etcd-ca
27 | .keystore
28 | vxms-demos/vxms-secure-spa-demo/securityConfPrivate.json
29 |
30 |
31 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
32 | hs_err_pid*
33 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/kube/mongo-controller-no-store.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: ReplicationController
3 | metadata:
4 | labels:
5 | name: mongo
6 | visualize: "false"
7 | name: mongo-controller
8 | spec:
9 | replicas: 1
10 | template:
11 | metadata:
12 | labels:
13 | name: mongo
14 | visualize: "false"
15 | spec:
16 | containers:
17 | - image: mongo
18 | name: mongo
19 | ports:
20 | - name: mongo
21 | containerPort: 27017
22 | hostPort: 27017
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/kube/mongo-controller-no-store.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: ReplicationController
3 | metadata:
4 | labels:
5 | name: mongo
6 | visualize: "false"
7 | name: mongo-controller
8 | spec:
9 | replicas: 1
10 | template:
11 | metadata:
12 | labels:
13 | name: mongo
14 | visualize: "false"
15 | spec:
16 | containers:
17 | - image: mongo
18 | name: mongo
19 | ports:
20 | - name: mongo
21 | containerPort: 27017
22 | hostPort: 27017
--------------------------------------------------------------------------------
/vxms-rest-base/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | module vxms.rest.base {
2 | requires vxms.core;
3 | requires vertx.core;
4 | requires vertx.web;
5 | requires io.netty.codec;
6 | requires io.netty.codec.http;
7 | requires java.logging;
8 | requires java.management;
9 |
10 |
11 | exports org.jacpfx.vxms.rest.base;
12 | exports org.jacpfx.vxms.rest.base.annotation;
13 | exports org.jacpfx.vxms.rest.base.response;
14 | exports org.jacpfx.vxms.rest.base.response.basic;
15 | exports org.jacpfx.vxms.rest.base.response.blocking;
16 | exports org.jacpfx.vxms.rest.base.util;
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/common/util/StreamUtils.java:
--------------------------------------------------------------------------------
1 | package org.jacpfx.vxms.common.util;
2 |
3 | import java.util.Iterator;
4 | import java.util.stream.Stream;
5 | import java.util.stream.StreamSupport;
6 |
7 | public class StreamUtils {
8 | public static Stream asStream(Iterator sourceIterator) {
9 | return asStream(sourceIterator, false);
10 | }
11 |
12 | public static Stream asStream(Iterator sourceIterator, boolean parallel) {
13 | Iterable iterable = () -> sourceIterator;
14 | return StreamSupport.stream(iterable.spliterator(), parallel);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 |
3 | jdk:
4 | #- oraclejdk8
5 | - oraclejdk13
6 |
7 | sudo: true
8 |
9 | # whitelist
10 | branches:
11 | only:
12 | - master
13 |
14 | #before_script:
15 | # - scripts/run_etcd.sh 3.0.0
16 |
17 | #before_script: mvn versions:set -DnewVersion=1.0.1
18 |
19 | script:
20 | #- ./etcd/etcd --listen-client-urls 'http://0.0.0.0:4001' --advertise-client-urls 'http://127.0.0.1:4001' >/dev/null 2>&1 &
21 | - mvn -q clean install -Dsun.net.http.allowRestrictedHeaders=true -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true
22 |
23 | # after_success: mvn versions:set -DnewVersion=1.0.2-SNAPSHOT
24 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 |
3 | # Mobile Tools for Java (J2ME)
4 | .mtj.tmp/
5 |
6 | # Package Files #
7 | *.jar
8 | *.war
9 | *.ear
10 | .DS_Store
11 | .gradle
12 | .idea
13 | *.iml
14 | build
15 | target
16 | file-uploads
17 | .vertx
18 | docker-compose.yml
19 |
20 | vxms-demos/vxms-stream-demo
21 | vxms-demos/vxms-core-demo/Backup
22 | vxms-demos/vxms-test
23 | vxms-demos/vxms-test/*
24 |
25 | vxms-demos/gatling-sample-project/*
26 |
27 | out
28 | mod
29 | etcd-ca
30 | .keystore
31 | vxms-demos/vxms-secure-spa-demo/securityConfPrivate.json
32 |
33 |
34 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
35 | hs_err_pid*
36 |
--------------------------------------------------------------------------------
/vxms-core/config-flags.md:
--------------------------------------------------------------------------------
1 | # configuration flags
2 | Can be set, by using a property json file or by setting System env variable
3 |
4 |
5 |
6 | | property name | description | default| possible vaslues |
7 | |--- |---|---|---|
8 | | name | the name/identifier of the service | --- |
9 | | port | the port number to bind http socket | 8080 |
10 | | host | the host name/interface to bind to | 0.0.0.0 |
11 | | contextRoot | the context-route for your service | "/" |
12 | | cbScope | The Scope defines whether the stateful circuit breaker is global (cluster wide), local (jvm wide) or unique (instance wide) | unique | global, local, unique|
13 |
14 |
15 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-read/src/main/fabric8/deployment.yml:
--------------------------------------------------------------------------------
1 | metadata:
2 | annotations:
3 | configmap.fabric8.io/update-on-change: springconfig
4 | spec:
5 | replicas: 1
6 | template:
7 | spec:
8 | volumes:
9 | - name: config
10 | configMap:
11 | name: springconfig
12 | items:
13 | - key: application.properties
14 | path: application.properties
15 | containers:
16 | - name: vertx
17 | ports:
18 | - containerPort: 7070
19 | env:
20 | - name: JAVA_ARGS
21 | value: '-Dspring.profiles.active=openshift'
22 | - name: MYENV
23 | value: "openshift"
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-read/src/main/fabric8/deployment.yml:
--------------------------------------------------------------------------------
1 | metadata:
2 | annotations:
3 | configmap.fabric8.io/update-on-change: hazelcastconfig
4 | spec:
5 | replicas: 1
6 | template:
7 | spec:
8 | volumes:
9 | - name: config
10 | configMap:
11 | name: hazelcastconfig
12 | items:
13 | - key: hazelcast.xml
14 | path: hazelcast.xml
15 | containers:
16 | - name: vertx
17 | ports:
18 | - containerPort: 8181
19 | volumeMounts:
20 | - name: config
21 | mountPath: /usr/src/app/config
22 | env:
23 | - name: JAVA_ARGS
24 | value: '-cluster -cp /usr/src/app/config'
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-write/src/main/fabric8/deployment.yml:
--------------------------------------------------------------------------------
1 | metadata:
2 | annotations:
3 | configmap.fabric8.io/update-on-change: hazelcastconfig
4 | spec:
5 | replicas: 1
6 | template:
7 | spec:
8 | volumes:
9 | - name: config
10 | configMap:
11 | name: hazelcastconfig
12 | items:
13 | - key: hazelcast.xml
14 | path: hazelcast.xml
15 | containers:
16 | - name: vertx
17 | ports:
18 | - containerPort: 8181
19 | volumeMounts:
20 | - name: config
21 | mountPath: /usr/src/app/config
22 | env:
23 | - name: JAVA_ARGS
24 | value: '-cluster -cp /usr/src/app/config'
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-frontend/src/main/fabric8/deployment.yml:
--------------------------------------------------------------------------------
1 | metadata:
2 | annotations:
3 | configmap.fabric8.io/update-on-change: hazelcastconfig
4 | spec:
5 | replicas: 1
6 | template:
7 | spec:
8 | volumes:
9 | - name: config
10 | configMap:
11 | name: hazelcastconfig
12 | items:
13 | - key: hazelcast.xml
14 | path: hazelcast.xml
15 | containers:
16 | - name: vertx
17 | ports:
18 | - containerPort: 8181
19 | volumeMounts:
20 | - name: config
21 | mountPath: /usr/src/app/config
22 | env:
23 | - name: JAVA_ARGS
24 | value: '-cluster -cp /usr/src/app/config'
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-read/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright [2018] [Andy Moncsek]
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | mongo.database=demo
18 |
19 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-core-demo/Dockerfile:
--------------------------------------------------------------------------------
1 |
2 | FROM panga/graalvm-ce:latest AS build-aot
3 | WORKDIR /app
4 | ADD . /app
5 | # Build image
6 | RUN native-image \
7 | --no-server \
8 | -Djava.net.preferIPv4Stack=true \
9 | -Dio.netty.noUnsafe=true \
10 | -Dvertx.disableDnsResolver=true \
11 | -H:+ReportUnsupportedElementsAtRuntime \
12 | -H:ReflectionConfigurationFiles=./reflectconfigs/netty.json \
13 | -jar "target/vxms-core-demo-fat.jar"
14 |
15 | # Create new image from alpine
16 | FROM frolvlad/alpine-glibc:alpine-3.8
17 | RUN apk add --no-cache ca-certificates
18 | # Copy generated native executable from build-aot
19 | COPY --from=build-aot /app/vxms-core-demo-fat /vxms-core-demo-fat
20 | # Set the entrypoint
21 | ENTRYPOINT [ "/vxms-core-demo-fat" ]
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-read/src/main/resources/application-TEST.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright [2018] [Andy Moncsek]
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | mongo.database=demo
18 | mongo.database.url=mongodb://localhost:27017
19 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-read/src/main/resources/application-openshift.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright [2018] [Andy Moncsek]
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | mongo.database=demo
18 | mongo.database.url=mongodb://mongo:27017
19 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/spi/VxmsRoutes.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.spi;
18 |
19 | /**
20 | * Marker interface
21 | */
22 | public interface VxmsRoutes {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-core-demo/Dockerfile.test1:
--------------------------------------------------------------------------------
1 | # GraalVM docker image used for AoT compilation
2 | FROM maven:3.5.4-jdk-11 AS mavenbuilder
3 | ADD . /app
4 | WORKDIR /app
5 | RUN mvn clean install
6 |
7 |
8 | FROM panga/graalvm-ce:latest AS build-aot
9 | WORKDIR /app
10 | COPY --from=mavenbuilder /app/ /app
11 | # Build image
12 | RUN native-image \
13 | --no-server \
14 | -Djava.net.preferIPv4Stack=true \
15 | -Dio.netty.noUnsafe=true \
16 | -Dvertx.disableDnsResolver=true \
17 | -H:+ReportUnsupportedElementsAtRuntime \
18 | -H:ReflectionConfigurationFiles=./reflectconfigs/netty.json \
19 | -jar "target/vxms-core-demo-fat.jar"
20 |
21 | # Create new image from alpine
22 | FROM frolvlad/alpine-glibc:alpine-3.8
23 | RUN apk add --no-cache ca-certificates
24 | # Copy generated native executable from build-aot
25 | COPY --from=build-aot /app/vxms-core-demo-fat /vxms-core-demo-fat
26 | # Set the entrypoint
27 | ENTRYPOINT [ "/vxms-core-demo-fat" ]
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/common/DefaultServerOptions.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.common;
18 |
19 | /**
20 | * Created by Andy Moncsek on 18.07.16.
21 | * Defines the default http server serverOptions if no custom option is defined
22 | */
23 | public class DefaultServerOptions implements CustomServerOptions {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/common/AsyncResultHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.common;
18 |
19 | import io.vertx.core.AsyncResult;
20 | import io.vertx.core.Handler;
21 |
22 | /**
23 | * Created by amo on 12.03.17.
24 | * Handles Async results
25 | */
26 | public interface AsyncResultHandler extends Handler> {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/common/configuration/DefaultRouterConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.common.configuration;
18 |
19 | /**
20 | * Created by Andy Moncsek on 27.01.16.
21 | * Default endpoint configuration when none is defined
22 | */
23 | public class DefaultRouterConfiguration implements RouterConfiguration {
24 |
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | import org.jacpfx.vxms.spi.EventhandlerSPI;
2 |
3 | module vxms.core {
4 | requires vertx.core;
5 | requires vertx.web;
6 | requires java.logging;
7 | requires java.management;
8 |
9 | exports org.jacpfx.vxms.spi;
10 | exports org.jacpfx.vxms.common.encoder;
11 | exports org.jacpfx.vxms.common.decoder;
12 | exports org.jacpfx.vxms.common.concurrent to vxms.rest.base,vxms.rest,vxms.rest.rs,vxms.event, vxms.k8sdiscovery;
13 | exports org.jacpfx.vxms.common.util to vxms.rest.base,vxms.rest,vxms.rest.rs,vxms.event, vxms.k8sdiscovery;
14 | exports org.jacpfx.vxms.common to vxms.rest.base,vxms.rest,vxms.rest.rs,vxms.event, vxms.k8sdiscovery;
15 | exports org.jacpfx.vxms.common.configuration;
16 | exports org.jacpfx.vxms.services;
17 | exports org.jacpfx.vxms.common.throwable;
18 |
19 | uses org.jacpfx.vxms.spi.EventhandlerSPI;
20 | uses org.jacpfx.vxms.spi.RESThandlerSPI;
21 | uses org.jacpfx.vxms.spi.ServiceDiscoverySPI;
22 | uses org.jacpfx.vxms.spi.WebSockethandlerSPI;
23 | }
--------------------------------------------------------------------------------
/vxms-demos/vxms-core-demo/src/main/java/module-info-graal.java1:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | open module vxms.core.demo {
19 | requires vxms.core;
20 | requires vertx.core;
21 | requires vertx.web;
22 | requires io.netty.codec;
23 | requires io.netty.codec.http;
24 | requires java.logging;
25 | requires java.management;
26 |
27 | exports org.jacpfx.vxms.verticle to vxms.core,vertx.core;
28 |
29 | }
--------------------------------------------------------------------------------
/vxms-k8sdiscovery/src/main/java/org/jacpfx/vxms/k8s/api/DefaultCustomClientConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.k8s.api;
18 |
19 | /**
20 | * The default implementation for a custom kubernetes client implementation. The should return null, so the annotation and property based configuration should match
21 | */
22 | public class DefaultCustomClientConfig implements CustomClientConfig {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-read/src/main/java/org/jacpfx/vxms/k8sread/ReadApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.k8sread;
18 |
19 |
20 | import org.springframework.context.annotation.ComponentScan;
21 | import org.springframework.context.annotation.Configuration;
22 |
23 |
24 | @Configuration
25 | @ComponentScan
26 | public class ReadApplication {
27 |
28 |
29 |
30 |
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/common/exceptions/EndpointExecutionException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.common.exceptions;
18 |
19 | /**
20 | * Created by Andy Moncsek on 30.11.15.
21 | * The endpoint execution exception
22 | */
23 | public class EndpointExecutionException extends RuntimeException {
24 |
25 |
26 | public EndpointExecutionException(Throwable cause) {
27 | super(cause);
28 | }
29 |
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/vxms-event/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | module vxms.event {
19 | requires vxms.core;
20 | requires vertx.core;
21 | requires vertx.web;
22 | requires io.netty.codec;
23 | requires io.netty.codec.http;
24 | requires java.logging;
25 | requires java.management;
26 |
27 | exports org.jacpfx.vxms.event.annotation;
28 |
29 | provides org.jacpfx.vxms.spi.EventhandlerSPI with org.jacpfx.vxms.event.Eventhandler;
30 |
31 |
32 | }
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-write/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | module vxms.k8s.write.demo {
19 | requires vxms.core;
20 | requires vertx.core;
21 | requires vxms.rest;
22 | requires vertx.web;
23 | requires vertx.mongo.client;
24 | requires java.logging;
25 | requires java.management;
26 | requires java.ws.rs;
27 | requires io.netty.codec.http;
28 |
29 | uses org.jacpfx.vxms.spi.RESThandlerSPI;
30 |
31 | }
--------------------------------------------------------------------------------
/vxms-demos/vxms-secure-spa-demo/src/main/java/org/jacpfx/vxms/spa/config/SpringConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.spa.config;
18 |
19 | import org.springframework.context.annotation.ComponentScan;
20 | import org.springframework.context.annotation.Configuration;
21 |
22 | /**
23 | * Created by Andy Moncsek on 28.01.16.
24 | */
25 | @Configuration
26 | @ComponentScan(basePackages = "org.jacpfx.vxms.spa.beans")
27 | public class SpringConfig {
28 | }
29 |
--------------------------------------------------------------------------------
/vxms-testing/src/test/java/org/jacpfx/kuberenetes/TestingClientConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2017] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.kuberenetes;
18 |
19 | import io.fabric8.kubernetes.client.Config;
20 | import io.vertx.core.Vertx;
21 | import org.jacpfx.vxms.k8s.api.CustomClientConfig;
22 |
23 | public class TestingClientConfig implements CustomClientConfig {
24 | public static Config config;
25 |
26 | public Config createCustomConfiguration(Vertx vertx) {
27 | return config;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/vxms-testing/src/test/java/org/jacpfx/entity/decoder/ExampleByteDecoder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2017] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.entity.decoder;
18 |
19 | import java.util.Optional;
20 | import org.jacpfx.vxms.common.decoder.Decoder;
21 |
22 | /** Created by Andy Moncsek on 18.11.15. */
23 | public class ExampleByteDecoder implements Decoder.ByteDecoder {
24 |
25 | @Override
26 | public Optional decode(byte[] input) {
27 | return Optional.of(new String(input));
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-rest-demo/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | module vxms.rest.demo {
19 | requires vxms.core;
20 | requires vertx.core;
21 | requires vxms.rest;
22 | requires vertx.web;
23 | requires java.logging;
24 | requires java.management;
25 | requires java.ws.rs;
26 | requires io.netty.codec.http;
27 |
28 | uses org.jacpfx.vxms.spi.RESThandlerSPI;
29 | opens org.jacpfx.vxms.verticle;
30 | exports org.jacpfx.vxms.verticle to vxms.core, vertx.core;
31 |
32 | }
--------------------------------------------------------------------------------
/vxms-demos/vxms-spring-demo/temp.txt:
--------------------------------------------------------------------------------
1 | target/moditect --add-modules io.netty.buffer,io.netty.common,reactor.core,org.reactivestreams,io.reactivex.rxjava2,rxjava,rxjava.reactive.streams,jopt.simple,aspectjweaver,kotlin.reflect,kotlin.stdlib,annotations,spring.jcl --module-path netty-buffer-4.1.19.Final.jar:netty-common-4.1.19.Final.jar:.m2/repository/io/projectreactor/reactor-core/3.1.7.RELEASE/reactor-core-3.1.7.RELEASE.jar:.m2/repository/org/reactivestreams/reactive-streams/1.0.2/reactive-streams-1.0.2.jar:.m2/repository/io/reactivex/rxjava2/rxjava/2.1.13/rxjava-2.1.13.jar:.m2/repository/io/reactivex/rxjava/1.3.8/rxjava-1.3.8.jar:.m2/repository/io/reactivex/rxjava-reactive-streams/1.2.1/rxjava-reactive-streams-1.2.1.jar:.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:aspectjweaver-1.8.10.jar:.m2/repository/org/jetbrains/kotlin/kotlin-reflect/1.2.41/kotlin-reflect-1.2.41.jar:.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.2.41/kotlin-stdlib-1.2.41.jar:.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar:spring-jcl-5.0.6.RELEASE.jar .m2/repository/org/springframework/spring-core/5.0.6.RELEASE/spring-core-5.0.6.RELEASE.jar
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-read/src/main/java/org/jacpfx/vxms/k8sread/repository/ReactiveUserRepository.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.k8sread.repository;
18 |
19 |
20 | import org.jacpfx.vxms.k8sread.entity.Users;
21 | import org.springframework.data.repository.reactive.ReactiveCrudRepository;
22 |
23 | /**
24 | * Created by Andy Moncsek on 22.06.17.
25 | */
26 |
27 | public interface ReactiveUserRepository extends ReactiveCrudRepository {
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/vxms-testing/src/test/resources/ca.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIC5zCCAc+gAwIBAgIBATANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDEwptaW5p
3 | a3ViZUNBMB4XDTE3MTIxMjA5MjExNVoXDTI3MTIxMDA5MjExNVowFTETMBEGA1UE
4 | AxMKbWluaWt1YmVDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMj5
5 | HZ7bMkfMW7uDLiZywuqz5BHiRu5OtZhr5PHprOk33GK94CjHM1EQLo5Rl1FVwMdM
6 | JGX5aI2OXbafwlIt//olDNjtM/ygCGfuXhY+JxAwqABVrDUdniErFFnXt1JuKU7W
7 | OhxhAQd7urjS3CgKaIqw3msjQkxhcsSq3PGJr95AkQPL+3FMeZF29Jm53sx4x8MF
8 | U1+eyTWOTJoxu3G4BXe2NWOR8avB74aVfppIyX4fiQqWI91h5UOekEGfAfvnLDsl
9 | CnpaNhFnMLehYFD4VD/kF1rESNdvyqxKVa7+MgN40kE+ckRDpp0klW/+OGyn9pRl
10 | 1usJWih4RJnDEbvfuasCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgKkMB0GA1UdJQQW
11 | MBQGCCsGAQUFBwMCBggrBgEFBQcDATAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3
12 | DQEBCwUAA4IBAQAXdBExvXYan1SWLNaCeQFzGHEWNKumwExY8tvQD7Itg3C1V5AN
13 | q63wSPCck1GsrzwUkrgOpch+UjkXfT3ObGLrS/l/3oTmRNdAgyXVodqGyPNHQdVw
14 | yKNxRCZaXeEwVhPS2EWz+nKjb8m+sjmFuGWQAClOF8Q7EReX0aUz7vxFTwHRd4Yx
15 | SgWoaw6w4S8X5O38+cUGREcuYSRtOrZM2GpyS4fk8U7oFGLx1+7nssSKN4C8jKB0
16 | b91euHqstVis/rfGQKCngqGSkWbwnQG4u0DKXHQFiLZ0Vghhery80YWPI9nS+YSD
17 | pRpdNsOlsqvee+DMDUaXcKNBprHt38bEOsEr
18 | -----END CERTIFICATE-----
19 |
--------------------------------------------------------------------------------
/vxms-testing/src/test/java/org/jacpfx/verticle/MyCustomServerOptions.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2017] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.verticle;
18 |
19 | import io.vertx.core.http.HttpServerOptions;
20 | import io.vertx.core.json.JsonObject;
21 | import org.jacpfx.vxms.common.CustomServerOptions;
22 |
23 | public class MyCustomServerOptions implements CustomServerOptions {
24 | public HttpServerOptions getServerOptions(JsonObject config) {
25 | System.out.println("custom serverOptions");
26 | return new HttpServerOptions();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/spi/ServiceDiscoverySPI.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.spi;
18 |
19 | import io.vertx.core.AbstractVerticle;
20 |
21 | /**
22 | * SPI for Service discovery in vxms
23 | * @author Andy Moncsek
24 | */
25 | public interface ServiceDiscoverySPI {
26 |
27 | /**
28 | * Initialize the service discovery for a provided AbstractVerticle
29 | * @param service, the service {@link io.vertx.core.AbstractVerticle}
30 | */
31 | void initDiscovery(AbstractVerticle service);
32 | }
33 |
--------------------------------------------------------------------------------
/vxms-event/src/main/java/org/jacpfx/vxms/event/Eventhandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.event;
18 |
19 | import io.vertx.core.AbstractVerticle;
20 | import org.jacpfx.vxms.common.VxmsShared;
21 | import org.jacpfx.vxms.spi.EventhandlerSPI;
22 |
23 | /** Created by amo on 05.08.16. */
24 | public class Eventhandler implements EventhandlerSPI {
25 |
26 | @Override
27 | public void initEventHandler(VxmsShared vxmsShared, AbstractVerticle service) {
28 | EventInitializer.initEventbusHandling(vxmsShared, service);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/vxms-testing/src/test/java/org/jacpfx/entity/encoder/ExampleStringEncoder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2017] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.entity.encoder;
18 |
19 | import com.google.gson.Gson;
20 | import org.jacpfx.entity.Payload;
21 | import org.jacpfx.vxms.common.encoder.Encoder;
22 |
23 | /** Created by Andy Moncsek on 25.11.15. */
24 | public class ExampleStringEncoder implements Encoder.StringEncoder> {
25 |
26 | @Override
27 | public String encode(Payload input) {
28 | Gson gg = new Gson();
29 | return gg.toJson(input);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/common/throwable/ThrowableSupplier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.common.throwable;
18 |
19 | /**
20 | * Created by Andy Moncsek on 27.11.15.
21 | * A supplier that throws a throwable, so vxms can handle the exceptions
22 | * @param the type of return
23 | */
24 | @FunctionalInterface
25 | public interface ThrowableSupplier {
26 |
27 | /**
28 | * the supplier method
29 | *
30 | * @return the value
31 | * @throws Throwable the throwable
32 | */
33 | T get() throws Throwable;
34 | }
35 |
--------------------------------------------------------------------------------
/vxms-testing/src/test/resources/client.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDADCCAeigAwIBAgIBAjANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDEwptaW5p
3 | a3ViZUNBMB4XDTE3MTIxMjA5MjExNloXDTE4MTIxMjA5MjExNlowMTEXMBUGA1UE
4 | ChMOc3lzdGVtOm1hc3RlcnMxFjAUBgNVBAMTDW1pbmlrdWJlLXVzZXIwggEiMA0G
5 | CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsh2oZKXfID6auIGBQxjPXlkn/PNqr
6 | zp5fQwm0CUr5S8+DN6m2WiHjIUhAIpRwkpnRoES8UUXN270cF4g1xS1pQp7uqsT/
7 | HA6/DF1L2Mv7QuRzT9z/fifFhkV2CkH6JS+xMouxivMPc0qroktL2VfIiF33cxiS
8 | SkIEb7RtUJgUgsVspvHStpc+DImgbBZyRQ/K/V15moj3bg0L4aFnNqCk0MeV24/k
9 | Y45elGDjcNtCdALMCSKOY5ymJ1BqGJUWAcbFRZdJmCee2NTJzeWW2YoIu0f/Zgzi
10 | 0+X5/hLGgb+22Y09AKzoNWudC+p5bYc8HZ102uL/Br2GOXZR4utJ8FdpAgMBAAGj
11 | PzA9MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUH
12 | AwIwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAQEAkaa2JaKoSZVa0WZg
13 | AnvAtQLi35JLEnAK+J2LyUk42C1Tczzd1vt8o0mq/8EH1VdLcZIapPC6Vlr2eN6c
14 | bre/Pj63gxzigqlkLnHHD2aFJn5ENpuPbIhR2e9O3K1hmTmLUfmA3tTHkUuMPV5b
15 | rlZpDTDYuWjBIj+qBfszzOfiRTT9m2tfdrssOx6reLaCHSBGfvli4YTgqG42siuX
16 | WXpSFupNy96LdBxiEjDVhnbKCW3sDbcnpY3fI4EsX+3ecFKjYk1cgxLbUcXQ21X4
17 | DLjNAVx6zHCWWP5B4JUVCu39WxFzXR7vU3Ymdkx5ws3pM1fQuHRZkXebmj1PhP4Q
18 | 4fQgwg==
19 | -----END CERTIFICATE-----
20 |
--------------------------------------------------------------------------------
/vxms-k8sdiscovery/src/main/java/org/jacpfx/vxms/k8s/util/StringUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.k8s.util;
18 |
19 | /**
20 | * Simple String util
21 | * Created by amo on 06.04.17.
22 | */
23 | public class StringUtil {
24 |
25 | /**
26 | * Determine if a string is {@code null} or {@link String#isEmpty()} returns {@code true}.
27 | *
28 | * @param s, the String to test
29 | * @return true if String is null or empty
30 | */
31 | public static boolean isNullOrEmpty(String s) {
32 | return s == null || s.isEmpty();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-spring-demo/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | open module vxms.spring.demo {
19 | requires vxms.core;
20 | requires vertx.core;
21 | requires spring.context;
22 | requires spring.core;
23 | requires jacpfx.vertx.spring;
24 | requires vxms.rest;
25 | requires vertx.web;
26 | requires java.logging;
27 | requires java.management;
28 | requires java.ws.rs;
29 | requires javax.inject;
30 | requires io.netty.codec.http;
31 |
32 |
33 | uses org.jacpfx.vxms.spi.RESThandlerSPI;
34 | exports org.jacpfx.vxms.spring;
35 |
36 |
37 |
38 | }
--------------------------------------------------------------------------------
/vxms-k8sdiscovery/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | module vxms.k8sdiscovery {
19 | requires vxms.core;
20 | requires vertx.core;
21 | requires vertx.web;
22 | requires io.netty.codec;
23 | requires io.netty.codec.http;
24 | requires java.logging;
25 | requires java.management;
26 | requires kubernetes.client;
27 | requires kubernetes.model;
28 | requires fabric8.annotations;
29 |
30 | exports org.jacpfx.vxms.k8s.annotation;
31 |
32 | provides org.jacpfx.vxms.spi.ServiceDiscoverySPI with org.jacpfx.vxms.k8s.client.VxmsDiscoveryK8SImpl;
33 |
34 |
35 | }
--------------------------------------------------------------------------------
/vxms-demos/vxms-secure-spa-demo/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | module vxms.spa.demo {
19 | requires vxms.core;
20 | requires vertx.core;
21 | requires vertx.auth.oauth2;
22 | requires vertx.auth.common;
23 | requires spring.context;
24 | requires vxms.rest;
25 | requires vertx.web;
26 | requires java.logging;
27 | requires java.management;
28 | requires java.ws.rs;
29 | requires javax.inject;
30 | requires java.xml.ws.annotation;
31 | requires io.netty.codec.http;
32 | requires jacpfx.vertx.spring;
33 |
34 | uses org.jacpfx.vxms.spi.RESThandlerSPI;
35 |
36 | }
--------------------------------------------------------------------------------
/vxms-demos/vxms-secure-spa-demo/src/main/resources/webroot/index.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 | AngularJs
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/spi/EventhandlerSPI.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.spi;
18 |
19 | import io.vertx.core.AbstractVerticle;
20 | import org.jacpfx.vxms.common.VxmsShared;
21 |
22 | /**
23 | * Created by amo on 05.08.16.
24 | */
25 | public interface EventhandlerSPI {
26 |
27 | /**
28 | * initialize the event-bus API
29 | *
30 | * @param vxmsShared the vxmsShared instance, containing the Vertx instance and other shared
31 | * objects per instance
32 | * @param service the verticle to be applied
33 | */
34 | void initEventHandler(VxmsShared vxmsShared, AbstractVerticle service);
35 | }
36 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-frontend/src/main/resources/webroot/index.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 | AngularJs
22 |
23 |
24 |
25 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-frontend/src/main/java/org/jacpfx/vxms/frontend/configuration/CustomRouterConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.frontend.configuration;
18 |
19 | import io.vertx.ext.web.Router;
20 | import io.vertx.ext.web.handler.StaticHandler;
21 | import org.jacpfx.vxms.common.configuration.RouterConfiguration;
22 |
23 | /**
24 | * Created by Andy Moncsek on 18.02.16.
25 | */
26 | public class CustomRouterConfig implements RouterConfiguration {
27 |
28 | @Override
29 | public void staticHandler(Router router) {
30 |
31 | router.route().handler(StaticHandler.create());
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/.github/workflows/maven.yml:
--------------------------------------------------------------------------------
1 | # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3 |
4 | # This workflow uses actions that are not certified by GitHub.
5 | # They are provided by a third-party and are governed by
6 | # separate terms of service, privacy policy, and support
7 | # documentation.
8 |
9 | name: Java CI with Maven
10 |
11 | on:
12 | push:
13 | branches: [ "master" ]
14 | pull_request:
15 | branches: [ "master" ]
16 |
17 | jobs:
18 | build:
19 |
20 | runs-on: ubuntu-latest
21 |
22 | steps:
23 | - uses: actions/checkout@v4
24 | - name: Set up JDK 17
25 | uses: actions/setup-java@v4
26 | with:
27 | java-version: '17'
28 | distribution: 'temurin'
29 | cache: maven
30 | - name: Build with Maven
31 | run: mvn -B package --file pom.xml
32 |
33 | # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
34 | - name: Update dependency graph
35 | uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
36 |
--------------------------------------------------------------------------------
/vxms-core/src/test/resources/vertx-default-jul-logging.properties-tmp:
--------------------------------------------------------------------------------
1 | -#
2 | # Copyright 2014 Red Hat, Inc.
3 | #
4 | # All rights reserved. This program and the accompanying materials
5 | # are made available under the terms of the Eclipse Public License v1.0
6 | # and Apache License v2.0 which accompanies this distribution.
7 | #
8 | # The Eclipse Public License is available at
9 | # http://www.eclipse.org/legal/epl-v10.html
10 | #
11 | # The Apache License v2.0 is available at
12 | # http://www.opensource.org/licenses/apache2.0.php
13 | #
14 | # You may elect to redistribute this code under either of these licenses.
15 | #
16 | handlers=java.util.logging.ConsoleHandler,java.util.logging.FileHandler
17 | java.util.logging.SimpleFormatter.format=%5$s %6$s\n
18 | java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
19 | java.util.logging.ConsoleHandler.level=INFO
20 | java.util.logging.FileHandler.level=INFO
21 | java.util.logging.FileHandler.formatter=io.vertx.core.logging.impl.VertxLoggerFormatter
22 |
23 | # Put the log in the system temporary directory
24 | java.util.logging.FileHandler.pattern=%failure/vertx.log
25 |
26 | .level=INFO
27 | io.vertx.ext.web.level=INFO
28 | io.vertx.level=INFO
29 | com.hazelcast.level=INFO
30 | io.netty.util.internal.PlatformDependent.level=SEVERE
--------------------------------------------------------------------------------
/vxms-testing/src/test/resources/vertx-default-jul-logging.properties-tmp:
--------------------------------------------------------------------------------
1 | -#
2 | # Copyright 2014 Red Hat, Inc.
3 | #
4 | # All rights reserved. This program and the accompanying materials
5 | # are made available under the terms of the Eclipse Public License v1.0
6 | # and Apache License v2.0 which accompanies this distribution.
7 | #
8 | # The Eclipse Public License is available at
9 | # http://www.eclipse.org/legal/epl-v10.html
10 | #
11 | # The Apache License v2.0 is available at
12 | # http://www.opensource.org/licenses/apache2.0.php
13 | #
14 | # You may elect to redistribute this code under either of these licenses.
15 | #
16 | handlers=java.util.logging.ConsoleHandler,java.util.logging.FileHandler
17 | java.util.logging.SimpleFormatter.format=%5$s %6$s\n
18 | java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
19 | java.util.logging.ConsoleHandler.level=INFO
20 | java.util.logging.FileHandler.level=INFO
21 | java.util.logging.FileHandler.formatter=io.vertx.core.logging.impl.VertxLoggerFormatter
22 |
23 | # Put the log in the system temporary directory
24 | java.util.logging.FileHandler.pattern=%failure/vertx.log
25 |
26 | .level=INFO
27 | io.vertx.ext.web.level=INFO
28 | io.vertx.level=INFO
29 | com.hazelcast.level=INFO
30 | io.netty.util.internal.PlatformDependent.level=SEVERE
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-frontend/src/main/java/org/jacpfx/vxms/k8sfrontend/configuration/CustomRouterConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.k8sfrontend.configuration;
18 |
19 | import io.vertx.ext.web.Router;
20 | import io.vertx.ext.web.handler.StaticHandler;
21 | import org.jacpfx.vxms.common.configuration.RouterConfiguration;
22 |
23 | /**
24 | * Created by Andy Moncsek on 11.05.17.
25 | */
26 | public class CustomRouterConfig implements RouterConfiguration {
27 |
28 | @Override
29 | public void staticHandler(Router router) {
30 |
31 | router.route().handler(StaticHandler.create());
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/vxms-k8sdiscovery/src/main/java/org/jacpfx/vxms/k8s/api/CustomClientConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.k8s.api;
18 |
19 | import io.fabric8.kubernetes.client.Config;
20 | import io.vertx.core.Vertx;
21 |
22 | /**
23 | * interface to define a custom implementation for a kubernetes client configuration
24 | */
25 | public interface CustomClientConfig {
26 |
27 | /**
28 | * Return a custom client implementation to connect to the kubernetes Master
29 | * @param vertx the vert.x instance
30 | * @return the configuration object
31 | */
32 | default Config createCustomConfiguration(Vertx vertx){
33 | return null;
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/common/throwable/ThrowableFunction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.common.throwable;
18 |
19 | /**
20 | * Created by Andy Moncsek on 12.04.16.
21 | * A function that throws a throwable, so vxms can handle the exceptions
22 | * @param the input type
23 | * @param the return type
24 | */
25 | @FunctionalInterface
26 | public interface ThrowableFunction {
27 |
28 | /**
29 | * Applies this function to the given argument.
30 | *
31 | * @param t the function argument
32 | * @return the function result
33 | * @throws Throwable the throwable
34 | */
35 | R apply(T t) throws Throwable;
36 | }
37 |
--------------------------------------------------------------------------------
/vxms-event/src/main/java/org/jacpfx/vxms/event/annotation/Consume.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.event.annotation;
18 |
19 | import java.lang.annotation.Documented;
20 | import java.lang.annotation.ElementType;
21 | import java.lang.annotation.Retention;
22 | import java.lang.annotation.RetentionPolicy;
23 | import java.lang.annotation.Target;
24 |
25 | @Target({ElementType.TYPE, ElementType.METHOD})
26 | @Retention(RetentionPolicy.RUNTIME)
27 | @Documented
28 | /**
29 | * Defines an eventbus consumer id
30 | */
31 | public @interface Consume {
32 |
33 | /**
34 | * The consumer ID
35 | *
36 | * @return the ID
37 | */
38 | String value();
39 | }
40 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-spring-demo/src/main/java/org/jacpfx/vxms/spring/beans/HelloWorldBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.spring.beans;
18 |
19 | import org.springframework.stereotype.Component;
20 |
21 | /**
22 | * Created by Andy Moncsek on 28.01.16.
23 | */
24 | @Component
25 | public class HelloWorldBean {
26 | public String sayHallo(){
27 | return "hello world";
28 | }
29 |
30 | public String sayHallo(String name){
31 | // System.out.println("got name: "+name);
32 | return "hello world "+name;
33 | }
34 |
35 | public String seyHelloWithException() {
36 | throw new NullPointerException("stupid exception");
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/vxms-testing/src/test/java/org/jacpfx/entity/encoder/ExampleByteEncoder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2017] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.entity.encoder;
18 |
19 | import java.io.IOException;
20 | import org.jacpfx.entity.Payload;
21 | import org.jacpfx.vxms.common.encoder.Encoder;
22 | import org.jacpfx.vxms.common.util.Serializer;
23 |
24 | /** Created by Andy Moncsek on 25.11.15. */
25 | public class ExampleByteEncoder implements Encoder.ByteEncoder> {
26 |
27 | @Override
28 | public byte[] encode(Payload input) {
29 | try {
30 | return Serializer.serialize(input);
31 | } catch (IOException e) {
32 | e.printStackTrace();
33 | }
34 | return new byte[0];
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-core-demo/src/main/java/org/jacpfx/vxms/verticle/Runner.java:
--------------------------------------------------------------------------------
1 | package org.jacpfx.vxms.verticle;
2 |
3 | import java.io.File;
4 |
5 | import io.vertx.core.Vertx;
6 | import io.vertx.core.logging.Logger;
7 | import io.vertx.core.logging.LoggerFactory;
8 | import io.vertx.core.logging.SLF4JLogDelegateFactory;
9 | import io.vertx.ext.web.Router;
10 |
11 | public class Runner {
12 |
13 | public static void main(String[] args) {
14 | // Use logback for logging
15 | File logbackFile = new File("config", "logback.xml");
16 | System.setProperty("logback.configurationFile", logbackFile.getAbsolutePath());
17 | System.setProperty(LoggerFactory.LOGGER_DELEGATE_FACTORY_CLASS_NAME, SLF4JLogDelegateFactory.class.getName());
18 | Logger log = LoggerFactory.getLogger(Runner.class);
19 |
20 | // Setup the http server
21 | log.info("Starting server for: http://localhost:8080/hello");
22 | Vertx vertx = Vertx.vertx();
23 | Router router = Router.router(vertx);
24 |
25 | router.route("/hello").handler(rc -> {
26 | log.info("Got hello request");
27 | rc.response().end("World");
28 | });
29 |
30 | vertx.createHttpServer()
31 | .requestHandler(router::accept)
32 | .listen(8080);
33 |
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/common/CustomServerOptions.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.common;
18 |
19 | import io.vertx.core.http.HttpServerOptions;
20 | import io.vertx.core.json.JsonObject;
21 |
22 | /**
23 | * Created by Andy Moncsek on 18.07.16.
24 | * Interface for custom http server option definition
25 | */
26 | public interface CustomServerOptions {
27 |
28 | /**
29 | * Return the HttpServerOptions for a specific vxms service
30 | * @param config the verticle configuration object
31 | * @return the serverOptions {@link io.vertx.core.http.HttpServerOptions}
32 | */
33 | default HttpServerOptions getServerOptions(JsonObject config) {
34 | return new HttpServerOptions();
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-read/src/main/resources/vertx-default-jul-logging.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright [2018] [Andy Moncsek]
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 | handlers=java.util.logging.ConsoleHandler,java.util.logging.FileHandler
17 | java.util.logging.SimpleFormatter.format=%5$s %6$s\n
18 | java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
19 | java.util.logging.ConsoleHandler.level=INFO
20 | java.util.logging.FileHandler.level=INFO
21 | java.util.logging.FileHandler.formatter=io.vertx.core.logging.impl.VertxLoggerFormatter
22 |
23 | # Put the log in the system temporary directory
24 | java.util.logging.FileHandler.pattern=%t/vertx.log
25 |
26 | logging.level.*=OFF
27 | io.vertx=INFO
28 | io.netty.buffer=INFO
29 | io.netty.util.internal.PlatformDependent.level=SEVERE
--------------------------------------------------------------------------------
/vxms-demos/vxms-secure-spa-demo/src/main/resources/vertx-default-jul-logging.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright [2018] [Andy Moncsek]
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 | handlers=java.util.logging.ConsoleHandler,java.util.logging.FileHandler
17 | java.util.logging.SimpleFormatter.format=%5$s %6$s\n
18 | java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
19 | java.util.logging.ConsoleHandler.level=INFO
20 | java.util.logging.FileHandler.level=INFO
21 | java.util.logging.FileHandler.formatter=io.vertx.core.logging.impl.VertxLoggerFormatter
22 |
23 | # Put the log in the system temporary directory
24 | java.util.logging.FileHandler.pattern=vertx.log
25 |
26 | .level=INFO
27 | io.vertx.ext.web.level=INFO
28 | io.vertx.level=INFO
29 | com.hazelcast.level=INFO
30 | io.netty.util.internal.PlatformDependent.level=SEVERE
--------------------------------------------------------------------------------
/vxms-event/src/main/java/org/jacpfx/vxms/event/annotation/OnEventError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.event.annotation;
18 |
19 | import java.lang.annotation.Documented;
20 | import java.lang.annotation.ElementType;
21 | import java.lang.annotation.Retention;
22 | import java.lang.annotation.RetentionPolicy;
23 | import java.lang.annotation.Target;
24 |
25 | @Target({ElementType.TYPE, ElementType.METHOD})
26 | @Retention(RetentionPolicy.RUNTIME)
27 | @Documented
28 | /** marks fallback methods to be executed wenn an exception in method occurred and not handled **/
29 | public @interface OnEventError {
30 |
31 | /**
32 | * the path name
33 | *
34 | * @return the name of the Consumes path
35 | */
36 | String value();
37 | }
38 |
--------------------------------------------------------------------------------
/vxms-testing/src/test/java/org/jacpfx/other/GetPidTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2017] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.other;
18 |
19 | import org.junit.Ignore;
20 | import org.junit.Test;
21 |
22 | /** Created by amo on 17.01.17. */
23 | public class GetPidTest {
24 |
25 | public static String getPID() {
26 | String processName = java.lang.management.ManagementFactory.getRuntimeMXBean().getName();
27 | if (processName != null && processName.length() > 0) {
28 | try {
29 | return processName.split("@")[0];
30 | } catch (Exception e) {
31 | return "0";
32 | }
33 | }
34 |
35 | return "0";
36 | }
37 |
38 | @Test
39 | @Ignore
40 | public void testGetPid() {
41 | System.out.println("test: " + getPID());
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/common/throwable/ThrowableFutureConsumer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.common.throwable;
18 |
19 | import io.vertx.core.Future;
20 | import io.vertx.core.Promise;
21 |
22 | /**
23 | * Created by Andy Moncsek on 21.01.16.
24 | *
25 | * A consumer that throws a throwable, so vxms can handle the exceptions
26 | * @param the return type
27 | */
28 | @FunctionalInterface
29 | public interface ThrowableFutureConsumer {
30 |
31 |
32 | /**
33 | * Performs this operation on the given argument.
34 | *
35 | * @param operationResult the input argument with the return type
36 | * @throws Throwable the throwable
37 | */
38 | void accept(Promise operationResult) throws Throwable;
39 | }
40 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-spring-demo/src/main/java/org/jacpfx/vxms/spring/configuration/SpringConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.spring.configuration;
18 |
19 | import org.jacpfx.vxms.spring.beans.HelloWorldBean;
20 | import org.springframework.context.annotation.Bean;
21 | import org.springframework.context.annotation.ComponentScan;
22 | import org.springframework.context.annotation.Configuration;
23 | import org.springframework.stereotype.Component;
24 |
25 | /**
26 | * Created by Andy Moncsek on 28.01.16.
27 | */
28 | @Configuration
29 | //@ComponentScan(basePackages = "org.jacpfx.vxms.spring.beans")
30 | public class SpringConfig {
31 | @Bean
32 | public HelloWorldBean getHelloWorldBean() {
33 | return new HelloWorldBean();
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/vxms-k8sdiscovery/src/main/java/org/jacpfx/vxms/k8s/util/FieldUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.k8s.util;
18 |
19 | import java.lang.reflect.Field;
20 |
21 | /**
22 | * Simple reflection util
23 | * Created by amo on 13.04.17.
24 | */
25 | public class FieldUtil {
26 |
27 | /**
28 | * set a value to a class member
29 | * @param bean the object to invoke
30 | * @param serviceNameField the name of the member
31 | * @param value the value
32 | */
33 | public static void setFieldValue(Object bean, Field serviceNameField, Object value) {
34 | serviceNameField.setAccessible(true);
35 | try {
36 | serviceNameField.set(bean, value);
37 | } catch (IllegalAccessException e) {
38 | e.printStackTrace();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/common/throwable/ThrowableErrorConsumer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.common.throwable;
18 |
19 | import io.vertx.core.Future;
20 |
21 | /**
22 | * Created by Andy Moncsek on 21.01.16.
23 | * A consumer that throws a throwable, so vxms can handle the exceptions
24 | * @param the type of the response
25 | * @param the type of the error value
26 | */
27 | @FunctionalInterface
28 | public interface ThrowableErrorConsumer {
29 |
30 | /**
31 | * Performs this operation on the given argument.
32 | *
33 | * @param error, the error
34 | * @param operationResult the response argument
35 | * @throws Throwable the throwable
36 | */
37 | void accept(T error, Future operationResult) throws Throwable;
38 | }
39 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/spi/WebSockethandlerSPI.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.spi;
18 |
19 | import io.vertx.core.AbstractVerticle;
20 | import io.vertx.core.Vertx;
21 | import io.vertx.core.http.HttpServer;
22 | import io.vertx.core.json.JsonObject;
23 |
24 | /**
25 | * WebSocket SPI for vxms
26 | * Created by amo on 05.08.16.
27 | */
28 | public interface WebSockethandlerSPI {
29 |
30 | /**
31 | * Initialize the WebSocket implementation
32 | * @param server the preconfigured HttpServer provided by vxms
33 | * @param vertx the Vert.x iunstance
34 | * @param config the Verticle configuration
35 | * @param service the Service
36 | */
37 | void registerWebSocketHandler(HttpServer server, Vertx vertx, JsonObject config,
38 | AbstractVerticle service);
39 | }
40 |
--------------------------------------------------------------------------------
/vxms-core/pom.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
20 | 4.0.0
21 |
22 |
23 | org.jacpfx
24 | vxms
25 | 1.2-SNAPSHOT
26 | ../
27 |
28 |
29 | vxms-core
30 | jar
31 |
32 | vxms-core
33 | http://maven.apache.org
34 |
35 |
36 | UTF-8
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/vxms-testing/src/test/java/org/jacpfx/entity/decoder/ExampleByteDecoderPayload.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2017] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.entity.decoder;
18 |
19 | import java.io.IOException;
20 | import java.util.Optional;
21 | import org.jacpfx.entity.Payload;
22 | import org.jacpfx.vxms.common.decoder.Decoder;
23 | import org.jacpfx.vxms.common.util.Serializer;
24 |
25 | /** Created by Andy Moncsek on 18.11.15. */
26 | public class ExampleByteDecoderPayload implements Decoder.ByteDecoder> {
27 |
28 | @Override
29 | public Optional> decode(byte[] input) {
30 | try {
31 | return Optional.ofNullable((Payload) Serializer.deserialize(input));
32 | } catch (IOException | ClassNotFoundException e) {
33 | e.printStackTrace();
34 | }
35 | return Optional.empty();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-read/src/main/fabric8/configmap.yml:
--------------------------------------------------------------------------------
1 | metadata:
2 | name: hazelcastconfig
3 | data:
4 | hazelcast.xml: |
5 |
8 |
9 |
10 | true
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
23 |
24 |
25 |
26 | cluster01
27 | true
28 | myproject
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-write/src/main/fabric8/configmap.yml:
--------------------------------------------------------------------------------
1 | metadata:
2 | name: hazelcastconfig
3 | data:
4 | hazelcast.xml: |
5 |
8 |
9 |
10 | true
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
23 |
24 |
25 |
26 | cluster01
27 | true
28 | myproject
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-frontend/src/main/fabric8/configmap.yml:
--------------------------------------------------------------------------------
1 | metadata:
2 | name: hazelcastconfig
3 | data:
4 | hazelcast.xml: |
5 |
8 |
9 |
10 | true
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
23 |
24 |
25 |
26 | cluster01
27 | true
28 | myproject
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/common/throwable/ThrowableFutureBiConsumer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.common.throwable;
18 |
19 | import io.vertx.core.Future;
20 | import io.vertx.core.Promise;
21 |
22 | /**
23 | * Created by Andy Moncsek on 21.01.16.
24 | * A bi function that throws a throwable, so vxms can handle the exceptions
25 | * @param the type of the input value
26 | * @param the type of the output value
27 | */
28 | @FunctionalInterface
29 | public interface ThrowableFutureBiConsumer {
30 |
31 | /**
32 | * Performs this operation on the given argument.
33 | *
34 | * @param operationResult the input argument
35 | * @param value the input argument
36 | * @throws Throwable the throwable
37 | */
38 | void accept(H value, Promise operationResult) throws Throwable;
39 | }
40 |
--------------------------------------------------------------------------------
/vxms-testing/src/test/java/org/jacpfx/entity/StaticContentRouterConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2017] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.entity;
18 |
19 | import io.vertx.ext.web.Router;
20 | import io.vertx.ext.web.handler.BodyHandler;
21 | import io.vertx.ext.web.handler.StaticHandler;
22 | import org.jacpfx.vxms.common.configuration.RouterConfiguration;
23 |
24 | /** Created by Andy Moncsek on 18.02.16. */
25 | public class StaticContentRouterConfig implements RouterConfiguration {
26 |
27 | public void staticHandler(Router router) {
28 | router.route("/static/*").handler(StaticHandler.create());
29 | System.out.println("-----");
30 | // Create a router endpoint for the static content.
31 | // router.route().handler(StaticHandler.create());
32 | }
33 |
34 | public BodyHandler bodyHandler() {
35 | return BodyHandler.create();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-spring-demo/jdeps2.txt:
--------------------------------------------------------------------------------
1 | jdeps --generate-module-info /Users/amo/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/moditect --module-path /Users/amo/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/netty-buffer-4.1.19.Final.jar:/Users/amo/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/netty-common-4.1.19.Final.jar:/Users/amo/.m2/repository/io/projectreactor/reactor-core/3.1.7.RELEASE/reactor-core-3.1.7.RELEASE.jar:/Users/amo/.m2/repository/org/reactivestreams/reactive-streams/1.0.2/reactive-streams-1.0.2.jar:/Users/amo/.m2/repository/io/reactivex/rxjava2/rxjava/2.1.13/rxjava-2.1.13.jar:/Users/amo/.m2/repository/io/reactivex/rxjava/1.3.8/rxjava-1.3.8.jar:/Users/amo/.m2/repository/io/reactivex/rxjava-reactive-streams/1.2.1/rxjava-reactive-streams-1.2.1.jar:/Users/amo/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/amo/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/aspectjweaver-1.8.10.jar:/Users/amo/.m2/repository/org/jetbrains/kotlin/kotlin-reflect/1.2.41/kotlin-reflect-1.2.41.jar:/Users/amo/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.2.41/kotlin-stdlib-1.2.41.jar:/Users/amo/.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar:/Users/amo/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/spring-jcl-5.0.6.RELEASE.jar /Users/amo/.m2/repository/org/springframework/spring-core/5.0.6.RELEASE/spring-core-5.0.6.RELEASE.jar
2 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-frontend/src/main/resources/webroot/tpl/lists.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
Users
18 |
19 |
20 |
21 |
Username
22 |
First Name
23 |
Last Name
24 |
Address
25 |
Options
26 |
27 |
28 |
29 |
30 |
{{user.username}}
31 |
{{user.firstName}}
32 |
{{user.lastName}}
33 |
{{user.address}}
34 |
35 |
36 |
37 |
38 |
39 | Add New User
--------------------------------------------------------------------------------
/vxms-testing/src/test/java/org/jacpfx/entity/decoder/ExampleByteDecoderMyTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2017] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.entity.decoder;
18 |
19 | import java.io.IOException;
20 | import java.util.Optional;
21 | import org.jacpfx.entity.MyTestObject;
22 | import org.jacpfx.vxms.common.decoder.Decoder;
23 | import org.jacpfx.vxms.common.util.Serializer;
24 |
25 | /** Created by Andy Moncsek on 18.11.15. */
26 | public class ExampleByteDecoderMyTest implements Decoder.ByteDecoder {
27 |
28 | @Override
29 | public Optional decode(byte[] input) {
30 | try {
31 | MyTestObject result = (MyTestObject) Serializer.deserialize(input);
32 | return Optional.ofNullable(result);
33 | } catch (IOException | ClassNotFoundException e) {
34 | e.printStackTrace();
35 | }
36 | return Optional.empty();
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/vxms-frontend/src/main/java/org/jacpfx/vxms/frontend/util/Runner.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.frontend.util;
18 |
19 | import io.vertx.core.DeploymentOptions;
20 | import io.vertx.core.Vertx;
21 | import io.vertx.core.VertxOptions;
22 |
23 | /**
24 | * Created by Andy Moncsek on 01.04.16.
25 | */
26 | public class Runner {
27 |
28 | public static void run(DeploymentOptions options, Class clazz) {
29 | VertxOptions vOpts = new VertxOptions();
30 | vOpts.setClustered(true);
31 | Vertx.clusteredVertx(vOpts, cluster -> {
32 | if (cluster.succeeded()) {
33 | final Vertx result = cluster.result();
34 | result.deployVerticle(clazz.getName(), options, handle -> {
35 |
36 | });
37 | }
38 | });
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-frontend/src/main/resources/webroot/tpl/lists.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
Users
18 |
19 |
20 |
21 |
Username
22 |
First Name
23 |
Last Name
24 |
Address
25 |
Options
26 |
27 |
28 |
29 |
30 |
{{user.username}}
31 |
{{user.firstName}}
32 |
{{user.lastName}}
33 |
{{user.address}}
34 |
35 |
36 |
37 |
38 |
39 | Add New User
--------------------------------------------------------------------------------
/vxms-demos/vxms-secure-spa-demo/src/main/resources/webroot/tpl/lists.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
Welcome {{userinfo}}
18 |
Users
19 |
20 |
21 |
22 |
Username
23 |
First Name
24 |
Last Name
25 |
Address
26 |
Options
27 |
28 |
29 |
30 |
31 |
{{user.username}}
32 |
{{user.firstName}}
33 |
{{user.lastName}}
34 |
{{user.address}}
35 |
36 |
37 |
38 |
39 | Add New User
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-frontend/src/main/java/org/jacpfx/vxms/k8sfrontend/util/Runner.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.k8sfrontend.util;
18 |
19 | import io.vertx.core.DeploymentOptions;
20 | import io.vertx.core.Vertx;
21 | import io.vertx.core.VertxOptions;
22 |
23 | /**
24 | * Created by Andy Moncsek on 11.05.17.
25 | */
26 | public class Runner {
27 |
28 | public static void run(DeploymentOptions options, Class clazz) {
29 | VertxOptions vOpts = new VertxOptions();
30 | vOpts.setClustered(true);
31 | Vertx.clusteredVertx(vOpts, cluster -> {
32 | if (cluster.succeeded()) {
33 | final Vertx result = cluster.result();
34 | result.deployVerticle(clazz.getName(), options, handle -> {
35 |
36 | });
37 | }
38 | });
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-spring-demo/jdeps1.txt:
--------------------------------------------------------------------------------
1 | jdeps --generate-module-info /Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/moditect --add-modules io.netty.buffer,io.netty.common,reactor.core,org.reactivestreams,io.reactivex.rxjava2,rxjava,rxjava.reactive.streams,jopt.simple,aspectjweaver,annotations,spring.jcl --module-path /Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/netty-buffer-4.1.19.Final.jar:/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/netty-common-4.1.19.Final.jar:/.m2/repository/io/projectreactor/reactor-core/3.1.7.RELEASE/reactor-core-3.1.7.RELEASE.jar:/.m2/repository/org/reactivestreams/reactive-streams/1.0.2/reactive-streams-1.0.2.jar:/.m2/repository/io/reactivex/rxjava2/rxjava/2.1.13/rxjava-2.1.13.jar:/.m2/repository/io/reactivex/rxjava/1.3.8/rxjava-1.3.8.jar:/.m2/repository/io/reactivex/rxjava-reactive-streams/1.2.1/rxjava-reactive-streams-1.2.1.jar:/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/aspectjweaver-1.8.10.jar:/.m2/repository/org/jetbrains/kotlin/kotlin-reflect/1.2.41/kotlin-reflect-1.2.41.jar:/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.2.41/kotlin-stdlib-1.2.41.jar:/.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar:/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/spring-jcl-5.0.6.RELEASE.jar /.m2/repository/org/springframework/spring-core/5.0.6.RELEASE/spring-core-5.0.6.RELEASE.jar
2 |
--------------------------------------------------------------------------------
/vxms-testing/src/test/java/org/jacpfx/entity/Payload.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2017] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.entity;
18 |
19 | import java.io.Serializable;
20 |
21 | /** Created by Andy Moncsek on 25.11.15. */
22 | public class Payload implements Serializable {
23 |
24 | private final T value;
25 |
26 | public Payload(T value) {
27 | this.value = value;
28 | }
29 |
30 | @Override
31 | public boolean equals(Object o) {
32 | if (this == o) {
33 | return true;
34 | }
35 | if (!(o instanceof Payload)) {
36 | return false;
37 | }
38 |
39 | Payload> payload = (Payload>) o;
40 |
41 | return !(value != null ? !value.equals(payload.value) : payload.value != null);
42 | }
43 |
44 | public T getValue() {
45 | return value;
46 | }
47 |
48 | @Override
49 | public int hashCode() {
50 | return value != null ? value.hashCode() : 0;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/common/encoder/Encoder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.common.encoder;
18 |
19 | /**
20 | * Created by Andy Moncsek on 17.11.15.
21 | * The encoder interface
22 | */
23 | public interface Encoder {
24 |
25 | /**
26 | * Encode to byte array
27 | *
28 | * @param the type of the object to encode
29 | */
30 | interface ByteEncoder extends Encoder {
31 |
32 | /**
33 | * encode an object to byte array
34 | *
35 | * @param input the object
36 | * @return the byte array
37 | */
38 | byte[] encode(I input);
39 | }
40 |
41 | /**
42 | * Encode to string
43 | *
44 | * @param the type of the object to encode
45 | */
46 | interface StringEncoder extends Encoder {
47 |
48 | /**
49 | * Encode to String
50 | *
51 | * @param input the object
52 | * @return the string
53 | */
54 | String encode(I input);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/common/VxmsShared.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.common;
18 |
19 | import io.vertx.core.Vertx;
20 | import org.jacpfx.vxms.common.concurrent.LocalData;
21 |
22 | /**
23 | * Created by amo on 23.03.17.
24 | * Thjis class contains shared structures needed in all modules
25 | */
26 | public class VxmsShared {
27 |
28 | private final Vertx vertx;
29 |
30 | private final LocalData localData;
31 |
32 | public VxmsShared(Vertx vertx, LocalData localData) {
33 | this.vertx = vertx;
34 | this.localData = localData;
35 | }
36 |
37 | /**
38 | * Returns the Vert.x instance
39 | *
40 | * @return the {@link Vertx} instance
41 | */
42 | public Vertx getVertx() {
43 | return vertx;
44 | }
45 |
46 | /**
47 | * Returns the local data instance
48 | *
49 | * @return the {@link LocalData} instance
50 | */
51 | public LocalData getLocalData() {
52 | return localData;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-secure-spa-demo/src/main/java/org/jacpfx/vxms/spa/config/CustomHTTPOptions.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.spa.config;
18 |
19 | import io.vertx.core.http.HttpServerOptions;
20 | import io.vertx.core.json.JsonObject;
21 | import io.vertx.core.net.JksOptions;
22 | import org.jacpfx.vxms.common.CustomServerOptions;
23 | import org.jacpfx.vxms.spa.util.KeyUtil;
24 |
25 | import java.io.File;
26 |
27 | /**
28 | * Created by amo on 11.08.16.
29 | */
30 | public class CustomHTTPOptions implements CustomServerOptions {
31 |
32 | public HttpServerOptions getServerOptions(JsonObject config) {
33 | if (!new File(KeyUtil.DEMO_KEYSTTORE).exists()) {
34 | KeyUtil.generateKey(); // only for demo, create keystore
35 | }
36 | return new HttpServerOptions().
37 | setKeyStoreOptions(new JksOptions().setPath(KeyUtil.DEMO_KEYSTTORE).setPassword(KeyUtil.DEMO_PWD)).
38 | setSsl(true);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-spring-demo/jdepstmp.txt:
--------------------------------------------------------------------------------
1 | jdeps --generate-module-info /Users/amo/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/moditect --add-modules io.netty.buffer,io.netty.common,reactor.core,org.reactivestreams,jopt.simple,aspectjweaver,kotlin.reflect,kotlin.stdlib,annotations,spring.jcl --module-path /Users/amo/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/netty-buffer-4.1.19.Final.jar:/Users/amo/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/netty-common-4.1.19.Final.jar:/Users/amo/.m2/repository/io/projectreactor/reactor-core/3.1.7.RELEASE/reactor-core-3.1.7.RELEASE.jar:/Users/amo/.m2/repository/org/reactivestreams/reactive-streams/1.0.2/reactive-streams-1.0.2.jar:/Users/amo/.m2/repository/io/reactivex/rxjava2/rxjava/2.1.13/rxjava-2.1.13.jar:/Users/amo/.m2/repository/io/reactivex/rxjava/1.3.8/rxjava-1.3.8.jar:/Users/amo/.m2/repository/io/reactivex/rxjava-reactive-streams/1.2.1/rxjava-reactive-streams-1.2.1.jar:/Users/amo/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/amo/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/aspectjweaver-1.8.10.jar:/Users/amo/.m2/repository/org/jetbrains/kotlin/kotlin-reflect/1.2.41/kotlin-reflect-1.2.41.jar:/Users/amo/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.2.41/kotlin-stdlib-1.2.41.jar:/Users/amo/.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar:/Users/amo/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/spring-jcl-5.0.6.RELEASE.jar /Users/amo/.m2/repository/org/springframework/spring-core/5.0.6.RELEASE/spring-core-5.0.6.RELEASE.jar
2 |
--------------------------------------------------------------------------------
/vxms-rest-base/src/main/java/org/jacpfx/vxms/rest/base/annotation/OnRestError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.rest.base.annotation;
18 |
19 | import java.lang.annotation.Documented;
20 | import java.lang.annotation.ElementType;
21 | import java.lang.annotation.Retention;
22 | import java.lang.annotation.RetentionPolicy;
23 | import java.lang.annotation.Target;
24 |
25 | /**
26 | * Marker annotation to define fallback methods for REST endpoints. The value mus be the same (also
27 | * the http method annotation POST,GET,...) as the REST method to identify the correct fallback. The
28 | * marked method will be executed, in case of exceptions are not handled in the REST method
29 | */
30 | @Target({ElementType.TYPE, ElementType.METHOD})
31 | @Retention(RetentionPolicy.RUNTIME)
32 | @Documented
33 | public @interface OnRestError {
34 |
35 | /**
36 | * The name/value of the method
37 | *
38 | * @return the value/identifier for the fakllback method
39 | */
40 | String value();
41 | }
42 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-spring-demo/README.MD:
--------------------------------------------------------------------------------
1 | # A vxms REST + Spring endpoint
2 | This example demonstrates the usage of the spring-vertx-ext together with vxms.
3 | Start the Endpoint either by using the main method or build the project und start the jar file.
4 |
5 |
6 |
7 | ## run as Java 9 module
8 | In this case we simply use the main method declared in the class, instead of using the Vert.x Factory mechanism used by maven shade.
9 |
10 | ```shell
11 | java --add-opens java.base/java.lang=spring.core --module-path target/vxms-spring-demo-1.2-SNAPSHOT.jar:target/modules:$JAVA_HOME/jmods/ --module vxms.spring.demo/org.jacpfx.vxms.spring.SimpleSpringRESTStaticInit
12 |
13 | ```
14 |
15 | ## create a modular runtime image
16 | The Dockerfile in this project is an example, how to build a modular runtime image to run a vxms (Vert.x based) application. To build the application modules, the moditec maven plugin is used(https://github.com/moditect/moditect). Basically the process consists of 3 Steps:
17 | - Step 1: clone the project, switch to Java9 branch and build the project against Java9
18 | - Step 2: the created modules are copied to the next step, the alpine JDK11 will be downloaded an a modular runtime image will be created
19 | - Step 3: the modular image (containing the REST service) will be copied to an alpine image
20 |
21 | ### how to build
22 | ```shell
23 | docker build -t spring-demo .
24 | ```
25 | ### how to run
26 | ```shell
27 | docker run -m32M -p 9090:9090 --name spring-demo spring-demo:latest
28 | ```
29 |
30 |
31 |
32 | Benchmark plain:
33 |
34 |
35 | STATIC ready
36 |
37 | real 0m3.844s
38 | user 0m0.085s
39 | sys 0m0.019s
40 |
41 |
42 |
--------------------------------------------------------------------------------
/vxms-testing/src/test/java/org/jacpfx/entity/MyCustomRouterConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2017] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.entity;
18 |
19 | import io.vertx.ext.web.Router;
20 | import io.vertx.ext.web.handler.CorsHandler;
21 | import org.jacpfx.vxms.common.configuration.RouterConfiguration;
22 |
23 | /** Created by Andy Moncsek on 18.02.16. */
24 | public class MyCustomRouterConfig implements RouterConfiguration {
25 |
26 | public void corsHandler(Router router) {
27 | router
28 | .route()
29 | .handler(
30 | CorsHandler.create("*")
31 | .allowedMethod(io.vertx.core.http.HttpMethod.GET)
32 | .allowedMethod(io.vertx.core.http.HttpMethod.POST)
33 | .allowedMethod(io.vertx.core.http.HttpMethod.OPTIONS)
34 | .allowedMethod(io.vertx.core.http.HttpMethod.PUT)
35 | .allowedMethod(io.vertx.core.http.HttpMethod.DELETE)
36 | .allowedHeader("Content-Type")
37 | .allowedHeader("X-Requested-With"));
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/vxms-testing/src/test/java/org/jacpfx/entity/CookieRouterConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2017] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.entity;
18 |
19 | import io.vertx.ext.web.Router;
20 | import io.vertx.ext.web.handler.CorsHandler;
21 | import org.jacpfx.vxms.common.configuration.RouterConfiguration;
22 |
23 | /** Created by Andy Moncsek on 18.02.16. */
24 | public class CookieRouterConfig implements RouterConfiguration {
25 |
26 | public void cookieHandler(Router router) {
27 | router
28 | .route()
29 | .handler(
30 | CorsHandler.create("127.0.0.1")
31 | .allowedMethod(io.vertx.core.http.HttpMethod.GET)
32 | .allowedMethod(io.vertx.core.http.HttpMethod.POST)
33 | .allowedMethod(io.vertx.core.http.HttpMethod.OPTIONS)
34 | .allowedMethod(io.vertx.core.http.HttpMethod.PUT)
35 | .allowedMethod(io.vertx.core.http.HttpMethod.DELETE)
36 | .allowedHeader("Content-Type")
37 | .allowedHeader("X-Requested-With"));
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-container-eventbus-demo/README.md:
--------------------------------------------------------------------------------
1 | # vxms container eventbus demo
2 |
3 | This applications demonstrates the usage of vxms-rest and vxms-event modules in a container ready application. It consists of 3 sub-projects:
4 |
5 | - vxms-frontend is serving the static html pages and is using vxms-rest to create a rest gateway. All rest requests are passed to either the vxms-read or vxms-write project by using events.
6 | - vxms-read is using vxms-event to provide all read methods like "getAllUsers" or "getUserById"
7 | - vxms-write is using vxms-event to provide all CRUD operations using events
8 |
9 |
10 | ## run the application locally
11 |
12 | - the application assumes you run mongodb on the same host (default port)
13 | - you can use the the main methods in each project to start the services (multicast must work on your machine)
14 | - OR: you can build the whole project (mvn clean package) and run each service like this: ("java -jar target/*-fat.jar -cluster)
15 | - when the vxms-frontend project is running you can access the application on http://localhost:8181
16 |
17 | ## run the application in Docker-compose
18 | - stop your local mongodb (port conflicts)
19 | - build the project (mvn clean package)
20 | - build the images (in root the folder of the project type: "docker-compose build")
21 | - run the project by typing "docker-compose up"
22 |
23 |
24 | ## run the application in kubernetes
25 |
26 | - deploy a mongoDB (kubectl apply -f kube/)
27 | - deploy the frontend: cd vxms-frontend && mvn clean install fabric8:deploy
28 | - deploy the read: cd vxms-read && mvn clean install fabric8:deploy
29 | - deploy the write: cd vxms-write && mvn clean install fabric8:deploy
--------------------------------------------------------------------------------
/vxms-demos/vxms-spring-demo/jdeps.txt:
--------------------------------------------------------------------------------
1 | jdeps --generate-module-info /Users/amo/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/moditect --add-modules io.netty.buffer,io.netty.common,reactor.core,org.reactivestreams,io.reactivex.rxjava2,rxjava,rxjava.reactive.streams,jopt.simple,aspectjweaver,kotlin.reflect,kotlin.stdlib,annotations,spring.jcl --module-path /Users/amo/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/netty-buffer-4.1.19.Final.jar:/Users/amo/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/netty-common-4.1.19.Final.jar:/Users/amo/.m2/repository/io/projectreactor/reactor-core/3.1.7.RELEASE/reactor-core-3.1.7.RELEASE.jar:/Users/amo/.m2/repository/org/reactivestreams/reactive-streams/1.0.2/reactive-streams-1.0.2.jar:/Users/amo/.m2/repository/io/reactivex/rxjava2/rxjava/2.1.13/rxjava-2.1.13.jar:/Users/amo/.m2/repository/io/reactivex/rxjava/1.3.8/rxjava-1.3.8.jar:/Users/amo/.m2/repository/io/reactivex/rxjava-reactive-streams/1.2.1/rxjava-reactive-streams-1.2.1.jar:/Users/amo/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/amo/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/aspectjweaver-1.8.10.jar:/Users/amo/.m2/repository/org/jetbrains/kotlin/kotlin-reflect/1.2.41/kotlin-reflect-1.2.41.jar:/Users/amo/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.2.41/kotlin-stdlib-1.2.41.jar:/Users/amo/.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar:/Users/amo/Documents/development/vertx/vxms/vxms-demos/vxms-spring-demo/target/modules/spring-jcl-5.0.6.RELEASE.jar /Users/amo/.m2/repository/org/springframework/spring-core/5.0.6.RELEASE/spring-core-5.0.6.RELEASE.jar
2 |
--------------------------------------------------------------------------------
/vxms-rest-rs/src/main/java/org/jacpfx/vxms/rest/RestRsHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.rest;
18 |
19 | import io.vertx.core.AbstractVerticle;
20 | import io.vertx.ext.web.Router;
21 | import org.jacpfx.vxms.common.VxmsShared;
22 | import org.jacpfx.vxms.spi.RESThandlerSPI;
23 | import org.jacpfx.vxms.spi.VxmsRoutes;
24 |
25 | /**
26 | * Created by amo on 05.08.16. Implements teh RESThandlerSPI and calls the initializer to bootstrap
27 | * the rest API
28 | */
29 | public class RestRsHandler implements RESThandlerSPI {
30 |
31 | @Override
32 | public void initRESTHandler(VxmsShared vxmsShared, Router router, AbstractVerticle service) {
33 | RestRsRouteInitializer.initRESTHandler(vxmsShared, router, service);
34 | }
35 |
36 | @Override
37 | public void initRESTHandler(
38 | VxmsShared vxmsShared, Router router, AbstractVerticle service, VxmsRoutes... routes) {
39 | if(routes==null || routes.length>0)
40 | return;
41 | RestRsRouteInitializer.initRESTHandler(vxmsShared, router, service);
42 | }
43 |
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/vxms-core/src/main/java/org/jacpfx/vxms/common/decoder/Decoder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.common.decoder;
18 |
19 | import java.util.Optional;
20 |
21 | /**
22 | * Created by Andy Moncsek on 18.11.15.
23 | * The decoder interface
24 | */
25 | public interface Decoder {
26 |
27 |
28 | /**
29 | * Decode from byte array
30 | *
31 | * @param the type of the object to decode
32 | */
33 | interface ByteDecoder extends Decoder {
34 |
35 | /**
36 | * decode the input
37 | *
38 | * @param input the byte array input
39 | * @return an optional with the result
40 | */
41 | Optional decode(byte[] input);
42 | }
43 |
44 | /**
45 | * Decode from String
46 | *
47 | * @param the type of the object to decode
48 | */
49 | interface StringDecoder extends Decoder {
50 |
51 | /**
52 | * decode the input
53 | *
54 | * @param input the String input
55 | * @return an optional with the result
56 | */
57 | Optional decode(String input);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/vxms-testing/src/test/java/org/jacpfx/entity/SessionRouterConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2017] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.entity;
18 |
19 | import io.vertx.core.Vertx;
20 | import io.vertx.ext.web.Router;
21 | import io.vertx.ext.web.handler.BodyHandler;
22 | import io.vertx.ext.web.handler.SessionHandler;
23 | import io.vertx.ext.web.sstore.LocalSessionStore;
24 | import io.vertx.ext.web.sstore.SessionStore;
25 | import org.jacpfx.vxms.common.configuration.RouterConfiguration;
26 |
27 | /** Created by Andy Moncsek on 18.02.16. */
28 | public class SessionRouterConfig implements RouterConfiguration {
29 |
30 | public void sessionHandler(Vertx vertx, Router router) {
31 | // Create a clustered session store using defaults
32 | SessionStore store = LocalSessionStore.create(vertx, "xyz");
33 |
34 | SessionHandler sessionHandler = SessionHandler.create(store);
35 |
36 | // Make sure all requests are routed through the session handler too
37 | router.route().handler(sessionHandler);
38 | }
39 |
40 | public BodyHandler bodyHandler() {
41 | return BodyHandler.create();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/vxms-demos/vxms-secure-spa-demo/src/main/java/org/jacpfx/vxms/spa/util/DefaultResponses.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.spa.util;
18 |
19 | import io.vertx.core.json.JsonObject;
20 |
21 | /**
22 | * Created by Andy Moncsek on 01.04.16.
23 | */
24 | public class DefaultResponses {
25 |
26 | public static JsonObject defaultErrorResponse() {
27 | JsonObject message = new JsonObject();
28 | message.put("username", "no connection").
29 | put("firstName", "no connection").
30 | put("lastName", "no connection").
31 | put("address", "no connection");
32 | return message;
33 | }
34 |
35 |
36 | public static JsonObject mapToUser(JsonObject input, String id) {
37 | return new JsonObject().
38 | put("username", input.getString("username")).
39 | put("firstName", input.getString("firstName")).
40 | put("lastName", input.getString("lastName")).
41 | put("address", input.getString("address")).
42 | put("_id", id);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/vxms-event/src/main/java/org/jacpfx/vxms/event/response/EventbusRequest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright [2018] [Andy Moncsek]
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.jacpfx.vxms.event.response;
18 |
19 | import io.vertx.core.eventbus.Message;
20 |
21 | /**
22 | * Created by Andy Moncsek on 12.01.16. his class allows easy access to event-bus message to get the
23 | * body and the reply address
24 | */
25 | public class EventbusRequest {
26 |
27 | private final Message