├── .github └── workflows │ └── maven.yml ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── _config.yml ├── h.graphml ├── pom.xml ├── scripts ├── run_etcd.sh └── startETCD.sh ├── vxms-core ├── README.md ├── config-flags.md ├── pom.xml └── src │ ├── main │ └── java │ │ ├── module-info.java │ │ └── org │ │ └── jacpfx │ │ └── vxms │ │ ├── common │ │ ├── AsyncResultHandler.java │ │ ├── BlockingExecutionStep.java │ │ ├── CustomServerOptions.java │ │ ├── DefaultServerOptions.java │ │ ├── ExecutionResult.java │ │ ├── ExecutionStep.java │ │ ├── ServiceEndpoint.java │ │ ├── VxmsShared.java │ │ ├── concurrent │ │ │ └── LocalData.java │ │ ├── configuration │ │ │ ├── DefaultRouterConfiguration.java │ │ │ └── RouterConfiguration.java │ │ ├── decoder │ │ │ └── Decoder.java │ │ ├── encoder │ │ │ └── Encoder.java │ │ ├── exceptions │ │ │ └── EndpointExecutionException.java │ │ ├── throwable │ │ │ ├── ThrowableErrorConsumer.java │ │ │ ├── ThrowableFunction.java │ │ │ ├── ThrowableFutureBiConsumer.java │ │ │ ├── ThrowableFutureConsumer.java │ │ │ └── ThrowableSupplier.java │ │ └── util │ │ │ ├── CommonReflectionUtil.java │ │ │ ├── ConfigurationUtil.java │ │ │ ├── ReflectionExecutionWrapper.java │ │ │ ├── Serializer.java │ │ │ ├── ServiceUtil.java │ │ │ ├── StreamUtils.java │ │ │ └── URIUtil.java │ │ ├── services │ │ └── VxmsEndpoint.java │ │ └── spi │ │ ├── EventhandlerSPI.java │ │ ├── RESThandlerSPI.java │ │ ├── ServiceDiscoverySPI.java │ │ ├── VxmsRoutes.java │ │ └── WebSockethandlerSPI.java │ └── test │ └── resources │ ├── payload.xml │ ├── vertx-default-jul-logging.properties-tmp │ └── webroot │ ├── index.html │ └── payload.xml ├── vxms-demos ├── vxms-container-eventbus-demo │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── docker-compose.yml │ ├── kube │ │ ├── mongo-controller-no-store.yaml │ │ └── mongo-service.yaml │ ├── pom.xml │ ├── vxms-frontend │ │ ├── Dockerfile │ │ ├── local.json │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── fabric8 │ │ │ ├── configmap.yml │ │ │ ├── deployment.yml │ │ │ └── service.yml │ │ │ ├── java │ │ │ └── org │ │ │ │ └── jacpfx │ │ │ │ └── vxms │ │ │ │ └── frontend │ │ │ │ ├── configuration │ │ │ │ └── CustomRouterConfig.java │ │ │ │ ├── util │ │ │ │ ├── DefaultResponses.java │ │ │ │ ├── InitMongoDB.java │ │ │ │ └── Runner.java │ │ │ │ └── verticles │ │ │ │ └── VxmsGateway.java │ │ │ └── resources │ │ │ └── webroot │ │ │ ├── index.html │ │ │ ├── js │ │ │ ├── app-docker.js │ │ │ ├── app-orig.js │ │ │ └── app.js │ │ │ └── tpl │ │ │ ├── add-new.html │ │ │ ├── edit.html │ │ │ └── lists.html │ ├── vxms-read │ │ ├── Dockerfile │ │ ├── local.json │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── fabric8 │ │ │ ├── configmap.yml │ │ │ ├── deployment.yml │ │ │ └── service.yml │ │ │ └── java │ │ │ └── org │ │ │ └── jacpfx │ │ │ └── vxms │ │ │ └── read │ │ │ ├── util │ │ │ ├── DefaultResponses.java │ │ │ └── InitMongoDB.java │ │ │ └── verticles │ │ │ └── UsersReadFromMongo.java │ └── vxms-write │ │ ├── Dockerfile │ │ ├── local.json │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── fabric8 │ │ ├── configmap.yml │ │ ├── deployment.yml │ │ └── service.yml │ │ └── java │ │ └── org │ │ └── jacpfx │ │ └── vxms │ │ └── write │ │ ├── util │ │ ├── DefaultResponses.java │ │ └── InitMongoDB.java │ │ └── verticles │ │ └── UsersWriteToMongo.java ├── vxms-container-k8s-discovery-demo │ ├── README.MD │ ├── kube │ │ ├── mongo-controller-no-store.yaml │ │ └── mongo-service.yaml │ ├── pom.xml │ ├── vxms-k8s-frontend │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── fabric8 │ │ │ ├── configmap.yml │ │ │ ├── deployment.yml │ │ │ └── service.yml │ │ │ ├── java │ │ │ └── org │ │ │ │ └── jacpfx │ │ │ │ └── vxms │ │ │ │ └── k8sfrontend │ │ │ │ ├── configuration │ │ │ │ └── CustomRouterConfig.java │ │ │ │ ├── util │ │ │ │ ├── DefaultResponses.java │ │ │ │ ├── InitMongoDB.java │ │ │ │ └── Runner.java │ │ │ │ └── verticles │ │ │ │ └── VxmsGateway.java │ │ │ └── resources │ │ │ └── webroot │ │ │ ├── index.html │ │ │ ├── js │ │ │ ├── app-docker.js │ │ │ ├── app-orig.js │ │ │ └── app.js │ │ │ └── tpl │ │ │ ├── add-new.html │ │ │ ├── edit.html │ │ │ └── lists.html │ ├── vxms-k8s-read │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── fabric8 │ │ │ ├── configmap.yml │ │ │ ├── deployment.yml │ │ │ └── service.yml │ │ │ ├── java │ │ │ └── org │ │ │ │ └── jacpfx │ │ │ │ └── vxms │ │ │ │ └── k8sread │ │ │ │ ├── MongoConfiguration.java │ │ │ │ ├── ReadApplication.java │ │ │ │ ├── entity │ │ │ │ └── Users.java │ │ │ │ ├── repository │ │ │ │ └── ReactiveUserRepository.java │ │ │ │ ├── service │ │ │ │ └── UserService.java │ │ │ │ ├── util │ │ │ │ ├── DefaultResponses.java │ │ │ │ └── InitMongoDB.java │ │ │ │ └── verticles │ │ │ │ └── UsersReadFromMongo.java │ │ │ └── resources │ │ │ ├── application-TEST.properties │ │ │ ├── application-openshift.properties │ │ │ ├── application.properties │ │ │ └── vertx-default-jul-logging.properties │ └── vxms-k8s-write │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── fabric8 │ │ └── service.yml │ │ └── java │ │ ├── module-info.java │ │ └── org │ │ └── jacpfx │ │ └── vxms │ │ └── k8swrite │ │ ├── service │ │ └── UserService.java │ │ ├── util │ │ ├── DefaultResponses.java │ │ └── InitMongoDB.java │ │ └── verticles │ │ └── UsersWriteToMongo.java ├── vxms-core-demo │ ├── .gitignore │ ├── Dockerfile │ ├── Dockerfile.test1 │ ├── README.MD │ ├── app-cds.jsa │ ├── cds.log │ ├── classes.lst │ ├── pom.xml │ ├── reflectconfigs │ │ └── netty.json │ └── src │ │ └── main │ │ └── java │ │ ├── io │ │ └── netty │ │ │ └── handler │ │ │ └── ssl │ │ │ └── ReferenceCountedOpenSslEngine.java │ │ ├── module-info-graal.java1 │ │ └── org │ │ └── jacpfx │ │ └── vxms │ │ └── verticle │ │ ├── Runner.java │ │ └── SimpleREST.java ├── vxms-rest-demo │ ├── README.MD │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ ├── module-info.java │ │ └── org │ │ └── jacpfx │ │ └── vxms │ │ └── verticle │ │ └── SimpleREST.java ├── vxms-secure-spa-demo │ ├── .gitignore │ ├── .keystore │ ├── README.MD │ ├── pom.xml │ ├── securityConf.json │ ├── src │ │ └── main │ │ │ ├── java │ │ │ ├── module-info.java │ │ │ └── org │ │ │ │ └── jacpfx │ │ │ │ └── vxms │ │ │ │ └── spa │ │ │ │ ├── beans │ │ │ │ └── UserLocalRepository.java │ │ │ │ ├── config │ │ │ │ ├── CustomHTTPOptions.java │ │ │ │ ├── CustomRouterConfig.java │ │ │ │ └── SpringConfig.java │ │ │ │ ├── util │ │ │ │ ├── DefaultResponses.java │ │ │ │ └── KeyUtil.java │ │ │ │ └── verticle │ │ │ │ └── SecureEndpoint.java │ │ │ └── resources │ │ │ ├── vertx-default-jul-logging.properties │ │ │ └── webroot │ │ │ ├── index.html │ │ │ ├── js │ │ │ └── app.js │ │ │ └── tpl │ │ │ ├── add-new.html │ │ │ ├── edit.html │ │ │ └── lists.html │ └── vertx.log └── vxms-spring-demo │ ├── Dockerfile │ ├── README.MD │ ├── jdeps.txt │ ├── jdeps1.txt │ ├── jdeps2.txt │ ├── jdepstmp.txt │ ├── pom.xml │ ├── src │ └── main │ │ └── java │ │ ├── module-info.java │ │ └── org │ │ └── jacpfx │ │ └── vxms │ │ └── spring │ │ ├── SimpleSpringREST.java │ │ ├── SimpleSpringRESTStaticInit.java │ │ ├── beans │ │ └── HelloWorldBean.java │ │ └── configuration │ │ └── SpringConfig.java │ └── temp.txt ├── vxms-event ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ ├── module-info.java │ │ └── org │ │ │ └── jacpfx │ │ │ └── vxms │ │ │ └── event │ │ │ ├── EventInitializer.java │ │ │ ├── Eventhandler.java │ │ │ ├── annotation │ │ │ ├── Consume.java │ │ │ └── OnEventError.java │ │ │ ├── eventbus │ │ │ ├── basic │ │ │ │ ├── EventbusBridgeExecution.java │ │ │ │ ├── EventbusBridgeRequest.java │ │ │ │ └── EventbusBridgeResponse.java │ │ │ └── blocking │ │ │ │ ├── EventbusBridgeExecution.java │ │ │ │ ├── EventbusBridgeRequest.java │ │ │ │ └── EventbusBridgeResponse.java │ │ │ ├── interfaces │ │ │ ├── basic │ │ │ │ ├── ExecuteEventbusByteCall.java │ │ │ │ ├── ExecuteEventbusObjectCall.java │ │ │ │ ├── ExecuteEventbusStringCall.java │ │ │ │ ├── RecursiveExecutor.java │ │ │ │ └── RetryExecutor.java │ │ │ └── blocking │ │ │ │ ├── ExecuteEventbusByteCall.java │ │ │ │ ├── ExecuteEventbusObjectCall.java │ │ │ │ ├── ExecuteEventbusStringCall.java │ │ │ │ ├── RecursiveExecutor.java │ │ │ │ └── RetryExecutor.java │ │ │ ├── response │ │ │ ├── AbstractResponse.java │ │ │ ├── EventbusHandler.java │ │ │ ├── EventbusRequest.java │ │ │ ├── EventbusResponse.java │ │ │ ├── EventbusResponseBlocking.java │ │ │ ├── basic │ │ │ │ ├── ExecuteEventChainResponse.java │ │ │ │ ├── ExecuteEventbusByte.java │ │ │ │ ├── ExecuteEventbusByteCircuitBreaker.java │ │ │ │ ├── ExecuteEventbusByteResponse.java │ │ │ │ ├── ExecuteEventbusObject.java │ │ │ │ ├── ExecuteEventbusObjectCircuitBreaker.java │ │ │ │ ├── ExecuteEventbusObjectResponse.java │ │ │ │ ├── ExecuteEventbusString.java │ │ │ │ ├── ExecuteEventbusStringCircuitBreaker.java │ │ │ │ ├── ExecuteEventbusStringResponse.java │ │ │ │ ├── ResponseExecution.java │ │ │ │ └── StepExecution.java │ │ │ └── blocking │ │ │ │ ├── ExecuteEventChainResponse.java │ │ │ │ ├── ExecuteEventbusByte.java │ │ │ │ ├── ExecuteEventbusByteCircuitBreaker.java │ │ │ │ ├── ExecuteEventbusByteResponse.java │ │ │ │ ├── ExecuteEventbusObject.java │ │ │ │ ├── ExecuteEventbusObjectCircuitBreaker.java │ │ │ │ ├── ExecuteEventbusObjectResponse.java │ │ │ │ ├── ExecuteEventbusString.java │ │ │ │ ├── ExecuteEventbusStringCircuitBreaker.java │ │ │ │ ├── ExecuteEventbusStringResponse.java │ │ │ │ ├── ResponseExecution.java │ │ │ │ └── StepExecution.java │ │ │ └── util │ │ │ ├── EventbusByteExecutionBlockingUtil.java │ │ │ ├── EventbusByteExecutionUtil.java │ │ │ ├── EventbusObjectExecutionBlockingUtil.java │ │ │ ├── EventbusObjectExecutionUtil.java │ │ │ ├── EventbusStringExecutionBlockingUtil.java │ │ │ ├── EventbusStringExecutionUtil.java │ │ │ └── ReflectionUtil.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── org.jacpfx.vxms.spi.EventhandlerSPI │ └── test │ └── resources │ ├── payload.xml │ └── webroot │ ├── index.html │ └── payload.xml ├── vxms-k8sdiscovery ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ ├── module-info.java │ └── org │ │ └── jacpfx │ │ └── vxms │ │ └── k8s │ │ ├── annotation │ │ └── K8SDiscovery.java │ │ ├── api │ │ ├── CustomClientConfig.java │ │ └── DefaultCustomClientConfig.java │ │ ├── client │ │ ├── KubeDiscovery.java │ │ └── VxmsDiscoveryK8SImpl.java │ │ ├── discovery │ │ ├── Endpoints.java │ │ └── Pods.java │ │ └── util │ │ ├── FieldUtil.java │ │ ├── StringUtil.java │ │ └── TokenUtil.java │ └── resources │ └── META-INF │ └── services │ └── org.jacpfx.vxms.spi.ServiceDiscoverySPI ├── vxms-rest-base ├── pom.xml └── src │ ├── main │ └── java │ │ ├── module-info.java │ │ └── org │ │ └── jacpfx │ │ └── vxms │ │ └── rest │ │ └── base │ │ ├── MethodDescriptor.java │ │ ├── RouteBuilder.java │ │ ├── VxmsRESTRoutes.java │ │ ├── annotation │ │ └── OnRestError.java │ │ ├── eventbus │ │ ├── basic │ │ │ ├── EventbusExecution.java │ │ │ ├── EventbusRequest.java │ │ │ └── EventbusResponse.java │ │ └── blocking │ │ │ ├── EventbusExecution.java │ │ │ ├── EventbusRequest.java │ │ │ └── EventbusResponse.java │ │ ├── interfaces │ │ ├── basic │ │ │ ├── ExecuteEventbusByteCall.java │ │ │ ├── ExecuteEventbusObjectCall.java │ │ │ ├── ExecuteEventbusStringCall.java │ │ │ ├── RecursiveExecutor.java │ │ │ └── RetryExecutor.java │ │ └── blocking │ │ │ ├── ExecuteEventbusByteCall.java │ │ │ ├── ExecuteEventbusObjectCall.java │ │ │ ├── ExecuteEventbusStringCall.java │ │ │ ├── RecursiveExecutor.java │ │ │ └── RetryExecutor.java │ │ ├── response │ │ ├── AbstractResponse.java │ │ ├── RESTRequest.java │ │ ├── RESTResponse.java │ │ ├── RESTResponseBlocking.java │ │ ├── RestHandler.java │ │ ├── basic │ │ │ ├── ExecuteRSByte.java │ │ │ ├── ExecuteRSByteCircuitBreaker.java │ │ │ ├── ExecuteRSByteOnFailureCode.java │ │ │ ├── ExecuteRSByteResponse.java │ │ │ ├── ExecuteRSChainResponse.java │ │ │ ├── ExecuteRSObject.java │ │ │ ├── ExecuteRSObjectCircuitBreaker.java │ │ │ ├── ExecuteRSObjectOnFailureCode.java │ │ │ ├── ExecuteRSObjectResponse.java │ │ │ ├── ExecuteRSString.java │ │ │ ├── ExecuteRSStringCircuitBreaker.java │ │ │ ├── ExecuteRSStringOnFailureCode.java │ │ │ ├── ExecuteRSStringResponse.java │ │ │ ├── ResponseExecution.java │ │ │ └── StepExecution.java │ │ └── blocking │ │ │ ├── ExecuteRSByte.java │ │ │ ├── ExecuteRSByteCircuitBreaker.java │ │ │ ├── ExecuteRSByteOnFailureCode.java │ │ │ ├── ExecuteRSByteResponse.java │ │ │ ├── ExecuteRSChainResponse.java │ │ │ ├── ExecuteRSObject.java │ │ │ ├── ExecuteRSObjectCircuitBreaker.java │ │ │ ├── ExecuteRSObjectOnFailureCode.java │ │ │ ├── ExecuteRSObjectResponse.java │ │ │ ├── ExecuteRSString.java │ │ │ ├── ExecuteRSStringCircuitBreaker.java │ │ │ ├── ExecuteRSStringOnFailureCode.java │ │ │ ├── ExecuteRSStringResponse.java │ │ │ ├── ResponseExecution.java │ │ │ └── StepExecution.java │ │ └── util │ │ ├── EventbusByteExecutionBlockingUtil.java │ │ ├── EventbusByteExecutionUtil.java │ │ ├── EventbusObjectExecutionBlockingUtil.java │ │ ├── EventbusObjectExecutionUtil.java │ │ ├── EventbusStringExecutionBlockingUtil.java │ │ ├── EventbusStringExecutionUtil.java │ │ └── ReflectionUtil.java │ └── test │ └── resources │ ├── payload.xml │ └── webroot │ ├── index.html │ └── payload.xml ├── vxms-rest-rs ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ ├── module-info.java │ │ └── org │ │ │ └── jacpfx │ │ │ └── vxms │ │ │ └── rest │ │ │ ├── RestRsHandler.java │ │ │ └── RestRsRouteInitializer.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── org.jacpfx.vxms.spi.RESThandlerSPI │ └── test │ └── resources │ ├── payload.xml │ └── webroot │ ├── index.html │ └── payload.xml ├── vxms-rest ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ ├── module-info.java │ │ └── org │ │ │ └── jacpfx │ │ │ └── vxms │ │ │ └── rest │ │ │ ├── RestBaseHandler.java │ │ │ └── RestRouteInitializer.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── org.jacpfx.vxms.spi.RESThandlerSPI │ └── test │ └── resources │ ├── payload.xml │ └── webroot │ ├── index.html │ └── payload.xml └── vxms-testing ├── pom.xml └── src └── test ├── java └── org │ └── jacpfx │ ├── ReflectionTest.java │ ├── TestMethodPerf.java │ ├── chain │ ├── EventbusBlockingChainingByteTest.java │ ├── EventbusBlockingChainingObjectTest.java │ ├── EventbusBlockingChainingStringTest.java │ ├── EventbusChainingByteTest.java │ ├── EventbusChainingObjectTest.java │ ├── EventbusChainingStringTest.java │ ├── RESTServiceBlockingChainByteTest.java │ ├── RESTServiceBlockingChainObjectTest.java │ ├── RESTServiceBlockingChainStringTest.java │ ├── RESTServiceChainByteTest.java │ ├── RESTServiceChainObjectTest.java │ └── RESTServiceChainStringTest.java │ ├── circuitbreaker │ ├── RESTJerseyClientStatefulCircuitBrakerAsyncTests.java │ └── RESTJerseyClientStatefulCircuitBrakerTests.java │ ├── entity │ ├── CookieRouterConfig.java │ ├── MyCustomRouterConfig.java │ ├── MyTestObject.java │ ├── Payload.java │ ├── RestrictedBodyHandlingRouterConfig.java │ ├── RestrictedCorsRouterConfig.java │ ├── RestrictedCorsRouterConfig2.java │ ├── RestrictedCorsRouterConfig3.java │ ├── SessionRouterConfig.java │ ├── StaticContentRouterConfig.java │ ├── decoder │ │ ├── ExampleByteDecoder.java │ │ ├── ExampleByteDecoderMyTest.java │ │ └── ExampleByteDecoderPayload.java │ └── encoder │ │ ├── ExampleByteEncoder.java │ │ └── ExampleStringEncoder.java │ ├── evbbridge │ ├── RESTJerseyClientEventByteCircuitBreakerAsyncTest.java │ ├── RESTJerseyClientEventByteCircuitBreakerTest.java │ ├── RESTJerseyClientEventByteResponseAsyncTest.java │ ├── RESTJerseyClientEventByteResponseTest.java │ ├── RESTJerseyClientEventObjectCircuitBreakerAsyncTest.java │ ├── RESTJerseyClientEventObjectCircuitBreakerTest.java │ ├── RESTJerseyClientEventObjectResponseAsyncTest.java │ ├── RESTJerseyClientEventObjectResponseTest.java │ ├── RESTJerseyClientEventStringCircuitBreakerAsyncTest.java │ ├── RESTJerseyClientEventStringCircuitBreakerTest.java │ ├── RESTJerseyClientEventStringResponseAsyncTest.java │ └── RESTJerseyClientEventStringResponseTest.java │ ├── eventbus │ ├── EventbusBasicTests.java │ ├── EventbusFailureCircuitBreakerTests.java │ ├── EventbusFailureRetryTests.java │ ├── EventbusFailureStatelessCircuitBreakerTests.java │ └── EventbusFailureTests.java │ ├── failure │ ├── RESTJerseyClientErrorTests.java │ ├── RESTServiceByteExceptionFallbackTest.java │ ├── RESTServiceExceptionFallbackTest.java │ ├── RESTServiceExceptionTest.java │ ├── RESTServiceOnFailureByteResponseTest.java │ ├── RESTServiceOnFailureObjectResponseTest.java │ ├── RESTServiceOnFailureStringResponseTest.java │ ├── RESTServiceOnFailureTest.java │ └── RESTServiceUnhandledExceptionsTest.java │ ├── kuberenetes │ ├── KubernetesMockTest.java │ ├── ResolveServicesByLAbelsWithPortNameOfflineTest.java │ ├── ResolveServicesByLAbelsWithPortNameTest.java │ ├── ResolveServicesByLabelOKTest.java │ ├── ResolveServicesByLabelWithConfigNOKTest.java │ ├── ResolveServicesByLabelWithConfigOKTest.java │ ├── ResolveServicesByLabelsConfigAndPortOKOfflineTest.java │ ├── ResolveServicesByLabelsConfigOKOfflineTest.java │ ├── ResolveServicesByLabelsConfigOKTest.java │ ├── ResolveServicesByLabelsOKTest.java │ ├── ResolveServicesByLabelsTooManyNOKTest.java │ ├── ResolveServicesByNameOfflineTest.java │ ├── ResolveServicesByNameTest.java │ ├── ResolveServicesByNameWithPortNameTest.java │ └── TestingClientConfig.java │ ├── other │ ├── AtomicCounterTest.java │ └── GetPidTest.java │ ├── postconstruct │ ├── PostConstructTest.java │ └── StaticPostConstructTest.java │ ├── rest │ ├── RESTAsyncThreadCheck.java │ ├── RESTAsyncThreadCheckStaticInitializer.java │ ├── RESTJerseyClientCORSTest.java │ ├── RESTJerseyClientCookieTest.java │ ├── RESTJerseyClientSessionTest.java │ ├── RESTJerseyClientStaticTest.java │ ├── RESTJerseyClientTests.java │ ├── RESTJerseyClientTimeoutTests.java │ ├── RESTJerseyMimeTypeClientTests.java │ ├── RESTJerseyPOSTFileClientTests.java │ ├── RESTRouteBuilderPOSTFileClientTests.java │ ├── RESTServiceSelfhostedAsyncTest.java │ ├── RESTServiceSelfhostedAsyncTestStaticInitializer.java │ ├── RESTServiceSelfhostedTest.java │ ├── RESTServiceSelfhostedTestStaticInitializer.java │ ├── RESTVerticleRouteBuilderSelfhostedAsyncTest.java │ ├── RESTVerticleRouteBuilderSelfhostedTest.java │ └── RESTVerticleRouteBuilderSelfhostedTestStaticInitializer.java │ ├── verticle │ ├── CircuitBreakerServiceTest.java │ ├── MyCustomServerOptions.java │ ├── Testverticl2.java │ ├── TestverticlWithRestBuilder.java │ └── Testverticle.java │ └── vxms │ └── rest │ └── BuilderTest.java └── resources ├── ca.crt ├── client.crt ├── client.key ├── payload.xml ├── vertx-default-jul-logging.properties-tmp └── webroot ├── index.html └── payload.xml /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /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-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-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-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-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/BlockingExecutionStep.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 org.jacpfx.vxms.common.throwable.ThrowableFunction; 20 | import org.jacpfx.vxms.common.throwable.ThrowableSupplier; 21 | 22 | /** 23 | * Represtens an execution step in a blocking supply/andThen chain 24 | * @param the input value of a step 25 | * @param the return type of a step 26 | */ 27 | public class BlockingExecutionStep { 28 | 29 | 30 | private final ThrowableSupplier chainsupplier; 31 | 32 | private final ThrowableFunction step; 33 | 34 | public BlockingExecutionStep(ThrowableSupplier chainsupplier) { 35 | this.chainsupplier = chainsupplier; 36 | this.step = null; 37 | } 38 | 39 | public BlockingExecutionStep(ThrowableFunction step) { 40 | this.step = step; 41 | this.chainsupplier = null; 42 | } 43 | 44 | /** 45 | * Returns the blocking supplier of the first step (supply) 46 | * @return the supplier 47 | */ 48 | public ThrowableSupplier getChainsupplier() { 49 | return chainsupplier; 50 | } 51 | 52 | /** 53 | * returns an execution step (andThen) 54 | * @return the single step 55 | */ 56 | public ThrowableFunction getStep() { 57 | return step; 58 | } 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /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-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/ExecutionStep.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 org.jacpfx.vxms.common.throwable.ThrowableFutureBiConsumer; 20 | import org.jacpfx.vxms.common.throwable.ThrowableFutureConsumer; 21 | 22 | /** 23 | * Keep the executions steps in supply/andThen 24 | * 25 | * @author Andy Moncsek 26 | * @param the type of the input value 27 | * @param the type of the return value 28 | */ 29 | public class ExecutionStep { 30 | 31 | /** the first step (supply) in a chain */ 32 | private final ThrowableFutureConsumer chainconsumer; 33 | 34 | /** An execution step */ 35 | private final ThrowableFutureBiConsumer step; 36 | 37 | public ExecutionStep(ThrowableFutureConsumer chainconsumer) { 38 | this.chainconsumer = chainconsumer; 39 | this.step = null; 40 | } 41 | 42 | public ExecutionStep(ThrowableFutureBiConsumer step) { 43 | this.step = step; 44 | this.chainconsumer = null; 45 | } 46 | 47 | /** 48 | * Returns a first step from the supply method 49 | * 50 | * @return the supply execution step 51 | */ 52 | public ThrowableFutureConsumer getChainconsumer() { 53 | return chainconsumer; 54 | } 55 | 56 | /** 57 | * Returns an execution step (andThen) 58 | * @return an execution step 59 | */ 60 | public ThrowableFutureBiConsumer getStep() { 61 | return step; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /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-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/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-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/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-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/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-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-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-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-core/src/main/java/org/jacpfx/vxms/common/util/Serializer.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.util; 18 | 19 | import java.io.ByteArrayInputStream; 20 | import java.io.ByteArrayOutputStream; 21 | import java.io.IOException; 22 | import java.io.ObjectInputStream; 23 | import java.io.ObjectOutputStream; 24 | 25 | /** 26 | * Created by amo on 04.12.14. 27 | * Serializing util 28 | */ 29 | public class Serializer { 30 | 31 | /** 32 | * Serialize an object 33 | * 34 | * @param obj the object to serialize 35 | * @return the byte array of the serialized object 36 | * @throws IOException the possible io exception 37 | */ 38 | public static byte[] serialize(Object obj) throws IOException { 39 | final ByteArrayOutputStream b = new ByteArrayOutputStream(); 40 | final ObjectOutputStream o = new ObjectOutputStream(b); 41 | o.writeObject(obj); 42 | o.close(); 43 | return b.toByteArray(); 44 | } 45 | 46 | /** 47 | * Deserialize an object 48 | * 49 | * @param bytes the byte array to deserialize 50 | * @return the object 51 | * @throws IOException deserialization exception 52 | * @throws ClassNotFoundException if class not found 53 | */ 54 | public static Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException { 55 | final ByteArrayInputStream b = new ByteArrayInputStream(bytes); 56 | final ObjectInputStream o = new ObjectInputStream(b); 57 | return o.readObject(); 58 | } 59 | 60 | 61 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vxms-core/src/main/java/org/jacpfx/vxms/common/util/URIUtil.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.util; 18 | 19 | /** 20 | * Created by amo on 20.02.17. 21 | * Utility to clean up context root 22 | */ 23 | public class URIUtil { 24 | 25 | private static final String ROOT = "/"; 26 | 27 | /** 28 | * clean the path and set correct root 29 | * 30 | * @param path the path to clean 31 | * @return the cleaned path 32 | */ 33 | public static String cleanPath(String path) { 34 | return path.startsWith(ROOT) ? path : ROOT + path; 35 | } 36 | 37 | 38 | /** 39 | * clean the context root 40 | * 41 | * @param contextRoot the context root to clean 42 | * @return the cleaned context root 43 | */ 44 | public static String getCleanContextRoot(String contextRoot) { 45 | if (String.valueOf(contextRoot.charAt(contextRoot.length() - 1)).equals(ROOT)) { 46 | String _root = contextRoot.substring(0, contextRoot.length() - 1); 47 | return _root.startsWith(ROOT) ? _root : ROOT + _root; 48 | } else if (!contextRoot.startsWith(ROOT)) { 49 | return ROOT + contextRoot; 50 | } 51 | return contextRoot; 52 | } 53 | 54 | /** 55 | * check if context root is set 56 | * 57 | * @param cRoot the URI string 58 | * @return true if context root is set 59 | */ 60 | public static boolean isContextRootSet(String cRoot) { 61 | return !cRoot.trim().equals(ROOT) && cRoot.length() > 1; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /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-core/src/main/java/org/jacpfx/vxms/spi/RESThandlerSPI.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.ext.web.Router; 21 | import org.jacpfx.vxms.common.VxmsShared; 22 | 23 | /** 24 | * Created by amo on 05.08.16. 25 | * Defines SPI to bootstrap a vxms rest API 26 | */ 27 | public interface RESThandlerSPI { 28 | 29 | /** 30 | * initialize a rest API 31 | * 32 | * @param vxmsShared the vxmsShared instance, containing the Vertx instance and other shared 33 | * objects per instance 34 | * @param router the vertx web router 35 | * @param service the verticle to be applied 36 | */ 37 | void initRESTHandler(VxmsShared vxmsShared, Router router, AbstractVerticle service); 38 | 39 | /** 40 | * initialize a rest API 41 | * 42 | * @param vxmsShared the vxmsShared instance, containing the Vertx instance and other shared 43 | * objects per instance 44 | * @param router the vertx web router 45 | * @param service the verticle to be applied 46 | * @param routes the user-defined routes 47 | */ 48 | void initRESTHandler(VxmsShared vxmsShared, Router router, AbstractVerticle service,VxmsRoutes ...routes); 49 | } 50 | -------------------------------------------------------------------------------- /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-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-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/src/test/resources/payload.xml: -------------------------------------------------------------------------------- 1 | dfgdfg -------------------------------------------------------------------------------- /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-core/src/test/resources/webroot/index.html: -------------------------------------------------------------------------------- 1 |

fgdfgdf

-------------------------------------------------------------------------------- /vxms-core/src/test/resources/webroot/payload.xml: -------------------------------------------------------------------------------- 1 | dfgdfg -------------------------------------------------------------------------------- /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/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-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-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-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-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 | -------------------------------------------------------------------------------- /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-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-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-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-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 | -------------------------------------------------------------------------------- /vxms-demos/vxms-container-eventbus-demo/vxms-frontend/src/main/java/org/jacpfx/vxms/frontend/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.frontend.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 | public static JsonObject defaultErrorResponse(String userMessage) { 36 | JsonObject message = new JsonObject(); 37 | message.put("username", userMessage). 38 | put("firstName", userMessage). 39 | put("lastName", userMessage). 40 | put("address", userMessage); 41 | return message; 42 | } 43 | 44 | 45 | public static JsonObject mapToUser(JsonObject input, String id) { 46 | return new JsonObject(). 47 | put("username", input.getString("username")). 48 | put("firstName", input.getString("firstName")). 49 | put("lastName", input.getString("lastName")). 50 | put("address", input.getString("address")). 51 | put("id", id); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /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-eventbus-demo/vxms-frontend/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-demos/vxms-container-eventbus-demo/vxms-frontend/src/main/resources/webroot/tpl/add-new.html: -------------------------------------------------------------------------------- 1 | 16 | 17 |

Add new user

18 |
19 |
20 |
21 |
22 | 23 | 24 |
25 |
26 | 27 | 28 |
29 |
30 | 31 | 32 |
33 |
34 | 35 | 36 |
37 | 40 | Cancel 41 |
42 |
43 |
-------------------------------------------------------------------------------- /vxms-demos/vxms-container-eventbus-demo/vxms-frontend/src/main/resources/webroot/tpl/lists.html: -------------------------------------------------------------------------------- 1 | 16 | 17 |

Users

18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 36 | 37 | 38 |
UsernameFirst NameLast NameAddressOptions
{{user.username}}{{user.firstName}}{{user.lastName}}{{user.address}} 35 |
39 | Add New User -------------------------------------------------------------------------------- /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-eventbus-demo/vxms-read/local.json: -------------------------------------------------------------------------------- 1 | { 2 | "local": true 3 | } 4 | -------------------------------------------------------------------------------- /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-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-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-read/src/main/java/org/jacpfx/vxms/read/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.read.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 | public static JsonObject defaultErrorResponse(String userMessage) { 36 | JsonObject message = new JsonObject(); 37 | message.put("username", userMessage). 38 | put("firstName", userMessage). 39 | put("lastName", userMessage). 40 | put("address", userMessage); 41 | return message; 42 | } 43 | 44 | public static JsonObject mapToUser(JsonObject input, String id) { 45 | return new JsonObject(). 46 | put("username", input.getString("username")). 47 | put("firstName", input.getString("firstName")). 48 | put("lastName", input.getString("lastName")). 49 | put("address", input.getString("address")). 50 | put("id", id); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /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-container-eventbus-demo/vxms-write/local.json: -------------------------------------------------------------------------------- 1 | { 2 | "local": true 3 | } 4 | -------------------------------------------------------------------------------- /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-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-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-write/src/main/java/org/jacpfx/vxms/write/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.write.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 | public static JsonObject defaultErrorResponse(String userMessage) { 36 | JsonObject message = new JsonObject(); 37 | message.put("username", userMessage). 38 | put("firstName", userMessage). 39 | put("lastName", userMessage). 40 | put("address", userMessage); 41 | return message; 42 | } 43 | 44 | public static JsonObject mapToUser(JsonObject input, String id) { 45 | return new JsonObject(). 46 | put("username", input.getString("username")). 47 | put("firstName", input.getString("firstName")). 48 | put("lastName", input.getString("lastName")). 49 | put("address", input.getString("address")). 50 | put("id", id); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /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-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-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-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-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-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-demos/vxms-container-k8s-discovery-demo/vxms-k8s-frontend/src/main/java/org/jacpfx/vxms/k8sfrontend/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.k8sfrontend.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 | public static JsonObject defaultErrorResponse(String userMessage) { 36 | JsonObject message = new JsonObject(); 37 | message.put("username", userMessage). 38 | put("firstName", userMessage). 39 | put("lastName", userMessage). 40 | put("address", userMessage); 41 | return message; 42 | } 43 | 44 | 45 | public static JsonObject mapToUser(JsonObject input, String id) { 46 | return new JsonObject(). 47 | put("username", input.getString("username")). 48 | put("firstName", input.getString("firstName")). 49 | put("lastName", input.getString("lastName")). 50 | put("address", input.getString("address")). 51 | put("id", id); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /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-container-k8s-discovery-demo/vxms-k8s-frontend/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-demos/vxms-container-k8s-discovery-demo/vxms-k8s-frontend/src/main/resources/webroot/tpl/add-new.html: -------------------------------------------------------------------------------- 1 | 16 | 17 |

Add new user

18 |
19 |
20 |
21 |
22 | 23 | 24 |
25 |
26 | 27 | 28 |
29 |
30 | 31 | 32 |
33 |
34 | 35 | 36 |
37 | 40 | Cancel 41 |
42 |
43 |
-------------------------------------------------------------------------------- /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 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 36 | 37 | 38 |
UsernameFirst NameLast NameAddressOptions
{{user.username}}{{user.firstName}}{{user.lastName}}{{user.address}} 35 |
39 | Add New User -------------------------------------------------------------------------------- /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-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-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-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-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-demos/vxms-container-k8s-discovery-demo/vxms-k8s-read/src/main/java/org/jacpfx/vxms/k8sread/service/UserService.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.service; 18 | 19 | import io.vertx.core.Future; 20 | import io.vertx.core.json.Json; 21 | import org.jacpfx.vxms.k8sread.entity.Users; 22 | import org.jacpfx.vxms.k8sread.repository.ReactiveUserRepository; 23 | import org.springframework.beans.factory.annotation.Autowired; 24 | import org.springframework.stereotype.Component; 25 | import reactor.core.publisher.Flux; 26 | 27 | @Component 28 | public class UserService { 29 | @Autowired 30 | private ReactiveUserRepository repository; 31 | 32 | public void findAllUsers(Future future) { 33 | repository 34 | .findAll() 35 | .collectList() 36 | .doOnSuccess(value -> future.complete(Json.encode(value))) 37 | .doOnError(error -> future.fail(error)) 38 | .subscribe(); 39 | } 40 | 41 | public void findUser(String id, Future future) { 42 | repository 43 | .findById(id) 44 | .doOnSuccess(value -> future.complete(Json.encode(value))) 45 | .doOnError(error -> future.fail(error)) 46 | .subscribe(); 47 | } 48 | 49 | public void initData(Future startFuture) { 50 | Flux people = 51 | Flux.just( 52 | new Users("1", "eoc", "Eric", "Foo", "Zh"), 53 | new Users("2", "fgdf", "Raymond", "Bar", "B"), 54 | new Users("3", "bdf", "Paul", "Baz", "x")); 55 | repository.findAll().collectList().doOnSuccess(result -> { 56 | if(result.isEmpty())repository.saveAll(people); 57 | startFuture.complete(); 58 | }).subscribe(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vxms-demos/vxms-container-k8s-discovery-demo/vxms-k8s-read/src/main/java/org/jacpfx/vxms/k8sread/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.k8sread.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 | public static JsonObject defaultErrorResponse(String userMessage) { 36 | JsonObject message = new JsonObject(); 37 | message.put("username", userMessage). 38 | put("firstName", userMessage). 39 | put("lastName", userMessage). 40 | put("address", userMessage); 41 | return message; 42 | } 43 | 44 | public static JsonObject mapToUser(JsonObject input, String id) { 45 | return new JsonObject(). 46 | put("username", input.getString("username")). 47 | put("firstName", input.getString("firstName")). 48 | put("lastName", input.getString("lastName")). 49 | put("address", input.getString("address")). 50 | put("id", id); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /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-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-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-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-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-container-k8s-discovery-demo/vxms-k8s-write/src/main/java/org/jacpfx/vxms/k8swrite/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.k8swrite.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 | public static JsonObject defaultErrorResponse(String userMessage) { 36 | JsonObject message = new JsonObject(); 37 | message.put("username", userMessage). 38 | put("firstName", userMessage). 39 | put("lastName", userMessage). 40 | put("address", userMessage); 41 | return message; 42 | } 43 | 44 | public static JsonObject mapToUser(JsonObject input, String id) { 45 | return new JsonObject(). 46 | put("username", input.getString("username")). 47 | put("firstName", input.getString("firstName")). 48 | put("lastName", input.getString("lastName")). 49 | put("address", input.getString("address")). 50 | put("id", id); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /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-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-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-demos/vxms-core-demo/README.MD: -------------------------------------------------------------------------------- 1 | # a basic vxms-core example 2 | 3 | This example shows the minimum usage of vxms-core. It defines a HTTP endpoint on port 9090 and two REST (Get) endpoints. 4 | You can start the service using the *main* method or you build the project (*mvn package*) and run the fat jar (*java -jar target/vxms-core-demo-one-fat.jar*). 5 | 6 | ## run as Java 9 module 7 | 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. 8 | 9 | ```shell 10 | java --module-path target/vxms-core-demo-1.2-SNAPSHOT.jar:target/mod --module vxms.core.demo/org.jacpfx.vxms.verticle.SimpleREST 11 | time java -XX:+UseAppCDS -Xshare:dump -XX:SharedArchiveFile=app-cds.jsa -XX:DumpLoadedClassList=classes.lst --class-path --module-path target/vxms-core-demo-1.2-SNAPSHOT.jar:target/mod --module vxms.core.demo/org.jacpfx.vxms.verticle.SimpleREST 12 | time java -XX:+UnlockCommercialFeatures -XX:+UseAppCDS -Xshare:on -XX:SharedArchiveFile=app-cds.jsa --module-path target/vxms-core-demo-1.2-SNAPSHOT.jar:target/mod --module vxms.core.demo/org.jacpfx.vxms.verticle.SimpleREST -Xlog:class+load 13 | 14 | ``` 15 | 16 | ## create a modular runtime image 17 | 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: 18 | - Step 1: clone the project, switch to Java9 branch and build the project against Java9 19 | - 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 20 | - Step 3: the modular image (containing the REST service) will be copied to an alpine image 21 | 22 | ### how to build 23 | ```shell 24 | docker build -t core-demo . 25 | ``` 26 | ### how to run 27 | ```shell 28 | docker run -m32M -p 9090:9090 --name core-demo core-demo:latest 29 | ``` 30 | -------------------------------------------------------------------------------- /vxms-demos/vxms-core-demo/app-cds.jsa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amoAHCP/vxms/06f5a01196f6aca4226ac73a3ddea4a264928b5e/vxms-demos/vxms-core-demo/app-cds.jsa -------------------------------------------------------------------------------- /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-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-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-demos/vxms-core-demo/src/main/java/org/jacpfx/vxms/verticle/SimpleREST.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.verticle; 18 | 19 | import io.vertx.core.DeploymentOptions; 20 | import io.vertx.core.Future; 21 | import io.vertx.core.Handler; 22 | import io.vertx.core.Vertx; 23 | import io.vertx.core.json.JsonObject; 24 | import io.vertx.ext.web.Router; 25 | import io.vertx.ext.web.RoutingContext; 26 | import org.jacpfx.vxms.common.ServiceEndpoint; 27 | import org.jacpfx.vxms.services.VxmsEndpoint; 28 | 29 | 30 | /** 31 | * Created by Andy Moncsek on 25.01.16. 32 | */ 33 | @ServiceEndpoint(port = 8080) 34 | public class SimpleREST extends VxmsEndpoint { 35 | 36 | @Override 37 | public void postConstruct(Router router, final Future startFuture) { 38 | router.get("/helloGET").handler(getSimpleResponse()); 39 | router.get("/helloGET/:name").handler(getName()); 40 | startFuture.complete(); 41 | } 42 | 43 | private Handler getName() { 44 | return helloGet -> helloGet.response().end("hello World " + helloGet.request().getParam("name")); 45 | } 46 | 47 | private Handler getSimpleResponse() { 48 | return helloGet -> helloGet.response().end("simple response"); 49 | } 50 | 51 | public static void main(String[] args) { 52 | DeploymentOptions options = new DeploymentOptions(); 53 | System.out.println("test"); 54 | SimpleREST t = new SimpleREST(); 55 | Vertx.vertx().deployVerticle(t, options); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /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-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-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-secure-spa-demo/.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amoAHCP/vxms/06f5a01196f6aca4226ac73a3ddea4a264928b5e/vxms-demos/vxms-secure-spa-demo/.keystore -------------------------------------------------------------------------------- /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-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/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-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-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-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-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-demos/vxms-secure-spa-demo/src/main/resources/webroot/tpl/add-new.html: -------------------------------------------------------------------------------- 1 | 16 | 17 |

Add new user

18 |
19 |
20 |
21 |
22 | 23 | 24 |
25 |
26 | 27 | 28 |
29 |
30 | 31 | 32 |
33 |
34 | 35 | 36 |
37 | 38 | Cancel 39 |
40 |
41 |
-------------------------------------------------------------------------------- /vxms-demos/vxms-secure-spa-demo/src/main/resources/webroot/tpl/edit.html: -------------------------------------------------------------------------------- 1 | 16 | 17 |

Edit user

18 |
19 |
20 |
21 | 22 |
23 | 24 | 25 |
26 |
27 | 28 | 29 |
30 |
31 | 32 | 33 |
34 |
35 | 36 | 37 |
38 | 39 | 40 | Cancel 41 |
42 |
43 |
-------------------------------------------------------------------------------- /vxms-demos/vxms-secure-spa-demo/src/main/resources/webroot/tpl/lists.html: -------------------------------------------------------------------------------- 1 | 16 | 17 |

Welcome {{userinfo}}

18 |

Users

19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
UsernameFirst NameLast NameAddressOptions
{{user.username}}{{user.firstName}}{{user.lastName}}{{user.address}}
39 | Add New User -------------------------------------------------------------------------------- /vxms-demos/vxms-spring-demo/Dockerfile: -------------------------------------------------------------------------------- 1 | # First stage: Copy the project and run mvn clean install in Docker to build the project against Java 9 2 | FROM maven:3.5.4-jdk-11 AS mavenbuilder 3 | MAINTAINER Andy Moncsek 4 | RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* 5 | WORKDIR /app 6 | RUN git clone https://github.com/amoAHCP/vxms.git && \ 7 | cd vxms && \ 8 | git checkout java11 && \ 9 | cd vxms-demos/vxms-spring-demo && \ 10 | mvn clean install 11 | 12 | 13 | # Second stage: Copies the builded application and creates a custom JRE 14 | FROM alpine:3.8 AS builder 15 | MAINTAINER Andy Moncsek 16 | ENV JAVA_HOME=/opt/jdk \ 17 | PATH=${PATH}:/opt/jdk/bin \ 18 | LANG=C.UTF-8 19 | RUN set -ex && \ 20 | apk add --no-cache bash && \ 21 | wget https://download.java.net/java/early_access/alpine/22/binaries/openjdk-11-ea+22_linux-x64-musl_bin.tar.gz -O jdk.tar.gz && \ 22 | mkdir -p /opt/jdk && \ 23 | tar zxvf jdk.tar.gz -C /opt/jdk --strip-components=1 && \ 24 | rm jdk.tar.gz && \ 25 | rm /opt/jdk/lib/src.zip 26 | WORKDIR /app 27 | COPY --from=mavenbuilder /app/vxms/vxms-demos/vxms-spring-demo/ ./ 28 | RUN jlink --module-path target/vxms-spring-demo-1.2-SNAPSHOT.jar:target/modules:$JAVA_HOME/jmods \ 29 | --add-modules vxms.spring.demo \ 30 | --limit-modules vxms.spring.demo \ 31 | --launcher run=vxms.spring.demo/org.jacpfx.vxms.spring.SimpleSpringRESTStaticInit \ 32 | --output dist \ 33 | --compress 2 \ 34 | --strip-debug \ 35 | --no-header-files \ 36 | --no-man-pages \ 37 | --vm server 38 | 39 | 40 | # Third stage: Copies the custom JRE into our image and runs it 41 | FROM alpine:3.8 42 | MAINTAINER Andy Moncsek 43 | WORKDIR /app 44 | COPY --from=builder /app/dist/ ./ 45 | EXPOSE 9090 46 | ENV JVM_OPTS="-XX:MaxRAMFraction=1" 47 | #ENV JVM_OPTS="-Xms16M" 48 | CMD ["bin/java", "--add-opens","java.base/java.lang=spring.core","-m","vxms.spring.demo/org.jacpfx.vxms.spring.SimpleSpringRESTStaticInit"] 49 | # CMD ["bin/java", "-m","vxms.spring.demo/org.jacpfx.vxms.spring.SimpleSpringREST", "--illigal-access=deny","--add-opens ","java.base/java.lang=ALL"] 50 | #CMD ["bin/java -m vxms.spring.demo/org.jacpfx.vxms.spring.SimpleSpringREST --illigal-access=deny --add-opens java.base/java.lang=ALL"] 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /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-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-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-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-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-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-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-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-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-event/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-event 30 | jar 31 | 32 | vxms-event 33 | http://maven.apache.org 34 | 35 | 36 | UTF-8 37 | 38 | 39 | 40 | 41 | org.jacpfx 42 | vxms-core 43 | ${parent.version} 44 | 45 | 46 | javax.ws.rs 47 | javax.ws.rs-api 48 | 2.0.1 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /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-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-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-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-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 message; 28 | 29 | /** 30 | * init the EventbusBridgeRequest 31 | * 32 | * @param message the event-bus message 33 | */ 34 | public EventbusRequest(Message message) { 35 | this.message = message; 36 | } 37 | 38 | /** 39 | * Returns the body of the message 40 | * 41 | * @param the type of payload 42 | * @return the payloasd 43 | */ 44 | public T body() { 45 | return (T) message.body(); 46 | } 47 | 48 | /** 49 | * Returns the reply-address to reply to the incoming message 50 | * 51 | * @return the reply address 52 | */ 53 | public String replyAddress() { 54 | return message.replyAddress(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /vxms-event/src/test/resources/payload.xml: -------------------------------------------------------------------------------- 1 | dfgdfg -------------------------------------------------------------------------------- /vxms-event/src/test/resources/webroot/index.html: -------------------------------------------------------------------------------- 1 |

fgdfgdf

-------------------------------------------------------------------------------- /vxms-event/src/test/resources/webroot/payload.xml: -------------------------------------------------------------------------------- 1 | dfgdfg -------------------------------------------------------------------------------- /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-k8sdiscovery/src/main/java/org/jacpfx/vxms/k8s/annotation/K8SDiscovery.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.annotation; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | import org.jacpfx.vxms.k8s.api.CustomClientConfig; 24 | import org.jacpfx.vxms.k8s.api.DefaultCustomClientConfig; 25 | 26 | @Target({ElementType.TYPE}) 27 | @Retention(RetentionPolicy.RUNTIME) 28 | /** The Kubernetes discovery annotation */ 29 | public @interface K8SDiscovery { 30 | 31 | /** 32 | * The user to access the master API 33 | * 34 | * @return the name of the user to access the master API 35 | */ 36 | String user() default ""; 37 | 38 | /** 39 | * The password to access the master API 40 | * 41 | * @return The API password 42 | */ 43 | String password() default ""; 44 | 45 | /** 46 | * The API token 47 | * 48 | * @return the API token 49 | */ 50 | String api_token() default ""; 51 | 52 | /** 53 | * The Kubernetes master URL 54 | * 55 | * @return the master url 56 | */ 57 | String master_url() default "https://kubernetes.default.svc"; 58 | 59 | /** 60 | * The namespace where to do the discovery 61 | * 62 | * @return the namespace where to discover 63 | */ 64 | String namespace() default "default"; 65 | 66 | /** 67 | * Returns a custom Kubernetes Client Configuration handler. If you define this, all other 68 | * properties will be ignored 69 | * 70 | * @return the customer kubernetes client configuration handler 71 | */ 72 | Class customClientConfiguration() default 73 | DefaultCustomClientConfig.class; 74 | } 75 | -------------------------------------------------------------------------------- /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-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-k8sdiscovery/src/main/java/org/jacpfx/vxms/k8s/discovery/Endpoints.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.discovery; 18 | 19 | import io.fabric8.kubernetes.api.model.EndpointsList; 20 | import io.fabric8.kubernetes.client.KubernetesClient; 21 | 22 | /** 23 | * Created by amo on 13.04.17. 24 | */ 25 | @Deprecated 26 | public class Endpoints { 27 | 28 | private final KubernetesClient client; 29 | private final String namespace, labelName, labelValue; 30 | 31 | private Endpoints(KubernetesClient client, String namespace, String labelName, 32 | String labelValue) { 33 | this.client = client; 34 | this.namespace = namespace; 35 | this.labelName = labelName; 36 | this.labelValue = labelValue; 37 | } 38 | 39 | public interface LabelValue { 40 | 41 | Endpoints labelValue(String labelValue); 42 | } 43 | 44 | public interface LabelName { 45 | 46 | LabelValue labelName(String serviceName); 47 | } 48 | 49 | public interface Namespace { 50 | 51 | LabelName namespace(String namespace); 52 | } 53 | 54 | public interface Client { 55 | 56 | Namespace client(KubernetesClient client); 57 | } 58 | 59 | public static Client build() { 60 | return client -> namespace -> labelName -> labelValue -> new Endpoints(client, namespace, 61 | labelName, labelValue); 62 | } 63 | 64 | public EndpointsList getEndpoints() { 65 | return labelValue != null && !labelValue.isEmpty() ? 66 | client.endpoints().inNamespace(namespace).withLabel(labelName, labelValue).list() : 67 | client.endpoints().inNamespace(namespace).withLabel(labelName).list(); 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /vxms-k8sdiscovery/src/main/java/org/jacpfx/vxms/k8s/discovery/Pods.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.discovery; 18 | 19 | import io.fabric8.kubernetes.api.model.PodList; 20 | import io.fabric8.kubernetes.client.KubernetesClient; 21 | 22 | /** 23 | * Created by amo on 13.04.17. 24 | */ 25 | @Deprecated 26 | public class Pods { 27 | 28 | private final KubernetesClient client; 29 | private final String namespace, labelName, labelValue; 30 | 31 | private Pods(KubernetesClient client, String namespace, String labelName, 32 | String labelValue) { 33 | this.client = client; 34 | this.namespace = namespace; 35 | this.labelName = labelName; 36 | this.labelValue = labelValue; 37 | } 38 | 39 | public interface LabelValue { 40 | 41 | Pods labelValue(String labelValue); 42 | } 43 | 44 | public interface LabelName { 45 | 46 | LabelValue labelName(String serviceName); 47 | } 48 | 49 | public interface Namespace { 50 | 51 | LabelName namespace(String namespace); 52 | } 53 | 54 | public interface Client { 55 | 56 | Namespace client(KubernetesClient client); 57 | } 58 | 59 | public static Client build() { 60 | return client -> namespace -> labelName -> labelValue -> new Pods(client, namespace, 61 | labelName, labelValue); 62 | } 63 | 64 | public PodList getPods() { 65 | return labelValue != null && !labelValue.isEmpty() ? 66 | client.pods().inNamespace(namespace).withLabel(labelName, labelValue).list() : 67 | client.pods().inNamespace(namespace).withLabel(labelName).list(); 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /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-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-k8sdiscovery/src/main/java/org/jacpfx/vxms/k8s/util/TokenUtil.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.io.IOException; 20 | import java.nio.file.Files; 21 | import java.nio.file.Path; 22 | import java.nio.file.Paths; 23 | import java.util.logging.Level; 24 | import java.util.logging.Logger; 25 | 26 | /** 27 | * Utility class to get default account token in a container 28 | * @author Andy Moncsek 29 | */ 30 | public class TokenUtil { 31 | private static final String IO_SERVICEACCOUNT_TOKEN = "/var/run/secrets/kubernetes.io/serviceaccount/token"; 32 | private static Logger log = Logger.getLogger(TokenUtil.class.getName()); 33 | 34 | public static String getAccountToken() { 35 | try { 36 | final Path path = Paths.get(IO_SERVICEACCOUNT_TOKEN); 37 | if (!path.toFile().exists()) { 38 | log.log(Level.WARNING, "no token found"); 39 | return null; 40 | } 41 | return new String(Files.readAllBytes(path)); 42 | 43 | } catch (IOException e) { 44 | throw new RuntimeException("Could not get token file", e); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /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-rest-base/src/main/java/org/jacpfx/vxms/rest/base/MethodDescriptor.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; 18 | 19 | import io.vertx.core.http.HttpMethod; 20 | import org.jacpfx.vxms.rest.base.VxmsRESTRoutes.RestErrorConsumer; 21 | import org.jacpfx.vxms.rest.base.VxmsRESTRoutes.RestHandlerConsumer; 22 | 23 | public class MethodDescriptor { 24 | public final HttpMethod httpMethod; 25 | public final String path; 26 | public final String[] consumes; 27 | public final RestHandlerConsumer method; 28 | public final RestErrorConsumer errorMethod; 29 | 30 | public MethodDescriptor( 31 | HttpMethod httpMethod, 32 | String path, 33 | RestHandlerConsumer method, 34 | String[] consumes, 35 | RestErrorConsumer errorMethod) { 36 | this.httpMethod = httpMethod; 37 | this.path = path; 38 | this.consumes = consumes; 39 | this.method = method; 40 | this.errorMethod = errorMethod; 41 | } 42 | 43 | public HttpMethod getHttpMethod() { 44 | return httpMethod; 45 | } 46 | 47 | public String getPath() { 48 | return path; 49 | } 50 | 51 | public String[] getConsumes() { 52 | return consumes; 53 | } 54 | 55 | public RestHandlerConsumer getMethod() { 56 | return method; 57 | } 58 | 59 | public RestErrorConsumer getErrorMethod() { 60 | return errorMethod; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vxms-rest-base/src/main/java/org/jacpfx/vxms/rest/base/VxmsRESTRoutes.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; 18 | 19 | import java.util.ArrayList; 20 | import java.util.Collections; 21 | import java.util.List; 22 | import java.util.function.BiConsumer; 23 | import java.util.function.Consumer; 24 | 25 | import org.jacpfx.vxms.rest.base.response.RestHandler; 26 | import org.jacpfx.vxms.spi.VxmsRoutes; 27 | 28 | public class VxmsRESTRoutes implements VxmsRoutes { 29 | 30 | protected final List descriptors; 31 | 32 | public VxmsRESTRoutes(List descriptors) { 33 | this.descriptors = descriptors; 34 | } 35 | 36 | public static VxmsRESTRoutes init() { 37 | return new VxmsRESTRoutes(Collections.emptyList()); 38 | } 39 | 40 | public VxmsRESTRoutes route(RouteBuilder builder) { 41 | List tmp = new ArrayList<>(descriptors); 42 | tmp.add(builder.getDescriptor()); 43 | return new VxmsRESTRoutes(tmp); 44 | } 45 | 46 | public List getDescriptors() { 47 | return descriptors; 48 | } 49 | 50 | public interface RestHandlerConsumer extends Consumer {} 51 | 52 | public interface RestErrorConsumer extends BiConsumer {} 53 | } 54 | -------------------------------------------------------------------------------- /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-rest-base/src/test/resources/payload.xml: -------------------------------------------------------------------------------- 1 | dfgdfg -------------------------------------------------------------------------------- /vxms-rest-base/src/test/resources/webroot/index.html: -------------------------------------------------------------------------------- 1 |

fgdfgdf

-------------------------------------------------------------------------------- /vxms-rest-base/src/test/resources/webroot/payload.xml: -------------------------------------------------------------------------------- 1 | dfgdfg -------------------------------------------------------------------------------- /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-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-rest-rs/src/test/resources/payload.xml: -------------------------------------------------------------------------------- 1 | dfgdfg -------------------------------------------------------------------------------- /vxms-rest-rs/src/test/resources/webroot/index.html: -------------------------------------------------------------------------------- 1 |

fgdfgdf

-------------------------------------------------------------------------------- /vxms-rest-rs/src/test/resources/webroot/payload.xml: -------------------------------------------------------------------------------- 1 | dfgdfg -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vxms-rest/src/main/java/org/jacpfx/vxms/rest/RestBaseHandler.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 | 22 | import java.util.Objects; 23 | import java.util.stream.Stream; 24 | 25 | import org.jacpfx.vxms.common.VxmsShared; 26 | import org.jacpfx.vxms.rest.base.VxmsRESTRoutes; 27 | import org.jacpfx.vxms.spi.RESThandlerSPI; 28 | import org.jacpfx.vxms.spi.VxmsRoutes; 29 | 30 | /** 31 | * Created by amo on 05.08.16. Implements teh RESThandlerSPI and calls the initializer to bootstrap 32 | * the rest API 33 | */ 34 | public class RestBaseHandler implements RESThandlerSPI { 35 | 36 | @Override 37 | public void initRESTHandler(VxmsShared vxmsShared, Router router, AbstractVerticle service) { 38 | RestRouteInitializer.initRESTHandler(vxmsShared, router, null); 39 | } 40 | 41 | @Override 42 | public void initRESTHandler( 43 | VxmsShared vxmsShared, Router router, AbstractVerticle service, VxmsRoutes... routes) { 44 | Objects.requireNonNull(routes,"no routes defined"); 45 | // check if VxmsRoutes contains REST routes 46 | Stream.of(routes) 47 | .filter(r -> r instanceof org.jacpfx.vxms.rest.base.VxmsRESTRoutes) 48 | .map(VxmsRESTRoutes.class::cast) 49 | .forEach( 50 | routesToInit -> 51 | RestRouteInitializer.initRESTHandler(vxmsShared, router, routesToInit)); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vxms-rest/src/test/resources/payload.xml: -------------------------------------------------------------------------------- 1 | dfgdfg -------------------------------------------------------------------------------- /vxms-rest/src/test/resources/webroot/index.html: -------------------------------------------------------------------------------- 1 |

fgdfgdf

-------------------------------------------------------------------------------- /vxms-rest/src/test/resources/webroot/payload.xml: -------------------------------------------------------------------------------- 1 | dfgdfg -------------------------------------------------------------------------------- /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-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/MyTestObject.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 19.11.15. */ 22 | public class MyTestObject implements Serializable { 23 | 24 | private final String name; 25 | private final String lastName; 26 | 27 | public MyTestObject(String name, String lastName) { 28 | this.name = name; 29 | this.lastName = lastName; 30 | } 31 | 32 | public String getName() { 33 | return name; 34 | } 35 | 36 | public String getLastName() { 37 | return lastName; 38 | } 39 | 40 | @Override 41 | public boolean equals(Object o) { 42 | if (this == o) { 43 | return true; 44 | } 45 | if (!(o instanceof MyTestObject)) { 46 | return false; 47 | } 48 | 49 | MyTestObject that = (MyTestObject) o; 50 | 51 | if (name != null ? !name.equals(that.name) : that.name != null) { 52 | return false; 53 | } 54 | return !(lastName != null ? !lastName.equals(that.lastName) : that.lastName != null); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = name != null ? name.hashCode() : 0; 60 | result = 31 * result + (lastName != null ? lastName.hashCode() : 0); 61 | return result; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /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-testing/src/test/java/org/jacpfx/entity/RestrictedBodyHandlingRouterConfig.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 RestrictedBodyHandlingRouterConfig 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 | public void bodyHandler(Router router) {} 41 | } 42 | -------------------------------------------------------------------------------- /vxms-testing/src/test/java/org/jacpfx/entity/RestrictedCorsRouterConfig.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.CorsHandler; 22 | import org.jacpfx.vxms.common.configuration.RouterConfiguration; 23 | 24 | /** Created by Andy Moncsek on 18.02.16. */ 25 | public class RestrictedCorsRouterConfig implements RouterConfiguration { 26 | 27 | public void corsHandler(Router router) { 28 | router 29 | .route() 30 | .handler( 31 | CorsHandler.create("127.0.0.1") 32 | .allowedMethod(io.vertx.core.http.HttpMethod.GET) 33 | .allowedMethod(io.vertx.core.http.HttpMethod.POST) 34 | .allowedMethod(io.vertx.core.http.HttpMethod.OPTIONS) 35 | .allowedMethod(io.vertx.core.http.HttpMethod.PUT) 36 | .allowedMethod(io.vertx.core.http.HttpMethod.DELETE) 37 | .allowedHeader("Content-Type") 38 | .allowedHeader("X-Requested-With")); 39 | } 40 | 41 | public BodyHandler bodyHandler() { 42 | return BodyHandler.create(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vxms-testing/src/test/java/org/jacpfx/entity/RestrictedCorsRouterConfig2.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.CorsHandler; 22 | import org.jacpfx.vxms.common.configuration.RouterConfiguration; 23 | 24 | /** Created by Andy Moncsek on 18.02.16. */ 25 | public class RestrictedCorsRouterConfig2 implements RouterConfiguration { 26 | 27 | public void corsHandler(Router router) { 28 | router 29 | .route() 30 | .handler( 31 | CorsHandler.create("http://example.com") 32 | .allowedMethod(io.vertx.core.http.HttpMethod.GET) 33 | .allowedMethod(io.vertx.core.http.HttpMethod.POST) 34 | .allowedMethod(io.vertx.core.http.HttpMethod.OPTIONS) 35 | .allowedMethod(io.vertx.core.http.HttpMethod.PUT) 36 | .allowedMethod(io.vertx.core.http.HttpMethod.DELETE) 37 | .allowedHeader("Content-Type") 38 | .allowedHeader("X-Requested-With")); 39 | } 40 | 41 | public BodyHandler bodyHandler() { 42 | return BodyHandler.create(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vxms-testing/src/test/java/org/jacpfx/entity/RestrictedCorsRouterConfig3.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.CorsHandler; 22 | import org.jacpfx.vxms.common.configuration.RouterConfiguration; 23 | 24 | /** Created by Andy Moncsek on 18.02.16. */ 25 | public class RestrictedCorsRouterConfig3 implements RouterConfiguration { 26 | 27 | public void corsHandler(Router router) { 28 | router 29 | .route("/stringGETResponseSyncAsync*") 30 | .handler( 31 | CorsHandler.create("http://example.com") 32 | .allowedMethod(io.vertx.core.http.HttpMethod.GET) 33 | .allowedMethod(io.vertx.core.http.HttpMethod.POST) 34 | .allowedMethod(io.vertx.core.http.HttpMethod.OPTIONS) 35 | .allowedMethod(io.vertx.core.http.HttpMethod.PUT) 36 | .allowedMethod(io.vertx.core.http.HttpMethod.DELETE) 37 | .allowedHeader("Content-Type") 38 | .allowedHeader("X-Requested-With")); 39 | } 40 | 41 | public BodyHandler bodyHandler() { 42 | return BodyHandler.create(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /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-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-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-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-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-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-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-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/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-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-testing/src/test/java/org/jacpfx/verticle/Testverticl2.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.AbstractVerticle; 20 | import io.vertx.core.DeploymentOptions; 21 | import io.vertx.core.Vertx; 22 | import io.vertx.core.json.JsonObject; 23 | import javax.ws.rs.GET; 24 | import javax.ws.rs.Path; 25 | import org.jacpfx.vxms.rest.base.response.RestHandler; 26 | import org.jacpfx.vxms.services.VxmsEndpoint; 27 | 28 | /** Created by amo on 23.11.16. */ 29 | public class Testverticl2 extends AbstractVerticle { 30 | 31 | public static void main(String[] args) { 32 | DeploymentOptions options = 33 | new DeploymentOptions() 34 | .setInstances(1) 35 | .setConfig( 36 | new JsonObject() 37 | .put("host", "localhost") 38 | .put("serverOptions", "org.jacpfx.verticle.MyCustomServerOptions")); 39 | Vertx.vertx().deployVerticle(Testverticl2.class.getName(), options); 40 | } 41 | 42 | @Override 43 | public void start(io.vertx.core.Future startFuture) throws Exception { 44 | VxmsEndpoint.start(startFuture, this); 45 | } 46 | 47 | @Path("/hello") 48 | @GET 49 | public void hello(RestHandler handler) { 50 | handler.response().stringResponse((future) -> future.complete("hi")).execute(); 51 | } 52 | 53 | @Path("/hello2") 54 | @GET 55 | public void hello2(RestHandler handler) { 56 | handler.response().stringResponse((future) -> future.complete("hi")).execute(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /vxms-testing/src/test/java/org/jacpfx/verticle/TestverticlWithRestBuilder.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.verticle; 18 | 19 | import io.vertx.core.AbstractVerticle; 20 | import io.vertx.core.DeploymentOptions; 21 | import io.vertx.core.Vertx; 22 | import io.vertx.core.json.JsonObject; 23 | import javax.ws.rs.GET; 24 | import javax.ws.rs.Path; 25 | import org.jacpfx.vxms.rest.base.response.RestHandler; 26 | import org.jacpfx.vxms.services.VxmsEndpoint; 27 | 28 | /** Created by amo on 23.11.16. */ 29 | public class TestverticlWithRestBuilder extends AbstractVerticle { 30 | 31 | public static void main(String[] args) { 32 | DeploymentOptions options = 33 | new DeploymentOptions() 34 | .setInstances(1) 35 | .setConfig( 36 | new JsonObject() 37 | .put("host", "localhost") 38 | .put("serverOptions", "org.jacpfx.verticle.MyCustomServerOptions")); 39 | Vertx.vertx().deployVerticle(TestverticlWithRestBuilder.class.getName(), options); 40 | } 41 | 42 | @Override 43 | public void start(io.vertx.core.Future startFuture) throws Exception { 44 | VxmsEndpoint.start(startFuture, this); 45 | } 46 | 47 | @Path("/hello") 48 | @GET 49 | public void hello(RestHandler handler) { 50 | handler.response().stringResponse((future) -> future.complete("hi")).execute(); 51 | } 52 | 53 | @Path("/hello2") 54 | @GET 55 | public void hello2(RestHandler handler) { 56 | handler.response().stringResponse((future) -> future.complete("hi")).execute(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /vxms-testing/src/test/java/org/jacpfx/verticle/Testverticle.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.AbstractVerticle; 20 | import io.vertx.core.DeploymentOptions; 21 | import io.vertx.core.Future; 22 | import io.vertx.core.Vertx; 23 | import io.vertx.core.http.HttpServer; 24 | import io.vertx.core.http.HttpServerOptions; 25 | import io.vertx.core.json.JsonObject; 26 | import io.vertx.ext.web.Router; 27 | 28 | /** Created by amo on 23.11.16. */ 29 | public class Testverticle extends AbstractVerticle { 30 | 31 | public static void main(String[] args) { 32 | DeploymentOptions options = 33 | new DeploymentOptions() 34 | .setInstances(2) 35 | .setConfig(new JsonObject().put("host", "localhost")); 36 | Vertx.vertx().deployVerticle(Testverticle.class.getName(), options); 37 | } 38 | 39 | @Override 40 | public void start(Future startFuture) throws Exception { 41 | final HttpServer localhost = 42 | vertx.createHttpServer(new HttpServerOptions().setHost("localhost").setPort(8080)); 43 | final Router router = Router.router(vertx); 44 | router 45 | .get("/test") 46 | .handler( 47 | handler -> { 48 | handler.response().end("hello"); 49 | }); 50 | localhost.requestHandler(router::accept).listen(); 51 | startFuture.complete(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /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/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-testing/src/test/resources/client.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEArIdqGSl3yA+mriBgUMYz15ZJ/zzaq86eX0MJtAlK+UvPgzep 3 | tloh4yFIQCKUcJKZ0aBEvFFFzdu9HBeINcUtaUKe7qrE/xwOvwxdS9jL+0Lkc0/c 4 | /34nxYZFdgpB+iUvsTKLsYrzD3NKq6JLS9lXyIhd93MYkkpCBG+0bVCYFILFbKbx 5 | 0raXPgyJoGwWckUPyv1deZqI924NC+GhZzagpNDHlduP5GOOXpRg43DbQnQCzAki 6 | jmOcpidQahiVFgHGxUWXSZgnntjUyc3lltmKCLtH/2YM4tPl+f4SxoG/ttmNPQCs 7 | 6DVrnQvqeW2HPB2ddNri/wa9hjl2UeLrSfBXaQIDAQABAoIBADpXqIdNwJXExSbJ 8 | CAkInWtgBTHs0D2dJ20rbFKXeeUHv+qtnhRuMltuW9JkXzIaQS3kNppAGYzdq/ud 9 | 8Y/NV+fqgXhQA0IJqOruMXZ+n6weGMbt0NwNO0HOgBrEqT7/6DrRzu+A/2TQJgYY 10 | YcIKg2bqxmvxXfPKbLy3UZpN0L/OUraxZ9wTspcoquXh67vfBtM8E6c3v+uGv3PI 11 | LLhDHnQZo+IOpmopCE4orDkaFBcIx79Vrl02pcDS1/IIMRrKznJVi4YJvzgMG8gu 12 | wEDO1azw/AHXmmJiO3QFn22ngpjuBNcRf/4lwaIbP3rnaQyqAwONQn1E1PXvCf3o 13 | fZIDIskCgYEA3t9LOoz77nR//QOCyreqzy+07b8PPdnslD3IE/AMncKGXKxAJJeH 14 | sTxc3b8cB7UjstR89Cru5zaXM8GxR298NXldr9vRydX+fXtVqramBR7LEmEi2537 15 | gvpZH96wAVF3zHuDKEpqk1DlQfTJ/M1+EGUki9auneEwbm33CyCID+MCgYEAxix2 16 | 7KU3owBzCxfmb36A/kC7wSCYYSPxk9oj/TsZZGi5Q55VKJ3i1d2dKMpMCJsYjocL 17 | YzynqXOfQiSrvkOqrdx7anLR1XVeKp9qP3SH0KWR8JnmjGLBikUlzGbfcM/4XIwY 18 | o8kulNblJOCxQ6UWQYVY+3r3jVO2zztWCcOERUMCgYBkJp9dnkEPtJZXEh7SDZra 19 | I6wAMh0dRDKFowWnv/VLZ0CNoHHqf5VgVam9k8V6yTFTiRzlc+2LRQLJJT8OxNBi 20 | DznEbtllA56qsKOcZRtRrba/eZr6aZG+F9W49o7M6NkWsGIN1vLxZCbBbsjdq1H8 21 | +BZmKICrPahP12ZuP54k1QKBgEyMcmeYrjQNgWLAmadpoyQTFzNThujG/JLTCWHQ 22 | yU8q0J1Y9KYazrszvng6JEKSvlqXuYNcs5rV6aegCKMW+j/sUdPdhEZC7tvh9iWK 23 | useSnRvmJtMFdqMVcLNS7W5jNxlwmDf0B0VA+QRUssRhaYZnnuaNKkByHMRRtDtT 24 | Ra2HAoGBAKflWXV5uI3lR9rRYlgtljnCtcdDIXb4y1IerMhWvotaKjLnA33xVsW/ 25 | a9B7JzTXDIWiBWbCWvrj3OW5wzjIGDwzSmTRm610tokZpxwxovFsDCtkVt+ByKI9 26 | HLdqxYAnw8V/HjZw6ujxz64U3pdlLFwEsagb1BcR+T0a7JiReGvf 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /vxms-testing/src/test/resources/payload.xml: -------------------------------------------------------------------------------- 1 | dfgdfg -------------------------------------------------------------------------------- /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-testing/src/test/resources/webroot/index.html: -------------------------------------------------------------------------------- 1 |

fgdfgdf

-------------------------------------------------------------------------------- /vxms-testing/src/test/resources/webroot/payload.xml: -------------------------------------------------------------------------------- 1 | dfgdfg --------------------------------------------------------------------------------