From a9bf9aa1aaf864f34d93eaf192346100a18d6cba Mon Sep 17 00:00:00 2001 From: enoreyes Date: Thu, 20 Jun 2024 16:56:50 -0700 Subject: [PATCH 1/4] Remove extraneous libraries" --- .../.cheatsheet.xml => .cheatsheet.xml | 0 .gitattributes | 2 - .github/workflows/reduce_readme.yml | 47 - .gitignore | 33 - LICENSE.txt | 219 --- README-source.adoc | 265 +--- README.adoc | 734 ++++++++-- README.html | 520 +++++-- {kitchensink/charts => charts}/helm.yaml | 0 cmt/README-source.adoc | 86 -- cmt/README.adoc | 899 ------------ cmt/README.html | 963 ------------- cmt/charts/helm.yaml | 6 - cmt/pom.xml | 280 ---- cmt/scripts/embedded-broker.cli | 14 - .../cmt/controller/CustomerManager.java | 71 - .../cmt/controller/LogMessageManager.java | 45 - .../cmt/ejb/CustomerManagerEJB.java | 91 -- .../cmt/ejb/InvoiceManagerEJB.java | 43 - .../cmt/ejb/LogMessageManagerEJB.java | 72 - .../as/quickstarts/cmt/mdb/HelloWorldMDB.java | 60 - .../as/quickstarts/cmt/model/Customer.java | 56 - .../as/quickstarts/cmt/model/LogMessage.java | 54 - .../main/resources/META-INF/persistence.xml | 30 - cmt/src/main/resources/import.sql | 19 - cmt/src/main/webapp/WEB-INF/activemq-jms.xml | 26 - cmt/src/main/webapp/WEB-INF/faces-config.xml | 48 - cmt/src/main/webapp/addCustomer.xhtml | 41 - cmt/src/main/webapp/customers.xhtml | 44 - cmt/src/main/webapp/duplicate.xhtml | 30 - cmt/src/main/webapp/index.html | 23 - cmt/src/main/webapp/invalidName.xhtml | 30 - cmt/src/main/webapp/logMessages.xhtml | 44 - cmt/src/main/webapp/template.xhtml | 47 - .../cmt/ProvisionedManagedCustomerIT.java | 51 - .../as/quickstarts/cmt/RemoteCustomerIT.java | 111 -- .../cmt/ejb/CustomerManagerEJBTest.java | 33 - ee-security/README-source.adoc | 131 -- ee-security/README.adoc | 1104 --------------- ee-security/README.html | 1072 --------------- ee-security/charts/helm.yaml | 6 - ee-security/configure-elytron.cli | 7 - ee-security/pom.xml | 255 ---- ee-security/restore-configuration.cli | 10 - .../ee_security/ElytronIdentityStore.java | 96 -- .../ee_security/SecuredServlet.java | 53 - .../ee_security/SecurityFactory.java | 40 - .../TestAuthenticationMechanism.java | 75 - ee-security/src/main/webapp/WEB-INF/beans.xml | 24 - .../ProvisionedManagedSecureIT.java | 49 - .../ee_security/RemoteSecureIT.java | 78 -- helloworld-ws/README-source.adoc | 79 -- helloworld-ws/README.adoc | 863 ------------ helloworld-ws/README.html | 907 ------------ helloworld-ws/charts/helm.yaml | 6 - helloworld-ws/pom.xml | 291 ---- .../wshelloworld/HelloWorldService.java | 57 - .../wshelloworld/HelloWorldServiceImpl.java | 89 -- .../src/main/webapp/WEB-INF/beans.xml | 24 - helloworld-ws/src/main/webapp/index.html | 39 - .../as/quickstarts/wshelloworld/Client.java | 79 -- .../quickstarts/wshelloworld/ClientArqIT.java | 111 -- .../as/quickstarts/wshelloworld/ClientIT.java | 124 -- .../wshelloworld/RemoteClientIT.java | 35 - helloworld/.cheatsheet.xml | 103 -- helloworld/README-source.adoc | 44 - helloworld/README.adoc | 828 ----------- helloworld/README.html | 871 ------------ helloworld/charts/helm.yaml | 6 - helloworld/pom.xml | 235 ---- .../helloworld/HelloWorldServlet.java | 55 - helloworld/src/main/webapp/index.html | 23 - .../helloworld/HelloWorldServletIT.java | 84 -- .../managed/ManagedHelloWorldServletIT.java | 46 - helloworld/src/test/resources/arquillian.xml | 23 - jaxrs-client/README-source.adoc | 112 -- jaxrs-client/README.adoc | 896 ------------ jaxrs-client/README.html | 939 ------------- jaxrs-client/charts/helm.yaml | 6 - jaxrs-client/pom.xml | 289 ---- .../jaxrsclient/model/Contact.java | 61 - .../rest/ContactResourceRESTService.java | 97 -- .../jaxrsclient/rest/JaxRsActivator.java | 33 - .../src/main/webapp/WEB-INF/beans.xml | 24 - .../test/AbstractContactsRestClient.java | 207 --- .../jaxrsclient/test/ContactsRestClient.java | 51 - .../jaxrsclient/test/LogResponseFilter.java | 36 - .../test/ManagedContactsRestClientIT.java | 95 -- ...ProvisionedManagedContactRestClientIT.java | 96 -- .../test/RemoteContactsRestClientIT.java | 84 -- .../test/SavedByClientRequestFilter.java | 43 - .../src/test/resources/arquillian.xml | 23 - kitchensink/README-source.adoc | 60 - kitchensink/README.adoc | 873 ------------ kitchensink/README.html | 902 ------------ kitchensink/pom.xml | 338 ----- kitchensink/src/main/webapp/WEB-INF/beans.xml | 24 - kitchensink/src/test/resources/arquillian.xml | 36 - numberguess/README-source.adoc | 45 - numberguess/README.adoc | 829 ----------- numberguess/README.html | 871 ------------ numberguess/charts/helm.yaml | 6 - numberguess/pom.xml | 253 ---- .../as/quickstarts/numberguess/Game.java | 169 --- .../as/quickstarts/numberguess/Generator.java | 67 - .../as/quickstarts/numberguess/MaxNumber.java | 43 - .../as/quickstarts/numberguess/Random.java | 43 - numberguess/src/main/webapp/WEB-INF/beans.xml | 24 - .../src/main/webapp/WEB-INF/faces-config.xml | 26 - numberguess/src/main/webapp/home.xhtml | 74 - numberguess/src/main/webapp/index.html | 23 - .../ProvisionedManagedNumberGuessIT.java | 51 - .../numberguess/RemoteNumberGuessIT.java | 100 -- pom.xml | 498 +++---- remote-helloworld-mdb/README-source.adoc | 190 --- remote-helloworld-mdb/README.adoc | 1038 -------------- remote-helloworld-mdb/README.html | 1034 -------------- remote-helloworld-mdb/charts/helm.yaml | 12 - .../configure-remote-broker.cli | 13 - remote-helloworld-mdb/pom.xml | 263 ---- .../remove-remote-broker.cli | 42 - .../quickstarts/mdb/HelloWorldQueueMDB.java | 58 - .../quickstarts/mdb/HelloWorldTopicMDB.java | 58 - .../servlet/HelloWorldMDBServletClient.java | 100 -- .../src/main/webapp/WEB-INF/beans.xml | 25 - .../src/main/webapp/index.html | 23 - .../quickstarts/mdb/AbstractMDBServletIT.java | 97 -- .../mdb/ProvisionedManagedMDBServletIT.java | 53 - .../quickstarts/mdb/RemoteMDBServletIT.java | 49 - .../src/test/resources/arquillian.xml | 36 - servlet-security/README-source.adoc | 221 --- servlet-security/README.adoc | 1224 ----------------- servlet-security/README.html | 1211 ---------------- servlet-security/charts/helm.yaml | 6 - servlet-security/configure-server.cli | 23 - servlet-security/pom.xml | 259 ---- servlet-security/restore-configuration.cli | 27 - .../servlet_security/DummyEntity.java | 33 - .../servlet_security/SecuredServlet.java | 66 - .../main/resources/META-INF/persistence.xml | 35 - .../src/main/resources/import.sql | 29 - .../src/main/webapp/WEB-INF/beans.xml | 24 - .../src/main/webapp/WEB-INF/jboss-web.xml | 26 - .../src/main/webapp/WEB-INF/web.xml | 27 - servlet-security/src/main/webapp/index.html | 23 - .../ProvisionedManagedSecureIT.java | 49 - .../servlet_security/RemoteSecureIT.java | 95 -- .../add-application-and-management-users.adoc | 49 - shared-doc/add-application-user.adoc | 37 - shared-doc/attributes.adoc | 194 --- shared-doc/available-quickstarts.adoc | 104 -- .../back-up-managed-domain-configuration.adoc | 20 - ...ck-up-server-standalone-configuration.adoc | 16 - .../build-and-deploy-the-quickstart.adoc | 104 -- ...-run-the-quickstart-with-bootable-jar.adoc | 317 ----- ...and-run-the-quickstart-with-openshift.adoc | 10 - ...he-quickstart-with-provisioned-server.adoc | 70 - .../build-the-quickstart-for-openshift.adoc | 109 -- shared-doc/cd-create-project.adoc | 34 - shared-doc/cd-deploy-project.adoc | 43 - .../cd-import-imagestreams-templates.adoc | 49 - ...cd-openshift-getting-started-overview.adoc | 8 - shared-doc/cd-post-deployment-tasks.adoc | 37 - shared-doc/debug-the-application.adoc | 23 - .../define-standalone-server-attributes.adoc | 62 - shared-doc/deploy-to-openshift-online.adoc | 68 - shared-doc/development-shortcuts.adoc | 26 - shared-doc/helm-deploy-project.adoc | 67 - shared-doc/helm-getting-started-overview.adoc | 6 - shared-doc/helm-pre-requisites.adoc | 39 - shared-doc/openshift-create-project.adoc | 46 - shared-doc/openshift-deploy-project.adoc | 97 -- .../openshift-getting-started-overview.adoc | 8 - shared-doc/openshift-getting-started.adoc | 8 - ...enshift-import-imagestreams-templates.adoc | 71 - shared-doc/openshift-incompatibility.adoc | 4 - .../openshift-post-deployment-tasks.adoc | 61 - ...e-managed-domain-configuration-manual.adoc | 17 - ...tandalone-server-configuration-manual.adoc | 13 - ...store-standalone-server-configuration.adoc | 30 - ...un-arquillian-functional-tests-remote.adoc | 37 - .../run-arquillian-functional-tests.adoc | 42 - ...lian-integration-tests-with-openshift.adoc | 24 - ...gration-tests-with-provisioned-server.adoc | 17 - ...ration-tests-with-server-distribution.adoc | 26 - shared-doc/run-arquillian-tests.adoc | 48 - ...-quickstart-in-jboss-developer-studio.adoc | 17 - shared-doc/setup-repositories.adoc | 59 - shared-doc/start-the-managed-domain.adoc | 23 - shared-doc/start-the-standalone-server.adoc | 50 - shared-doc/system-requirements.adoc | 13 - shared-doc/undeploy-the-quickstart.adoc | 16 - shared-doc/use-of-jboss-home-name.adoc | 30 - shared-doc/xp-create-project.adoc | 46 - shared-doc/xp-deploy-project.adoc | 283 ---- .../xp-import-imagestreams-templates.adoc | 65 - shared-doc/xp-install-amq-streams.adoc | 58 - shared-doc/xp-install-jaeger.adoc | 24 - shared-doc/xp-openshift-getting-started.adoc | 6 - shared-doc/xp-post-deployment-tasks.adoc | 81 -- .../controller/MemberController.java | 0 .../kitchensink/data/MemberListProducer.java | 0 .../kitchensink/data/MemberRepository.java | 0 .../quickstarts/kitchensink/model/Member.java | 0 .../kitchensink/rest/JaxRsActivator.java | 0 .../rest/MemberResourceRESTService.java | 0 .../service/MemberRegistration.java | 0 .../kitchensink/util/Resources.java | 0 .../main/resources/META-INF/persistence.xml | 0 .../src => src}/main/resources/import.sql | 0 .../src => src}/main/webapp/WEB-INF/beans.xml | 0 .../main/webapp/WEB-INF/faces-config.xml | 0 .../WEB-INF/kitchensink-quickstart-ds.xml | 0 .../webapp/WEB-INF/templates/default.xhtml | 0 .../src => src}/main/webapp/index.html | 0 .../src => src}/main/webapp/index.xhtml | 0 .../main/webapp/resources/css/screen.css | 0 .../main/webapp/resources/gfx/asidebkg.png | Bin .../main/webapp/resources/gfx/banner.png | Bin .../webapp/resources/gfx/bkg-blkheader.png | Bin .../main/webapp/resources/gfx/headerbkg.png | Bin .../webapp/resources/gfx/rhjb_eap_logo.png | Bin .../webapp/resources/gfx/wildfly_400x130.jpg | Bin .../test/MemberRegistrationIT.java | 0 .../test/RemoteMemberRegistrationIT.java | 0 .../resources/META-INF/test-persistence.xml | 0 .../src => src}/test/resources/arquillian.xml | 0 .../src => src}/test/resources/test-ds.xml | 0 temperature-converter/README-source.adoc | 59 - temperature-converter/README.adoc | 843 ------------ temperature-converter/README.html | 909 ------------ temperature-converter/charts/helm.yaml | 6 - temperature-converter/pom.xml | 260 ---- .../controller/ScaleConverter.java | 53 - .../controller/TemperatureConverter.java | 94 -- .../temperatureconverter/ejb/Scale.java | 57 - .../temperatureconverter/ejb/Temperature.java | 97 -- .../ejb/TemperatureConvertEJB.java | 64 - .../src/main/webapp/WEB-INF/beans.xml | 24 - .../src/main/webapp/WEB-INF/faces-config.xml | 26 - .../src/main/webapp/index.html | 23 - .../src/main/webapp/temperatureconvert.xhtml | 65 - ...visionedManagedTemperatureConverterIT.java | 51 - .../RemoteTemperatureConverterIT.java | 112 -- thread-racing/README-source.adoc | 72 - thread-racing/README.adoc | 885 ------------ thread-racing/README.html | 919 ------------- thread-racing/charts/helm.yaml | 6 - thread-racing/pom.xml | 326 ----- thread-racing/scripts/embedded-broker.cli | 14 - .../threadracing/EnvironmentProperties.java | 40 - .../as/quickstarts/threadracing/Race.java | 272 ---- .../threadracing/RaceBroadcaster.java | 69 - .../as/quickstarts/threadracing/Racer.java | 157 --- .../threadracing/WebSocketRace.java | 127 -- .../WebSocketRaceBroadcaster.java | 139 -- .../threadracing/legends/JimmieThronson.java | 31 - .../legends/MichaelThrumacher.java | 31 - .../threadracing/legends/SebastienThroeb.java | 31 - .../legends/ValentinoThrossi.java | 31 - .../results/ChampionshipStandings.java | 170 --- .../threadracing/results/RaceResult.java | 212 --- .../threadracing/results/RaceResults.java | 54 - .../threadracing/stage/RaceStage.java | 35 - .../stage/batch/BatchRaceStage.java | 52 - .../batch/BatchRaceStageItemProcessor.java | 34 - .../stage/batch/BatchRaceStageItemReader.java | 68 - .../stage/batch/BatchRaceStageItemWriter.java | 39 - .../concurrency/EEConcurrencyRaceStage.java | 67 - .../stage/jaxrs/BoxApplication.java | 34 - .../threadracing/stage/jaxrs/BoxService.java | 56 - .../stage/jaxrs/JAXRSRaceStage.java | 69 - .../threadracing/stage/jms/JMSRaceStage.java | 67 - .../jms/JMSRaceStageMessageListener.java | 62 - .../stage/json/JSONRaceStage.java | 75 - .../resources/META-INF/batch-jobs/race.xml | 28 - .../resources/META-INF/batch-jobs/race.xsd | 61 - .../main/resources/META-INF/persistence.xml | 30 - .../src/main/webapp/WEB-INF/beans.xml | 24 - thread-racing/src/main/webapp/index.html | 54 - .../threadracing/EchoListener.java | 96 -- .../ProvisionedManagedThreadRacingIT.java | 49 - .../threadracing/RemoteThreadRacingIT.java | 93 -- .../src/test/resources/arquillian.xml | 23 - todo-backend/README-source.adoc | 696 ---------- todo-backend/README.adoc | 1118 --------------- todo-backend/README.html | 1010 -------------- todo-backend/charts/helm.yaml | 34 - todo-backend/pom.xml | 266 ---- .../wildfly/quickstarts/todos/Resources.java | 42 - .../org/wildfly/quickstarts/todos/ToDo.java | 143 -- .../todos/ToDoBackendApplication.java | 29 - .../quickstarts/todos/ToDoController.java | 104 -- .../wildfly/quickstarts/todos/ToDoDAO.java | 41 - .../quickstarts/todos/ToDoDAOImpl.java | 70 - .../main/resources/META-INF/persistence.xml | 31 - .../src/main/scripts/cors_filters.cli | 16 - .../src/main/webapp/WEB-INF/beans.xml | 24 - .../quickstarts/todos/AbstractToDoIT.java | 68 - .../todos/ProvisionedManagedToDoIT.java | 67 - .../quickstarts/todos/RemoteToDoIT.java | 62 - .../src/test/resources/arquillian.xml | 36 - websocket-hello/README-source.adoc | 63 - websocket-hello/README.adoc | 847 ------------ websocket-hello/README.html | 920 ------------- websocket-hello/charts/helm.yaml | 6 - websocket-hello/pom.xml | 236 ---- .../websocket_hello/HelloName.java | 44 - websocket-hello/src/main/webapp/index.html | 109 -- .../src/main/webapp/resources/css/hello.css | 42 - .../websocket_hello/EchoListener.java | 80 -- .../ProvisionedManagedWebsocketIT.java | 55 - .../websocket_hello/RemoteWebSocketIT.java | 84 -- .../src/test/resources/arquillian.xml | 23 - 314 files changed, 1219 insertions(+), 43479 deletions(-) rename kitchensink/.cheatsheet.xml => .cheatsheet.xml (100%) delete mode 100644 .gitattributes delete mode 100644 .github/workflows/reduce_readme.yml delete mode 100644 .gitignore delete mode 100644 LICENSE.txt rename {kitchensink/charts => charts}/helm.yaml (100%) delete mode 100644 cmt/README-source.adoc delete mode 100644 cmt/README.adoc delete mode 100644 cmt/README.html delete mode 100644 cmt/charts/helm.yaml delete mode 100644 cmt/pom.xml delete mode 100644 cmt/scripts/embedded-broker.cli delete mode 100644 cmt/src/main/java/org/jboss/as/quickstarts/cmt/controller/CustomerManager.java delete mode 100644 cmt/src/main/java/org/jboss/as/quickstarts/cmt/controller/LogMessageManager.java delete mode 100644 cmt/src/main/java/org/jboss/as/quickstarts/cmt/ejb/CustomerManagerEJB.java delete mode 100644 cmt/src/main/java/org/jboss/as/quickstarts/cmt/ejb/InvoiceManagerEJB.java delete mode 100644 cmt/src/main/java/org/jboss/as/quickstarts/cmt/ejb/LogMessageManagerEJB.java delete mode 100644 cmt/src/main/java/org/jboss/as/quickstarts/cmt/mdb/HelloWorldMDB.java delete mode 100644 cmt/src/main/java/org/jboss/as/quickstarts/cmt/model/Customer.java delete mode 100644 cmt/src/main/java/org/jboss/as/quickstarts/cmt/model/LogMessage.java delete mode 100644 cmt/src/main/resources/META-INF/persistence.xml delete mode 100644 cmt/src/main/resources/import.sql delete mode 100644 cmt/src/main/webapp/WEB-INF/activemq-jms.xml delete mode 100644 cmt/src/main/webapp/WEB-INF/faces-config.xml delete mode 100644 cmt/src/main/webapp/addCustomer.xhtml delete mode 100644 cmt/src/main/webapp/customers.xhtml delete mode 100644 cmt/src/main/webapp/duplicate.xhtml delete mode 100644 cmt/src/main/webapp/index.html delete mode 100644 cmt/src/main/webapp/invalidName.xhtml delete mode 100644 cmt/src/main/webapp/logMessages.xhtml delete mode 100644 cmt/src/main/webapp/template.xhtml delete mode 100644 cmt/src/test/java/org/jboss/as/quickstarts/cmt/ProvisionedManagedCustomerIT.java delete mode 100644 cmt/src/test/java/org/jboss/as/quickstarts/cmt/RemoteCustomerIT.java delete mode 100644 cmt/src/test/java/org/jboss/as/quickstarts/cmt/ejb/CustomerManagerEJBTest.java delete mode 100644 ee-security/README-source.adoc delete mode 100644 ee-security/README.adoc delete mode 100644 ee-security/README.html delete mode 100644 ee-security/charts/helm.yaml delete mode 100644 ee-security/configure-elytron.cli delete mode 100644 ee-security/pom.xml delete mode 100644 ee-security/restore-configuration.cli delete mode 100644 ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/ElytronIdentityStore.java delete mode 100644 ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/SecuredServlet.java delete mode 100644 ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/SecurityFactory.java delete mode 100644 ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/TestAuthenticationMechanism.java delete mode 100644 ee-security/src/main/webapp/WEB-INF/beans.xml delete mode 100644 ee-security/src/test/java/org/jboss/as/quickstarts/ee_security/ProvisionedManagedSecureIT.java delete mode 100644 ee-security/src/test/java/org/jboss/as/quickstarts/ee_security/RemoteSecureIT.java delete mode 100644 helloworld-ws/README-source.adoc delete mode 100644 helloworld-ws/README.adoc delete mode 100644 helloworld-ws/README.html delete mode 100644 helloworld-ws/charts/helm.yaml delete mode 100644 helloworld-ws/pom.xml delete mode 100644 helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldService.java delete mode 100644 helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldServiceImpl.java delete mode 100644 helloworld-ws/src/main/webapp/WEB-INF/beans.xml delete mode 100644 helloworld-ws/src/main/webapp/index.html delete mode 100644 helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/Client.java delete mode 100644 helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientArqIT.java delete mode 100644 helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientIT.java delete mode 100644 helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/RemoteClientIT.java delete mode 100644 helloworld/.cheatsheet.xml delete mode 100644 helloworld/README-source.adoc delete mode 100644 helloworld/README.adoc delete mode 100644 helloworld/README.html delete mode 100644 helloworld/charts/helm.yaml delete mode 100644 helloworld/pom.xml delete mode 100644 helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java delete mode 100644 helloworld/src/main/webapp/index.html delete mode 100644 helloworld/src/test/java/org/jboss/as/quickstarts/helloworld/HelloWorldServletIT.java delete mode 100644 helloworld/src/test/java/org/jboss/as/quickstarts/helloworld/managed/ManagedHelloWorldServletIT.java delete mode 100644 helloworld/src/test/resources/arquillian.xml delete mode 100644 jaxrs-client/README-source.adoc delete mode 100644 jaxrs-client/README.adoc delete mode 100644 jaxrs-client/README.html delete mode 100644 jaxrs-client/charts/helm.yaml delete mode 100644 jaxrs-client/pom.xml delete mode 100644 jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/model/Contact.java delete mode 100644 jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/rest/ContactResourceRESTService.java delete mode 100644 jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/rest/JaxRsActivator.java delete mode 100644 jaxrs-client/src/main/webapp/WEB-INF/beans.xml delete mode 100644 jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/AbstractContactsRestClient.java delete mode 100644 jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/ContactsRestClient.java delete mode 100644 jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/LogResponseFilter.java delete mode 100644 jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/ManagedContactsRestClientIT.java delete mode 100644 jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/ProvisionedManagedContactRestClientIT.java delete mode 100644 jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/RemoteContactsRestClientIT.java delete mode 100644 jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/SavedByClientRequestFilter.java delete mode 100644 jaxrs-client/src/test/resources/arquillian.xml delete mode 100644 kitchensink/README-source.adoc delete mode 100644 kitchensink/README.adoc delete mode 100644 kitchensink/README.html delete mode 100644 kitchensink/pom.xml delete mode 100644 kitchensink/src/main/webapp/WEB-INF/beans.xml delete mode 100644 kitchensink/src/test/resources/arquillian.xml delete mode 100644 numberguess/README-source.adoc delete mode 100644 numberguess/README.adoc delete mode 100644 numberguess/README.html delete mode 100644 numberguess/charts/helm.yaml delete mode 100644 numberguess/pom.xml delete mode 100644 numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Game.java delete mode 100644 numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Generator.java delete mode 100644 numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/MaxNumber.java delete mode 100644 numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Random.java delete mode 100644 numberguess/src/main/webapp/WEB-INF/beans.xml delete mode 100644 numberguess/src/main/webapp/WEB-INF/faces-config.xml delete mode 100644 numberguess/src/main/webapp/home.xhtml delete mode 100644 numberguess/src/main/webapp/index.html delete mode 100644 numberguess/src/test/java/org/jboss/as/quickstarts/numberguess/ProvisionedManagedNumberGuessIT.java delete mode 100644 numberguess/src/test/java/org/jboss/as/quickstarts/numberguess/RemoteNumberGuessIT.java delete mode 100644 remote-helloworld-mdb/README-source.adoc delete mode 100644 remote-helloworld-mdb/README.adoc delete mode 100644 remote-helloworld-mdb/README.html delete mode 100644 remote-helloworld-mdb/charts/helm.yaml delete mode 100644 remote-helloworld-mdb/configure-remote-broker.cli delete mode 100644 remote-helloworld-mdb/pom.xml delete mode 100644 remote-helloworld-mdb/remove-remote-broker.cli delete mode 100644 remote-helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldQueueMDB.java delete mode 100644 remote-helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldTopicMDB.java delete mode 100644 remote-helloworld-mdb/src/main/java/org/jboss/as/quickstarts/servlet/HelloWorldMDBServletClient.java delete mode 100644 remote-helloworld-mdb/src/main/webapp/WEB-INF/beans.xml delete mode 100644 remote-helloworld-mdb/src/main/webapp/index.html delete mode 100644 remote-helloworld-mdb/src/test/java/org/jboss/as/quickstarts/mdb/AbstractMDBServletIT.java delete mode 100644 remote-helloworld-mdb/src/test/java/org/jboss/as/quickstarts/mdb/ProvisionedManagedMDBServletIT.java delete mode 100644 remote-helloworld-mdb/src/test/java/org/jboss/as/quickstarts/mdb/RemoteMDBServletIT.java delete mode 100644 remote-helloworld-mdb/src/test/resources/arquillian.xml delete mode 100644 servlet-security/README-source.adoc delete mode 100644 servlet-security/README.adoc delete mode 100644 servlet-security/README.html delete mode 100644 servlet-security/charts/helm.yaml delete mode 100644 servlet-security/configure-server.cli delete mode 100644 servlet-security/pom.xml delete mode 100644 servlet-security/restore-configuration.cli delete mode 100644 servlet-security/src/main/java/org/jboss/as/quickstarts/servlet_security/DummyEntity.java delete mode 100644 servlet-security/src/main/java/org/jboss/as/quickstarts/servlet_security/SecuredServlet.java delete mode 100644 servlet-security/src/main/resources/META-INF/persistence.xml delete mode 100644 servlet-security/src/main/resources/import.sql delete mode 100644 servlet-security/src/main/webapp/WEB-INF/beans.xml delete mode 100644 servlet-security/src/main/webapp/WEB-INF/jboss-web.xml delete mode 100644 servlet-security/src/main/webapp/WEB-INF/web.xml delete mode 100644 servlet-security/src/main/webapp/index.html delete mode 100644 servlet-security/src/test/java/org/jboss/as/quickstarts/servlet_security/ProvisionedManagedSecureIT.java delete mode 100644 servlet-security/src/test/java/org/jboss/as/quickstarts/servlet_security/RemoteSecureIT.java delete mode 100644 shared-doc/add-application-and-management-users.adoc delete mode 100644 shared-doc/add-application-user.adoc delete mode 100644 shared-doc/attributes.adoc delete mode 100644 shared-doc/available-quickstarts.adoc delete mode 100644 shared-doc/back-up-managed-domain-configuration.adoc delete mode 100644 shared-doc/back-up-server-standalone-configuration.adoc delete mode 100644 shared-doc/build-and-deploy-the-quickstart.adoc delete mode 100644 shared-doc/build-and-run-the-quickstart-with-bootable-jar.adoc delete mode 100644 shared-doc/build-and-run-the-quickstart-with-openshift.adoc delete mode 100644 shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc delete mode 100644 shared-doc/build-the-quickstart-for-openshift.adoc delete mode 100644 shared-doc/cd-create-project.adoc delete mode 100644 shared-doc/cd-deploy-project.adoc delete mode 100644 shared-doc/cd-import-imagestreams-templates.adoc delete mode 100644 shared-doc/cd-openshift-getting-started-overview.adoc delete mode 100644 shared-doc/cd-post-deployment-tasks.adoc delete mode 100644 shared-doc/debug-the-application.adoc delete mode 100644 shared-doc/define-standalone-server-attributes.adoc delete mode 100644 shared-doc/deploy-to-openshift-online.adoc delete mode 100644 shared-doc/development-shortcuts.adoc delete mode 100644 shared-doc/helm-deploy-project.adoc delete mode 100644 shared-doc/helm-getting-started-overview.adoc delete mode 100644 shared-doc/helm-pre-requisites.adoc delete mode 100644 shared-doc/openshift-create-project.adoc delete mode 100644 shared-doc/openshift-deploy-project.adoc delete mode 100644 shared-doc/openshift-getting-started-overview.adoc delete mode 100644 shared-doc/openshift-getting-started.adoc delete mode 100644 shared-doc/openshift-import-imagestreams-templates.adoc delete mode 100644 shared-doc/openshift-incompatibility.adoc delete mode 100644 shared-doc/openshift-post-deployment-tasks.adoc delete mode 100644 shared-doc/restore-managed-domain-configuration-manual.adoc delete mode 100644 shared-doc/restore-standalone-server-configuration-manual.adoc delete mode 100644 shared-doc/restore-standalone-server-configuration.adoc delete mode 100644 shared-doc/run-arquillian-functional-tests-remote.adoc delete mode 100644 shared-doc/run-arquillian-functional-tests.adoc delete mode 100644 shared-doc/run-arquillian-integration-tests-with-openshift.adoc delete mode 100644 shared-doc/run-arquillian-integration-tests-with-provisioned-server.adoc delete mode 100644 shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc delete mode 100644 shared-doc/run-arquillian-tests.adoc delete mode 100644 shared-doc/run-the-quickstart-in-jboss-developer-studio.adoc delete mode 100644 shared-doc/setup-repositories.adoc delete mode 100644 shared-doc/start-the-managed-domain.adoc delete mode 100644 shared-doc/start-the-standalone-server.adoc delete mode 100644 shared-doc/system-requirements.adoc delete mode 100644 shared-doc/undeploy-the-quickstart.adoc delete mode 100644 shared-doc/use-of-jboss-home-name.adoc delete mode 100644 shared-doc/xp-create-project.adoc delete mode 100644 shared-doc/xp-deploy-project.adoc delete mode 100644 shared-doc/xp-import-imagestreams-templates.adoc delete mode 100644 shared-doc/xp-install-amq-streams.adoc delete mode 100644 shared-doc/xp-install-jaeger.adoc delete mode 100644 shared-doc/xp-openshift-getting-started.adoc delete mode 100644 shared-doc/xp-post-deployment-tasks.adoc rename {kitchensink/src => src}/main/java/org/jboss/as/quickstarts/kitchensink/controller/MemberController.java (100%) rename {kitchensink/src => src}/main/java/org/jboss/as/quickstarts/kitchensink/data/MemberListProducer.java (100%) rename {kitchensink/src => src}/main/java/org/jboss/as/quickstarts/kitchensink/data/MemberRepository.java (100%) rename {kitchensink/src => src}/main/java/org/jboss/as/quickstarts/kitchensink/model/Member.java (100%) rename {kitchensink/src => src}/main/java/org/jboss/as/quickstarts/kitchensink/rest/JaxRsActivator.java (100%) rename {kitchensink/src => src}/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceRESTService.java (100%) rename {kitchensink/src => src}/main/java/org/jboss/as/quickstarts/kitchensink/service/MemberRegistration.java (100%) rename {kitchensink/src => src}/main/java/org/jboss/as/quickstarts/kitchensink/util/Resources.java (100%) rename {kitchensink/src => src}/main/resources/META-INF/persistence.xml (100%) rename {kitchensink/src => src}/main/resources/import.sql (100%) rename {cmt/src => src}/main/webapp/WEB-INF/beans.xml (100%) rename {kitchensink/src => src}/main/webapp/WEB-INF/faces-config.xml (100%) rename {kitchensink/src => src}/main/webapp/WEB-INF/kitchensink-quickstart-ds.xml (100%) rename {kitchensink/src => src}/main/webapp/WEB-INF/templates/default.xhtml (100%) rename {kitchensink/src => src}/main/webapp/index.html (100%) rename {kitchensink/src => src}/main/webapp/index.xhtml (100%) rename {kitchensink/src => src}/main/webapp/resources/css/screen.css (100%) rename {kitchensink/src => src}/main/webapp/resources/gfx/asidebkg.png (100%) rename {kitchensink/src => src}/main/webapp/resources/gfx/banner.png (100%) rename {kitchensink/src => src}/main/webapp/resources/gfx/bkg-blkheader.png (100%) rename {kitchensink/src => src}/main/webapp/resources/gfx/headerbkg.png (100%) rename {kitchensink/src => src}/main/webapp/resources/gfx/rhjb_eap_logo.png (100%) rename {kitchensink/src => src}/main/webapp/resources/gfx/wildfly_400x130.jpg (100%) rename {kitchensink/src => src}/test/java/org/jboss/as/quickstarts/kitchensink/test/MemberRegistrationIT.java (100%) rename {kitchensink/src => src}/test/java/org/jboss/as/quickstarts/kitchensink/test/RemoteMemberRegistrationIT.java (100%) rename {kitchensink/src => src}/test/resources/META-INF/test-persistence.xml (100%) rename {helloworld-ws/src => src}/test/resources/arquillian.xml (100%) rename {kitchensink/src => src}/test/resources/test-ds.xml (100%) delete mode 100644 temperature-converter/README-source.adoc delete mode 100644 temperature-converter/README.adoc delete mode 100644 temperature-converter/README.html delete mode 100644 temperature-converter/charts/helm.yaml delete mode 100644 temperature-converter/pom.xml delete mode 100644 temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/ScaleConverter.java delete mode 100644 temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/TemperatureConverter.java delete mode 100644 temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Scale.java delete mode 100644 temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Temperature.java delete mode 100644 temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/TemperatureConvertEJB.java delete mode 100644 temperature-converter/src/main/webapp/WEB-INF/beans.xml delete mode 100644 temperature-converter/src/main/webapp/WEB-INF/faces-config.xml delete mode 100644 temperature-converter/src/main/webapp/index.html delete mode 100644 temperature-converter/src/main/webapp/temperatureconvert.xhtml delete mode 100644 temperature-converter/src/test/java/org/jboss/as/quickstarts/temperatureconverter/ProvisionedManagedTemperatureConverterIT.java delete mode 100644 temperature-converter/src/test/java/org/jboss/as/quickstarts/temperatureconverter/RemoteTemperatureConverterIT.java delete mode 100644 thread-racing/README-source.adoc delete mode 100644 thread-racing/README.adoc delete mode 100644 thread-racing/README.html delete mode 100644 thread-racing/charts/helm.yaml delete mode 100644 thread-racing/pom.xml delete mode 100644 thread-racing/scripts/embedded-broker.cli delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/EnvironmentProperties.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/Race.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/RaceBroadcaster.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/Racer.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/WebSocketRace.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/WebSocketRaceBroadcaster.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/JimmieThronson.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/MichaelThrumacher.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/SebastienThroeb.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/ValentinoThrossi.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/results/ChampionshipStandings.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/results/RaceResult.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/results/RaceResults.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/RaceStage.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStage.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStageItemProcessor.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStageItemReader.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStageItemWriter.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/concurrency/EEConcurrencyRaceStage.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jaxrs/BoxApplication.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jaxrs/BoxService.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jaxrs/JAXRSRaceStage.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jms/JMSRaceStage.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jms/JMSRaceStageMessageListener.java delete mode 100644 thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/json/JSONRaceStage.java delete mode 100644 thread-racing/src/main/resources/META-INF/batch-jobs/race.xml delete mode 100644 thread-racing/src/main/resources/META-INF/batch-jobs/race.xsd delete mode 100644 thread-racing/src/main/resources/META-INF/persistence.xml delete mode 100644 thread-racing/src/main/webapp/WEB-INF/beans.xml delete mode 100644 thread-racing/src/main/webapp/index.html delete mode 100644 thread-racing/src/test/java/org/jboss/as/quickstarts/threadracing/EchoListener.java delete mode 100644 thread-racing/src/test/java/org/jboss/as/quickstarts/threadracing/ProvisionedManagedThreadRacingIT.java delete mode 100644 thread-racing/src/test/java/org/jboss/as/quickstarts/threadracing/RemoteThreadRacingIT.java delete mode 100644 thread-racing/src/test/resources/arquillian.xml delete mode 100644 todo-backend/README-source.adoc delete mode 100644 todo-backend/README.adoc delete mode 100644 todo-backend/README.html delete mode 100644 todo-backend/charts/helm.yaml delete mode 100644 todo-backend/pom.xml delete mode 100644 todo-backend/src/main/java/org/wildfly/quickstarts/todos/Resources.java delete mode 100644 todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDo.java delete mode 100644 todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoBackendApplication.java delete mode 100644 todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoController.java delete mode 100644 todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoDAO.java delete mode 100644 todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoDAOImpl.java delete mode 100644 todo-backend/src/main/resources/META-INF/persistence.xml delete mode 100644 todo-backend/src/main/scripts/cors_filters.cli delete mode 100644 todo-backend/src/main/webapp/WEB-INF/beans.xml delete mode 100644 todo-backend/src/test/java/org/wildfly/quickstarts/todos/AbstractToDoIT.java delete mode 100644 todo-backend/src/test/java/org/wildfly/quickstarts/todos/ProvisionedManagedToDoIT.java delete mode 100644 todo-backend/src/test/java/org/wildfly/quickstarts/todos/RemoteToDoIT.java delete mode 100644 todo-backend/src/test/resources/arquillian.xml delete mode 100644 websocket-hello/README-source.adoc delete mode 100644 websocket-hello/README.adoc delete mode 100644 websocket-hello/README.html delete mode 100644 websocket-hello/charts/helm.yaml delete mode 100644 websocket-hello/pom.xml delete mode 100644 websocket-hello/src/main/java/org/jboss/as/quickstarts/websocket_hello/HelloName.java delete mode 100644 websocket-hello/src/main/webapp/index.html delete mode 100644 websocket-hello/src/main/webapp/resources/css/hello.css delete mode 100644 websocket-hello/src/test/java/org/jboss/as/quickstarts/websocket_hello/EchoListener.java delete mode 100644 websocket-hello/src/test/java/org/jboss/as/quickstarts/websocket_hello/ProvisionedManagedWebsocketIT.java delete mode 100644 websocket-hello/src/test/java/org/jboss/as/quickstarts/websocket_hello/RemoteWebSocketIT.java delete mode 100644 websocket-hello/src/test/resources/arquillian.xml diff --git a/kitchensink/.cheatsheet.xml b/.cheatsheet.xml similarity index 100% rename from kitchensink/.cheatsheet.xml rename to .cheatsheet.xml diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 114239c427..0000000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -*.sh text eol=lf -*.bat text eol=crlf diff --git a/.github/workflows/reduce_readme.yml b/.github/workflows/reduce_readme.yml deleted file mode 100644 index baea94539b..0000000000 --- a/.github/workflows/reduce_readme.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: JBoss EAP 8.0 Quickstarts Update 'README.adoc's - -on: - push: - branches: - - 8.0.x - -# Only run the latest job -concurrency: - group: '${{ github.workflow }} @ ${{ github.ref || github.run_id }}' - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Install Asciidoctor Reducer - run: sudo gem install asciidoctor-reducer - - name: Reduce README - run: | - CURRENT_DIR="$( pwd -P)" - #Get a list of subdirectories that don't start with a . - subdirs=`find . -maxdepth 1 -type d ! -iname ".*"` - #Loop over the subdirectories - for subdir in $subdirs - do - cd $subdir - #Check if the directory contains README-source.adoc - if [ -e README-source.adoc ] - then - #Get the dirname to define artifactId in the adoc - ARTIFACT_ID=":artifactId: $(basename `pwd`)" - #Use asciidoctor-reducer to create a flattened README.adoc - asciidoctor-reducer --preserve-conditionals -o README.adoc README-source.adoc - #Insert the directory name with env-github def so that this only affects GitHub rendering - sed -i "1s/^/ifdef::env-github[]\n$ARTIFACT_ID\nendif::[]\n\n/" README.adoc - fi - cd $CURRENT_DIR - done - #Reduce root README - asciidoctor-reducer --preserve-conditionals -o README.adoc README-source.adoc - - name: Commit and Push README - uses: EndBug/add-and-commit@v9 - with: - add: '*.adoc' diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 507e3e33af..0000000000 --- a/.gitignore +++ /dev/null @@ -1,33 +0,0 @@ -*~ -build -target -.DS_Store -bin -.openshift -*/.gitignore -.gitkeep -/helloworld-jsp -SERVICES.html -CHANGES.html -CONTRIBUTING.html -RELEASE_PROCEDURE.html -guide/*.html -shared-doc/*.html -out -nb-configuration.xml -nbactions.xml -.idea -*.ipr -*.iws -*.iml -atlassian-ide-plugin.xml -.checkstyle -.classpath -.project -.settings -.metadata -.factorypath -.nbattrs -*.log -build.metadata - diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 2ace97f851..0000000000 --- a/LICENSE.txt +++ /dev/null @@ -1,219 +0,0 @@ -==== - JBoss, Home of Professional Open Source - Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - contributors by the @authors tag. See the copyright.txt in the - distribution for a full listing of individual contributors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==== - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/README-source.adoc b/README-source.adoc index adb2b131bd..17f2c20b74 100644 --- a/README-source.adoc +++ b/README-source.adoc @@ -1,245 +1,60 @@ -include::shared-doc/attributes.adoc[] +include::../shared-doc/attributes.adoc[] -:toc: -:toclevels: 4 -:numbered: - -ifndef::ProductRelease,EAPXPRelease[] -= {productName} Quickstarts - -[toc] += kitchensink: Assortment of technologies including Arquillian +:author: Pete Muir +:level: Intermediate +:technologies: CDI, JSF, JPA, EJB, JAX-RS, BV +:openshift: true [abstract] -The quickstarts demonstrate {javaVersion} and a few additional technologies from the {productNameFull} stack. They provide small, specific, working examples that can be used as a reference for your own project. - -[[introduction]] -== Introduction - -These quickstarts run on the WildFly application server. The quickstarts are configured to use the correct Maven dependencies and ensure that you test and compile the quickstarts against the correct runtime environment. - -Each quickstart folder contains a `README.adoc` file that describes the quickstart features and provides instructions about how to build and run it. Instructions are provided to build the more readable `README.html` files. - -Make sure you read this entire document before you attempt to work with the quickstarts. - -[[system_requirements]] -== System Requirements - -The applications these projects produce are designed to be run on {productNameFull} {productVersion} or later. - -All you need to build these projects is {buildRequirements}. - -[[use_of_product_home_and_jboss_home_variables]] -== Use of WILDFLY_HOME and QUICKSTART_HOME Variables - -The quickstart `README` files use the _replaceable_ value `__WILDFLY_HOME__` to denote the path to the WildFly server. When you encounter this value in a `README` file, make sure you replace it with the actual path to your WildFly server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. - -[[prerequisites]] -== Prerequisites - -Before you begin, you must perform the following tasks. - -. xref:build_wildfly_server[Build the WildFly Server (Optional)]: This step is only required if you plan to run the latest https://github.com/wildfly/wildfly[development version of the WildFly server]. It is not required if you are running a https://github.com/wildfly/wildfly/tags[tagged] or https://github.com/wildfly/wildfly/releases[released] version of the WildFly server. - -. xref:build_wildfly_boms[Build and Install the WildFly BOMs (Optional)]: This step is only required if you are building a development version of the WildFly server and see dependency issues when you build the quickstarts. It is not required if you are running a https://github.com/wildfly/quickstart/tags[tagged] or https://github.com/wildfly/boms/releases[released] version of the WildFly server. - -. xref:build_quickstart_readme_files[Build the Quickstart README.html Files (Required)]: The quickstart `README` files are written in AsciiDoc to provide modular, reusable content; however, this makes them difficult to read. For this reason, you must also build the quickstart `README.html` files from the AsciiDoc source. - -[[build_wildfly_server]] -=== Build the WildFly Server (Optional) - -If you have downloaded a https://github.com/wildfly/wildfly/tags[tagged] or https://github.com/wildfly/wildfly/releases[released] version of the WildFly server, you can ignore this step. You can simply extract the WildFly server from the compressed file and https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/START_JBOSS_EAP.adoc#start-the-red-hat-jboss-enterprise-application-platform-server[start the server] from that directory. +The `kitchensink` quickstart demonstrates a {javaVersion} web-enabled database application using JSF, CDI, EJB, JPA, and Bean Validation. -If you plan to run the https://github.com/wildfly/wildfly[development version of the WildFly server], you must first download and build the WildFly server from source. +:standalone-server-type: default +:archiveType: war +:uses-h2: +:uses-ds-xml: -. If you have not yet done so, you must clone https://github.com/wildfly/wildfly[WildFly server] repository and navigate to it. You might also want to change the remote name from `origin` to `upstream` to be consistent with your other repositories. -+ -[source,options="nowrap"] ----- -$ git clone git@github.com:wildfly/wildfly.git -$ cd wildfly -$ git remote rename origin upstream ----- -. Verify that your local `master` branch contains the latest updates. -+ -[source,options="nowrap"] ----- -$ git fetch upstream -$ git checkout master -$ git reset --hard upstream/master ----- - -. Build the WildFly server using the following command. -+ -[source,options="nowrap"] ----- -$ mvn clean install -DskipTests -Denforcer.skip=true -Dcheckstyle.skip=true ----- +== What is it? -. The WildFly server folder and ZIP files, which are named `wildfly-__VERSION__-SNAPSHOT` and `wildfly-__VERSION__-SNAPSHOT.ZIP` respectively, are located in the `build/target/` directory. You can copy that folder or unzip the file to another location or https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/START_JBOSS_EAP.adoc#start-the-red-hat-jboss-enterprise-application-platform-server[start the server] from that directory. +The `kitchensink` quickstart is a deployable Maven 3 project designed to help you get your foot in the door developing with {javaVersion} on {productNameFull}. +It demonstrates how to create a compliant {javaVersion} application using JSF, CDI, JAX-RS, EJB, JPA, and Bean Validation. It also includes a persistence unit and some sample persistence and transaction code to introduce you to database access in enterprise Java. -[[build_wildfly_boms]] -=== Build and Install the WildFly BOMs (Optional) - -If you have downloaded and are running a https://github.com/wildfly/quickstart/tags[tagged] or https://github.com/wildfly/quickstart/releases[released] version of the quickstarts, you can ignore this step because the required BOMs are already installed in Maven. - -If you are using the latest https://github.com/wildfly/quickstart[development version] of the quickstarts and you are able to successfully build and deploy the quickstarts, you can also ignore this step because the required BOMS are already installed in Maven. - -However, if you are using the latest https://github.com/wildfly/quickstart[development version] of the quickstarts and you see build errors indicating missing dependencies, you must first xref:build_wildfly_server[build the latest WildFly server] and then build and install the WildFly BOMs. This installs the latest Maven artifacts that are required by the SNAPSHOT version of the WildFly quickstarts that are still under development. - -. If you have not yet done so, clone https://github.com/wildfly/boms[WildFly BOMs] repository and navigate to it. You might also want to rename the directory to `wildfly-boms` to make it clear which BOMs it contains and also change the remote name from `origin` to `upstream` to be consistent with your other repositories. -+ -[source,options="nowrap"] ----- -$ git clone git@github.com:wildfly/boms.git -$ mv boms wildfly-boms -$ cd wildfly-boms -$ git remote rename origin upstream ----- -. Verify that your local `master` branch contains the latest updates. -+ -[source,options="nowrap"] ----- -$ git fetch upstream -$ git checkout master -$ git reset --hard upstream/master ----- - -. Build the WildFly BOMs using the following command. -+ -[source,options="nowrap"] ----- -$ mvn clean install ----- -+ -NOTE: If you run into build errors, check with the WildFly team to see if the repositories are temporarily out of sync. +// Considerations for Use in a Production Environment +include::../shared-doc/development-shortcuts.adoc[leveloffset=+1] +// System Requirements +include::../shared-doc/system-requirements.adoc[leveloffset=+1] +// Use of {jbossHomeName} +include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1] -. At this point, you can verify that all of the quickstarts build using the following command. -+ -[source,options="nowrap"] ----- -$ mvn clean install '-Pdefault,!complex-dependencies' ----- +// build and run with standard server distribution +[[build_and_run_the_quickstart_with_server_dist]] +== Building and running the quickstart application with a {productName} server distribution +// Start the {productName} Standalone Server +include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+2] +// Build and Deploy the Quickstart +include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+2] -[[build_quickstart_readme_files]] -=== Build the Quickstart README.html Files (Required) +=== Access the Application -The quickstart `README` files are written in AsciiDoc, not only because the language is much more powerful than Markdown, but also also because it is possible to extract common instructions into separate files to be reused across the quickstarts. While this makes them more flexible and easier to maintain, unfortunately, included files do not render in a readable format in GitHub or in most text editors. +The application will be running at the following URL: http://localhost:8080/{artifactId}/. -The Maven plugin that is used to build and deploy the quickstarts can also generate fully rendered `README.html` instructions from the `README.adoc` files. +=== Server Log: Expected Warnings and Errors -To build all of the quickstart `README.html` files, including the root `README.html` file that contains the table with links to all available quickstarts, navigate to the root folder of the quickstarts and run the following command. +You will see the following warnings in the server log. You can ignore these warnings. [source,options="nowrap"] ---- -$ mvn clean package -Pdocs +WFLYJCA0091: -ds.xml file deployments are deprecated. Support may be removed in a future version. ---- -[TIP] -==== -To build the `README.html` file for a specific quickstart, navigate to the quickstart directory and run the above command. -==== - -If you see errors about missing dependencies, check the xref:prerequisites[prerequisites] section to determine whether you need to xref:build_wildfly_boms[build the WildFly BOMs] that corresponds to the version of the quickstarts that you are using. - -[[suggested_approach_to_the_quickstarts]] -== Suggested Approach to the Quickstarts - -We recommend that you approach the quickstarts as follows: - -* Regardless of your level of expertise, we suggest you start with the `helloworld` quickstart. It is the simplest example and is an easy way to prove the server is configured and running correctly. -* If you are a beginner or new to JBoss, start with the quickstarts labeled `Beginner`, then try those marked as `Intermediate`. When you are comfortable with those, move on to the `Advanced` quickstarts. -* Some quickstarts are based upon other quickstarts but have expanded capabilities and functionality. If a prerequisite quickstart is listed, make sure you deploy and test it before looking at the expanded version. - -The root folder of each individual quickstart contains a `README.html` file with detailed instructions on how to build and run the example. - -// END ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -endif::[] - -//********************************************************************************** -// -// WildFly Developers: You can ignore the rest of this file. -// It is for the JBoss EAP product, CD and XP Releases. -// -//********************************************************************************** - -ifdef::ProductRelease,EAPXPRelease[] -// These instructions are only for the JBoss EAP product, CD and XP Releases. -= {productNameFull} ({productName}) Quickstarts - -[abstract] -The quickstarts demonstrate {javaVersion} and a few additional technologies from the {productNameFull} stack. They provide small, specific, working examples that can be used as a reference for your own project. - -[[introduction]] -== Introduction - -These quickstarts run on {productNameFull} {productVersion}. +// Testing with Arquillian +include::../shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc[leveloffset=+2] +// Undeploy the Quickstart +include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2] -We recommend that you use the *{quickstartDownloadName}* ZIP file, which you can download from the {quickstartDownloadUrl}[{productName} Software Download] page on the Red Hat Customer Portal. This version of the quickstarts uses the correct dependencies and ensures that you test and compile against the correct server runtime environment. - -Each quickstart folder contains a `README{outfilesuffix}` file that describes the quickstart features and provides instructions about how to build and run it. - -Make sure you read this entire document before you attempt to work with the quickstarts. - -ifdef::ProductRelease,EAPXPRelease[] -// System Requirements are not needed for the CD Releases, only for the Product and XP Release. -[[system_requirements]] -== System Requirements - -The applications these projects produce are designed to be run on {productNameFull} {productVersion} or later. - -All you need to build these projects is {buildRequirements}. - -[[use_of_product_home_and_jboss_home_variables]] -== Use of {jbossHomeName} and QUICKSTART_HOME Variables - -The quickstart `README` files use the _replaceable_ value `__{jbossHomeName}__` to denote the path to the {productName} installation. When you encounter this value in a `README` file, make sure you replace it with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables] - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -// END ifdef::ProductRelease,EAPXPRelease[] -endif::[] - -[[suggested_approach_to_the_quickstarts]] -== Suggested Approach to the Quickstarts - -We suggest you approach the quickstarts as follows: - -* Regardless of your level of expertise, we suggest you start with the `helloworld` quickstart. It is the simplest example and is an easy way to prove the server is configured and running correctly. -* If you are a beginner or new to JBoss, start with the quickstarts labeled `Beginner`, then try those marked as `Intermediate`. When you are comfortable with those, move on to the `Advanced` quickstarts. -* Some quickstarts are based upon other quickstarts but have expanded capabilities and functionality. If a prerequisite quickstart is listed, make sure you deploy and test it before looking at the expanded version. - -// END ifdef::ProductRelease,EAPXPRelease[] +// Build and run sections for other environments/builds +ifndef::ProductRelease,EAPXPRelease[] +include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] endif::[] - -// The following is included for all versions: WildFly, JBoss EAP, EAP CD and EAP XP -[[available_quickstarts]] -== Table of Available Quickstarts - -The sources for all available quickstarts, which are listed in the following table, can be found here: {githubRepoUrl}. - -Each quickstart provides the list of technologies demonstrated by the quickstart and the required experience level needed to build and deploy it. Click on the quickstart link in the table to see more detailed information about how to run it. Some quickstarts require deployment of other quickstarts. This information is noted in the `Prerequisites` section of the quickstart `README.html` file. - -NOTE: Some of these quickstarts use the H2 database included with {productNameFull} {productVersion}. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment! - -// -[cols="1,1,2,1,1", options="header"] -|=== -| Quickstart Name | Demonstrated Technologies | Description | Experience Level Required | Prerequisites -| link:cmt/README{outfilesuffix}[cmt]|EJB, CMT, JMS | The `cmt` quickstart demonstrates Container-Managed Transactions (CMT), showing how to use transactions managed by the container. | Intermediate | _none_ -| link:ee-security/README{outfilesuffix}[ee-security]|EE Security, Servlet, CDI | The `ee-security` quickstart demonstrates Jakarta EE security. | Intermediate | _none_ -| link:helloworld/README{outfilesuffix}[helloworld]|Servlet | The `helloworld` quickstart demonstrates the use of Servlet 6 and is a good starting point to verify {productName} is configured correctly. | Beginner | _none_ -| link:helloworld-ws/README{outfilesuffix}[helloworld-ws]|JAX-WS | The `helloworld-ws` quickstart demonstrates a simple Hello World application, bundled and deployed as a WAR, that uses JAX-WS to say Hello. | Beginner | _none_ -| link:jaxrs-client/README{outfilesuffix}[jaxrs-client]|JAX-RS | The `jaxrs-client` quickstart demonstrates JAX-RS Client API, which interacts with a JAX-RS Web service that runs on {productName}. | Beginner | _none_ -| link:kitchensink/README{outfilesuffix}[kitchensink]|CDI, JSF, JPA, EJB, JAX-RS, BV | The `kitchensink` quickstart demonstrates a {javaVersion} web-enabled database application using JSF, CDI, EJB, JPA, and Bean Validation. | Intermediate | _none_ -| link:numberguess/README{outfilesuffix}[numberguess]|CDI, JSF | The `numberguess` quickstart demonstrates the use of CDI (Contexts and Dependency Injection) and JSF (JavaServer Faces) in {productName}. | Beginner | _none_ -| link:remote-helloworld-mdb/README{outfilesuffix}[remote-helloworld-mdb]|JMS, EJB, MDB | The `remote-helloworld-mdb` quickstart demonstrates the use of JMS and EJB Message-Driven Bean in {productName} with a remote broker. | Intermediate | _none_ -| link:servlet-security/README{outfilesuffix}[servlet-security]|Servlet, Security | The `servlet-security` quickstart demonstrates the use of Jakarta EE declarative security to control access to Servlets and Security in {productName}. | Intermediate | _none_ -| link:temperature-converter/README{outfilesuffix}[temperature-converter]|CDI, JSF, SLSB EJB | The `temperature-converter` quickstart does temperature conversion using an EJB Stateless Session Bean (SLSB), CDI, and a JSF front-end client. | Beginner | _none_ -| link:thread-racing/README{outfilesuffix}[thread-racing]|Batch, CDI, EE Concurrency, JAX-RS, JMS, JPA, JSON, Web Sockets | A thread racing web application that demonstrates technologies introduced or updated in the latest Jakarta EE specification. | Beginner | _none_ -| link:todo-backend/README{outfilesuffix}[todo-backend]|JPA, JAX-RS, OpenShift, Galleon | The `todo-backend` quickstart demonstrates how to implement a backend that exposes a HTTP API with JAX-RS | Intermediate | _none_ -| link:websocket-hello/README{outfilesuffix}[websocket-hello]|WebSocket, CDI, JSF | The `websocket-hello` quickstart demonstrates how to create a simple WebSocket application. | Beginner | _none_ -|=== -// - +include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1] diff --git a/README.adoc b/README.adoc index f2b98af85e..412e7f9aa7 100644 --- a/README.adoc +++ b/README.adoc @@ -1,3 +1,7 @@ +ifdef::env-github[] +:artifactId: kitchensink +endif::[] + //*********************************************************************************** // Enable the following flag to build README.html files for JBoss EAP product builds. // Comment it out for WildFly builds. @@ -193,245 +197,677 @@ endif::[] :LinkJBDSGettingStarted: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/getting_started_with_codeready_studio_tools/ :JBDSGettingStartedBookName: Getting Started with CodeReady Studio Tools -:toc: -:toclevels: 4 -:numbered: += kitchensink: Assortment of technologies including Arquillian +:author: Pete Muir +:level: Intermediate +:technologies: CDI, JSF, JPA, EJB, JAX-RS, BV +:openshift: true -ifndef::ProductRelease,EAPXPRelease[] -= {productName} Quickstarts +[abstract] +The `kitchensink` quickstart demonstrates a {javaVersion} web-enabled database application using JSF, CDI, EJB, JPA, and Bean Validation. -[toc] +:standalone-server-type: default +:archiveType: war +:uses-h2: +:uses-ds-xml: -[abstract] -The quickstarts demonstrate {javaVersion} and a few additional technologies from the {productNameFull} stack. They provide small, specific, working examples that can be used as a reference for your own project. +== What is it? + +The `kitchensink` quickstart is a deployable Maven 3 project designed to help you get your foot in the door developing with {javaVersion} on {productNameFull}. + +It demonstrates how to create a compliant {javaVersion} application using JSF, CDI, JAX-RS, EJB, JPA, and Bean Validation. It also includes a persistence unit and some sample persistence and transaction code to introduce you to database access in enterprise Java. + +// Considerations for Use in a Production Environment +:leveloffset: +1 + +[[considerations_for_use_in_a_production_environment]] += Considerations for Use in a Production Environment +//****************************************************************************** +// Include this template if your quickstart: +// * Uses the h2 database: Be sure to define the `uses-h2` attribute. +// * Uses an `*-ds.xml file`: Be sure to define the `uses-ds-xml` attribute. +// * Has performance or scalability concerns: Be sure to define the `uses-ds-xml` attribute. +//****************************************************************************** + +ifdef::uses-h2[] + +H2 Database:: This quickstart uses the H2 database included with {productNameFull} {productVersion}. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment. + +endif::uses-h2[] -[[introduction]] -== Introduction +ifdef::uses-ds-xml[] -These quickstarts run on the WildFly application server. The quickstarts are configured to use the correct Maven dependencies and ensure that you test and compile the quickstarts against the correct runtime environment. +Datasource Configuration File:: This quickstart uses a `*-ds.xml` datasource configuration file for convenience and ease of database configuration. These files are deprecated in {productName} and should not be used in a production environment. Instead, you should configure the datasource using the Management CLI or Management Console. Datasource configuration is documented in the {LinkConfigGuide}[__{ConfigBookName}__]. -Each quickstart folder contains a `README.adoc` file that describes the quickstart features and provides instructions about how to build and run it. Instructions are provided to build the more readable `README.html` files. +endif::uses-ds-xml[] -Make sure you read this entire document before you attempt to work with the quickstarts. +ifdef::performance-scalability[] + +Performance and Scalability:: A Jakarta EE container is designed with robustness in mind, so you should carefully analyze the scalabiltiy, concurrency, and performance needs of your application before taking advantage of these techniques in your own applications. + +endif::performance-scalability[] + +:leveloffset!: +// System Requirements +:leveloffset: +1 [[system_requirements]] -== System Requirements += System Requirements +//****************************************************************************** +// Include this template to describe the standard system requirements for +// running the quickstarts. +// +// The Forge quickstarts define a `forge-from-scratch` attribute because they +// run entirely in CodeReady Studio and have different requirements . +//****************************************************************************** + +The application this project produces is designed to be run on {productNameFull} {productVersion} or later. + +All you need to build this project is {buildRequirements}. See link:{configureMavenDocUrl}[Configure Maven to Build and Deploy the Quickstarts] to make sure you are configured correctly for testing the quickstarts. -The applications these projects produce are designed to be run on {productNameFull} {productVersion} or later. +:leveloffset!: +// Use of {jbossHomeName} +:leveloffset: +1 -All you need to build these projects is {buildRequirements}. +ifdef::requires-multiple-servers[] +[[use_of_jboss_home_name]] += Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables -[[use_of_product_home_and_jboss_home_variables]] -== Use of WILDFLY_HOME and QUICKSTART_HOME Variables +This quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. -The quickstart `README` files use the _replaceable_ value `__WILDFLY_HOME__` to denote the path to the WildFly server. When you encounter this value in a `README` file, make sure you replace it with the actual path to your WildFly server. +In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. +endif::[] -[[prerequisites]] -== Prerequisites +ifdef::optional-domain-or-multiple-servers[] +[[use_of_jboss_home_name]] += Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables -Before you begin, you must perform the following tasks. +When deploying this quickstart to a managed domain, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. -. xref:build_wildfly_server[Build the WildFly Server (Optional)]: This step is only required if you plan to run the latest https://github.com/wildfly/wildfly[development version of the WildFly server]. It is not required if you are running a https://github.com/wildfly/wildfly/tags[tagged] or https://github.com/wildfly/wildfly/releases[released] version of the WildFly server. +When deploying this quickstart to multiple standalone servers, this quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. -. xref:build_wildfly_boms[Build and Install the WildFly BOMs (Optional)]: This step is only required if you are building a development version of the WildFly server and see dependency issues when you build the quickstarts. It is not required if you are running a https://github.com/wildfly/quickstart/tags[tagged] or https://github.com/wildfly/boms/releases[released] version of the WildFly server. +When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. +endif::[] -. xref:build_quickstart_readme_files[Build the Quickstart README.html Files (Required)]: The quickstart `README` files are written in AsciiDoc to provide modular, reusable content; however, this makes them difficult to read. For this reason, you must also build the quickstart `README.html` files from the AsciiDoc source. +ifndef::requires-multiple-servers,optional-domain-or-multiple-servers[] +[[use_of_jboss_home_name]] += Use of the {jbossHomeName} and QUICKSTART_HOME Variables -[[build_wildfly_server]] -=== Build the WildFly Server (Optional) +In the following instructions, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. -If you have downloaded a https://github.com/wildfly/wildfly/tags[tagged] or https://github.com/wildfly/wildfly/releases[released] version of the WildFly server, you can ignore this step. You can simply extract the WildFly server from the compressed file and https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/START_JBOSS_EAP.adoc#start-the-red-hat-jboss-enterprise-application-platform-server[start the server] from that directory. +When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. +endif::[] + +:leveloffset!: + +// build and run with standard server distribution +[[build_and_run_the_quickstart_with_server_dist]] +== Building and running the quickstart application with a {productName} server distribution +// Start the {productName} Standalone Server +:leveloffset: +2 + +[[start_the_eap_standalone_server]] += Start the {productName} Standalone Server +//****************************************************************************** +// Include this template if your quickstart requires a normal start of a single +// standalone server. +// +// You must define the `standalone-server-type`. Supported values are: +// default +// full +// full-ha +// ha +// custom +// +// * For mobile applications, you can define the `mobileApp` variable in the +// `README.adoc` file to add `-b 0.0.0.0` to the command line. This allows +// external clients, such as phones, tablets, and desktops, to connect +// to the application through through your local network +// ::mobileApp: {artifactId}-service +// +//****************************************************************************** + +//****************************************************************************** +// This template sets attributes for the different standalone server profiles. +// +// You must define the `standalone-server-type`. Supported values are: +// default +// full +// full-ha +// ha +// microprofile +// custom +//****************************************************************************** + +// Standalone server with the default profile. +ifeval::["{standalone-server-type}"=="default"] +:serverProfile: default profile +:configFileName: standalone/configuration/standalone.xml +:serverArguments: +endif::[] + +// Standalone server with the full profile. +ifeval::["{standalone-server-type}"=="full"] +:serverProfile: full profile +:configFileName: standalone/configuration/standalone-full.xml +:serverArguments: -c standalone-full.xml +endif::[] + +// Standalone server with the full HA profile. +ifeval::["{standalone-server-type}"=="full-ha"] +:serverProfile: full HA profile +:configFileName: standalone/configuration/standalone-full-ha.xml +:serverArguments: -c standalone-full-ha.xml +endif::[] -If you plan to run the https://github.com/wildfly/wildfly[development version of the WildFly server], you must first download and build the WildFly server from source. +// Start the standalone server with the HA profile. +ifeval::["{standalone-server-type}"=="ha"] +:serverProfile: HA profile +:configFileName: standalone/configuration/standalone-ha.xml +:serverArguments: -c standalone-ha.xml +endif::[] + +// Start the standalone server with the Eclipse MicroProfile profile. +ifeval::["{standalone-server-type}"=="microprofile"] +:serverProfile: MicroProfile profile +:configFileName: standalone/configuration/standalone-microprofile.xml +:serverArguments: -c standalone-microprofile.xml +endif::[] -. If you have not yet done so, you must clone https://github.com/wildfly/wildfly[WildFly server] repository and navigate to it. You might also want to change the remote name from `origin` to `upstream` to be consistent with your other repositories. +// Standalone server with the custom profile. +// NOTE: This profile requires that you define the `serverArguments` variable +// within the quickstart README.adoc file. For example: +// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml +ifeval::["{standalone-server-type}"=="custom"] +:serverProfile: custom profile +endif::[] + +// If there is no match, use the default profile. +ifndef::serverProfile[] +:standalone-server-type: default +:serverProfile: default profile +:configFileName: standalone/configuration/standalone.xml +:serverArguments: +endif::serverProfile[] + +. Open a terminal and navigate to the root of the {productName} directory. +. Start the {productName} server with the {serverProfile} by typing the following command. + -[source,options="nowrap"] +ifdef::uses-jaeger[] +[source,subs="+quotes,attributes+",options="nowrap"] ---- -$ git clone git@github.com:wildfly/wildfly.git -$ cd wildfly -$ git remote rename origin upstream +$ __JAEGER_REPORTER_LOG_SPANS=true JAEGER_SAMPLER_TYPE=const JAEGER_SAMPLER_PARAM=1__ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ---- -. Verify that your local `master` branch contains the latest updates. -+ -[source,options="nowrap"] +endif::[] +ifndef::uses-jaeger[] +[source,subs="+quotes,attributes+",options="nowrap"] ---- -$ git fetch upstream -$ git checkout master -$ git reset --hard upstream/master +$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ---- +endif::[] ++ +NOTE: For Windows, use the `__{jbossHomeName}__\bin\standalone.bat` script. -. Build the WildFly server using the following command. +ifdef::mobileApp[] + -[source,options="nowrap"] +Adding `-b 0.0.0.0` to the above command allows external clients, such as phones, tablets, and desktops, to connect through your local network. For example: ++ +[source,subs="+quotes,attributes+",options="nowrap"] ---- -$ mvn clean install -DskipTests -Denforcer.skip=true -Dcheckstyle.skip=true +$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} -b 0.0.0.0 ---- +endif::[] + +:leveloffset!: +// Build and Deploy the Quickstart +:leveloffset: +2 + +[[build_and_deploy_the_quickstart]] += Build and Deploy the Quickstart +//****************************************************************************** +// Include this template if your quickstart does a normal deployment of a archive. +// +// * Define the `archiveType` variable in the quickstart README file. +// Supported values: +// :archiveType: ear +// :archiveType: war +// :archiveType: jar +// +// * To override the archive name, which defaults to the {artifactId), +// define the `archiveName` variable, for example: +// :archiveName: {artifactId}-service +// +// * To override the archive output directory, +// define the `archiveDir` variable, for example: +// :archiveDir: ear/target +// +// * To override the Maven command, define the `mavenCommand` variable, +// for example: +// :mavenCommand: clean install wildfly:deploy +//****************************************************************************** + +// The archive name defaults to the artifactId if not overridden +ifndef::archiveName[] +:archiveName: {artifactId} +endif::archiveName[] + +// The archive type defaults to war if not overridden +ifndef::archiveType[] +:archiveType: war +endif::archiveType[] + +// Define the archive file name as the concatenation of "archiveName" + "." + "archiveType+ +:archiveFileName: {archiveName}.{archiveType} + +// If they have not defined the target archive directory, make it the default for the archive type. +ifndef::archiveDir[] -. The WildFly server folder and ZIP files, which are named `wildfly-__VERSION__-SNAPSHOT` and `wildfly-__VERSION__-SNAPSHOT.ZIP` respectively, are located in the `build/target/` directory. You can copy that folder or unzip the file to another location or https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/START_JBOSS_EAP.adoc#start-the-red-hat-jboss-enterprise-application-platform-server[start the server] from that directory. +ifeval::["{archiveType}"=="ear"] +:archiveDir: {artifactId}/ear/target +endif::[] + +ifeval::["{archiveType}"=="war"] +:archiveDir: {artifactId}/target +endif::[] + +ifeval::["{archiveType}"=="jar"] +:archiveDir: {artifactId}/target +endif::[] +endif::archiveDir[] -[[build_wildfly_boms]] -=== Build and Install the WildFly BOMs (Optional) +ifndef::mavenCommand[] +ifeval::["{archiveType}"=="ear"] +:mavenCommand: clean install +endif::[] -If you have downloaded and are running a https://github.com/wildfly/quickstart/tags[tagged] or https://github.com/wildfly/quickstart/releases[released] version of the quickstarts, you can ignore this step because the required BOMs are already installed in Maven. +ifeval::["{archiveType}"=="war"] +:mavenCommand: clean package +endif::[] -If you are using the latest https://github.com/wildfly/quickstart[development version] of the quickstarts and you are able to successfully build and deploy the quickstarts, you can also ignore this step because the required BOMS are already installed in Maven. +ifeval::["{archiveType}"=="jar"] +:mavenCommand: clean install +endif::[] -However, if you are using the latest https://github.com/wildfly/quickstart[development version] of the quickstarts and you see build errors indicating missing dependencies, you must first xref:build_wildfly_server[build the latest WildFly server] and then build and install the WildFly BOMs. This installs the latest Maven artifacts that are required by the SNAPSHOT version of the WildFly quickstarts that are still under development. +endif::mavenCommand[] -. If you have not yet done so, clone https://github.com/wildfly/boms[WildFly BOMs] repository and navigate to it. You might also want to rename the directory to `wildfly-boms` to make it clear which BOMs it contains and also change the remote name from `origin` to `upstream` to be consistent with your other repositories. +. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. +. Open a terminal and navigate to the root directory of this quickstart. +ifdef::reactive-messaging[] +. Run this command to enable the MicroProfile Reactive Messaging functionality on the server + -[source,options="nowrap"] +[source,subs="attributes+",options="nowrap"] ---- -$ git clone git@github.com:wildfly/boms.git -$ mv boms wildfly-boms -$ cd wildfly-boms -$ git remote rename origin upstream +$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=enable-reactive-messaging.cli ---- -. Verify that your local `master` branch contains the latest updates. +endif::reactive-messaging[] +. Type the following command to build the quickstart. + -[source,options="nowrap"] +[source,subs="attributes+",options="nowrap"] ---- -$ git fetch upstream -$ git checkout master -$ git reset --hard upstream/master +$ mvn {mavenCommand} ---- -. Build the WildFly BOMs using the following command. +. Type the following command to deploy the quickstart. + -[source,options="nowrap"] +[source,subs="attributes+",options="nowrap"] ---- -$ mvn clean install +$ mvn wildfly:deploy ---- -+ -NOTE: If you run into build errors, check with the WildFly team to see if the repositories are temporarily out of sync. -. At this point, you can verify that all of the quickstarts build using the following command. -+ +ifdef::rest-client-qs[] +This builds and deploys the `country-server` and `country-client` to the running instance of the server. + +You should see a message in the server log indicating that the archives deployed successfully. +endif::[] +ifndef::rest-client-qs[] +This deploys the `{archiveDir}/{archiveFileName}` to the running instance of the server. + +You should see a message in the server log indicating that the archive deployed successfully. +endif::[] + + +:leveloffset!: + +=== Access the Application + +The application will be running at the following URL: http://localhost:8080/{artifactId}/. + +=== Server Log: Expected Warnings and Errors + +You will see the following warnings in the server log. You can ignore these warnings. + [source,options="nowrap"] ---- -$ mvn clean install '-Pdefault,!complex-dependencies' +WFLYJCA0091: -ds.xml file deployments are deprecated. Support may be removed in a future version. ---- -[[build_quickstart_readme_files]] -=== Build the Quickstart README.html Files (Required) +// Testing with Arquillian +:leveloffset: +2 + +[[run_the_arquillian_integration_tests_with_server_distribution]] += Run the Arquillian Integration Tests +//****************************************************************************** +// Include this template if your quickstart provides standard Arquillian +// integration tests. +//****************************************************************************** -The quickstart `README` files are written in AsciiDoc, not only because the language is much more powerful than Markdown, but also also because it is possible to extract common instructions into separate files to be reused across the quickstarts. While this makes them more flexible and easier to maintain, unfortunately, included files do not render in a readable format in GitHub or in most text editors. +This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. -The Maven plugin that is used to build and deploy the quickstarts can also generate fully rendered `README.html` instructions from the `README.adoc` files. +Follow these steps to run the integration tests. -To build all of the quickstart `README.html` files, including the root `README.html` file that contains the table with links to all available quickstarts, navigate to the root folder of the quickstarts and run the following command. +. Make sure you start the {productName} server, as previously described. +. Make sure you build and deploy the quickstart, as previously described. + +. Type the following command to run the `verify` goal with the `arq-remote` profile activated. ++ [source,options="nowrap"] ---- -$ mvn clean package -Pdocs +$ mvn verify -Parq-remote ---- -[TIP] +[NOTE] ==== -To build the `README.html` file for a specific quickstart, navigate to the quickstart directory and run the above command. +You may also use the environment variable `SERVER_HOST` or the system property `server.host` to define the target host of the tests. ==== -If you see errors about missing dependencies, check the xref:prerequisites[prerequisites] section to determine whether you need to xref:build_wildfly_boms[build the WildFly BOMs] that corresponds to the version of the quickstarts that you are using. +:leveloffset!: +// Undeploy the Quickstart +:leveloffset: +2 -[[suggested_approach_to_the_quickstarts]] -== Suggested Approach to the Quickstarts +[[undeploy_the_quickstart]] += Undeploy the Quickstart -We recommend that you approach the quickstarts as follows: +//******************************************************************************* +// Include this template if your quickstart does a normal undeployment of an archive. +//******************************************************************************* +When you are finished testing the quickstart, follow these steps to undeploy the archive. -* Regardless of your level of expertise, we suggest you start with the `helloworld` quickstart. It is the simplest example and is an easy way to prove the server is configured and running correctly. -* If you are a beginner or new to JBoss, start with the quickstarts labeled `Beginner`, then try those marked as `Intermediate`. When you are comfortable with those, move on to the `Advanced` quickstarts. -* Some quickstarts are based upon other quickstarts but have expanded capabilities and functionality. If a prerequisite quickstart is listed, make sure you deploy and test it before looking at the expanded version. +. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. +. Open a terminal and navigate to the root directory of this quickstart. +. Type this command to undeploy the archive: ++ +[source,options="nowrap"] +---- +$ mvn wildfly:undeploy +---- -The root folder of each individual quickstart contains a `README.html` file with detailed instructions on how to build and run the example. +:leveloffset!: -// END ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] +// Build and run sections for other environments/builds +ifndef::ProductRelease,EAPXPRelease[] +include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] endif::[] +:leveloffset: +1 -//********************************************************************************** -// -// WildFly Developers: You can ignore the rest of this file. -// It is for the JBoss EAP product, CD and XP Releases. -// -//********************************************************************************** +[[build_and_run_the_quickstart_on_openshift]] += Building and running the quickstart application with OpenShift +// The openshift profile +:leveloffset: +1 -ifdef::ProductRelease,EAPXPRelease[] -// These instructions are only for the JBoss EAP product, CD and XP Releases. -= {productNameFull} ({productName}) Quickstarts +[[build-the-quickstart-for-openshift]] +== Build the {productName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts -[abstract] -The quickstarts demonstrate {javaVersion} and a few additional technologies from the {productNameFull} stack. They provide small, specific, working examples that can be used as a reference for your own project. +On OpenShift, the S2I build with Apache Maven will use an `openshift` profile used to provision a {productName} server to deploy and run the quickstart in OpenShift environment. +You can activate the Maven profile named `openshift` when building the quickstart: -[[introduction]] -== Introduction +[source,subs="attributes+",options="nowrap"] +---- +$ mvn clean package -Popenshift +---- -These quickstarts run on {productNameFull} {productVersion}. +The provisioned {productName} server for OpenShift, with the quickstart deployed, can then be found in the `target/server` directory, and its usage is similar to a standard server distribution. +ifndef::ProductRelease,EAPXPRelease[] +You may note that unlike the `provisioned-server` profile it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. +endif::[] +ifdef::ProductRelease,EAPXPRelease[] +You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. +endif::[] -We recommend that you use the *{quickstartDownloadName}* ZIP file, which you can download from the {quickstartDownloadUrl}[{productName} Software Download] page on the Red Hat Customer Portal. This version of the quickstarts uses the correct dependencies and ensures that you test and compile against the correct server runtime environment. +ifndef::ProductRelease,EAPXPRelease[] +The server provisioning functionality is provided by the WildFly Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: +endif::[] -Each quickstart folder contains a `README{outfilesuffix}` file that describes the quickstart features and provides instructions about how to build and run it. +ifdef::ProductRelease,EAPXPRelease[] +The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: +endif::[] -Make sure you read this entire document before you attempt to work with the quickstarts. +ifndef::ProductRelease,EAPXPRelease[] +[source,xml,subs="attributes+"] +---- + + openshift + + + + org.jboss.eap.plugins + eap-maven-plugin + ${version.eap.maven.plugin} + + + + org.wildfly:wildfly-galleon-pack:${version.server} + + + org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp} + + + + cloud-server + + ROOT.war + + + + + package + + + + + + + +---- +endif::[] ifdef::ProductRelease,EAPXPRelease[] -// System Requirements are not needed for the CD Releases, only for the Product and XP Release. -[[system_requirements]] -== System Requirements +[source,xml,subs="attributes+"] +---- + + openshift + + + + org.jboss.eap.plugins + eap-maven-plugin + ${version.eap.maven.plugin} + + + + org.jboss.eap:wildfly-ee-galleon-pack + + + org.jboss.eap.cloud:eap-cloud-galleon-pack + + + + cloud-server + + ROOT.war + + + + + package + + + + + + + +---- +endif::[] -The applications these projects produce are designed to be run on {productNameFull} {productVersion} or later. +[NOTE] +==== +Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`. +==== -All you need to build these projects is {buildRequirements}. +:leveloffset: 1 +// Getting Started with Helm +:leveloffset: +1 -[[use_of_product_home_and_jboss_home_variables]] -== Use of {jbossHomeName} and QUICKSTART_HOME Variables +[[getting_started_with_helm]] += Getting Started with {xpaasproduct-shortname} and Helm Charts -The quickstart `README` files use the _replaceable_ value `__{jbossHomeName}__` to denote the path to the {productName} installation. When you encounter this value in a `README` file, make sure you replace it with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables] +This section contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} using Helm Charts. -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -// END ifdef::ProductRelease,EAPXPRelease[] +[[prerequisites_helm_openshift]] +== Prerequisites + +* You must be logged in OpenShift and have an `oc` client to connect to OpenShift +* https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. + +Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}. + +ifndef::ProductRelease,EAPXPRelease[] +[source,options="nowrap"] +---- +$ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ +"wildfly" has been added to your repositories +$ helm search repo wildfly +NAME CHART VERSION APP VERSION DESCRIPTION +wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift +wildfly/wildfly-common ... ... A library chart for WildFly-based applications +---- +endif::[] +ifdef::ProductRelease[] +[source,options="nowrap",subs="+attributes"] +---- +$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ +"jboss-eap" has been added to your repositories +$ helm search repo jboss-eap +NAME CHART VERSION APP VERSION DESCRIPTION +{helmChartName} ... ... A Helm chart to build and deploy EAP {productVersion} applications +---- +endif::[] +ifdef::EAPXPRelease[] +[source,options="nowrap",subs="+attributes"] +---- +$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ +"jboss-eap" has been added to your repositories +$ helm search repo jboss-eap +NAME CHART VERSION APP VERSION DESCRIPTION +{helmChartName} ... ... A Helm chart to build and deploy EAP XP {productVersion} applications +---- endif::[] -[[suggested_approach_to_the_quickstarts]] -== Suggested Approach to the Quickstarts +:leveloffset: 1 +//Prepare Helm for Quickstart Deployment +:leveloffset: +1 -We suggest you approach the quickstarts as follows: +[[deploy_helm]] +== Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts -* Regardless of your level of expertise, we suggest you start with the `helloworld` quickstart. It is the simplest example and is an easy way to prove the server is configured and running correctly. -* If you are a beginner or new to JBoss, start with the quickstarts labeled `Beginner`, then try those marked as `Intermediate`. When you are comfortable with those, move on to the `Advanced` quickstarts. -* Some quickstarts are based upon other quickstarts but have expanded capabilities and functionality. If a prerequisite quickstart is listed, make sure you deploy and test it before looking at the expanded version. +Log in to your OpenShift instance using the `oc login` command. +The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. -// END ifdef::ProductRelease,EAPXPRelease[] -endif::[] +Navigate to the root directory of this quickstart and run the following command: +[source,options="nowrap",subs="+attributes"] +---- +$ helm install {artifactId} -f charts/helm.yaml {helmChartName} +NAME: {artifactId} +... +STATUS: deployed +REVISION: 1 +---- + +The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17: + +[source,options="nowrap",subs="+attributes"] +---- +build: + uri: {githubRepoCodeUrl} + ref: {WildFlyQuickStartRepoTag} + contextDir: {artifactId} +deploy: + replicas: 1 +---- + +This will create a new deployment on OpenShift and deploy the application. + +If you want to see all the configuration elements to customize your deployment you can use the following command: +[source,options="nowrap",subs="+attributes"] +---- +$ helm show readme {helmChartName} +---- + +Let’s wait for the application to be built and deployed: +[source,options="nowrap",subs="+attributes"] +---- +$ oc get deployment {artifactId} -w +NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE +{artifactId} 1 1 1 0 12s +... +{artifactId} 1 1 1 1 2m +---- + +Get the URL of the route to the deployment. + +[source,options="nowrap",subs="+attributes"] +---- +$ oc get route {artifactId} -o jsonpath="{.spec.host}" +---- +Access the application in your web browser using the displayed URL. + +[NOTE] +==== +The Maven profile named `openshift` is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the `/{artifactId}` path segment after `HOST:PORT`. +==== + +[[undeploy_helm]] +== Undeploy the {ProductShortName} Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts + + +[source,options="nowrap",subs="+attributes"] +---- +$ helm uninstall {artifactId} +---- + +:leveloffset: 1 +// Testing on Openshift +:leveloffset: +1 + +[[run_the_arquillian_integration_tests_with_openshift]] += Run the Arquillian Integration Tests with OpenShift +//****************************************************************************** +// Include this template if your quickstart provides Openshift Arquillian +// integration tests. +//****************************************************************************** + +This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. + +[NOTE] +==== +The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin. +==== + +Run the integration tests using the following command to run the `verify` goal with the `arq-remote` profile activated and the proper URL: +[source,options="nowrap",subs="+attributes"] +---- +$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route {artifactId} --template='{{ .spec.host }}') +---- + +[NOTE] +==== +The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from. +==== + +:leveloffset: 1 -// The following is included for all versions: WildFly, JBoss EAP, EAP CD and EAP XP -[[available_quickstarts]] -== Table of Available Quickstarts - -The sources for all available quickstarts, which are listed in the following table, can be found here: {githubRepoUrl}. - -Each quickstart provides the list of technologies demonstrated by the quickstart and the required experience level needed to build and deploy it. Click on the quickstart link in the table to see more detailed information about how to run it. Some quickstarts require deployment of other quickstarts. This information is noted in the `Prerequisites` section of the quickstart `README.html` file. - -NOTE: Some of these quickstarts use the H2 database included with {productNameFull} {productVersion}. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment! - -// -[cols="1,1,2,1,1", options="header"] -|=== -| Quickstart Name | Demonstrated Technologies | Description | Experience Level Required | Prerequisites -| link:cmt/README{outfilesuffix}[cmt]|EJB, CMT, JMS | The `cmt` quickstart demonstrates Container-Managed Transactions (CMT), showing how to use transactions managed by the container. | Intermediate | _none_ -| link:ee-security/README{outfilesuffix}[ee-security]|EE Security, Servlet, CDI | The `ee-security` quickstart demonstrates Jakarta EE security. | Intermediate | _none_ -| link:helloworld/README{outfilesuffix}[helloworld]|Servlet | The `helloworld` quickstart demonstrates the use of Servlet 6 and is a good starting point to verify {productName} is configured correctly. | Beginner | _none_ -| link:helloworld-ws/README{outfilesuffix}[helloworld-ws]|JAX-WS | The `helloworld-ws` quickstart demonstrates a simple Hello World application, bundled and deployed as a WAR, that uses JAX-WS to say Hello. | Beginner | _none_ -| link:jaxrs-client/README{outfilesuffix}[jaxrs-client]|JAX-RS | The `jaxrs-client` quickstart demonstrates JAX-RS Client API, which interacts with a JAX-RS Web service that runs on {productName}. | Beginner | _none_ -| link:kitchensink/README{outfilesuffix}[kitchensink]|CDI, JSF, JPA, EJB, JAX-RS, BV | The `kitchensink` quickstart demonstrates a {javaVersion} web-enabled database application using JSF, CDI, EJB, JPA, and Bean Validation. | Intermediate | _none_ -| link:numberguess/README{outfilesuffix}[numberguess]|CDI, JSF | The `numberguess` quickstart demonstrates the use of CDI (Contexts and Dependency Injection) and JSF (JavaServer Faces) in {productName}. | Beginner | _none_ -| link:remote-helloworld-mdb/README{outfilesuffix}[remote-helloworld-mdb]|JMS, EJB, MDB | The `remote-helloworld-mdb` quickstart demonstrates the use of JMS and EJB Message-Driven Bean in {productName} with a remote broker. | Intermediate | _none_ -| link:servlet-security/README{outfilesuffix}[servlet-security]|Servlet, Security | The `servlet-security` quickstart demonstrates the use of Jakarta EE declarative security to control access to Servlets and Security in {productName}. | Intermediate | _none_ -| link:temperature-converter/README{outfilesuffix}[temperature-converter]|CDI, JSF, SLSB EJB | The `temperature-converter` quickstart does temperature conversion using an EJB Stateless Session Bean (SLSB), CDI, and a JSF front-end client. | Beginner | _none_ -| link:thread-racing/README{outfilesuffix}[thread-racing]|Batch, CDI, EE Concurrency, JAX-RS, JMS, JPA, JSON, Web Sockets | A thread racing web application that demonstrates technologies introduced or updated in the latest Jakarta EE specification. | Beginner | _none_ -| link:todo-backend/README{outfilesuffix}[todo-backend]|JPA, JAX-RS, OpenShift, Galleon | The `todo-backend` quickstart demonstrates how to implement a backend that exposes a HTTP API with JAX-RS | Intermediate | _none_ -| link:websocket-hello/README{outfilesuffix}[websocket-hello]|WebSocket, CDI, JSF | The `websocket-hello` quickstart demonstrates how to create a simple WebSocket application. | Beginner | _none_ -|=== -// +:leveloffset!: diff --git a/README.html b/README.html index 51bad6a120..b22575eaa5 100644 --- a/README.html +++ b/README.html @@ -5,7 +5,8 @@ -Red Hat JBoss Enterprise Application Platform (JBoss EAP) Quickstarts + +kitchensink: Assortment of technologies including Arquillian - - - -
-
-
-
-
-The cmt quickstart demonstrates Container-Managed Transactions (CMT), showing how to use transactions managed by the container. -
-
-
-
-
-

What is it?

-
-
-

The cmt quickstart demonstrates how to use container-managed transactions (CMT), which are transactions managed by the container in Red Hat JBoss Enterprise Application Platform. It is a fairly typical scenario of updating a database and sending a JMS message in the same transaction. A simple MDB is provided that prints out the message sent but this is not a transactional MDB and is purely provided for debugging purposes.

-
-
-

Aspects touched upon in the code:

-
-
-
    -
  • -

    XA transaction control using the container managed transaction annotations

    -
  • -
  • -

    XA access to the standard default datasource using the JPA API

    -
  • -
  • -

    XA access to a JMS queue

    -
  • -
-
-
-

What are Container Managed Transactions?

-
-

Prior to EJB, getting the right incantation to ensure sound transactional operation of the business logic was a highly specialized skill. Although this still holds true to a great extent, EJB has provided a series of improvements to allow simplified transaction demarcation notation that is therefore easier to read and test.

-
-
-

With CMT, the EJB container sets the boundaries of a transaction. This differs from BMT (bean-managed transactions), where the developer is responsible for initiating and completing a transaction using the begin, commit, and rollback methods on a jakarta.transaction.UserTransaction.

-
-
-
-

What Makes This an Example of Container Managed Transactions?

-
-

Take a look at org.jboss.as.quickstarts.cmt.ejb.CustomerManagerEJB. You can see that this stateless session bean has been marked up with the @jakarta.ejb.TransactionAttribute annotation.

-
-
-

The following options are available for this annotation.

-
-
-
-
Required
-
-

As demonstrated in the quickstart. If a transaction does not already exist, this will initiate a transaction and complete it for you, otherwise the business logic will be integrated into the existing transaction.

-
-
RequiresNew
-
-

If there is already a transaction running, it will be suspended, the work performed within a new transaction which is completed at exit of the method and then the original transaction resumed.

-
-
Mandatory
-
-

If there is no transaction running, calling a business method with this annotation will result in an error.

-
-
NotSupported
-
-

If there is a transaction running, it will be suspended and no transaction will be initiated for this business method.

-
-
Supports
-
-

This will run the method within a transaction if a transaction exists, alternatively, if there is no transaction running, the method will not be executed within the scope of a transaction.

-
-
Never
-
-

If the client has a transaction running and does not suspend it but calls a method annotated with Never then an EJB exception will be raised.

-
-
-
-
-
-
-
-

Considerations for Use in a Production Environment

-
-
-
-
H2 Database
-
-

This quickstart uses the H2 database included with Red Hat JBoss Enterprise Application Platform 8.0. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment.

-
-
-
-
-
-
-

System Requirements

-
-
-

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 8.0 or later.

-
-
-

All you need to build this project is Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later. See Configure Maven to Build and Deploy the Quickstarts to make sure you are configured correctly for testing the quickstarts.

-
-
-
-
-

Use of the EAP_HOME and QUICKSTART_HOME Variables

-
-
-

In the following instructions, replace EAP_HOME with the actual path to your JBoss EAP installation. The installation path is described in detail here: Use of EAP_HOME and JBOSS_HOME Variables.

-
-
-

When you see the replaceable variable QUICKSTART_HOME, replace it with the path to the root directory of all of the quickstarts.

-
-
-
-
-

Building and running the quickstart application with a JBoss EAP server distribution

-
-
-

Start the JBoss EAP Standalone Server

-
-
    -
  1. -

    Open a terminal and navigate to the root of the JBoss EAP directory.

    -
  2. -
  3. -

    Start the JBoss EAP server with the full profile by typing the following command.

    -
    -
    -
    $ EAP_HOME/bin/standalone.sh -c standalone-full.xml
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\standalone.bat script. -
    -
    -
  4. -
-
-
-
-

Build and Deploy the Quickstart

-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type the following command to build the quickstart.

    -
    -
    -
    $ mvn clean package
    -
    -
    -
  6. -
  7. -

    Type the following command to deploy the quickstart.

    -
    -
    -
    $ mvn wildfly:deploy
    -
    -
    -
  8. -
-
-
-

This deploys the cmt/target/cmt.war to the running instance of the server.

-
-
-

You should see a message in the server log indicating that the archive deployed successfully.

-
-
-
-

Access the Application

-
-

The application will be running at the following URL: http://localhost:8080/cmt/

-
-
-

You are presented with a simple form for adding customers to a database.

-
-
-

After a customer is successfully added to the database, a message is produced containing the details of the customer. An example MDB dequeues this message and print the following contents.

-
-
-
-
Received Message: Created invoice for customer named:  Jack
-
-
-
-

If an existing customer name is provided, no JMS message is sent. Instead of the above message, a duplicate warning is displayed.

-
-
-

The customer name should match: letter & '-', otherwise an error is given. This is to show that a LogMessage entity is still stored in the database. That is because the logCreateCustomer method in the LogMessageManagerEJB EJB is decorated with the @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) annotation.

-
-
-
-

Run the Arquillian Integration Tests

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
-

Follow these steps to run the integration tests.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server, as previously described.

    -
  2. -
  3. -

    Make sure you build and deploy the quickstart, as previously described.

    -
  4. -
  5. -

    Type the following command to run the verify goal with the arq-remote profile activated.

    -
    -
    -
    $ mvn verify -Parq-remote
    -
    -
    -
  6. -
-
-
- - - - - -
-
Note
-
-
-

You may also use the environment variable SERVER_HOST or the system property server.host to define the target host of the tests.

-
-
-
-
-
-

Undeploy the Quickstart

-
-

When you are finished testing the quickstart, follow these steps to undeploy the archive.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type this command to undeploy the archive:

    -
    -
    -
    $ mvn wildfly:undeploy
    -
    -
    -
  6. -
-
-
-
-
-
-

Building and running the quickstart application with OpenShift

-
-
-

Build the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

On OpenShift, the S2I build with Apache Maven will use an openshift profile used to provision a JBoss EAP server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named openshift when building the quickstart:

-
-
-
-
$ mvn clean package -Popenshift
-
-
-
-

The provisioned JBoss EAP server for OpenShift, with the quickstart deployed, can then be found in the target/server directory, and its usage is similar to a standard server distribution. -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.

-
-
-

The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart pom.xml:

-
-
-
-
        <profile>
-            <id>openshift</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.jboss.eap.plugins</groupId>
-                        <artifactId>eap-maven-plugin</artifactId>
-                        <version>${version.eap.maven.plugin}</version>
-                        <configuration>
-                            <feature-packs>
-                                <feature-pack>
-                                    <location>org.jboss.eap:wildfly-ee-galleon-pack</location>
-                                </feature-pack>
-                                <feature-pack>
-                                    <location>org.jboss.eap.cloud:eap-cloud-galleon-pack</location>
-                                </feature-pack>
-                            </feature-packs>
-                            <layers>
-                                <layer>cloud-server</layer>
-                            </layers>
-                            <filename>ROOT.war</filename>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>package</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-
-
-
- - - - - -
-
Note
-
-
-

Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the /cmt path segment after HOST:PORT.

-
-
-
-
-
-

Getting Started with JBoss EAP for OpenShift and Helm Charts

-
-

This section contains the basic instructions to build and deploy this quickstart to JBoss EAP for OpenShift or JBoss EAP for OpenShift Online using Helm Charts.

-
-
-

Prerequisites

-
-
    -
  • -

    You must be logged in OpenShift and have an oc client to connect to OpenShift

    -
  • -
  • -

    Helm must be installed to deploy the backend on OpenShift.

    -
  • -
-
-
-

Once you have installed Helm, you need to add the repository that provides Helm Charts for JBoss EAP.

-
-
-
-
$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/
-"jboss-eap" has been added to your repositories
-$ helm search repo jboss-eap
-NAME                    CHART VERSION   APP VERSION     DESCRIPTION
-jboss-eap/eap8         ...             ...             A Helm chart to build and deploy EAP 8.0 applications
-
-
-
-
-

Deploy the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

Log in to your OpenShift instance using the oc login command. -The backend will be built and deployed on OpenShift with a Helm Chart for JBoss EAP.

-
-
-

Navigate to the root directory of this quickstart and run the following command:

-
-
-
-
$ helm install cmt -f charts/helm.yaml jboss-eap/eap8
-NAME: cmt
-...
-STATUS: deployed
-REVISION: 1
-
-
-
-

The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17:

-
-
-
-
build:
-  uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git
-  ref: 8.0.x
-  contextDir: cmt
-deploy:
-  replicas: 1
-
-
-
-

This will create a new deployment on OpenShift and deploy the application.

-
-
-

If you want to see all the configuration elements to customize your deployment you can use the following command:

-
-
-
-
$ helm show readme jboss-eap/eap8
-
-
-
-

Let’s wait for the application to be built and deployed:

-
-
-
-
$ oc get deployment cmt -w
-NAME         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
-cmt   1         1         1            0           12s
-...
-cmt   1         1         1            1           2m
-
-
-
-

Get the URL of the route to the deployment.

-
-
-
-
$ oc get route cmt -o jsonpath="{.spec.host}"
-
-
-
-

Access the application in your web browser using the displayed URL.

-
-
- - - - - -
-
Note
-
-
-

The Maven profile named openshift is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the /cmt path segment after HOST:PORT.

-
-
-
-
-
-

Undeploy the JBoss EAP Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts

-
-
-
$ helm uninstall cmt
-
-
-
-
-
-

Run the Arquillian Integration Tests with OpenShift

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
- - - - - -
-
Note
-
-
-

The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin.

-
-
-
-
-

Run the integration tests using the following command to run the verify goal with the arq-remote profile activated and the proper URL:

-
-
-
-
$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route cmt --template='{{ .spec.host }}')
-
-
-
- - - - - -
-
Note
-
-
-

The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from.

-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/cmt/charts/helm.yaml b/cmt/charts/helm.yaml deleted file mode 100644 index 4ed440d236..0000000000 --- a/cmt/charts/helm.yaml +++ /dev/null @@ -1,6 +0,0 @@ -build: - uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git - ref: 8.0.x - contextDir: cmt -deploy: - replicas: 1 \ No newline at end of file diff --git a/cmt/pom.xml b/cmt/pom.xml deleted file mode 100644 index 8f86490b32..0000000000 --- a/cmt/pom.xml +++ /dev/null @@ -1,280 +0,0 @@ - - - - 4.0.0 - - org.jboss.eap.quickstarts - jboss-eap-quickstart-parent - - 6.0.0.redhat-00001 - - - cmt - 8.0.0.GA - war - Quickstart: cmt - This project demonstrates how to use transactions managed by the container - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - 8.0.0.GA-redhat-00009 - 1.0.0.Final-redhat-00014 - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - never - - default - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - never - - - true - never - - default - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - - - true - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - - - true - - - - - - - - - org.jboss.bom - jboss-eap-ee-with-tools - ${version.server.bom} - pom - import - - - - - - - - jakarta.inject - jakarta.inject-api - provided - - - - - jakarta.persistence - jakarta.persistence-api - provided - - - - jakarta.ejb - jakarta.ejb-api - provided - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - - jakarta.faces - jakarta.faces-api - provided - - - - jakarta.jms - jakarta.jms-api - provided - - - - jakarta.transaction - jakarta.transaction-api - provided - - - jakarta.annotation - jakarta.annotation-api - provided - - - - - - junit - junit - test - - - org.jboss.arquillian.container - arquillian-container-test-api - test - jar - - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet-jakarta - test - - - org.wildfly.arquillian - wildfly-arquillian-common - test - - - org.wildfly.arquillian - wildfly-arquillian-container-managed - test - - - - - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - - org.jboss.eap.channels - eap-8.0 - - - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - ejb - jsf - embedded-activemq - h2-default-datasource - - ROOT.war - - - - - package - - - - - - - - - arq-remote - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} - - - **/RemoteCustomerIT - - - **/ProvisionedManagedCustomerIT - - - - - - integration-test - verify - - - - - - - - - diff --git a/cmt/scripts/embedded-broker.cli b/cmt/scripts/embedded-broker.cli deleted file mode 100644 index 265c11be65..0000000000 --- a/cmt/scripts/embedded-broker.cli +++ /dev/null @@ -1,14 +0,0 @@ -if (outcome == success) of /subsystem=messaging-activemq:read-resource - /subsystem=messaging-activemq/server=default:add(elytron-domain=ApplicationDomain) -end-if -if (outcome == success) of /subsystem=messaging-activemq/server=default:read-resource - /subsystem=messaging-activemq/server=default/in-vm-acceptor=in-vm:add(server-id=0, params=[buffer-pooling=false]) - /subsystem=messaging-activemq/server=default/in-vm-connector=in-vm:add(server-id=0, params=[buffer-pooling=false]) - /subsystem=messaging-activemq/server=default/pooled-connection-factory=activemq-ra:add(connectors=[in-vm], transaction=xa, entries=[java:/JmsXA,java:jboss/DefaultJMSConnectionFactory]) - /subsystem=messaging-activemq/server=default/jms-queue=DLQ:add(entries=[java:/jms/queue/DLQ]) - /subsystem=messaging-activemq/server=default/jms-queue=ExpiryQueue:add(entries=[java:/jms/queue/ExpiryQueue]) - /subsystem=messaging-activemq/server=default/address-setting=#:add(dead-letter-address=jms.queue.DLQ, expiry-address=jms.queue.ExpiryQueue) -end-if -if (outcome == success) of /subsystem=ee/service=default-bindings:read-resource - /subsystem=ee/service=default-bindings:write-attribute(name="jms-connection-factory", value="java:jboss/DefaultJMSConnectionFactory") -end-if \ No newline at end of file diff --git a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/controller/CustomerManager.java b/cmt/src/main/java/org/jboss/as/quickstarts/cmt/controller/CustomerManager.java deleted file mode 100644 index b323971296..0000000000 --- a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/controller/CustomerManager.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.cmt.controller; - -import java.util.List; -import java.util.logging.Logger; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import javax.naming.NamingException; -import jakarta.transaction.HeuristicMixedException; -import jakarta.transaction.HeuristicRollbackException; -import jakarta.transaction.NotSupportedException; -import jakarta.transaction.RollbackException; -import jakarta.transaction.SystemException; - -import org.jboss.as.quickstarts.cmt.ejb.CustomerManagerEJB; -import org.jboss.as.quickstarts.cmt.model.Customer; - -@Named("customerManager") -@RequestScoped -public class CustomerManager { - private Logger logger = Logger.getLogger(CustomerManager.class.getName()); - private String name; - - @Inject - private CustomerManagerEJB customerManager; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public List getCustomers() throws SecurityException, IllegalStateException, NamingException, - NotSupportedException, SystemException, RollbackException, HeuristicMixedException, HeuristicRollbackException { - return customerManager.listCustomers(); - } - - public String addCustomer() { - try { - customerManager.createCustomer(name); - return "customerAdded"; - } catch (Exception e) { - if (e.getMessage().contains("Invalid name")) { - logger.warning("Invalid name: " + e.getMessage()); - return "customerInvalidName"; - } - logger.warning("Caught a duplicate: " + e.getMessage()); - // Transaction will be marked rollback only anyway utx.rollback(); - return "customerDuplicate"; - } - } -} diff --git a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/controller/LogMessageManager.java b/cmt/src/main/java/org/jboss/as/quickstarts/cmt/controller/LogMessageManager.java deleted file mode 100644 index 51bc1637d9..0000000000 --- a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/controller/LogMessageManager.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.cmt.controller; - -import java.util.List; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import javax.naming.NamingException; -import jakarta.transaction.HeuristicMixedException; -import jakarta.transaction.HeuristicRollbackException; -import jakarta.transaction.NotSupportedException; -import jakarta.transaction.RollbackException; -import jakarta.transaction.SystemException; - -import org.jboss.as.quickstarts.cmt.ejb.LogMessageManagerEJB; -import org.jboss.as.quickstarts.cmt.model.LogMessage; - -@Named("logMessageManager") -@RequestScoped -public class LogMessageManager { - @Inject - private LogMessageManagerEJB logMessageManager; - - public List getLogMessages() throws SecurityException, IllegalStateException, - NamingException, NotSupportedException, SystemException, RollbackException, - HeuristicMixedException, HeuristicRollbackException { - return logMessageManager.listLogMessages(); - } -} diff --git a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/ejb/CustomerManagerEJB.java b/cmt/src/main/java/org/jboss/as/quickstarts/cmt/ejb/CustomerManagerEJB.java deleted file mode 100644 index 78b57851a0..0000000000 --- a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/ejb/CustomerManagerEJB.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.cmt.ejb; - -import java.rmi.RemoteException; -import java.util.List; - -import jakarta.ejb.EJBException; -import jakarta.ejb.Stateless; -import jakarta.ejb.TransactionAttribute; -import jakarta.ejb.TransactionAttributeType; -import jakarta.inject.Inject; -import jakarta.jms.JMSException; -import javax.naming.NamingException; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; -import jakarta.transaction.HeuristicMixedException; -import jakarta.transaction.HeuristicRollbackException; -import jakarta.transaction.NotSupportedException; -import jakarta.transaction.RollbackException; -import jakarta.transaction.SystemException; - -import org.jboss.as.quickstarts.cmt.model.Customer; - -@Stateless -public class CustomerManagerEJB { - - @PersistenceContext - private EntityManager entityManager; - - @Inject - private LogMessageManagerEJB logMessageManager; - - @Inject - private InvoiceManagerEJB invoiceManager; - - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void createCustomer(String name) throws RemoteException, JMSException { - logMessageManager.logCreateCustomer(name); - - Customer c1 = new Customer(); - c1.setName(name); - entityManager.persist(c1); - - invoiceManager.createInvoice(name); - - // It could be done before all the 'storing' but this is just to show that - // the invoice is not delivered when we cause an EJBException - // after the fact but before the transaction is committed. - if (!nameIsValid(name)) { - throw new EJBException("Invalid name: customer names should only contain letters & '-'"); - } - } - - static boolean nameIsValid(String name) { - return name.matches("[\\p{L}-]+"); - } - - /** - * List all the customers. - * - * @return - * @throws NamingException - * @throws NotSupportedException - * @throws SystemException - * @throws SecurityException - * @throws IllegalStateException - * @throws RollbackException - * @throws HeuristicMixedException - * @throws HeuristicRollbackException - */ - @TransactionAttribute(TransactionAttributeType.NEVER) - @SuppressWarnings("unchecked") - public List listCustomers() { - return entityManager.createQuery("select c from Customer c").getResultList(); - } -} diff --git a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/ejb/InvoiceManagerEJB.java b/cmt/src/main/java/org/jboss/as/quickstarts/cmt/ejb/InvoiceManagerEJB.java deleted file mode 100644 index 2c9866a8a1..0000000000 --- a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/ejb/InvoiceManagerEJB.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.cmt.ejb; - -import jakarta.annotation.Resource; -import jakarta.ejb.Stateless; -import jakarta.ejb.TransactionAttribute; -import jakarta.ejb.TransactionAttributeType; -import jakarta.inject.Inject; -import jakarta.jms.JMSConnectionFactory; -import jakarta.jms.JMSContext; -import jakarta.jms.Queue; - -@Stateless -public class InvoiceManagerEJB { - - @Inject - @JMSConnectionFactory("java:/JmsXA") - private JMSContext jmsContext; - - @Resource(lookup = "java:/queue/CMTQueue") - private Queue queue; - - @TransactionAttribute(TransactionAttributeType.MANDATORY) - public void createInvoice(String name) { - jmsContext.createProducer() - .send(queue, "Created invoice for customer named: " + name); - } -} diff --git a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/ejb/LogMessageManagerEJB.java b/cmt/src/main/java/org/jboss/as/quickstarts/cmt/ejb/LogMessageManagerEJB.java deleted file mode 100644 index 7d6a73661f..0000000000 --- a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/ejb/LogMessageManagerEJB.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.cmt.ejb; - -import java.rmi.RemoteException; -import java.util.List; - -import jakarta.ejb.Stateless; -import jakarta.ejb.TransactionAttribute; -import jakarta.ejb.TransactionAttributeType; -import jakarta.jms.JMSException; -import javax.naming.NamingException; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; -import jakarta.transaction.HeuristicMixedException; -import jakarta.transaction.HeuristicRollbackException; -import jakarta.transaction.NotSupportedException; -import jakarta.transaction.RollbackException; -import jakarta.transaction.SystemException; - -import org.jboss.as.quickstarts.cmt.model.LogMessage; - -@Stateless -public class LogMessageManagerEJB { - @PersistenceContext - private EntityManager entityManager; - - @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) - public void logCreateCustomer(String name) throws RemoteException, JMSException { - LogMessage lm = new LogMessage(); - lm.setMessage("Attempt to create record for customer: '" + name + "'"); - entityManager.persist(lm); - } - - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void blaMethod() throws RemoteException, JMSException { - logCreateCustomer("Niks"); - } - - /** - * List all the log-messages. - * - * @return - * @throws NamingException - * @throws NotSupportedException - * @throws SystemException - * @throws SecurityException - * @throws IllegalStateException - * @throws RollbackException - * @throws HeuristicMixedException - * @throws HeuristicRollbackException - */ - @TransactionAttribute(TransactionAttributeType.NEVER) - @SuppressWarnings("unchecked") - public List listLogMessages() { - return entityManager.createQuery("select lm from LogMessage lm").getResultList(); - } -} diff --git a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/mdb/HelloWorldMDB.java b/cmt/src/main/java/org/jboss/as/quickstarts/cmt/mdb/HelloWorldMDB.java deleted file mode 100644 index b1baa80802..0000000000 --- a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/mdb/HelloWorldMDB.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.cmt.mdb; - -import java.util.logging.Logger; - -import jakarta.ejb.ActivationConfigProperty; -import jakarta.ejb.MessageDriven; -import jakarta.jms.JMSException; -import jakarta.jms.Message; -import jakarta.jms.MessageListener; -import jakarta.jms.TextMessage; - -/** - *

- * A simple Message Driven Bean that asynchronously receives and processes the messages that are sent to the queue. - *

- * - * @author Serge Pagop (spagop@redhat.com) - * - */ -@MessageDriven(name = "HelloWorldMDB", activationConfig = { - @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "jakarta.jms.Queue"), - @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/CMTQueue"), - @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge") }) -public class HelloWorldMDB implements MessageListener { - - private static final Logger LOGGER = Logger.getLogger(HelloWorldMDB.class.toString()); - - /** - * @see MessageListener#onMessage(Message) - */ - public void onMessage(Message rcvMessage) { - TextMessage msg = null; - try { - if (rcvMessage instanceof TextMessage) { - msg = (TextMessage) rcvMessage; - LOGGER.info("Received Message: " + msg.getText()); - } else { - LOGGER.warning("Message of wrong type: " + rcvMessage.getClass().getName()); - } - } catch (JMSException e) { - throw new RuntimeException(e); - } - } -} diff --git a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/model/Customer.java b/cmt/src/main/java/org/jboss/as/quickstarts/cmt/model/Customer.java deleted file mode 100644 index a003cfdaaf..0000000000 --- a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/model/Customer.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.cmt.model; - -import java.io.Serializable; - -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; -import jakarta.persistence.Table; - -@Entity -@Table(name = "Customer") -public class Customer implements Serializable { - - /** Default value included to remove warning. **/ - private static final long serialVersionUID = 1L; - - @Id - @GeneratedValue - private int id; - - @Column(unique = true, nullable = false) - private String name; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/model/LogMessage.java b/cmt/src/main/java/org/jboss/as/quickstarts/cmt/model/LogMessage.java deleted file mode 100644 index 6d203a72cd..0000000000 --- a/cmt/src/main/java/org/jboss/as/quickstarts/cmt/model/LogMessage.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.cmt.model; - -import java.io.Serializable; - -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; -import jakarta.persistence.Table; - -@Entity -@Table(name = "LogMessage") -public class LogMessage implements Serializable { - private static final long serialVersionUID = 1L; - - @Id - @GeneratedValue - private int id; - - @Column(unique = true, nullable = false) - private String message; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getMessage() { - return message; - } - - public void setMessage(String name) { - this.message = name; - } -} diff --git a/cmt/src/main/resources/META-INF/persistence.xml b/cmt/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index 677fd3fa6f..0000000000 --- a/cmt/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - diff --git a/cmt/src/main/resources/import.sql b/cmt/src/main/resources/import.sql deleted file mode 100644 index 5aa2cd1b99..0000000000 --- a/cmt/src/main/resources/import.sql +++ /dev/null @@ -1,19 +0,0 @@ --- --- JBoss, Home of Professional Open Source --- Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual --- contributors by the @authors tag. See the copyright.txt in the --- distribution for a full listing of individual contributors. --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- http://www.apache.org/licenses/LICENSE-2.0 --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- - --- You can use this file to load seed data into the database using SQL statements -insert into Customer (id, name) values (0, 'TomJ') diff --git a/cmt/src/main/webapp/WEB-INF/activemq-jms.xml b/cmt/src/main/webapp/WEB-INF/activemq-jms.xml deleted file mode 100644 index eba90eb82a..0000000000 --- a/cmt/src/main/webapp/WEB-INF/activemq-jms.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - diff --git a/cmt/src/main/webapp/WEB-INF/faces-config.xml b/cmt/src/main/webapp/WEB-INF/faces-config.xml deleted file mode 100644 index 84488dc5e5..0000000000 --- a/cmt/src/main/webapp/WEB-INF/faces-config.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - /addCustomer.xhtml - - #{customerManager.addCustomer} - customerAdded - /customers.xhtml - - - - #{customerManager.addCustomer} - customerDuplicate - /duplicate.xhtml - - - - #{customerManager.addCustomer} - customerInvalidName - /invalidName.xhtml - - - - - diff --git a/cmt/src/main/webapp/addCustomer.xhtml b/cmt/src/main/webapp/addCustomer.xhtml deleted file mode 100644 index ae8f609a51..0000000000 --- a/cmt/src/main/webapp/addCustomer.xhtml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - Name: - - - - - -
    -
  • List customers
  • -
  • List log messages
  • -
-
-
- diff --git a/cmt/src/main/webapp/customers.xhtml b/cmt/src/main/webapp/customers.xhtml deleted file mode 100644 index 19334251c2..0000000000 --- a/cmt/src/main/webapp/customers.xhtml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - -

List of customers

- - - - Name - - - - - - Id - - - - - Go Back -
-
- diff --git a/cmt/src/main/webapp/duplicate.xhtml b/cmt/src/main/webapp/duplicate.xhtml deleted file mode 100644 index 76e0000949..0000000000 --- a/cmt/src/main/webapp/duplicate.xhtml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - -

Customer Already Existed

- - Go back -
-
- diff --git a/cmt/src/main/webapp/index.html b/cmt/src/main/webapp/index.html deleted file mode 100644 index a78a0b2bfe..0000000000 --- a/cmt/src/main/webapp/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - diff --git a/cmt/src/main/webapp/invalidName.xhtml b/cmt/src/main/webapp/invalidName.xhtml deleted file mode 100644 index f92e323265..0000000000 --- a/cmt/src/main/webapp/invalidName.xhtml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - -

Name of the customer is invalid

- - Go back -
-
- diff --git a/cmt/src/main/webapp/logMessages.xhtml b/cmt/src/main/webapp/logMessages.xhtml deleted file mode 100644 index 1601d2b6cc..0000000000 --- a/cmt/src/main/webapp/logMessages.xhtml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - -

List of log-messages

- - - - Message - - - - - - Id - - - - - Go Back -
-
- diff --git a/cmt/src/main/webapp/template.xhtml b/cmt/src/main/webapp/template.xhtml deleted file mode 100644 index edebe920c9..0000000000 --- a/cmt/src/main/webapp/template.xhtml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - cmt - - - - - -

Customer Database

-
- - - - -
- -
- -
-
- - - diff --git a/cmt/src/test/java/org/jboss/as/quickstarts/cmt/ProvisionedManagedCustomerIT.java b/cmt/src/test/java/org/jboss/as/quickstarts/cmt/ProvisionedManagedCustomerIT.java deleted file mode 100644 index 24bbcc1859..0000000000 --- a/cmt/src/test/java/org/jboss/as/quickstarts/cmt/ProvisionedManagedCustomerIT.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.cmt; - - -import java.net.URI; -import java.net.URISyntaxException; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.junit.Test; - -import org.junit.runner.RunWith; - -@RunWith(Arquillian.class) -@RunAsClient -public class ProvisionedManagedCustomerIT extends RemoteCustomerIT { - - @Override - protected URI getHTTPEndpoint(String path) { - String host = getServerHost(); - if (host == null) { - host = "http://localhost:8080/"; - } - try { - return new URI(host + path); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } - - @Test - @Override - public void testAddCustomer() throws Exception { - addCustomer("LisaS"); - } - -} diff --git a/cmt/src/test/java/org/jboss/as/quickstarts/cmt/RemoteCustomerIT.java b/cmt/src/test/java/org/jboss/as/quickstarts/cmt/RemoteCustomerIT.java deleted file mode 100644 index f8688e20f8..0000000000 --- a/cmt/src/test/java/org/jboss/as/quickstarts/cmt/RemoteCustomerIT.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.cmt; - -import java.io.IOException; -import java.net.CookieManager; -import java.net.CookiePolicy; -import java.util.logging.Logger; - -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URLEncoder; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.net.http.HttpRequest.BodyPublisher; -import java.net.http.HttpRequest.BodyPublishers; -import java.net.http.HttpResponse; -import java.nio.charset.StandardCharsets; -import java.util.Map; -import org.junit.Assert; -import org.junit.Test; - - -public class RemoteCustomerIT { - - private static final Logger log = Logger.getLogger(RemoteCustomerIT.class.getName()); - - protected URI getHTTPEndpoint(String path) { - String host = getServerHost(); - if (host == null) { - host = "http://localhost:8080/cmt"; - } - try { - return new URI(host + path); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } - - protected String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host"); - } - return host; - } - - @Test - public void testAddCustomer() throws Exception { - addCustomer("BartS"); - } - - public void addCustomer(String name) throws IOException, InterruptedException { - CookieManager manager = new CookieManager(null, CookiePolicy.ACCEPT_ALL); - HttpClient client = HttpClient.newBuilder() - .followRedirects(HttpClient.Redirect.ALWAYS) - .cookieHandler(manager) - .version(HttpClient.Version.HTTP_1_1) - .build(); - HttpResponse response = client.send(HttpRequest.newBuilder(getHTTPEndpoint("/addCustomer.jsf")).GET().build(), HttpResponse.BodyHandlers.ofString()); - String body = response.body().toString(); - Assert.assertEquals(200, response.statusCode()); - Assert.assertTrue(body, body.contains(" data) { - StringBuilder builder = new StringBuilder(); - for (Map.Entry entry : data.entrySet()) { - if (builder.length() > 0) { - builder.append("&"); - } - builder.append(URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8)); - builder.append("="); - builder.append(URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8)); - } - return BodyPublishers.ofString(builder.toString()); - } - -} diff --git a/cmt/src/test/java/org/jboss/as/quickstarts/cmt/ejb/CustomerManagerEJBTest.java b/cmt/src/test/java/org/jboss/as/quickstarts/cmt/ejb/CustomerManagerEJBTest.java deleted file mode 100644 index 1c16ba6d2f..0000000000 --- a/cmt/src/test/java/org/jboss/as/quickstarts/cmt/ejb/CustomerManagerEJBTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.cmt.ejb; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -public class CustomerManagerEJBTest { - @Test - public void testNameIsValid() { - assertTrue(CustomerManagerEJB.nameIsValid("Jan")); - assertFalse(CustomerManagerEJB.nameIsValid("Jan1")); - assertTrue(CustomerManagerEJB.nameIsValid("Jan-Piet")); - assertFalse(CustomerManagerEJB.nameIsValid("Jan_Piet")); - assertTrue(CustomerManagerEJB.nameIsValid("gefräßig")); - } -} diff --git a/ee-security/README-source.adoc b/ee-security/README-source.adoc deleted file mode 100644 index cabe47c770..0000000000 --- a/ee-security/README-source.adoc +++ /dev/null @@ -1,131 +0,0 @@ -include::../shared-doc/attributes.adoc[] - -= ee-security: Using Jakarta EE Security -:author: Darran Lofthouse -:level: Intermediate -:technologies: EE Security, Servlet, CDI -:openshift: true - -[abstract] -The `ee-security` quickstart demonstrates Jakarta EE security. - -:standalone-server-type: default -:archiveType: war -:restoreScriptName: restore-configuration.cli - -== What is it? - -The `ee-security` quickstart is an example project showing the use of Jakarta EE security in {productNameFull}. - -The deployment in this quickstart contains a simple HTTP servlet, which is secured using a custom `HttpAuthenticationMechanism`. The authentication mechanism in turn makes use of a custom `IdentityStore`. - -This quickstart is hard coded to work with a user `quickstartUser` with password `quickstartPwd1!`. - -// System Requirements -include::../shared-doc/system-requirements.adoc[leveloffset=+1] -// Use of {jbossHomeName} -include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1] - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Back Up the {productName} Standalone Server Configuration -include::../shared-doc/back-up-server-standalone-configuration.adoc[leveloffset=+2] -// Start the {productName} Standalone Server -include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+2] - -[[configure_the_server]] -=== Configure the Server - -You configure the security domain by running JBoss CLI commands. For your convenience, this quickstart batches the commands into a `configure-elytron.cli` script provided in the root directory of this quickstart. - -. Before you begin, make sure you do the following: - -* xref:back_up_standalone_server_configuration[Back up the {productName} standalone server configuration] as described above. -* xref:start_the_eap_standalone_server[Start the {productName} server with the standalone default profile] as described above. - -. Review the `configure-elytron.cli` file in the root of this quickstart directory. This script adds the configuration that enables Elytron security for the quickstart components. Comments in the script describe the purpose of each block of commands. -. Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing `__{jbossHomeName}__` with the path to your server: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=configure-elytron.cli ----- -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. -+ - -You should see the following result when you run the script: -+ -[source,options="nowrap"] ----- -The batch executed successfully -process-state: reload-required ----- - -. You'll need to reload the configuration after that: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --commands=reload ----- - -// Build and Deploy the Quickstart -include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+2] - -=== Access the Application - -The application will be running at the following URL: http://localhost:8080/{artifactId}/secured - -NOTE: If you attempt to access that URL, you will see "Unauthorized". - -To see and manipulate the HTTP headers within the HTTP requests, it is recommended to use a client like `curl` to invoke the servlet. - -[source,options="nowrap"] ----- -$ curl -v http://localhost:8080/ee-security/secured -... -< HTTP/1.1 401 Unauthorized -< Connection: keep-alive -< X-MESSAGE: Please resubmit the request with a username specified using the X-USERNAME and a password specified using the X-PASSWORD header. ----- - -This first request shows the client is being prompted to authenticate. The `X-MESSAGE` header is providing additional information as to how the client can achieve this. - -The request can now be submitted with the previously added user. - -[source,options="nowrap"] ----- -$ curl -v http://localhost:8080/ee-security/secured -H 'X-Username:quickstartUser' -H 'X-Password:quickstartPwd1!' -... -> GET /ee-security/secured HTTP/1.1 -> Host: localhost:8080 -> X-Username:quickstartUser -> X-Password:quickstartPwd1! -> -< HTTP/1.1 200 OK -< Connection: keep-alive -< Content-Length: 125 -< -SecuredServlet - doGet() -Identity as available from SecurityContext 'quickstartUser' -Identity as available from injection 'quickstartUser' ----- - -The resulting output shows authentication was successful and the correct identity has been established. - -// Testing with Arquillian -include::../shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc[leveloffset=+2] -// Undeploy the Quickstart -include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2] -// Restore the {productName} Standalone Server Configuration -include::../shared-doc/restore-standalone-server-configuration.adoc[leveloffset=+2] -// Restore the {productName} Standalone Server Configuration Manually -include::../shared-doc/restore-standalone-server-configuration-manual.adoc[leveloffset=+3] - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1] - diff --git a/ee-security/README.adoc b/ee-security/README.adoc deleted file mode 100644 index 45b6304fa0..0000000000 --- a/ee-security/README.adoc +++ /dev/null @@ -1,1104 +0,0 @@ -ifdef::env-github[] -:artifactId: ee-security -endif::[] - -//*********************************************************************************** -// Enable the following flag to build README.html files for JBoss EAP product builds. -// Comment it out for WildFly builds. -//*********************************************************************************** -:ProductRelease: - -//*********************************************************************************** -// Enable the following flag to build README.html files for EAP XP product builds. -// Comment it out for WildFly or JBoss EAP product builds. -//*********************************************************************************** -//:EAPXPRelease: - -// This is a universal name for all releases -:ProductShortName: JBoss EAP -// Product names and links are dependent on whether it is a product release (CD or JBoss) -// or the WildFly project. -// The "DocInfo*" attributes are used to build the book links to the product documentation - -ifdef::ProductRelease[] -// JBoss EAP release -:productName: JBoss EAP -:productNameFull: Red Hat JBoss Enterprise Application Platform -:productVersion: 8.0 -:DocInfoProductNumber: {productVersion} -:WildFlyQuickStartRepoTag: 8.0.x -:productImageVersion: 8.0.0 -:helmChartName: jboss-eap/eap8 -endif::[] - -ifdef::EAPXPRelease[] -// JBoss EAP XP release -:productName: JBoss EAP XP -:productNameFull: Red Hat JBoss Enterprise Application Platform expansion pack -:productVersion: 3.0 -:DocInfoProductNumber: 7.4 -:WildFlyQuickStartRepoTag: XP_3.0.0.GA -:productImageVersion: 3.0 -:helmChartName: jboss-eap/eap-xp3 -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -:githubRepoUrl: https://github.com/jboss-developer/jboss-eap-quickstarts/ -:githubRepoCodeUrl: https://github.com/jboss-developer/jboss-eap-quickstarts.git -:jbossHomeName: EAP_HOME -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:quickstartDownloadName: {productNameFull} {productVersion} Quickstarts -:quickstartDownloadUrl: https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=appplatform&downloadType=distributions -:helmRepoName: jboss-eap -:helmRepoUrl: https://jbossas.github.io/eap-charts/ -// END ifdef::ProductRelease,EAPXPRelease[] -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -// WildFly project -:productName: WildFly -:productNameFull: WildFly Application Server -:ProductShortName: {productName} -:jbossHomeName: WILDFLY_HOME -:productVersion: 28 -:productImageVersion: 28.0 -:githubRepoUrl: https://github.com/wildfly/quickstart/ -:githubRepoCodeUrl: https://github.com/wildfly/quickstart.git -:WildFlyQuickStartRepoTag: 28.0.1.Final -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -// Do not update the following until after the 7.4 docs are published! -:DocInfoProductNumber: 7.4 -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:helmRepoName: wildfly -:helmRepoUrl: http://docs.wildfly.org/wildfly-charts/ -:helmChartName: wildfly/wildfly -// END ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -endif::[] - -:source: {githubRepoUrl} - -// Values for Openshift S2i sections attributes -:CDProductName: {productNameFull} for OpenShift -:CDProductShortName: {ProductShortName} for OpenShift -:CDProductTitle: {CDProductName} -:CDProductNameSentence: Openshift release for {ProductShortName} -:CDProductAcronym: {CDProductShortName} -:CDProductVersion: {productVersion} -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {EapForOpenshiftBookName} Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {xpaasproduct} Online -:xpaasproduct-shortname: {CDProductShortName} -:xpaasproductOpenShiftOnline-shortname: {xpaasproduct-shortname} Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: Getting Started with {ProductShortName} for OpenShift Container Platform -:EapForOpenshiftOnlineBookName: Getting Started with {ProductShortName} for OpenShift Online -:OpenShiftOnlinePlatformName: Red Hat OpenShift Container Platform -:OpenShiftOnlineName: Red Hat OpenShift Online -:ImagePrefixVersion: eap80 -:ImageandTemplateImportBaseURL: https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift - -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepo: https://github.com/jboss-developer/jboss-eap-quickstarts -:EAPQuickStartRepoRef: 8.0.x -:EAPQuickStartRepoTag: EAP_8.0.0.GA -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_container_platform/ -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_online/ - -ifdef::EAPXPRelease[] -// Attributes for XP releases -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {productNameFull} for OpenShift Online -:xpaasproduct-shortname: {ProductShortName} for OpenShift -:xpaasproductOpenShiftOnline-shortname: {ProductShortName} for OpenShift Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:ImagePrefixVersion: eap-xp3 -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepoRef: xp-3.0.x -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -endif::[] - -ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -:ImageandTemplateImportURL: https://raw.githubusercontent.com/wildfly/wildfly-s2i/v{productVersion}.0/ -endif::[] - -//************************* -// Other values -//************************* -:buildRequirements: Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later -:jbdsEapServerName: Red Hat JBoss Enterprise Application Platform 7.3 -:javaVersion: Jakarta EE 10 -ifdef::EAPXPRelease[] -:javaVersion: Eclipse MicroProfile -endif::[] -:githubRepoBranch: master -:guidesBaseUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/ -:useEclipseUrl: {guidesBaseUrl}USE_JBDS.adoc#use_red_hat_jboss_developer_studio_or_eclipse_to_run_the_quickstarts -:useEclipseDeployJavaClientDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_containing_server_and_java_client_projects -:useEclipseDeployEARDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_ear_project -:useProductHomeDocUrl: {guidesBaseUrl}USE_OF_{jbossHomeName}.adoc#use_of_product_home_and_jboss_home_variables -:configureMavenDocUrl: {guidesBaseUrl}CONFIGURE_MAVEN_JBOSS_EAP.adoc#configure_maven_to_build_and_deploy_the_quickstarts -:arquillianTestsDocUrl: {guidesBaseUrl}RUN_ARQUILLIAN_TESTS.adoc#run_the_arquillian_tests -:addUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#create_users_required_by_the_quickstarts -:addApplicationUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_application_user -:addManagementUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_management_user -:startServerDocUrl: {guidesBaseUrl}START_JBOSS_EAP.adoc#start_the_jboss_eap_server -:configurePostgresDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_database_for_use_with_the_quickstarts -:configurePostgresDownloadDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#download_and_install_postgresql -:configurePostgresCreateUserDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#create_a_database_user -:configurePostgresAddModuleDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#add_the_postgres_module_to_the_jboss_eap_server -:configurePostgresDriverDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_driver_in_the_jboss_eap_server -:configureBytemanDownloadDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#download_and_configure_byteman -:configureBytemanDisableDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#disable_the_byteman_script -:configureBytemanClearDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#clear_the_transaction_object_store -:configureBytemanQuickstartDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts -:configureBytemanHaltDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#use_byteman_to_halt_the_application[ -:configureBytemanQuickstartsDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts - -:EESubsystemNamespace: urn:jboss:domain:ee:4.0 -:IiopOpenJdkSubsystemNamespace: urn:jboss:domain:iiop-openjdk:2.0 -:MailSubsystemNamespace: urn:jboss:domain:mail:3.0 -:SingletonSubsystemNamespace: urn:jboss:domain:singleton:1.0 -:TransactionsSubsystemNamespace: urn:jboss:domain:transactions:4.0 - -// LinkProductDocHome: https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/ -:LinkProductDocHome: https://access.redhat.com/documentation/en/jboss-enterprise-application-platform-continuous-delivery -:LinkConfigGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/configuration_guide/ -:LinkDevelopmentGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/development_guide/ -:LinkGettingStartedGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_guide/ -:LinkOpenShiftWelcome: https://docs.openshift.com/online/welcome/index.html -:LinkOpenShiftSignup: https://docs.openshift.com/online/getting_started/choose_a_plan.html -:OpenShiftTemplateName: JBoss EAP CD (no https) - -:ConfigBookName: Configuration Guide -:DevelopmentBookName: Development Guide -:GettingStartedBookName: Getting Started Guide - -:JBDSProductName: Red Hat CodeReady Studio -:JBDSVersion: 12.15 -:LinkJBDSInstall: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/installation_guide/ -:JBDSInstallBookName: Installation Guide -:LinkJBDSGettingStarted: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/getting_started_with_codeready_studio_tools/ -:JBDSGettingStartedBookName: Getting Started with CodeReady Studio Tools - -= ee-security: Using Jakarta EE Security -:author: Darran Lofthouse -:level: Intermediate -:technologies: EE Security, Servlet, CDI -:openshift: true - -[abstract] -The `ee-security` quickstart demonstrates Jakarta EE security. - -:standalone-server-type: default -:archiveType: war -:restoreScriptName: restore-configuration.cli - -== What is it? - -The `ee-security` quickstart is an example project showing the use of Jakarta EE security in {productNameFull}. - -The deployment in this quickstart contains a simple HTTP servlet, which is secured using a custom `HttpAuthenticationMechanism`. The authentication mechanism in turn makes use of a custom `IdentityStore`. - -This quickstart is hard coded to work with a user `quickstartUser` with password `quickstartPwd1!`. - -// System Requirements -:leveloffset: +1 - -[[system_requirements]] -= System Requirements -//****************************************************************************** -// Include this template to describe the standard system requirements for -// running the quickstarts. -// -// The Forge quickstarts define a `forge-from-scratch` attribute because they -// run entirely in CodeReady Studio and have different requirements . -//****************************************************************************** - -The application this project produces is designed to be run on {productNameFull} {productVersion} or later. - -All you need to build this project is {buildRequirements}. See link:{configureMavenDocUrl}[Configure Maven to Build and Deploy the Quickstarts] to make sure you are configured correctly for testing the quickstarts. - -:leveloffset!: -// Use of {jbossHomeName} -:leveloffset: +1 - -ifdef::requires-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -This quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifdef::optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -When deploying this quickstart to a managed domain, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When deploying this quickstart to multiple standalone servers, this quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifndef::requires-multiple-servers,optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName} and QUICKSTART_HOME Variables - -In the following instructions, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -:leveloffset!: - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Back Up the {productName} Standalone Server Configuration -:leveloffset: +2 - -[[back_up_standalone_server_configuration]] -= Back Up the {productName} Standalone Server Configuration -//****************************************************************************** -// Include this template if your quickstart runs in a standalone server and -// needs to back up the server configuration file before running -// a CLI script to modify the server. -//****************************************************************************** -// Define the attributes needed for this topic. -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -Before you begin, back up your server configuration file. - -. If it is running, stop the {productName} server. -. Back up the `__{jbossHomeName}__/{configFileName}` file. - -After you have completed testing this quickstart, you can replace this file to restore the server to its original configuration. - -:leveloffset!: -// Start the {productName} Standalone Server -:leveloffset: +2 - -[[start_the_eap_standalone_server]] -= Start the {productName} Standalone Server -//****************************************************************************** -// Include this template if your quickstart requires a normal start of a single -// standalone server. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// custom -// -// * For mobile applications, you can define the `mobileApp` variable in the -// `README.adoc` file to add `-b 0.0.0.0` to the command line. This allows -// external clients, such as phones, tablets, and desktops, to connect -// to the application through through your local network -// ::mobileApp: {artifactId}-service -// -//****************************************************************************** - -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -. Open a terminal and navigate to the root of the {productName} directory. -. Start the {productName} server with the {serverProfile} by typing the following command. -+ -ifdef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __JAEGER_REPORTER_LOG_SPANS=true JAEGER_SAMPLER_TYPE=const JAEGER_SAMPLER_PARAM=1__ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -ifndef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\standalone.bat` script. - -ifdef::mobileApp[] -+ -Adding `-b 0.0.0.0` to the above command allows external clients, such as phones, tablets, and desktops, to connect through your local network. For example: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} -b 0.0.0.0 ----- -endif::[] - -:leveloffset!: - -[[configure_the_server]] -=== Configure the Server - -You configure the security domain by running JBoss CLI commands. For your convenience, this quickstart batches the commands into a `configure-elytron.cli` script provided in the root directory of this quickstart. - -. Before you begin, make sure you do the following: - -* xref:back_up_standalone_server_configuration[Back up the {productName} standalone server configuration] as described above. -* xref:start_the_eap_standalone_server[Start the {productName} server with the standalone default profile] as described above. - -. Review the `configure-elytron.cli` file in the root of this quickstart directory. This script adds the configuration that enables Elytron security for the quickstart components. Comments in the script describe the purpose of each block of commands. -. Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing `__{jbossHomeName}__` with the path to your server: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=configure-elytron.cli ----- -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. -+ - -You should see the following result when you run the script: -+ -[source,options="nowrap"] ----- -The batch executed successfully -process-state: reload-required ----- - -. You'll need to reload the configuration after that: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --commands=reload ----- - -// Build and Deploy the Quickstart -:leveloffset: +2 - -[[build_and_deploy_the_quickstart]] -= Build and Deploy the Quickstart -//****************************************************************************** -// Include this template if your quickstart does a normal deployment of a archive. -// -// * Define the `archiveType` variable in the quickstart README file. -// Supported values: -// :archiveType: ear -// :archiveType: war -// :archiveType: jar -// -// * To override the archive name, which defaults to the {artifactId), -// define the `archiveName` variable, for example: -// :archiveName: {artifactId}-service -// -// * To override the archive output directory, -// define the `archiveDir` variable, for example: -// :archiveDir: ear/target -// -// * To override the Maven command, define the `mavenCommand` variable, -// for example: -// :mavenCommand: clean install wildfly:deploy -//****************************************************************************** - -// The archive name defaults to the artifactId if not overridden -ifndef::archiveName[] -:archiveName: {artifactId} -endif::archiveName[] - -// The archive type defaults to war if not overridden -ifndef::archiveType[] -:archiveType: war -endif::archiveType[] - -// Define the archive file name as the concatenation of "archiveName" + "." + "archiveType+ -:archiveFileName: {archiveName}.{archiveType} - -// If they have not defined the target archive directory, make it the default for the archive type. -ifndef::archiveDir[] - -ifeval::["{archiveType}"=="ear"] -:archiveDir: {artifactId}/ear/target -endif::[] - -ifeval::["{archiveType}"=="war"] -:archiveDir: {artifactId}/target -endif::[] - -ifeval::["{archiveType}"=="jar"] -:archiveDir: {artifactId}/target -endif::[] - -endif::archiveDir[] - -ifndef::mavenCommand[] -ifeval::["{archiveType}"=="ear"] -:mavenCommand: clean install -endif::[] - -ifeval::["{archiveType}"=="war"] -:mavenCommand: clean package -endif::[] - -ifeval::["{archiveType}"=="jar"] -:mavenCommand: clean install -endif::[] - -endif::mavenCommand[] - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -ifdef::reactive-messaging[] -. Run this command to enable the MicroProfile Reactive Messaging functionality on the server -+ -[source,subs="attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=enable-reactive-messaging.cli ----- -endif::reactive-messaging[] -. Type the following command to build the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn {mavenCommand} ----- - -. Type the following command to deploy the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn wildfly:deploy ----- - -ifdef::rest-client-qs[] -This builds and deploys the `country-server` and `country-client` to the running instance of the server. - -You should see a message in the server log indicating that the archives deployed successfully. -endif::[] -ifndef::rest-client-qs[] -This deploys the `{archiveDir}/{archiveFileName}` to the running instance of the server. - -You should see a message in the server log indicating that the archive deployed successfully. -endif::[] - - -:leveloffset!: - -=== Access the Application - -The application will be running at the following URL: http://localhost:8080/{artifactId}/secured - -NOTE: If you attempt to access that URL, you will see "Unauthorized". - -To see and manipulate the HTTP headers within the HTTP requests, it is recommended to use a client like `curl` to invoke the servlet. - -[source,options="nowrap"] ----- -$ curl -v http://localhost:8080/ee-security/secured -... -< HTTP/1.1 401 Unauthorized -< Connection: keep-alive -< X-MESSAGE: Please resubmit the request with a username specified using the X-USERNAME and a password specified using the X-PASSWORD header. ----- - -This first request shows the client is being prompted to authenticate. The `X-MESSAGE` header is providing additional information as to how the client can achieve this. - -The request can now be submitted with the previously added user. - -[source,options="nowrap"] ----- -$ curl -v http://localhost:8080/ee-security/secured -H 'X-Username:quickstartUser' -H 'X-Password:quickstartPwd1!' -... -> GET /ee-security/secured HTTP/1.1 -> Host: localhost:8080 -> X-Username:quickstartUser -> X-Password:quickstartPwd1! -> -< HTTP/1.1 200 OK -< Connection: keep-alive -< Content-Length: 125 -< -SecuredServlet - doGet() -Identity as available from SecurityContext 'quickstartUser' -Identity as available from injection 'quickstartUser' ----- - -The resulting output shows authentication was successful and the correct identity has been established. - -// Testing with Arquillian -:leveloffset: +2 - -[[run_the_arquillian_integration_tests_with_server_distribution]] -= Run the Arquillian Integration Tests -//****************************************************************************** -// Include this template if your quickstart provides standard Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -Follow these steps to run the integration tests. - -. Make sure you start the {productName} server, as previously described. - -. Make sure you build and deploy the quickstart, as previously described. - -. Type the following command to run the `verify` goal with the `arq-remote` profile activated. -+ -[source,options="nowrap"] ----- -$ mvn verify -Parq-remote ----- - -[NOTE] -==== -You may also use the environment variable `SERVER_HOST` or the system property `server.host` to define the target host of the tests. -==== - -:leveloffset!: -// Undeploy the Quickstart -:leveloffset: +2 - -[[undeploy_the_quickstart]] -= Undeploy the Quickstart - -//******************************************************************************* -// Include this template if your quickstart does a normal undeployment of an archive. -//******************************************************************************* -When you are finished testing the quickstart, follow these steps to undeploy the archive. - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -. Type this command to undeploy the archive: -+ -[source,options="nowrap"] ----- -$ mvn wildfly:undeploy ----- - -:leveloffset!: -// Restore the {productName} Standalone Server Configuration -:leveloffset: +2 - -[[restore_the_standalone_server_configuration]] -= Restore the {productName} Standalone Server Configuration -//****************************************************************************** -// Include this template if your quickstart does a normal restoration of a single -// standalone server configuration. -// * It provides a CLI script. -// * You can manually restore the backup copy. -// -// You must define the script file name using the `restoreScriptName` attribute. -// For example: -// :restoreScriptName: remove-configuration.cli -//****************************************************************************** - -You can restore the original server configuration using either of the following methods. - -* You can xref:restore_standalone_server_configuration_using_cli[run the `{restoreScriptName}` script] provided in the root directory of this quickstart. -* You can xref:restore_standalone_server_configuration_manually[manually restore the configuration] using the backup copy of the configuration file. - -[[restore_standalone_server_configuration_using_cli]] -== Restore the {productName} Standalone Server Configuration by Running the JBoss CLI Script - -. xref:start_the_eap_standalone_server[Start the {productName} server] as described above. -. Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing `__{jbossHomeName}__` with the path to your server: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file={restoreScriptName} ----- -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. - -:leveloffset!: -// Restore the {productName} Standalone Server Configuration Manually -:leveloffset: +3 - -[[restore_standalone_server_configuration_manually]] -= Restore the {productName} Standalone Server Configuration Manually -//****************************************************************************** -// Include this template if your quickstart does a normal manual restoration -// of a single standalone server. -//****************************************************************************** - -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -When you have completed testing the quickstart, you can restore the original server configuration by manually restoring the backup copy the configuration file. - -. If it is running, stop the {productName} server. -. Replace the `__{jbossHomeName}__/{configFileName}` file with the backup copy of the file. - -:leveloffset!: - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -:leveloffset: +1 - -[[build_and_run_the_quickstart_on_openshift]] -= Building and running the quickstart application with OpenShift -// The openshift profile -:leveloffset: +1 - -[[build-the-quickstart-for-openshift]] -== Build the {productName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -On OpenShift, the S2I build with Apache Maven will use an `openshift` profile used to provision a {productName} server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named `openshift` when building the quickstart: - -[source,subs="attributes+",options="nowrap"] ----- -$ mvn clean package -Popenshift ----- - -The provisioned {productName} server for OpenShift, with the quickstart deployed, can then be found in the `target/server` directory, and its usage is similar to a standard server distribution. -ifndef::ProductRelease,EAPXPRelease[] -You may note that unlike the `provisioned-server` profile it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the WildFly Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.wildfly:wildfly-galleon-pack:${version.server} - - - org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp} - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -[NOTE] -==== -Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`. -==== - -:leveloffset: 1 -// Getting Started with Helm -:leveloffset: +1 - -[[getting_started_with_helm]] -= Getting Started with {xpaasproduct-shortname} and Helm Charts - -This section contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} using Helm Charts. - -[[prerequisites_helm_openshift]] -== Prerequisites - -* You must be logged in OpenShift and have an `oc` client to connect to OpenShift -* https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. - -Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}. - -ifndef::ProductRelease,EAPXPRelease[] -[source,options="nowrap"] ----- -$ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ -"wildfly" has been added to your repositories -$ helm search repo wildfly -NAME CHART VERSION APP VERSION DESCRIPTION -wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift -wildfly/wildfly-common ... ... A library chart for WildFly-based applications ----- -endif::[] -ifdef::ProductRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP {productVersion} applications ----- -endif::[] -ifdef::EAPXPRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP XP {productVersion} applications ----- -endif::[] - -:leveloffset: 1 -//Prepare Helm for Quickstart Deployment -:leveloffset: +1 - -[[deploy_helm]] -== Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -Log in to your OpenShift instance using the `oc login` command. -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -Navigate to the root directory of this quickstart and run the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm install {artifactId} -f charts/helm.yaml {helmChartName} -NAME: {artifactId} -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17: - -[source,options="nowrap",subs="+attributes"] ----- -build: - uri: {githubRepoCodeUrl} - ref: {WildFlyQuickStartRepoTag} - contextDir: {artifactId} -deploy: - replicas: 1 ----- - -This will create a new deployment on OpenShift and deploy the application. - -If you want to see all the configuration elements to customize your deployment you can use the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let’s wait for the application to be built and deployed: -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment {artifactId} -w -NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE -{artifactId} 1 1 1 0 12s -... -{artifactId} 1 1 1 1 2m ----- - -Get the URL of the route to the deployment. - -[source,options="nowrap",subs="+attributes"] ----- -$ oc get route {artifactId} -o jsonpath="{.spec.host}" ----- -Access the application in your web browser using the displayed URL. - -[NOTE] -==== -The Maven profile named `openshift` is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the `/{artifactId}` path segment after `HOST:PORT`. -==== - -[[undeploy_helm]] -== Undeploy the {ProductShortName} Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts - - -[source,options="nowrap",subs="+attributes"] ----- -$ helm uninstall {artifactId} ----- - -:leveloffset: 1 -// Testing on Openshift -:leveloffset: +1 - -[[run_the_arquillian_integration_tests_with_openshift]] -= Run the Arquillian Integration Tests with OpenShift -//****************************************************************************** -// Include this template if your quickstart provides Openshift Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -[NOTE] -==== -The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin. -==== - -Run the integration tests using the following command to run the `verify` goal with the `arq-remote` profile activated and the proper URL: -[source,options="nowrap",subs="+attributes"] ----- -$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route {artifactId} --template='{{ .spec.host }}') ----- - -[NOTE] -==== -The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from. -==== - -:leveloffset: 1 - -:leveloffset!: diff --git a/ee-security/README.html b/ee-security/README.html deleted file mode 100644 index e34ebf7271..0000000000 --- a/ee-security/README.html +++ /dev/null @@ -1,1072 +0,0 @@ - - - - - - - - -ee-security: Using Jakarta EE Security - - - - - -
-
-
-
-
-The ee-security quickstart demonstrates Jakarta EE security. -
-
-
-
-
-

What is it?

-
-
-

The ee-security quickstart is an example project showing the use of Jakarta EE security in Red Hat JBoss Enterprise Application Platform.

-
-
-

The deployment in this quickstart contains a simple HTTP servlet, which is secured using a custom HttpAuthenticationMechanism. The authentication mechanism in turn makes use of a custom IdentityStore.

-
-
-

This quickstart is hard coded to work with a user quickstartUser with password quickstartPwd1!.

-
-
-
-
-

System Requirements

-
-
-

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 8.0 or later.

-
-
-

All you need to build this project is Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later. See Configure Maven to Build and Deploy the Quickstarts to make sure you are configured correctly for testing the quickstarts.

-
-
-
-
-

Use of the EAP_HOME and QUICKSTART_HOME Variables

-
-
-

In the following instructions, replace EAP_HOME with the actual path to your JBoss EAP installation. The installation path is described in detail here: Use of EAP_HOME and JBOSS_HOME Variables.

-
-
-

When you see the replaceable variable QUICKSTART_HOME, replace it with the path to the root directory of all of the quickstarts.

-
-
-
-
-

Building and running the quickstart application with a JBoss EAP server distribution

-
-
-

Back Up the JBoss EAP Standalone Server Configuration

-
-

Before you begin, back up your server configuration file.

-
-
-
    -
  1. -

    If it is running, stop the JBoss EAP server.

    -
  2. -
  3. -

    Back up the EAP_HOME/standalone/configuration/standalone.xml file.

    -
  4. -
-
-
-

After you have completed testing this quickstart, you can replace this file to restore the server to its original configuration.

-
-
-
-

Start the JBoss EAP Standalone Server

-
-
    -
  1. -

    Open a terminal and navigate to the root of the JBoss EAP directory.

    -
  2. -
  3. -

    Start the JBoss EAP server with the default profile by typing the following command.

    -
    -
    -
    $ EAP_HOME/bin/standalone.sh 
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\standalone.bat script. -
    -
    -
  4. -
-
-
-
-

Configure the Server

-
-

You configure the security domain by running JBoss CLI commands. For your convenience, this quickstart batches the commands into a configure-elytron.cli script provided in the root directory of this quickstart.

-
-
-
    -
  1. -

    Before you begin, make sure you do the following:

    - -
  2. -
  3. -

    Review the configure-elytron.cli file in the root of this quickstart directory. This script adds the configuration that enables Elytron security for the quickstart components. Comments in the script describe the purpose of each block of commands.

    -
  4. -
  5. -

    Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing EAP_HOME with the path to your server:

    -
    -
    -
    $ EAP_HOME/bin/jboss-cli.sh --connect --file=configure-elytron.cli
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\jboss-cli.bat script. -
    -
    -
    -

    You should see the following result when you run the script:

    -
    -
    -
    -
    The batch executed successfully
    -process-state: reload-required
    -
    -
    -
  6. -
  7. -

    You’ll need to reload the configuration after that:

    -
    -
    -
    $ EAP_HOME/bin/jboss-cli.sh --connect --commands=reload
    -
    -
    -
  8. -
-
-
-
-

Build and Deploy the Quickstart

-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type the following command to build the quickstart.

    -
    -
    -
    $ mvn clean package
    -
    -
    -
  6. -
  7. -

    Type the following command to deploy the quickstart.

    -
    -
    -
    $ mvn wildfly:deploy
    -
    -
    -
  8. -
-
-
-

This deploys the ee-security/target/ee-security.war to the running instance of the server.

-
-
-

You should see a message in the server log indicating that the archive deployed successfully.

-
-
-
-

Access the Application

-
-

The application will be running at the following URL: http://localhost:8080/ee-security/secured

-
-
- - - - - -
-
Note
-
-If you attempt to access that URL, you will see "Unauthorized". -
-
-
-

To see and manipulate the HTTP headers within the HTTP requests, it is recommended to use a client like curl to invoke the servlet.

-
-
-
-
$ curl -v http://localhost:8080/ee-security/secured
-...
-< HTTP/1.1 401 Unauthorized
-< Connection: keep-alive
-< X-MESSAGE: Please resubmit the request with a username specified using the X-USERNAME and a password specified using the X-PASSWORD header.
-
-
-
-

This first request shows the client is being prompted to authenticate. The X-MESSAGE header is providing additional information as to how the client can achieve this.

-
-
-

The request can now be submitted with the previously added user.

-
-
-
-
$ curl -v http://localhost:8080/ee-security/secured -H 'X-Username:quickstartUser' -H 'X-Password:quickstartPwd1!'
-...
-> GET /ee-security/secured HTTP/1.1
-> Host: localhost:8080
-> X-Username:quickstartUser
-> X-Password:quickstartPwd1!
->
-< HTTP/1.1 200 OK
-< Connection: keep-alive
-< Content-Length: 125
-<
-SecuredServlet - doGet()
-Identity as available from SecurityContext 'quickstartUser'
-Identity as available from injection 'quickstartUser'
-
-
-
-

The resulting output shows authentication was successful and the correct identity has been established.

-
-
-
-

Run the Arquillian Integration Tests

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
-

Follow these steps to run the integration tests.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server, as previously described.

    -
  2. -
  3. -

    Make sure you build and deploy the quickstart, as previously described.

    -
  4. -
  5. -

    Type the following command to run the verify goal with the arq-remote profile activated.

    -
    -
    -
    $ mvn verify -Parq-remote
    -
    -
    -
  6. -
-
-
- - - - - -
-
Note
-
-
-

You may also use the environment variable SERVER_HOST or the system property server.host to define the target host of the tests.

-
-
-
-
-
-

Undeploy the Quickstart

-
-

When you are finished testing the quickstart, follow these steps to undeploy the archive.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type this command to undeploy the archive:

    -
    -
    -
    $ mvn wildfly:undeploy
    -
    -
    -
  6. -
-
-
-
-

Restore the JBoss EAP Standalone Server Configuration

-
-

You can restore the original server configuration using either of the following methods.

-
-
- -
-
-

Restore the JBoss EAP Standalone Server Configuration by Running the JBoss CLI Script

-
-
    -
  1. -

    Start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing EAP_HOME with the path to your server:

    -
    -
    -
    $ EAP_HOME/bin/jboss-cli.sh --connect --file=restore-configuration.cli
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\jboss-cli.bat script. -
    -
    -
  4. -
-
-
-
-

Restore the JBoss EAP Standalone Server Configuration Manually

-
-

When you have completed testing the quickstart, you can restore the original server configuration by manually restoring the backup copy the configuration file.

-
-
-
    -
  1. -

    If it is running, stop the JBoss EAP server.

    -
  2. -
  3. -

    Replace the EAP_HOME/standalone/configuration/standalone.xml file with the backup copy of the file.

    -
  4. -
-
-
-
-
-
-
-

Building and running the quickstart application with OpenShift

-
-
-

Build the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

On OpenShift, the S2I build with Apache Maven will use an openshift profile used to provision a JBoss EAP server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named openshift when building the quickstart:

-
-
-
-
$ mvn clean package -Popenshift
-
-
-
-

The provisioned JBoss EAP server for OpenShift, with the quickstart deployed, can then be found in the target/server directory, and its usage is similar to a standard server distribution. -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.

-
-
-

The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart pom.xml:

-
-
-
-
        <profile>
-            <id>openshift</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.jboss.eap.plugins</groupId>
-                        <artifactId>eap-maven-plugin</artifactId>
-                        <version>${version.eap.maven.plugin}</version>
-                        <configuration>
-                            <feature-packs>
-                                <feature-pack>
-                                    <location>org.jboss.eap:wildfly-ee-galleon-pack</location>
-                                </feature-pack>
-                                <feature-pack>
-                                    <location>org.jboss.eap.cloud:eap-cloud-galleon-pack</location>
-                                </feature-pack>
-                            </feature-packs>
-                            <layers>
-                                <layer>cloud-server</layer>
-                            </layers>
-                            <filename>ROOT.war</filename>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>package</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-
-
-
- - - - - -
-
Note
-
-
-

Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the /ee-security path segment after HOST:PORT.

-
-
-
-
-
-

Getting Started with JBoss EAP for OpenShift and Helm Charts

-
-

This section contains the basic instructions to build and deploy this quickstart to JBoss EAP for OpenShift or JBoss EAP for OpenShift Online using Helm Charts.

-
-
-

Prerequisites

-
-
    -
  • -

    You must be logged in OpenShift and have an oc client to connect to OpenShift

    -
  • -
  • -

    Helm must be installed to deploy the backend on OpenShift.

    -
  • -
-
-
-

Once you have installed Helm, you need to add the repository that provides Helm Charts for JBoss EAP.

-
-
-
-
$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/
-"jboss-eap" has been added to your repositories
-$ helm search repo jboss-eap
-NAME                    CHART VERSION   APP VERSION     DESCRIPTION
-jboss-eap/eap8         ...             ...             A Helm chart to build and deploy EAP 8.0 applications
-
-
-
-
-

Deploy the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

Log in to your OpenShift instance using the oc login command. -The backend will be built and deployed on OpenShift with a Helm Chart for JBoss EAP.

-
-
-

Navigate to the root directory of this quickstart and run the following command:

-
-
-
-
$ helm install ee-security -f charts/helm.yaml jboss-eap/eap8
-NAME: ee-security
-...
-STATUS: deployed
-REVISION: 1
-
-
-
-

The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17:

-
-
-
-
build:
-  uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git
-  ref: 8.0.x
-  contextDir: ee-security
-deploy:
-  replicas: 1
-
-
-
-

This will create a new deployment on OpenShift and deploy the application.

-
-
-

If you want to see all the configuration elements to customize your deployment you can use the following command:

-
-
-
-
$ helm show readme jboss-eap/eap8
-
-
-
-

Let’s wait for the application to be built and deployed:

-
-
-
-
$ oc get deployment ee-security -w
-NAME         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
-ee-security   1         1         1            0           12s
-...
-ee-security   1         1         1            1           2m
-
-
-
-

Get the URL of the route to the deployment.

-
-
-
-
$ oc get route ee-security -o jsonpath="{.spec.host}"
-
-
-
-

Access the application in your web browser using the displayed URL.

-
-
- - - - - -
-
Note
-
-
-

The Maven profile named openshift is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the /ee-security path segment after HOST:PORT.

-
-
-
-
-
-

Undeploy the JBoss EAP Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts

-
-
-
$ helm uninstall ee-security
-
-
-
-
-
-

Run the Arquillian Integration Tests with OpenShift

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
- - - - - -
-
Note
-
-
-

The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin.

-
-
-
-
-

Run the integration tests using the following command to run the verify goal with the arq-remote profile activated and the proper URL:

-
-
-
-
$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route ee-security --template='{{ .spec.host }}')
-
-
-
- - - - - -
-
Note
-
-
-

The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from.

-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/ee-security/charts/helm.yaml b/ee-security/charts/helm.yaml deleted file mode 100644 index 6e3c6309df..0000000000 --- a/ee-security/charts/helm.yaml +++ /dev/null @@ -1,6 +0,0 @@ -build: - uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git - ref: 8.0.x - contextDir: ee-security -deploy: - replicas: 1 \ No newline at end of file diff --git a/ee-security/configure-elytron.cli b/ee-security/configure-elytron.cli deleted file mode 100644 index 2155bcdf7a..0000000000 --- a/ee-security/configure-elytron.cli +++ /dev/null @@ -1,7 +0,0 @@ -# CLI script to enable elytron for the quickstart application in the application server - -# Disable 'integrated-jaspi' as the quickstart will be managing it's own identities -/subsystem=undertow/application-security-domain=other:write-attribute(name=integrated-jaspi, value=false) - -# Reload the server configuration -#reload diff --git a/ee-security/pom.xml b/ee-security/pom.xml deleted file mode 100644 index 3ac5e193cd..0000000000 --- a/ee-security/pom.xml +++ /dev/null @@ -1,255 +0,0 @@ - - - - 4.0.0 - - org.jboss.eap.quickstarts - jboss-eap-quickstart-parent - - 6.0.0.redhat-00001 - - - - ee-security - 8.0.0.GA - war - Quickstart: ee-security - This project demonstrates using EE security - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - 8.0.0.GA-redhat-00009 - 1.0.0.Final-redhat-00014 - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - never - - default - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - never - - - true - never - - default - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - - - true - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - - - true - - - - - - - - - org.jboss.bom - jboss-eap-ee-with-tools - ${version.server.bom} - pom - import - - - - - - - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - - jakarta.servlet - jakarta.servlet-api - provided - - - - jakarta.security.enterprise - jakarta.security.enterprise-api - provided - - - - org.wildfly.security - wildfly-elytron - provided - - - - - - junit - junit - test - - - - - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet-jakarta - test - - - - - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - - org.jboss.eap.channels - eap-8.0 - - - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - - - false - - - - - - - package - - - - - - - - - arq-remote - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} - - - **/RemoteSecureIT - - - **/ProvisionedManagedSecureIT - - - - - - integration-test - verify - - - - - - - - - diff --git a/ee-security/restore-configuration.cli b/ee-security/restore-configuration.cli deleted file mode 100644 index 2428144f70..0000000000 --- a/ee-security/restore-configuration.cli +++ /dev/null @@ -1,10 +0,0 @@ -# CLI script to restore the application server configuration that was modified to run the quickstart - -# Activate 'integrated-jaspi' for the 'other' application-security-domain again. -/subsystem=undertow/application-security-domain=other:write-attribute(name=integrated-jaspi, value=true) - -# Remove the WildFly Elytron JACC policy -/subsystem=elytron/policy=jacc:remove - -# Reload the server configuration -reload diff --git a/ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/ElytronIdentityStore.java b/ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/ElytronIdentityStore.java deleted file mode 100644 index 8976233130..0000000000 --- a/ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/ElytronIdentityStore.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.as.quickstarts.ee_security; - -import static jakarta.security.enterprise.identitystore.CredentialValidationResult.INVALID_RESULT; - -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import org.wildfly.security.auth.server.SecurityDomain; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import jakarta.security.enterprise.credential.Credential; -import jakarta.security.enterprise.credential.UsernamePasswordCredential; -import jakarta.security.enterprise.identitystore.CredentialValidationResult; -import jakarta.security.enterprise.identitystore.IdentityStore; - -/** - * - * @author Darran Lofthouse - */ -@ApplicationScoped -public class ElytronIdentityStore implements IdentityStore { - - private static final Map USERS; - - static { - Map users = new HashMap<>(); - User user = new User("quickstartUser", "quickstartPwd1!".toCharArray(), "Users"); - users.put(user.getUserName(), user); - USERS = Collections.unmodifiableMap(users); - } - - @Inject - private SecurityDomain securityDomain; - - @Override - public CredentialValidationResult validate(Credential credential) { - if (credential instanceof UsernamePasswordCredential) { - UsernamePasswordCredential upc = (UsernamePasswordCredential) credential; - - User candidate = USERS.get(upc.getCaller()); - if (candidate != null && Arrays.equals(candidate.getPassword(), upc.getPassword().getValue())) { - return new CredentialValidationResult(candidate.getUserName(), candidate.getGroups()); - } - } - - return INVALID_RESULT; - } - - private static class User { - - private final String userName; - private final char[] password; - private final Set groups; - - User(final String userName, final char[] password, final String... roles) { - this.userName = userName; - this.password = password; - groups = new HashSet<>(Arrays.asList(roles)); - } - - public String getUserName() { - return userName; - } - - public char[] getPassword() { - return password; - } - - public Set getGroups() { - return groups; - } - - } - -} diff --git a/ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/SecuredServlet.java b/ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/SecuredServlet.java deleted file mode 100644 index 16d7fe010f..0000000000 --- a/ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/SecuredServlet.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.as.quickstarts.ee_security; - -import java.io.IOException; -import java.io.PrintWriter; - -import jakarta.inject.Inject; -import jakarta.security.enterprise.SecurityContext; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.wildfly.security.auth.server.SecurityIdentity; - -/** - * - * @author Darran Lofthouse - */ -@WebServlet(value="/secured") -public class SecuredServlet extends HttpServlet { - - @Inject - private SecurityContext securityContext; - - @Inject - private SecurityIdentity securityIdentity; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - PrintWriter pw = resp.getWriter(); - pw.println("SecuredServlet - doGet()"); - pw.println(String.format("Identity as available from SecurityContext '%s'", securityContext.getCallerPrincipal().getName())); - pw.println(String.format("Identity as available from injection '%s'", securityIdentity.getPrincipal().getName())); - } - -} diff --git a/ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/SecurityFactory.java b/ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/SecurityFactory.java deleted file mode 100644 index 9f915f83b8..0000000000 --- a/ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/SecurityFactory.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.as.quickstarts.ee_security; - -import jakarta.enterprise.inject.Produces; - -import org.wildfly.security.auth.server.SecurityDomain; -import org.wildfly.security.auth.server.SecurityIdentity; - -/** - * - * @author Darran Lofthouse - */ -public class SecurityFactory { - - @Produces - public SecurityDomain getSecurityDomain() { - return SecurityDomain.getCurrent(); - } - - @Produces - public SecurityIdentity getSecurityIdentity(SecurityDomain securityDomain) { - return securityDomain.getCurrentSecurityIdentity(); - } - -} diff --git a/ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/TestAuthenticationMechanism.java b/ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/TestAuthenticationMechanism.java deleted file mode 100644 index f93ce20bb0..0000000000 --- a/ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/TestAuthenticationMechanism.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.as.quickstarts.ee_security; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import jakarta.security.enterprise.AuthenticationException; -import jakarta.security.enterprise.AuthenticationStatus; -import jakarta.security.enterprise.authentication.mechanism.http.HttpAuthenticationMechanism; -import jakarta.security.enterprise.authentication.mechanism.http.HttpMessageContext; -import jakarta.security.enterprise.credential.UsernamePasswordCredential; -import jakarta.security.enterprise.identitystore.CredentialValidationResult; -import jakarta.security.enterprise.identitystore.CredentialValidationResult.Status; -import jakarta.security.enterprise.identitystore.IdentityStoreHandler; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -/** - * A simple {@link HttpAuthenticationMechanism} for testing. - * - * @author Darran Lofthouse - */ -@ApplicationScoped -public class TestAuthenticationMechanism implements HttpAuthenticationMechanism { - - static final String USERNAME_HEADER = "X-USERNAME"; - static final String PASSWORD_HEADER = "X-PASSWORD"; - static final String MESSAGE_HEADER = "X-MESSAGE"; - static final String MESSAGE = "Please resubmit the request with a username specified using the X-USERNAME and a password specified using the X-PASSWORD header."; - - @Inject - private IdentityStoreHandler identityStoreHandler; - - @Override - public AuthenticationStatus validateRequest(HttpServletRequest request, HttpServletResponse response, - HttpMessageContext httpMessageContext) throws AuthenticationException { - - final String username = request.getHeader(USERNAME_HEADER); - final String password = request.getHeader(PASSWORD_HEADER); - - if (username != null && password != null) { - UsernamePasswordCredential upc = new UsernamePasswordCredential(username, password); - CredentialValidationResult cvr = identityStoreHandler.validate(upc); - - if (cvr.getStatus() == Status.VALID) { - return httpMessageContext.notifyContainerAboutLogin(cvr.getCallerPrincipal(), cvr.getCallerGroups()); - } else { - return challenge(response, httpMessageContext); - } - } - - return challenge(response, httpMessageContext); - } - - private static AuthenticationStatus challenge(HttpServletResponse response, HttpMessageContext httpMessageContext) { - response.addHeader(MESSAGE_HEADER, MESSAGE); - - return httpMessageContext.responseUnauthorized(); - } - -} diff --git a/ee-security/src/main/webapp/WEB-INF/beans.xml b/ee-security/src/main/webapp/WEB-INF/beans.xml deleted file mode 100644 index 2d96d0e249..0000000000 --- a/ee-security/src/main/webapp/WEB-INF/beans.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/ee-security/src/test/java/org/jboss/as/quickstarts/ee_security/ProvisionedManagedSecureIT.java b/ee-security/src/test/java/org/jboss/as/quickstarts/ee_security/ProvisionedManagedSecureIT.java deleted file mode 100644 index 3de8e8477b..0000000000 --- a/ee-security/src/test/java/org/jboss/as/quickstarts/ee_security/ProvisionedManagedSecureIT.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 Red Hat, Inc. - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jboss.as.quickstarts.ee_security; - -import java.net.URI; -import java.net.URISyntaxException; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.junit.runner.RunWith; - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -@RunWith(Arquillian.class) -@RunAsClient -public class ProvisionedManagedSecureIT extends RemoteSecureIT { - - @Override - protected URI getHTTPEndpoint() { - String host = getServerHost(); - if (host == null) { - host = "http://localhost:8080"; - } - try { - return new URI(host + "/secured"); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } -} diff --git a/ee-security/src/test/java/org/jboss/as/quickstarts/ee_security/RemoteSecureIT.java b/ee-security/src/test/java/org/jboss/as/quickstarts/ee_security/RemoteSecureIT.java deleted file mode 100644 index c4708744d8..0000000000 --- a/ee-security/src/test/java/org/jboss/as/quickstarts/ee_security/RemoteSecureIT.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2022 Red Hat, Inc. - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jboss.as.quickstarts.ee_security; - -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import org.junit.Assert; -import org.junit.Test; - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -public class RemoteSecureIT { - - protected URI getHTTPEndpoint() { - String host = getServerHost(); - if (host == null) { - host = "http://localhost:8080/ee-security"; - } - try { - return new URI(host + "/secured"); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } - - protected static String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host"); - } - return host; - } - - @Test - public void testConnectOk() throws IOException, InterruptedException { - HttpRequest request = HttpRequest.newBuilder(getHTTPEndpoint()) - .GET() - .build(); - HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); - Assert.assertEquals(401, response.statusCode()); - request = HttpRequest.newBuilder(getHTTPEndpoint()) - .header("X-Username", "quickstartUser") - .header("X-Password", "quickstartPwd1!") - .GET() - .build(); - response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); - Assert.assertEquals(200, response.statusCode()); - String[] lines = response.body().toString().split(System.lineSeparator()); - Assert.assertEquals("SecuredServlet - doGet()", lines[0].trim()); - Assert.assertEquals("Identity as available from SecurityContext 'quickstartUser'", lines[1].trim()); - Assert.assertEquals("Identity as available from injection 'quickstartUser'", lines[2].trim()); - } - -} diff --git a/helloworld-ws/README-source.adoc b/helloworld-ws/README-source.adoc deleted file mode 100644 index 61e6a241d1..0000000000 --- a/helloworld-ws/README-source.adoc +++ /dev/null @@ -1,79 +0,0 @@ -include::../shared-doc/attributes.adoc[] - -= helloworld-ws: Hello World JAX-WS Web Service -:author: Lee Newson -:level: Beginner -:technologies: JAX-WS -:openshift: true - -[abstract] -The `helloworld-ws` quickstart demonstrates a simple Hello World application, bundled and deployed as a WAR, that uses JAX-WS to say Hello. - -:standalone-server-type: default -:archiveType: war - -== What is it? - -The `helloworld-ws` quickstart demonstrates the use of JAX-WS in {productNameFull} as a simple Hello World application. - -// System Requirements -include::../shared-doc/system-requirements.adoc[leveloffset=+1] -// Use of {jbossHomeName} -include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1] - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Start the {productName} Standalone Server -include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+2] -// Build and Deploy the Quickstart -include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+2] - -Review the server log to see useful information about the deployed web service endpoint. - -[source,options="nowrap"] ----- -JBWS024061: Adding service endpoint metadata: id=org.jboss.as.quickstarts.wshelloworld.HelloWorldServiceImpl - address=http://localhost:8080/{artifactId}/HelloWorldService - implementor=org.jboss.as.quickstarts.wshelloworld.HelloWorldServiceImpl - serviceName={http://www.jboss.org/eap/quickstarts/wshelloworld/HelloWorld}HelloWorldService - portName={http://www.jboss.org/eap/quickstarts/wshelloworld/HelloWorld}HelloWorld - annotationWsdlLocation=null - wsdlLocationOverride=null - mtomEnabled=false ----- - -=== Access the Application - -You can verify that the Web Service is running and deployed correctly by accessing the following URL: http://localhost:8080/{artifactId}/HelloWorldService?wsdl. This URL will display the deployed WSDL endpoint for the Web Service. - -// Testing with Arquillian -include::../shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc[leveloffset=+2] - -=== Investigate the Console Output - -When you run the Arquillian tests, Maven prints summary of the performed tests to the console. You should see the following results. - -[source,options="nowrap"] ----- -------------------------------------------------------- -T E S T S -------------------------------------------------------- -Running org.jboss.as.quickstarts.wshelloworld.ClientArqTest -[Client] Requesting the WebService to say Hello. -[WebService] Hello World! -[Client] Requesting the WebService to say Hello to John. -[WebService] Hello John! -[Client] Requesting the WebService to say Hello to John, Mary and Mark. -[WebService] Hello John, Mary & Mark! -Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.988 sec ----- - -// Undeploy the Quickstart -include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2] - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1] \ No newline at end of file diff --git a/helloworld-ws/README.adoc b/helloworld-ws/README.adoc deleted file mode 100644 index ac11e7a6ec..0000000000 --- a/helloworld-ws/README.adoc +++ /dev/null @@ -1,863 +0,0 @@ -ifdef::env-github[] -:artifactId: helloworld-ws -endif::[] - -//*********************************************************************************** -// Enable the following flag to build README.html files for JBoss EAP product builds. -// Comment it out for WildFly builds. -//*********************************************************************************** -:ProductRelease: - -//*********************************************************************************** -// Enable the following flag to build README.html files for EAP XP product builds. -// Comment it out for WildFly or JBoss EAP product builds. -//*********************************************************************************** -//:EAPXPRelease: - -// This is a universal name for all releases -:ProductShortName: JBoss EAP -// Product names and links are dependent on whether it is a product release (CD or JBoss) -// or the WildFly project. -// The "DocInfo*" attributes are used to build the book links to the product documentation - -ifdef::ProductRelease[] -// JBoss EAP release -:productName: JBoss EAP -:productNameFull: Red Hat JBoss Enterprise Application Platform -:productVersion: 8.0 -:DocInfoProductNumber: {productVersion} -:WildFlyQuickStartRepoTag: 8.0.x -:productImageVersion: 8.0.0 -:helmChartName: jboss-eap/eap8 -endif::[] - -ifdef::EAPXPRelease[] -// JBoss EAP XP release -:productName: JBoss EAP XP -:productNameFull: Red Hat JBoss Enterprise Application Platform expansion pack -:productVersion: 3.0 -:DocInfoProductNumber: 7.4 -:WildFlyQuickStartRepoTag: XP_3.0.0.GA -:productImageVersion: 3.0 -:helmChartName: jboss-eap/eap-xp3 -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -:githubRepoUrl: https://github.com/jboss-developer/jboss-eap-quickstarts/ -:githubRepoCodeUrl: https://github.com/jboss-developer/jboss-eap-quickstarts.git -:jbossHomeName: EAP_HOME -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:quickstartDownloadName: {productNameFull} {productVersion} Quickstarts -:quickstartDownloadUrl: https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=appplatform&downloadType=distributions -:helmRepoName: jboss-eap -:helmRepoUrl: https://jbossas.github.io/eap-charts/ -// END ifdef::ProductRelease,EAPXPRelease[] -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -// WildFly project -:productName: WildFly -:productNameFull: WildFly Application Server -:ProductShortName: {productName} -:jbossHomeName: WILDFLY_HOME -:productVersion: 28 -:productImageVersion: 28.0 -:githubRepoUrl: https://github.com/wildfly/quickstart/ -:githubRepoCodeUrl: https://github.com/wildfly/quickstart.git -:WildFlyQuickStartRepoTag: 28.0.1.Final -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -// Do not update the following until after the 7.4 docs are published! -:DocInfoProductNumber: 7.4 -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:helmRepoName: wildfly -:helmRepoUrl: http://docs.wildfly.org/wildfly-charts/ -:helmChartName: wildfly/wildfly -// END ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -endif::[] - -:source: {githubRepoUrl} - -// Values for Openshift S2i sections attributes -:CDProductName: {productNameFull} for OpenShift -:CDProductShortName: {ProductShortName} for OpenShift -:CDProductTitle: {CDProductName} -:CDProductNameSentence: Openshift release for {ProductShortName} -:CDProductAcronym: {CDProductShortName} -:CDProductVersion: {productVersion} -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {EapForOpenshiftBookName} Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {xpaasproduct} Online -:xpaasproduct-shortname: {CDProductShortName} -:xpaasproductOpenShiftOnline-shortname: {xpaasproduct-shortname} Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: Getting Started with {ProductShortName} for OpenShift Container Platform -:EapForOpenshiftOnlineBookName: Getting Started with {ProductShortName} for OpenShift Online -:OpenShiftOnlinePlatformName: Red Hat OpenShift Container Platform -:OpenShiftOnlineName: Red Hat OpenShift Online -:ImagePrefixVersion: eap80 -:ImageandTemplateImportBaseURL: https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift - -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepo: https://github.com/jboss-developer/jboss-eap-quickstarts -:EAPQuickStartRepoRef: 8.0.x -:EAPQuickStartRepoTag: EAP_8.0.0.GA -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_container_platform/ -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_online/ - -ifdef::EAPXPRelease[] -// Attributes for XP releases -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {productNameFull} for OpenShift Online -:xpaasproduct-shortname: {ProductShortName} for OpenShift -:xpaasproductOpenShiftOnline-shortname: {ProductShortName} for OpenShift Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:ImagePrefixVersion: eap-xp3 -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepoRef: xp-3.0.x -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -endif::[] - -ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -:ImageandTemplateImportURL: https://raw.githubusercontent.com/wildfly/wildfly-s2i/v{productVersion}.0/ -endif::[] - -//************************* -// Other values -//************************* -:buildRequirements: Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later -:jbdsEapServerName: Red Hat JBoss Enterprise Application Platform 7.3 -:javaVersion: Jakarta EE 10 -ifdef::EAPXPRelease[] -:javaVersion: Eclipse MicroProfile -endif::[] -:githubRepoBranch: master -:guidesBaseUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/ -:useEclipseUrl: {guidesBaseUrl}USE_JBDS.adoc#use_red_hat_jboss_developer_studio_or_eclipse_to_run_the_quickstarts -:useEclipseDeployJavaClientDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_containing_server_and_java_client_projects -:useEclipseDeployEARDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_ear_project -:useProductHomeDocUrl: {guidesBaseUrl}USE_OF_{jbossHomeName}.adoc#use_of_product_home_and_jboss_home_variables -:configureMavenDocUrl: {guidesBaseUrl}CONFIGURE_MAVEN_JBOSS_EAP.adoc#configure_maven_to_build_and_deploy_the_quickstarts -:arquillianTestsDocUrl: {guidesBaseUrl}RUN_ARQUILLIAN_TESTS.adoc#run_the_arquillian_tests -:addUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#create_users_required_by_the_quickstarts -:addApplicationUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_application_user -:addManagementUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_management_user -:startServerDocUrl: {guidesBaseUrl}START_JBOSS_EAP.adoc#start_the_jboss_eap_server -:configurePostgresDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_database_for_use_with_the_quickstarts -:configurePostgresDownloadDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#download_and_install_postgresql -:configurePostgresCreateUserDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#create_a_database_user -:configurePostgresAddModuleDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#add_the_postgres_module_to_the_jboss_eap_server -:configurePostgresDriverDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_driver_in_the_jboss_eap_server -:configureBytemanDownloadDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#download_and_configure_byteman -:configureBytemanDisableDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#disable_the_byteman_script -:configureBytemanClearDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#clear_the_transaction_object_store -:configureBytemanQuickstartDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts -:configureBytemanHaltDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#use_byteman_to_halt_the_application[ -:configureBytemanQuickstartsDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts - -:EESubsystemNamespace: urn:jboss:domain:ee:4.0 -:IiopOpenJdkSubsystemNamespace: urn:jboss:domain:iiop-openjdk:2.0 -:MailSubsystemNamespace: urn:jboss:domain:mail:3.0 -:SingletonSubsystemNamespace: urn:jboss:domain:singleton:1.0 -:TransactionsSubsystemNamespace: urn:jboss:domain:transactions:4.0 - -// LinkProductDocHome: https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/ -:LinkProductDocHome: https://access.redhat.com/documentation/en/jboss-enterprise-application-platform-continuous-delivery -:LinkConfigGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/configuration_guide/ -:LinkDevelopmentGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/development_guide/ -:LinkGettingStartedGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_guide/ -:LinkOpenShiftWelcome: https://docs.openshift.com/online/welcome/index.html -:LinkOpenShiftSignup: https://docs.openshift.com/online/getting_started/choose_a_plan.html -:OpenShiftTemplateName: JBoss EAP CD (no https) - -:ConfigBookName: Configuration Guide -:DevelopmentBookName: Development Guide -:GettingStartedBookName: Getting Started Guide - -:JBDSProductName: Red Hat CodeReady Studio -:JBDSVersion: 12.15 -:LinkJBDSInstall: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/installation_guide/ -:JBDSInstallBookName: Installation Guide -:LinkJBDSGettingStarted: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/getting_started_with_codeready_studio_tools/ -:JBDSGettingStartedBookName: Getting Started with CodeReady Studio Tools - -= helloworld-ws: Hello World JAX-WS Web Service -:author: Lee Newson -:level: Beginner -:technologies: JAX-WS -:openshift: true - -[abstract] -The `helloworld-ws` quickstart demonstrates a simple Hello World application, bundled and deployed as a WAR, that uses JAX-WS to say Hello. - -:standalone-server-type: default -:archiveType: war - -== What is it? - -The `helloworld-ws` quickstart demonstrates the use of JAX-WS in {productNameFull} as a simple Hello World application. - -// System Requirements -:leveloffset: +1 - -[[system_requirements]] -= System Requirements -//****************************************************************************** -// Include this template to describe the standard system requirements for -// running the quickstarts. -// -// The Forge quickstarts define a `forge-from-scratch` attribute because they -// run entirely in CodeReady Studio and have different requirements . -//****************************************************************************** - -The application this project produces is designed to be run on {productNameFull} {productVersion} or later. - -All you need to build this project is {buildRequirements}. See link:{configureMavenDocUrl}[Configure Maven to Build and Deploy the Quickstarts] to make sure you are configured correctly for testing the quickstarts. - -:leveloffset!: -// Use of {jbossHomeName} -:leveloffset: +1 - -ifdef::requires-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -This quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifdef::optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -When deploying this quickstart to a managed domain, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When deploying this quickstart to multiple standalone servers, this quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifndef::requires-multiple-servers,optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName} and QUICKSTART_HOME Variables - -In the following instructions, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -:leveloffset!: - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Start the {productName} Standalone Server -:leveloffset: +2 - -[[start_the_eap_standalone_server]] -= Start the {productName} Standalone Server -//****************************************************************************** -// Include this template if your quickstart requires a normal start of a single -// standalone server. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// custom -// -// * For mobile applications, you can define the `mobileApp` variable in the -// `README.adoc` file to add `-b 0.0.0.0` to the command line. This allows -// external clients, such as phones, tablets, and desktops, to connect -// to the application through through your local network -// ::mobileApp: {artifactId}-service -// -//****************************************************************************** - -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -. Open a terminal and navigate to the root of the {productName} directory. -. Start the {productName} server with the {serverProfile} by typing the following command. -+ -ifdef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __JAEGER_REPORTER_LOG_SPANS=true JAEGER_SAMPLER_TYPE=const JAEGER_SAMPLER_PARAM=1__ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -ifndef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\standalone.bat` script. - -ifdef::mobileApp[] -+ -Adding `-b 0.0.0.0` to the above command allows external clients, such as phones, tablets, and desktops, to connect through your local network. For example: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} -b 0.0.0.0 ----- -endif::[] - -:leveloffset!: -// Build and Deploy the Quickstart -:leveloffset: +2 - -[[build_and_deploy_the_quickstart]] -= Build and Deploy the Quickstart -//****************************************************************************** -// Include this template if your quickstart does a normal deployment of a archive. -// -// * Define the `archiveType` variable in the quickstart README file. -// Supported values: -// :archiveType: ear -// :archiveType: war -// :archiveType: jar -// -// * To override the archive name, which defaults to the {artifactId), -// define the `archiveName` variable, for example: -// :archiveName: {artifactId}-service -// -// * To override the archive output directory, -// define the `archiveDir` variable, for example: -// :archiveDir: ear/target -// -// * To override the Maven command, define the `mavenCommand` variable, -// for example: -// :mavenCommand: clean install wildfly:deploy -//****************************************************************************** - -// The archive name defaults to the artifactId if not overridden -ifndef::archiveName[] -:archiveName: {artifactId} -endif::archiveName[] - -// The archive type defaults to war if not overridden -ifndef::archiveType[] -:archiveType: war -endif::archiveType[] - -// Define the archive file name as the concatenation of "archiveName" + "." + "archiveType+ -:archiveFileName: {archiveName}.{archiveType} - -// If they have not defined the target archive directory, make it the default for the archive type. -ifndef::archiveDir[] - -ifeval::["{archiveType}"=="ear"] -:archiveDir: {artifactId}/ear/target -endif::[] - -ifeval::["{archiveType}"=="war"] -:archiveDir: {artifactId}/target -endif::[] - -ifeval::["{archiveType}"=="jar"] -:archiveDir: {artifactId}/target -endif::[] - -endif::archiveDir[] - -ifndef::mavenCommand[] -ifeval::["{archiveType}"=="ear"] -:mavenCommand: clean install -endif::[] - -ifeval::["{archiveType}"=="war"] -:mavenCommand: clean package -endif::[] - -ifeval::["{archiveType}"=="jar"] -:mavenCommand: clean install -endif::[] - -endif::mavenCommand[] - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -ifdef::reactive-messaging[] -. Run this command to enable the MicroProfile Reactive Messaging functionality on the server -+ -[source,subs="attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=enable-reactive-messaging.cli ----- -endif::reactive-messaging[] -. Type the following command to build the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn {mavenCommand} ----- - -. Type the following command to deploy the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn wildfly:deploy ----- - -ifdef::rest-client-qs[] -This builds and deploys the `country-server` and `country-client` to the running instance of the server. - -You should see a message in the server log indicating that the archives deployed successfully. -endif::[] -ifndef::rest-client-qs[] -This deploys the `{archiveDir}/{archiveFileName}` to the running instance of the server. - -You should see a message in the server log indicating that the archive deployed successfully. -endif::[] - - -:leveloffset!: - -Review the server log to see useful information about the deployed web service endpoint. - -[source,options="nowrap"] ----- -JBWS024061: Adding service endpoint metadata: id=org.jboss.as.quickstarts.wshelloworld.HelloWorldServiceImpl - address=http://localhost:8080/{artifactId}/HelloWorldService - implementor=org.jboss.as.quickstarts.wshelloworld.HelloWorldServiceImpl - serviceName={http://www.jboss.org/eap/quickstarts/wshelloworld/HelloWorld}HelloWorldService - portName={http://www.jboss.org/eap/quickstarts/wshelloworld/HelloWorld}HelloWorld - annotationWsdlLocation=null - wsdlLocationOverride=null - mtomEnabled=false ----- - -=== Access the Application - -You can verify that the Web Service is running and deployed correctly by accessing the following URL: http://localhost:8080/{artifactId}/HelloWorldService?wsdl. This URL will display the deployed WSDL endpoint for the Web Service. - -// Testing with Arquillian -:leveloffset: +2 - -[[run_the_arquillian_integration_tests_with_server_distribution]] -= Run the Arquillian Integration Tests -//****************************************************************************** -// Include this template if your quickstart provides standard Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -Follow these steps to run the integration tests. - -. Make sure you start the {productName} server, as previously described. - -. Make sure you build and deploy the quickstart, as previously described. - -. Type the following command to run the `verify` goal with the `arq-remote` profile activated. -+ -[source,options="nowrap"] ----- -$ mvn verify -Parq-remote ----- - -[NOTE] -==== -You may also use the environment variable `SERVER_HOST` or the system property `server.host` to define the target host of the tests. -==== - -:leveloffset!: - -=== Investigate the Console Output - -When you run the Arquillian tests, Maven prints summary of the performed tests to the console. You should see the following results. - -[source,options="nowrap"] ----- -------------------------------------------------------- -T E S T S -------------------------------------------------------- -Running org.jboss.as.quickstarts.wshelloworld.ClientArqTest -[Client] Requesting the WebService to say Hello. -[WebService] Hello World! -[Client] Requesting the WebService to say Hello to John. -[WebService] Hello John! -[Client] Requesting the WebService to say Hello to John, Mary and Mark. -[WebService] Hello John, Mary & Mark! -Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.988 sec ----- - -// Undeploy the Quickstart -:leveloffset: +2 - -[[undeploy_the_quickstart]] -= Undeploy the Quickstart - -//******************************************************************************* -// Include this template if your quickstart does a normal undeployment of an archive. -//******************************************************************************* -When you are finished testing the quickstart, follow these steps to undeploy the archive. - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -. Type this command to undeploy the archive: -+ -[source,options="nowrap"] ----- -$ mvn wildfly:undeploy ----- - -:leveloffset!: - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -:leveloffset: +1 - -[[build_and_run_the_quickstart_on_openshift]] -= Building and running the quickstart application with OpenShift -// The openshift profile -:leveloffset: +1 - -[[build-the-quickstart-for-openshift]] -== Build the {productName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -On OpenShift, the S2I build with Apache Maven will use an `openshift` profile used to provision a {productName} server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named `openshift` when building the quickstart: - -[source,subs="attributes+",options="nowrap"] ----- -$ mvn clean package -Popenshift ----- - -The provisioned {productName} server for OpenShift, with the quickstart deployed, can then be found in the `target/server` directory, and its usage is similar to a standard server distribution. -ifndef::ProductRelease,EAPXPRelease[] -You may note that unlike the `provisioned-server` profile it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the WildFly Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.wildfly:wildfly-galleon-pack:${version.server} - - - org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp} - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -[NOTE] -==== -Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`. -==== - -:leveloffset: 1 -// Getting Started with Helm -:leveloffset: +1 - -[[getting_started_with_helm]] -= Getting Started with {xpaasproduct-shortname} and Helm Charts - -This section contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} using Helm Charts. - -[[prerequisites_helm_openshift]] -== Prerequisites - -* You must be logged in OpenShift and have an `oc` client to connect to OpenShift -* https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. - -Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}. - -ifndef::ProductRelease,EAPXPRelease[] -[source,options="nowrap"] ----- -$ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ -"wildfly" has been added to your repositories -$ helm search repo wildfly -NAME CHART VERSION APP VERSION DESCRIPTION -wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift -wildfly/wildfly-common ... ... A library chart for WildFly-based applications ----- -endif::[] -ifdef::ProductRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP {productVersion} applications ----- -endif::[] -ifdef::EAPXPRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP XP {productVersion} applications ----- -endif::[] - -:leveloffset: 1 -//Prepare Helm for Quickstart Deployment -:leveloffset: +1 - -[[deploy_helm]] -== Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -Log in to your OpenShift instance using the `oc login` command. -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -Navigate to the root directory of this quickstart and run the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm install {artifactId} -f charts/helm.yaml {helmChartName} -NAME: {artifactId} -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17: - -[source,options="nowrap",subs="+attributes"] ----- -build: - uri: {githubRepoCodeUrl} - ref: {WildFlyQuickStartRepoTag} - contextDir: {artifactId} -deploy: - replicas: 1 ----- - -This will create a new deployment on OpenShift and deploy the application. - -If you want to see all the configuration elements to customize your deployment you can use the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let’s wait for the application to be built and deployed: -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment {artifactId} -w -NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE -{artifactId} 1 1 1 0 12s -... -{artifactId} 1 1 1 1 2m ----- - -Get the URL of the route to the deployment. - -[source,options="nowrap",subs="+attributes"] ----- -$ oc get route {artifactId} -o jsonpath="{.spec.host}" ----- -Access the application in your web browser using the displayed URL. - -[NOTE] -==== -The Maven profile named `openshift` is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the `/{artifactId}` path segment after `HOST:PORT`. -==== - -[[undeploy_helm]] -== Undeploy the {ProductShortName} Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts - - -[source,options="nowrap",subs="+attributes"] ----- -$ helm uninstall {artifactId} ----- - -:leveloffset: 1 -// Testing on Openshift -:leveloffset: +1 - -[[run_the_arquillian_integration_tests_with_openshift]] -= Run the Arquillian Integration Tests with OpenShift -//****************************************************************************** -// Include this template if your quickstart provides Openshift Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -[NOTE] -==== -The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin. -==== - -Run the integration tests using the following command to run the `verify` goal with the `arq-remote` profile activated and the proper URL: -[source,options="nowrap",subs="+attributes"] ----- -$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route {artifactId} --template='{{ .spec.host }}') ----- - -[NOTE] -==== -The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from. -==== - -:leveloffset: 1 - -:leveloffset!: diff --git a/helloworld-ws/README.html b/helloworld-ws/README.html deleted file mode 100644 index 5903a21967..0000000000 --- a/helloworld-ws/README.html +++ /dev/null @@ -1,907 +0,0 @@ - - - - - - - - -helloworld-ws: Hello World JAX-WS Web Service - - - - - -
-
-
-
-
-The helloworld-ws quickstart demonstrates a simple Hello World application, bundled and deployed as a WAR, that uses JAX-WS to say Hello. -
-
-
-
-
-

What is it?

-
-
-

The helloworld-ws quickstart demonstrates the use of JAX-WS in Red Hat JBoss Enterprise Application Platform as a simple Hello World application.

-
-
-
-
-

System Requirements

-
-
-

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 8.0 or later.

-
-
-

All you need to build this project is Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later. See Configure Maven to Build and Deploy the Quickstarts to make sure you are configured correctly for testing the quickstarts.

-
-
-
-
-

Use of the EAP_HOME and QUICKSTART_HOME Variables

-
-
-

In the following instructions, replace EAP_HOME with the actual path to your JBoss EAP installation. The installation path is described in detail here: Use of EAP_HOME and JBOSS_HOME Variables.

-
-
-

When you see the replaceable variable QUICKSTART_HOME, replace it with the path to the root directory of all of the quickstarts.

-
-
-
-
-

Building and running the quickstart application with a JBoss EAP server distribution

-
-
-

Start the JBoss EAP Standalone Server

-
-
    -
  1. -

    Open a terminal and navigate to the root of the JBoss EAP directory.

    -
  2. -
  3. -

    Start the JBoss EAP server with the default profile by typing the following command.

    -
    -
    -
    $ EAP_HOME/bin/standalone.sh 
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\standalone.bat script. -
    -
    -
  4. -
-
-
-
-

Build and Deploy the Quickstart

-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type the following command to build the quickstart.

    -
    -
    -
    $ mvn clean package
    -
    -
    -
  6. -
  7. -

    Type the following command to deploy the quickstart.

    -
    -
    -
    $ mvn wildfly:deploy
    -
    -
    -
  8. -
-
-
-

This deploys the helloworld-ws/target/helloworld-ws.war to the running instance of the server.

-
-
-

You should see a message in the server log indicating that the archive deployed successfully.

-
-
-

Review the server log to see useful information about the deployed web service endpoint.

-
-
-
-
JBWS024061: Adding service endpoint metadata: id=org.jboss.as.quickstarts.wshelloworld.HelloWorldServiceImpl
- address=http://localhost:8080/{artifactId}/HelloWorldService
- implementor=org.jboss.as.quickstarts.wshelloworld.HelloWorldServiceImpl
- serviceName={http://www.jboss.org/eap/quickstarts/wshelloworld/HelloWorld}HelloWorldService
- portName={http://www.jboss.org/eap/quickstarts/wshelloworld/HelloWorld}HelloWorld
- annotationWsdlLocation=null
- wsdlLocationOverride=null
- mtomEnabled=false
-
-
-
-
-

Access the Application

-
-

You can verify that the Web Service is running and deployed correctly by accessing the following URL: http://localhost:8080/helloworld-ws/HelloWorldService?wsdl. This URL will display the deployed WSDL endpoint for the Web Service.

-
-
-
-

Run the Arquillian Integration Tests

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
-

Follow these steps to run the integration tests.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server, as previously described.

    -
  2. -
  3. -

    Make sure you build and deploy the quickstart, as previously described.

    -
  4. -
  5. -

    Type the following command to run the verify goal with the arq-remote profile activated.

    -
    -
    -
    $ mvn verify -Parq-remote
    -
    -
    -
  6. -
-
-
- - - - - -
-
Note
-
-
-

You may also use the environment variable SERVER_HOST or the system property server.host to define the target host of the tests.

-
-
-
-
-
-

Investigate the Console Output

-
-

When you run the Arquillian tests, Maven prints summary of the performed tests to the console. You should see the following results.

-
-
-
-
-------------------------------------------------------
-T E S T S
--------------------------------------------------------
-Running org.jboss.as.quickstarts.wshelloworld.ClientArqTest
-[Client] Requesting the WebService to say Hello.
-[WebService] Hello World!
-[Client] Requesting the WebService to say Hello to John.
-[WebService] Hello John!
-[Client] Requesting the WebService to say Hello to John, Mary and Mark.
-[WebService] Hello John, Mary & Mark!
-Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.988 sec
-
-
-
-
-

Undeploy the Quickstart

-
-

When you are finished testing the quickstart, follow these steps to undeploy the archive.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type this command to undeploy the archive:

    -
    -
    -
    $ mvn wildfly:undeploy
    -
    -
    -
  6. -
-
-
-
-
-
-

Building and running the quickstart application with OpenShift

-
-
-

Build the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

On OpenShift, the S2I build with Apache Maven will use an openshift profile used to provision a JBoss EAP server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named openshift when building the quickstart:

-
-
-
-
$ mvn clean package -Popenshift
-
-
-
-

The provisioned JBoss EAP server for OpenShift, with the quickstart deployed, can then be found in the target/server directory, and its usage is similar to a standard server distribution. -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.

-
-
-

The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart pom.xml:

-
-
-
-
        <profile>
-            <id>openshift</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.jboss.eap.plugins</groupId>
-                        <artifactId>eap-maven-plugin</artifactId>
-                        <version>${version.eap.maven.plugin}</version>
-                        <configuration>
-                            <feature-packs>
-                                <feature-pack>
-                                    <location>org.jboss.eap:wildfly-ee-galleon-pack</location>
-                                </feature-pack>
-                                <feature-pack>
-                                    <location>org.jboss.eap.cloud:eap-cloud-galleon-pack</location>
-                                </feature-pack>
-                            </feature-packs>
-                            <layers>
-                                <layer>cloud-server</layer>
-                            </layers>
-                            <filename>ROOT.war</filename>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>package</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-
-
-
- - - - - -
-
Note
-
-
-

Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the /helloworld-ws path segment after HOST:PORT.

-
-
-
-
-
-

Getting Started with JBoss EAP for OpenShift and Helm Charts

-
-

This section contains the basic instructions to build and deploy this quickstart to JBoss EAP for OpenShift or JBoss EAP for OpenShift Online using Helm Charts.

-
-
-

Prerequisites

-
-
    -
  • -

    You must be logged in OpenShift and have an oc client to connect to OpenShift

    -
  • -
  • -

    Helm must be installed to deploy the backend on OpenShift.

    -
  • -
-
-
-

Once you have installed Helm, you need to add the repository that provides Helm Charts for JBoss EAP.

-
-
-
-
$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/
-"jboss-eap" has been added to your repositories
-$ helm search repo jboss-eap
-NAME                    CHART VERSION   APP VERSION     DESCRIPTION
-jboss-eap/eap8         ...             ...             A Helm chart to build and deploy EAP 8.0 applications
-
-
-
-
-

Deploy the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

Log in to your OpenShift instance using the oc login command. -The backend will be built and deployed on OpenShift with a Helm Chart for JBoss EAP.

-
-
-

Navigate to the root directory of this quickstart and run the following command:

-
-
-
-
$ helm install helloworld-ws -f charts/helm.yaml jboss-eap/eap8
-NAME: helloworld-ws
-...
-STATUS: deployed
-REVISION: 1
-
-
-
-

The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17:

-
-
-
-
build:
-  uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git
-  ref: 8.0.x
-  contextDir: helloworld-ws
-deploy:
-  replicas: 1
-
-
-
-

This will create a new deployment on OpenShift and deploy the application.

-
-
-

If you want to see all the configuration elements to customize your deployment you can use the following command:

-
-
-
-
$ helm show readme jboss-eap/eap8
-
-
-
-

Let’s wait for the application to be built and deployed:

-
-
-
-
$ oc get deployment helloworld-ws -w
-NAME         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
-helloworld-ws   1         1         1            0           12s
-...
-helloworld-ws   1         1         1            1           2m
-
-
-
-

Get the URL of the route to the deployment.

-
-
-
-
$ oc get route helloworld-ws -o jsonpath="{.spec.host}"
-
-
-
-

Access the application in your web browser using the displayed URL.

-
-
- - - - - -
-
Note
-
-
-

The Maven profile named openshift is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the /helloworld-ws path segment after HOST:PORT.

-
-
-
-
-
-

Undeploy the JBoss EAP Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts

-
-
-
$ helm uninstall helloworld-ws
-
-
-
-
-
-

Run the Arquillian Integration Tests with OpenShift

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
- - - - - -
-
Note
-
-
-

The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin.

-
-
-
-
-

Run the integration tests using the following command to run the verify goal with the arq-remote profile activated and the proper URL:

-
-
-
-
$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route helloworld-ws --template='{{ .spec.host }}')
-
-
-
- - - - - -
-
Note
-
-
-

The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from.

-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/helloworld-ws/charts/helm.yaml b/helloworld-ws/charts/helm.yaml deleted file mode 100644 index 5421012bce..0000000000 --- a/helloworld-ws/charts/helm.yaml +++ /dev/null @@ -1,6 +0,0 @@ -build: - uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git - ref: 8.0.x - contextDir: helloworld-ws -deploy: - replicas: 1 \ No newline at end of file diff --git a/helloworld-ws/pom.xml b/helloworld-ws/pom.xml deleted file mode 100644 index 45007811df..0000000000 --- a/helloworld-ws/pom.xml +++ /dev/null @@ -1,291 +0,0 @@ - - - - 4.0.0 - - org.jboss.eap.quickstarts - jboss-eap-quickstart-parent - - 6.0.0.redhat-00001 - - - helloworld-ws - 8.0.0.GA - war - Quickstart: helloworld-ws - This project demonstrates a Hello World JAX-WS web service - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - 8.0.0.GA-redhat-00009 - 1.0.0.Final-redhat-00014 - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - never - - default - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - never - - - true - never - - default - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - - - true - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - - - true - - - - - - - - - org.jboss.bom - jboss-eap-ee-with-tools - ${version.server.bom} - pom - import - - - - - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - - - junit - junit - test - jar - - - org.jboss.arquillian.container - arquillian-container-test-api - test - jar - - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet-jakarta - test - - - org.wildfly.arquillian - wildfly-arquillian-common - test - - - org.jboss.eap - wildfly-jaxws-client-bom - pom - test - - - - - jakarta.annotation - jakarta.annotation-api - provided - - - - - jakarta.servlet - jakarta.servlet-api - provided - - - org.jboss.spec.jakarta.xml.ws - jboss-jakarta-xml-ws-api_4.0_spec - provided - - - - - - - - - arq-remote - - - org.wildfly.arquillian - wildfly-arquillian-container-remote - test - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/RemoteClientIT - - - **/ClientArqIT - **/ClientIT - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} - - - **/ClientIT - - - **/ClientArqIT - **/RemoteClientIT - - - - - - verify - - - - - - - - - openshift - - - - org.apache.maven.plugins - maven-war-plugin - - ${project.artifactId} - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - - org.jboss.eap.channels - eap-8.0 - - - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - webservices - - ${project.artifactId}.war - - - - - package - - - - - - - - - - diff --git a/helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldService.java b/helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldService.java deleted file mode 100644 index 6e75b79dcf..0000000000 --- a/helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldService.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.wshelloworld; - -import java.util.List; -import jakarta.jws.WebMethod; -import jakarta.jws.WebService; - -/** - * A simple example of how to setup a JAX-WS Web Service. It can say hello to everyone or to someone in particular. - * - * @author lnewson@redhat.com - */ - -@WebService(targetNamespace = "http://www.jboss.org/eap/quickstarts/wshelloworld/HelloWorld") -public interface HelloWorldService { - - /** - * Say hello as a response - * - * @return A simple hello world message - */ - @WebMethod - String sayHello(); - - /** - * Say hello to someone precisely - * - * @param name The name of the person to say hello to - * @return the number of current bookings - */ - @WebMethod - String sayHelloToName(String name); - - /** - * Say hello to a list of people - * - * @param names The list of names to say hello to - * @return the number of current bookings - */ - @WebMethod - String sayHelloToNames(List names); -} diff --git a/helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldServiceImpl.java b/helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldServiceImpl.java deleted file mode 100644 index c42badd8f5..0000000000 --- a/helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldServiceImpl.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.wshelloworld; - -import java.util.ArrayList; -import java.util.List; - -import jakarta.jws.WebService; - -/** - * The implementation of the HelloWorld JAX-WS Web Service. - * - * @author lnewson@redhat.com - */ -@WebService(serviceName = "HelloWorldService", portName = "HelloWorld", name = "HelloWorld", endpointInterface = "org.jboss.as.quickstarts.wshelloworld.HelloWorldService", - targetNamespace = "http://www.jboss.org/eap/quickstarts/wshelloworld/HelloWorld") -public class HelloWorldServiceImpl implements HelloWorldService { - - @Override - public String sayHello() { - return "Hello World!"; - } - - @Override - public String sayHelloToName(final String name) { - - /* Create a list with just the one value */ - final List names = new ArrayList<>(); - names.add(name); - - return sayHelloToNames(names); - } - - @Override - public String sayHelloToNames(final List names) { - return "Hello " + createNameListString(names); - } - - /** - * Creates a list of names separated by commas or an and symbol if its the last separation. This is then used to say hello to - * the list of names. - * - * i.e. if the input was {John, Mary, Luke} the output would be John, Mary & Luke - * - * @param names A list of names - * @return The list of names separated as described above. - */ - private String createNameListString(final List names) { - - /* - * If the list is null or empty then assume the call was anonymous. - */ - if (names == null || names.isEmpty()) { - return "Anonymous!"; - } - - final StringBuilder nameBuilder = new StringBuilder(); - for (int i = 0; i < names.size(); i++) { - - /* - * Add the separator if its not the first string or the last separator since that should be an and (&) symbol. - */ - if (i != 0 && i != names.size() - 1) - nameBuilder.append(", "); - else if (i != 0 && i == names.size() - 1) - nameBuilder.append(" & "); - - nameBuilder.append(names.get(i)); - } - - nameBuilder.append("!"); - - return nameBuilder.toString(); - } -} diff --git a/helloworld-ws/src/main/webapp/WEB-INF/beans.xml b/helloworld-ws/src/main/webapp/WEB-INF/beans.xml deleted file mode 100644 index d3ddf148e7..0000000000 --- a/helloworld-ws/src/main/webapp/WEB-INF/beans.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/helloworld-ws/src/main/webapp/index.html b/helloworld-ws/src/main/webapp/index.html deleted file mode 100644 index 144a666967..0000000000 --- a/helloworld-ws/src/main/webapp/index.html +++ /dev/null @@ -1,39 +0,0 @@ - - - helloworld-ws Quickstart - - - -

helloworld-ws Quickstart

-

- The helloworld-ws quickstart demonstrates the use of JAX-WS in - Red Hat JBoss Enterprise Application Platform as a simple Hello World application. -

-

- There is no user interface for this quickstart. Instead, you can verify the - Web Service is running and deployed correctly by accessing the following URL: -

- -

- This URL will display the WSDL definition for the deployed Web Service endpoint. -

- - - diff --git a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/Client.java b/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/Client.java deleted file mode 100644 index 7eba80e145..0000000000 --- a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/Client.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.wshelloworld; - -import javax.xml.namespace.QName; -import jakarta.xml.ws.Service; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.List; - -/** - * A Client stub to the HelloWorld JAX-WS Web Service. - * - * @author lnewson@redhat.com - */ -public class Client implements HelloWorldService { - private HelloWorldService helloWorldService; - - /** - * Default constructor - * - * @param wsdlUrl The URL to the Hello World WSDL endpoint. - */ - public Client(final URL wsdlUrl) { - QName serviceName = new QName("http://www.jboss.org/eap/quickstarts/wshelloworld/HelloWorld", "HelloWorldService"); - - Service service = Service.create(wsdlUrl, serviceName); - helloWorldService = service.getPort(HelloWorldService.class); - assert (helloWorldService != null); - } - - /** - * Default constructor - * - * @param url The URL to the Hello World WSDL endpoint. - * @throws MalformedURLException if the WSDL url is malformed. - */ - public Client(final String url) throws MalformedURLException { - this(new URL(url)); - } - - /** - * Gets the Web Service to say hello - */ - @Override - public String sayHello() { - return helloWorldService.sayHello(); - } - - /** - * Gets the Web Service to say hello to someone - */ - @Override - public String sayHelloToName(final String name) { - return helloWorldService.sayHelloToName(name); - } - - /** - * Gets the Web Service to say hello to a group of people - */ - @Override - public String sayHelloToNames(final List names) { - return helloWorldService.sayHelloToNames(names); - } -} diff --git a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientArqIT.java b/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientArqIT.java deleted file mode 100644 index 5ad885a81c..0000000000 --- a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientArqIT.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.wshelloworld; - -import static org.junit.Assert.assertEquals; - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * Simple set of tests for the HelloWorld Web Service to demonstrate accessing the web service using a client - * - * @author lnewson@redhat.com - */ -@RunWith(Arquillian.class) -@RunAsClient -public class ClientArqIT { - /** - * The name of the WAR Archive that will be used by Arquillian to deploy the application. - */ - private static final String APP_NAME = "helloworld-ws"; - /** - * The path of the WSDL endpoint in relation to the deployed web application. - */ - private static final String WSDL_PATH = "HelloWorldService?wsdl"; - - @ArquillianResource - private URL deploymentUrl; - - private HelloWorldService client; - - @Deployment(testable = false) - public static WebArchive createDeployment() { - return ShrinkWrap.create(WebArchive.class, APP_NAME + ".war").addPackage(HelloWorldService.class.getPackage()); - } - - @Before - public void setup() { - try { - client = new Client(new URL(deploymentUrl, WSDL_PATH)); - } catch (MalformedURLException e) { - e.printStackTrace(); - } - } - - @Test - public void testHello() { - System.out.println("[Client] Requesting the WebService to say Hello."); - - // Get a response from the WebService - final String response = client.sayHello(); - assertEquals(response, "Hello World!"); - - System.out.println("[WebService] " + response); - - } - - @Test - public void testHelloName() { - System.out.println("[Client] Requesting the WebService to say Hello to John."); - - // Get a response from the WebService - final String response = client.sayHelloToName("John"); - assertEquals(response, "Hello John!"); - - System.out.println("[WebService] " + response); - } - - @Test - public void testHelloNames() { - System.out.println("[Client] Requesting the WebService to say Hello to John, Mary and Mark."); - - // Create the array of names for the WebService to say hello to. - final List names = new ArrayList<>(); - names.add("John"); - names.add("Mary"); - names.add("Mark"); - - // Get a response from the WebService - final String response = client.sayHelloToNames(names); - assertEquals(response, "Hello John, Mary & Mark!"); - - System.out.println("[WebService] " + response); - } -} diff --git a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientIT.java b/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientIT.java deleted file mode 100644 index 8e7ef788ca..0000000000 --- a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientIT.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.wshelloworld; - -import static org.junit.Assert.assertEquals; - -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * Simple set of tests for the HelloWorld Web Service to demonstrate accessing the web service using a client - * - * @author lnewson@redhat.com - */ -public class ClientIT { - /** - * The path of the WSDL endpoint in relation to the deployed web application. - */ - private static final String WSDL_PATH = "HelloWorldService?wsdl"; - - protected static URL getHTTPEndpoint() { - String host = getServerHost(); - if (host == null) { - host = "http://localhost:8080"; - } - try { - return new URI(host + "/helloworld-ws/" + WSDL_PATH).toURL(); - } catch (URISyntaxException | MalformedURLException ex) { - throw new RuntimeException(ex); - } - } - - private static String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host"); - } - return host; - } - private static URL deploymentUrl; - - private HelloWorldService client; - - @BeforeClass - public static void beforeClass() throws MalformedURLException { - URL deploymentUrl = getHTTPEndpoint(); - - System.out.println("WSDL Deployment URL: " + deploymentUrl); - - // Set the deployment url - ClientIT.deploymentUrl = deploymentUrl; - } - - @Before - public void setup() { - try { - client = new Client(new URL(deploymentUrl, WSDL_PATH)); - } catch (MalformedURLException e) { - e.printStackTrace(); - } - } - - @Test - public void testHello() { - System.out.println("[Client] Requesting the WebService to say Hello."); - - // Get a response from the WebService - final String response = client.sayHello(); - assertEquals(response, "Hello World!"); - - System.out.println("[WebService] " + response); - - } - - @Test - public void testHelloName() { - System.out.println("[Client] Requesting the WebService to say Hello to John."); - - // Get a response from the WebService - final String response = client.sayHelloToName("John"); - assertEquals(response, "Hello John!"); - - System.out.println("[WebService] " + response); - } - - @Test - public void testHelloNames() { - System.out.println("[Client] Requesting the WebService to say Hello to John, Mary and Mark."); - - // Create the array of names for the WebService to say hello to. - final List names = new ArrayList<>(); - names.add("John"); - names.add("Mary"); - names.add("Mark"); - - // Get a response from the WebService - final String response = client.sayHelloToNames(names); - assertEquals(response, "Hello John, Mary & Mark!"); - - System.out.println("[WebService] " + response); - } -} diff --git a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/RemoteClientIT.java b/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/RemoteClientIT.java deleted file mode 100644 index 2bdf897fb9..0000000000 --- a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/RemoteClientIT.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2022 Red Hat, Inc. - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jboss.as.quickstarts.wshelloworld; - -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.junit.runner.RunWith; - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -@RunWith(Arquillian.class) -@RunAsClient -public class RemoteClientIT extends ClientIT { - -} diff --git a/helloworld/.cheatsheet.xml b/helloworld/.cheatsheet.xml deleted file mode 100644 index f7aba506ce..0000000000 --- a/helloworld/.cheatsheet.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - This quickstart demonstrates the use of CDI 1.0 and Servlet 3.0. It is a simple application that can be used to verify the JBoss EAP server is configured and running correctly. -
-
- CDI -
-
- Contexts and Dependency Injection (CDI) defines a set of complementary services that help improve the structure of application code. CDI provides type-safe dependency injection and shrinks the application code base by replace large sections of code with annotations. It also simplifies packaging and deployments and provides lifecycle management - via contexts. -
-
- Servlet 3.0 -
- Servlet 3.0 introduces @Servlet, @ServletFilter, @FilterMapping, and other annotations to ease development of servlet applications. -
-
- - - The helloworld application is a simple example that helps you get started with Jakarta EE. This example demonstrates CDI and uses a servlet for the user interface. -
-
- As usual, let's start by looking at the necessary deployment descriptors. - By now, we're very used to seeing - beans.xml - in - WEB-INF/ - , which can be found in the - src/main/webapp - directory of the example. - Notice that we don't need a - web.xml - file. - This example does not contain a JSF file. The user interface is provided by the servlet. -
- -
- - - - Let's take a look at the servlet that handles the request. - - - - - - - - - - - - - - - - - - This HTML page is the default landing page for the application. - - - - - - -
diff --git a/helloworld/README-source.adoc b/helloworld/README-source.adoc deleted file mode 100644 index 50a6776464..0000000000 --- a/helloworld/README-source.adoc +++ /dev/null @@ -1,44 +0,0 @@ -include::../shared-doc/attributes.adoc[] - -= helloworld: Helloworld Example -:author: Pete Muir -:level: Beginner -:technologies: Servlet -:openshift: true - -[abstract] -The `helloworld` quickstart demonstrates the use of Servlet 6 and is a good starting point to verify {productName} is configured correctly. - -:standalone-server-type: default -:archiveType: war - -== What is it? - -The `helloworld` quickstart demonstrates the use of _Servlet 6_ in {productNameFull} {productVersion}. - -// System Requirements -include::../shared-doc/system-requirements.adoc[leveloffset=+1] -// Use of {jbossHomeName} -include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1] - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Start the {productName} Standalone Server -include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+2] -// Build and Deploy the Quickstart -include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+2] - -=== Access the Application -The application will be running at the following URL: http://localhost:8080/{artifactId}/. - -// Testing with Arquillian -include::../shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc[leveloffset=+2] -// Undeploy the Quickstart -include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2] - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1] \ No newline at end of file diff --git a/helloworld/README.adoc b/helloworld/README.adoc deleted file mode 100644 index 52bc174e83..0000000000 --- a/helloworld/README.adoc +++ /dev/null @@ -1,828 +0,0 @@ -ifdef::env-github[] -:artifactId: helloworld -endif::[] - -//*********************************************************************************** -// Enable the following flag to build README.html files for JBoss EAP product builds. -// Comment it out for WildFly builds. -//*********************************************************************************** -:ProductRelease: - -//*********************************************************************************** -// Enable the following flag to build README.html files for EAP XP product builds. -// Comment it out for WildFly or JBoss EAP product builds. -//*********************************************************************************** -//:EAPXPRelease: - -// This is a universal name for all releases -:ProductShortName: JBoss EAP -// Product names and links are dependent on whether it is a product release (CD or JBoss) -// or the WildFly project. -// The "DocInfo*" attributes are used to build the book links to the product documentation - -ifdef::ProductRelease[] -// JBoss EAP release -:productName: JBoss EAP -:productNameFull: Red Hat JBoss Enterprise Application Platform -:productVersion: 8.0 -:DocInfoProductNumber: {productVersion} -:WildFlyQuickStartRepoTag: 8.0.x -:productImageVersion: 8.0.0 -:helmChartName: jboss-eap/eap8 -endif::[] - -ifdef::EAPXPRelease[] -// JBoss EAP XP release -:productName: JBoss EAP XP -:productNameFull: Red Hat JBoss Enterprise Application Platform expansion pack -:productVersion: 3.0 -:DocInfoProductNumber: 7.4 -:WildFlyQuickStartRepoTag: XP_3.0.0.GA -:productImageVersion: 3.0 -:helmChartName: jboss-eap/eap-xp3 -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -:githubRepoUrl: https://github.com/jboss-developer/jboss-eap-quickstarts/ -:githubRepoCodeUrl: https://github.com/jboss-developer/jboss-eap-quickstarts.git -:jbossHomeName: EAP_HOME -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:quickstartDownloadName: {productNameFull} {productVersion} Quickstarts -:quickstartDownloadUrl: https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=appplatform&downloadType=distributions -:helmRepoName: jboss-eap -:helmRepoUrl: https://jbossas.github.io/eap-charts/ -// END ifdef::ProductRelease,EAPXPRelease[] -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -// WildFly project -:productName: WildFly -:productNameFull: WildFly Application Server -:ProductShortName: {productName} -:jbossHomeName: WILDFLY_HOME -:productVersion: 28 -:productImageVersion: 28.0 -:githubRepoUrl: https://github.com/wildfly/quickstart/ -:githubRepoCodeUrl: https://github.com/wildfly/quickstart.git -:WildFlyQuickStartRepoTag: 28.0.1.Final -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -// Do not update the following until after the 7.4 docs are published! -:DocInfoProductNumber: 7.4 -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:helmRepoName: wildfly -:helmRepoUrl: http://docs.wildfly.org/wildfly-charts/ -:helmChartName: wildfly/wildfly -// END ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -endif::[] - -:source: {githubRepoUrl} - -// Values for Openshift S2i sections attributes -:CDProductName: {productNameFull} for OpenShift -:CDProductShortName: {ProductShortName} for OpenShift -:CDProductTitle: {CDProductName} -:CDProductNameSentence: Openshift release for {ProductShortName} -:CDProductAcronym: {CDProductShortName} -:CDProductVersion: {productVersion} -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {EapForOpenshiftBookName} Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {xpaasproduct} Online -:xpaasproduct-shortname: {CDProductShortName} -:xpaasproductOpenShiftOnline-shortname: {xpaasproduct-shortname} Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: Getting Started with {ProductShortName} for OpenShift Container Platform -:EapForOpenshiftOnlineBookName: Getting Started with {ProductShortName} for OpenShift Online -:OpenShiftOnlinePlatformName: Red Hat OpenShift Container Platform -:OpenShiftOnlineName: Red Hat OpenShift Online -:ImagePrefixVersion: eap80 -:ImageandTemplateImportBaseURL: https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift - -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepo: https://github.com/jboss-developer/jboss-eap-quickstarts -:EAPQuickStartRepoRef: 8.0.x -:EAPQuickStartRepoTag: EAP_8.0.0.GA -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_container_platform/ -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_online/ - -ifdef::EAPXPRelease[] -// Attributes for XP releases -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {productNameFull} for OpenShift Online -:xpaasproduct-shortname: {ProductShortName} for OpenShift -:xpaasproductOpenShiftOnline-shortname: {ProductShortName} for OpenShift Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:ImagePrefixVersion: eap-xp3 -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepoRef: xp-3.0.x -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -endif::[] - -ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -:ImageandTemplateImportURL: https://raw.githubusercontent.com/wildfly/wildfly-s2i/v{productVersion}.0/ -endif::[] - -//************************* -// Other values -//************************* -:buildRequirements: Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later -:jbdsEapServerName: Red Hat JBoss Enterprise Application Platform 7.3 -:javaVersion: Jakarta EE 10 -ifdef::EAPXPRelease[] -:javaVersion: Eclipse MicroProfile -endif::[] -:githubRepoBranch: master -:guidesBaseUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/ -:useEclipseUrl: {guidesBaseUrl}USE_JBDS.adoc#use_red_hat_jboss_developer_studio_or_eclipse_to_run_the_quickstarts -:useEclipseDeployJavaClientDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_containing_server_and_java_client_projects -:useEclipseDeployEARDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_ear_project -:useProductHomeDocUrl: {guidesBaseUrl}USE_OF_{jbossHomeName}.adoc#use_of_product_home_and_jboss_home_variables -:configureMavenDocUrl: {guidesBaseUrl}CONFIGURE_MAVEN_JBOSS_EAP.adoc#configure_maven_to_build_and_deploy_the_quickstarts -:arquillianTestsDocUrl: {guidesBaseUrl}RUN_ARQUILLIAN_TESTS.adoc#run_the_arquillian_tests -:addUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#create_users_required_by_the_quickstarts -:addApplicationUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_application_user -:addManagementUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_management_user -:startServerDocUrl: {guidesBaseUrl}START_JBOSS_EAP.adoc#start_the_jboss_eap_server -:configurePostgresDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_database_for_use_with_the_quickstarts -:configurePostgresDownloadDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#download_and_install_postgresql -:configurePostgresCreateUserDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#create_a_database_user -:configurePostgresAddModuleDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#add_the_postgres_module_to_the_jboss_eap_server -:configurePostgresDriverDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_driver_in_the_jboss_eap_server -:configureBytemanDownloadDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#download_and_configure_byteman -:configureBytemanDisableDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#disable_the_byteman_script -:configureBytemanClearDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#clear_the_transaction_object_store -:configureBytemanQuickstartDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts -:configureBytemanHaltDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#use_byteman_to_halt_the_application[ -:configureBytemanQuickstartsDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts - -:EESubsystemNamespace: urn:jboss:domain:ee:4.0 -:IiopOpenJdkSubsystemNamespace: urn:jboss:domain:iiop-openjdk:2.0 -:MailSubsystemNamespace: urn:jboss:domain:mail:3.0 -:SingletonSubsystemNamespace: urn:jboss:domain:singleton:1.0 -:TransactionsSubsystemNamespace: urn:jboss:domain:transactions:4.0 - -// LinkProductDocHome: https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/ -:LinkProductDocHome: https://access.redhat.com/documentation/en/jboss-enterprise-application-platform-continuous-delivery -:LinkConfigGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/configuration_guide/ -:LinkDevelopmentGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/development_guide/ -:LinkGettingStartedGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_guide/ -:LinkOpenShiftWelcome: https://docs.openshift.com/online/welcome/index.html -:LinkOpenShiftSignup: https://docs.openshift.com/online/getting_started/choose_a_plan.html -:OpenShiftTemplateName: JBoss EAP CD (no https) - -:ConfigBookName: Configuration Guide -:DevelopmentBookName: Development Guide -:GettingStartedBookName: Getting Started Guide - -:JBDSProductName: Red Hat CodeReady Studio -:JBDSVersion: 12.15 -:LinkJBDSInstall: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/installation_guide/ -:JBDSInstallBookName: Installation Guide -:LinkJBDSGettingStarted: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/getting_started_with_codeready_studio_tools/ -:JBDSGettingStartedBookName: Getting Started with CodeReady Studio Tools - -= helloworld: Helloworld Example -:author: Pete Muir -:level: Beginner -:technologies: Servlet -:openshift: true - -[abstract] -The `helloworld` quickstart demonstrates the use of Servlet 6 and is a good starting point to verify {productName} is configured correctly. - -:standalone-server-type: default -:archiveType: war - -== What is it? - -The `helloworld` quickstart demonstrates the use of _Servlet 6_ in {productNameFull} {productVersion}. - -// System Requirements -:leveloffset: +1 - -[[system_requirements]] -= System Requirements -//****************************************************************************** -// Include this template to describe the standard system requirements for -// running the quickstarts. -// -// The Forge quickstarts define a `forge-from-scratch` attribute because they -// run entirely in CodeReady Studio and have different requirements . -//****************************************************************************** - -The application this project produces is designed to be run on {productNameFull} {productVersion} or later. - -All you need to build this project is {buildRequirements}. See link:{configureMavenDocUrl}[Configure Maven to Build and Deploy the Quickstarts] to make sure you are configured correctly for testing the quickstarts. - -:leveloffset!: -// Use of {jbossHomeName} -:leveloffset: +1 - -ifdef::requires-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -This quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifdef::optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -When deploying this quickstart to a managed domain, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When deploying this quickstart to multiple standalone servers, this quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifndef::requires-multiple-servers,optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName} and QUICKSTART_HOME Variables - -In the following instructions, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -:leveloffset!: - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Start the {productName} Standalone Server -:leveloffset: +2 - -[[start_the_eap_standalone_server]] -= Start the {productName} Standalone Server -//****************************************************************************** -// Include this template if your quickstart requires a normal start of a single -// standalone server. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// custom -// -// * For mobile applications, you can define the `mobileApp` variable in the -// `README.adoc` file to add `-b 0.0.0.0` to the command line. This allows -// external clients, such as phones, tablets, and desktops, to connect -// to the application through through your local network -// ::mobileApp: {artifactId}-service -// -//****************************************************************************** - -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -. Open a terminal and navigate to the root of the {productName} directory. -. Start the {productName} server with the {serverProfile} by typing the following command. -+ -ifdef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __JAEGER_REPORTER_LOG_SPANS=true JAEGER_SAMPLER_TYPE=const JAEGER_SAMPLER_PARAM=1__ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -ifndef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\standalone.bat` script. - -ifdef::mobileApp[] -+ -Adding `-b 0.0.0.0` to the above command allows external clients, such as phones, tablets, and desktops, to connect through your local network. For example: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} -b 0.0.0.0 ----- -endif::[] - -:leveloffset!: -// Build and Deploy the Quickstart -:leveloffset: +2 - -[[build_and_deploy_the_quickstart]] -= Build and Deploy the Quickstart -//****************************************************************************** -// Include this template if your quickstart does a normal deployment of a archive. -// -// * Define the `archiveType` variable in the quickstart README file. -// Supported values: -// :archiveType: ear -// :archiveType: war -// :archiveType: jar -// -// * To override the archive name, which defaults to the {artifactId), -// define the `archiveName` variable, for example: -// :archiveName: {artifactId}-service -// -// * To override the archive output directory, -// define the `archiveDir` variable, for example: -// :archiveDir: ear/target -// -// * To override the Maven command, define the `mavenCommand` variable, -// for example: -// :mavenCommand: clean install wildfly:deploy -//****************************************************************************** - -// The archive name defaults to the artifactId if not overridden -ifndef::archiveName[] -:archiveName: {artifactId} -endif::archiveName[] - -// The archive type defaults to war if not overridden -ifndef::archiveType[] -:archiveType: war -endif::archiveType[] - -// Define the archive file name as the concatenation of "archiveName" + "." + "archiveType+ -:archiveFileName: {archiveName}.{archiveType} - -// If they have not defined the target archive directory, make it the default for the archive type. -ifndef::archiveDir[] - -ifeval::["{archiveType}"=="ear"] -:archiveDir: {artifactId}/ear/target -endif::[] - -ifeval::["{archiveType}"=="war"] -:archiveDir: {artifactId}/target -endif::[] - -ifeval::["{archiveType}"=="jar"] -:archiveDir: {artifactId}/target -endif::[] - -endif::archiveDir[] - -ifndef::mavenCommand[] -ifeval::["{archiveType}"=="ear"] -:mavenCommand: clean install -endif::[] - -ifeval::["{archiveType}"=="war"] -:mavenCommand: clean package -endif::[] - -ifeval::["{archiveType}"=="jar"] -:mavenCommand: clean install -endif::[] - -endif::mavenCommand[] - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -ifdef::reactive-messaging[] -. Run this command to enable the MicroProfile Reactive Messaging functionality on the server -+ -[source,subs="attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=enable-reactive-messaging.cli ----- -endif::reactive-messaging[] -. Type the following command to build the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn {mavenCommand} ----- - -. Type the following command to deploy the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn wildfly:deploy ----- - -ifdef::rest-client-qs[] -This builds and deploys the `country-server` and `country-client` to the running instance of the server. - -You should see a message in the server log indicating that the archives deployed successfully. -endif::[] -ifndef::rest-client-qs[] -This deploys the `{archiveDir}/{archiveFileName}` to the running instance of the server. - -You should see a message in the server log indicating that the archive deployed successfully. -endif::[] - - -:leveloffset!: - -=== Access the Application -The application will be running at the following URL: http://localhost:8080/{artifactId}/. - -// Testing with Arquillian -:leveloffset: +2 - -[[run_the_arquillian_integration_tests_with_server_distribution]] -= Run the Arquillian Integration Tests -//****************************************************************************** -// Include this template if your quickstart provides standard Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -Follow these steps to run the integration tests. - -. Make sure you start the {productName} server, as previously described. - -. Make sure you build and deploy the quickstart, as previously described. - -. Type the following command to run the `verify` goal with the `arq-remote` profile activated. -+ -[source,options="nowrap"] ----- -$ mvn verify -Parq-remote ----- - -[NOTE] -==== -You may also use the environment variable `SERVER_HOST` or the system property `server.host` to define the target host of the tests. -==== - -:leveloffset!: -// Undeploy the Quickstart -:leveloffset: +2 - -[[undeploy_the_quickstart]] -= Undeploy the Quickstart - -//******************************************************************************* -// Include this template if your quickstart does a normal undeployment of an archive. -//******************************************************************************* -When you are finished testing the quickstart, follow these steps to undeploy the archive. - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -. Type this command to undeploy the archive: -+ -[source,options="nowrap"] ----- -$ mvn wildfly:undeploy ----- - -:leveloffset!: - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -:leveloffset: +1 - -[[build_and_run_the_quickstart_on_openshift]] -= Building and running the quickstart application with OpenShift -// The openshift profile -:leveloffset: +1 - -[[build-the-quickstart-for-openshift]] -== Build the {productName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -On OpenShift, the S2I build with Apache Maven will use an `openshift` profile used to provision a {productName} server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named `openshift` when building the quickstart: - -[source,subs="attributes+",options="nowrap"] ----- -$ mvn clean package -Popenshift ----- - -The provisioned {productName} server for OpenShift, with the quickstart deployed, can then be found in the `target/server` directory, and its usage is similar to a standard server distribution. -ifndef::ProductRelease,EAPXPRelease[] -You may note that unlike the `provisioned-server` profile it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the WildFly Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.wildfly:wildfly-galleon-pack:${version.server} - - - org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp} - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -[NOTE] -==== -Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`. -==== - -:leveloffset: 1 -// Getting Started with Helm -:leveloffset: +1 - -[[getting_started_with_helm]] -= Getting Started with {xpaasproduct-shortname} and Helm Charts - -This section contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} using Helm Charts. - -[[prerequisites_helm_openshift]] -== Prerequisites - -* You must be logged in OpenShift and have an `oc` client to connect to OpenShift -* https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. - -Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}. - -ifndef::ProductRelease,EAPXPRelease[] -[source,options="nowrap"] ----- -$ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ -"wildfly" has been added to your repositories -$ helm search repo wildfly -NAME CHART VERSION APP VERSION DESCRIPTION -wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift -wildfly/wildfly-common ... ... A library chart for WildFly-based applications ----- -endif::[] -ifdef::ProductRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP {productVersion} applications ----- -endif::[] -ifdef::EAPXPRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP XP {productVersion} applications ----- -endif::[] - -:leveloffset: 1 -//Prepare Helm for Quickstart Deployment -:leveloffset: +1 - -[[deploy_helm]] -== Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -Log in to your OpenShift instance using the `oc login` command. -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -Navigate to the root directory of this quickstart and run the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm install {artifactId} -f charts/helm.yaml {helmChartName} -NAME: {artifactId} -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17: - -[source,options="nowrap",subs="+attributes"] ----- -build: - uri: {githubRepoCodeUrl} - ref: {WildFlyQuickStartRepoTag} - contextDir: {artifactId} -deploy: - replicas: 1 ----- - -This will create a new deployment on OpenShift and deploy the application. - -If you want to see all the configuration elements to customize your deployment you can use the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let’s wait for the application to be built and deployed: -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment {artifactId} -w -NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE -{artifactId} 1 1 1 0 12s -... -{artifactId} 1 1 1 1 2m ----- - -Get the URL of the route to the deployment. - -[source,options="nowrap",subs="+attributes"] ----- -$ oc get route {artifactId} -o jsonpath="{.spec.host}" ----- -Access the application in your web browser using the displayed URL. - -[NOTE] -==== -The Maven profile named `openshift` is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the `/{artifactId}` path segment after `HOST:PORT`. -==== - -[[undeploy_helm]] -== Undeploy the {ProductShortName} Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts - - -[source,options="nowrap",subs="+attributes"] ----- -$ helm uninstall {artifactId} ----- - -:leveloffset: 1 -// Testing on Openshift -:leveloffset: +1 - -[[run_the_arquillian_integration_tests_with_openshift]] -= Run the Arquillian Integration Tests with OpenShift -//****************************************************************************** -// Include this template if your quickstart provides Openshift Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -[NOTE] -==== -The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin. -==== - -Run the integration tests using the following command to run the `verify` goal with the `arq-remote` profile activated and the proper URL: -[source,options="nowrap",subs="+attributes"] ----- -$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route {artifactId} --template='{{ .spec.host }}') ----- - -[NOTE] -==== -The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from. -==== - -:leveloffset: 1 - -:leveloffset!: diff --git a/helloworld/README.html b/helloworld/README.html deleted file mode 100644 index 25381df9c2..0000000000 --- a/helloworld/README.html +++ /dev/null @@ -1,871 +0,0 @@ - - - - - - - - -helloworld: Helloworld Example - - - - - -
-
-
-
-
-The helloworld quickstart demonstrates the use of Servlet 6 and is a good starting point to verify JBoss EAP is configured correctly. -
-
-
-
-
-

What is it?

-
-
-

The helloworld quickstart demonstrates the use of Servlet 6 in Red Hat JBoss Enterprise Application Platform 8.0.

-
-
-
-
-

System Requirements

-
-
-

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 8.0 or later.

-
-
-

All you need to build this project is Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later. See Configure Maven to Build and Deploy the Quickstarts to make sure you are configured correctly for testing the quickstarts.

-
-
-
-
-

Use of the EAP_HOME and QUICKSTART_HOME Variables

-
-
-

In the following instructions, replace EAP_HOME with the actual path to your JBoss EAP installation. The installation path is described in detail here: Use of EAP_HOME and JBOSS_HOME Variables.

-
-
-

When you see the replaceable variable QUICKSTART_HOME, replace it with the path to the root directory of all of the quickstarts.

-
-
-
-
-

Building and running the quickstart application with a JBoss EAP server distribution

-
-
-

Start the JBoss EAP Standalone Server

-
-
    -
  1. -

    Open a terminal and navigate to the root of the JBoss EAP directory.

    -
  2. -
  3. -

    Start the JBoss EAP server with the default profile by typing the following command.

    -
    -
    -
    $ EAP_HOME/bin/standalone.sh 
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\standalone.bat script. -
    -
    -
  4. -
-
-
-
-

Build and Deploy the Quickstart

-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type the following command to build the quickstart.

    -
    -
    -
    $ mvn clean package
    -
    -
    -
  6. -
  7. -

    Type the following command to deploy the quickstart.

    -
    -
    -
    $ mvn wildfly:deploy
    -
    -
    -
  8. -
-
-
-

This deploys the helloworld/target/helloworld.war to the running instance of the server.

-
-
-

You should see a message in the server log indicating that the archive deployed successfully.

-
-
-
-

Access the Application

-
-

The application will be running at the following URL: http://localhost:8080/helloworld/.

-
-
-
-

Run the Arquillian Integration Tests

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
-

Follow these steps to run the integration tests.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server, as previously described.

    -
  2. -
  3. -

    Make sure you build and deploy the quickstart, as previously described.

    -
  4. -
  5. -

    Type the following command to run the verify goal with the arq-remote profile activated.

    -
    -
    -
    $ mvn verify -Parq-remote
    -
    -
    -
  6. -
-
-
- - - - - -
-
Note
-
-
-

You may also use the environment variable SERVER_HOST or the system property server.host to define the target host of the tests.

-
-
-
-
-
-

Undeploy the Quickstart

-
-

When you are finished testing the quickstart, follow these steps to undeploy the archive.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type this command to undeploy the archive:

    -
    -
    -
    $ mvn wildfly:undeploy
    -
    -
    -
  6. -
-
-
-
-
-
-

Building and running the quickstart application with OpenShift

-
-
-

Build the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

On OpenShift, the S2I build with Apache Maven will use an openshift profile used to provision a JBoss EAP server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named openshift when building the quickstart:

-
-
-
-
$ mvn clean package -Popenshift
-
-
-
-

The provisioned JBoss EAP server for OpenShift, with the quickstart deployed, can then be found in the target/server directory, and its usage is similar to a standard server distribution. -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.

-
-
-

The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart pom.xml:

-
-
-
-
        <profile>
-            <id>openshift</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.jboss.eap.plugins</groupId>
-                        <artifactId>eap-maven-plugin</artifactId>
-                        <version>${version.eap.maven.plugin}</version>
-                        <configuration>
-                            <feature-packs>
-                                <feature-pack>
-                                    <location>org.jboss.eap:wildfly-ee-galleon-pack</location>
-                                </feature-pack>
-                                <feature-pack>
-                                    <location>org.jboss.eap.cloud:eap-cloud-galleon-pack</location>
-                                </feature-pack>
-                            </feature-packs>
-                            <layers>
-                                <layer>cloud-server</layer>
-                            </layers>
-                            <filename>ROOT.war</filename>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>package</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-
-
-
- - - - - -
-
Note
-
-
-

Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the /helloworld path segment after HOST:PORT.

-
-
-
-
-
-

Getting Started with JBoss EAP for OpenShift and Helm Charts

-
-

This section contains the basic instructions to build and deploy this quickstart to JBoss EAP for OpenShift or JBoss EAP for OpenShift Online using Helm Charts.

-
-
-

Prerequisites

-
-
    -
  • -

    You must be logged in OpenShift and have an oc client to connect to OpenShift

    -
  • -
  • -

    Helm must be installed to deploy the backend on OpenShift.

    -
  • -
-
-
-

Once you have installed Helm, you need to add the repository that provides Helm Charts for JBoss EAP.

-
-
-
-
$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/
-"jboss-eap" has been added to your repositories
-$ helm search repo jboss-eap
-NAME                    CHART VERSION   APP VERSION     DESCRIPTION
-jboss-eap/eap8         ...             ...             A Helm chart to build and deploy EAP 8.0 applications
-
-
-
-
-

Deploy the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

Log in to your OpenShift instance using the oc login command. -The backend will be built and deployed on OpenShift with a Helm Chart for JBoss EAP.

-
-
-

Navigate to the root directory of this quickstart and run the following command:

-
-
-
-
$ helm install helloworld -f charts/helm.yaml jboss-eap/eap8
-NAME: helloworld
-...
-STATUS: deployed
-REVISION: 1
-
-
-
-

The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17:

-
-
-
-
build:
-  uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git
-  ref: 8.0.x
-  contextDir: helloworld
-deploy:
-  replicas: 1
-
-
-
-

This will create a new deployment on OpenShift and deploy the application.

-
-
-

If you want to see all the configuration elements to customize your deployment you can use the following command:

-
-
-
-
$ helm show readme jboss-eap/eap8
-
-
-
-

Let’s wait for the application to be built and deployed:

-
-
-
-
$ oc get deployment helloworld -w
-NAME         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
-helloworld   1         1         1            0           12s
-...
-helloworld   1         1         1            1           2m
-
-
-
-

Get the URL of the route to the deployment.

-
-
-
-
$ oc get route helloworld -o jsonpath="{.spec.host}"
-
-
-
-

Access the application in your web browser using the displayed URL.

-
-
- - - - - -
-
Note
-
-
-

The Maven profile named openshift is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the /helloworld path segment after HOST:PORT.

-
-
-
-
-
-

Undeploy the JBoss EAP Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts

-
-
-
$ helm uninstall helloworld
-
-
-
-
-
-

Run the Arquillian Integration Tests with OpenShift

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
- - - - - -
-
Note
-
-
-

The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin.

-
-
-
-
-

Run the integration tests using the following command to run the verify goal with the arq-remote profile activated and the proper URL:

-
-
-
-
$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route helloworld --template='{{ .spec.host }}')
-
-
-
- - - - - -
-
Note
-
-
-

The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from.

-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/helloworld/charts/helm.yaml b/helloworld/charts/helm.yaml deleted file mode 100644 index 27d8b579f7..0000000000 --- a/helloworld/charts/helm.yaml +++ /dev/null @@ -1,6 +0,0 @@ -build: - uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git - ref: 8.0.x - contextDir: helloworld -deploy: - replicas: 1 \ No newline at end of file diff --git a/helloworld/pom.xml b/helloworld/pom.xml deleted file mode 100644 index f8bb6cfc6d..0000000000 --- a/helloworld/pom.xml +++ /dev/null @@ -1,235 +0,0 @@ - - - - 4.0.0 - - org.jboss.eap.quickstarts - jboss-eap-quickstart-parent - - 6.0.0.redhat-00001 - - - helloworld - 8.0.0.GA - war - Quickstart: helloworld - Helloworld - - - - Apache License, Version 2.0 - repo - http://www.apache.org/licenses/LICENSE-2.0.html - - - - - - 8.0.0.GA-redhat-00009 - 1.0.0.Final-redhat-00014 - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - never - - default - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - never - - - true - never - - default - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - - - true - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - - - true - - - - - - - - - org.jboss.bom - jboss-eap-ee-with-tools - ${version.server.bom} - pom - import - - - - - - - - jakarta.servlet - jakarta.servlet-api - provided - - - - - junit - junit - test - jar - - - org.jboss.arquillian.container - arquillian-container-test-api - test - jar - - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet-jakarta - test - - - org.wildfly.arquillian - wildfly-arquillian-common - test - - - org.wildfly.arquillian - wildfly-arquillian-container-managed - test - - - - - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - - org.jboss.eap.channels - eap-8.0 - - - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - - - arq-remote - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} - - - **/HelloWorldServletIT - - - **/managed/* - - - - - - integration-test - - - - - - - - - - diff --git a/helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java b/helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java deleted file mode 100644 index 93a225545e..0000000000 --- a/helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.helloworld; - -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import java.io.IOException; -import java.io.PrintWriter; - -/** - * - *

- * The servlet is registered and mapped to /HelloServlet using the {@linkplain WebServlet - * @HttpServlet}. - *

- * - * @author Pete Muir - * - */ -@SuppressWarnings("serial") -@WebServlet("/HelloWorld") -public class HelloWorldServlet extends HttpServlet { - - static String PAGE_HEADER = "helloworld"; - - static String PAGE_FOOTER = ""; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - resp.setContentType("text/html"); - PrintWriter writer = resp.getWriter(); - writer.println(PAGE_HEADER); - writer.println("

Hello World!

"); - writer.println(PAGE_FOOTER); - writer.close(); - } - -} diff --git a/helloworld/src/main/webapp/index.html b/helloworld/src/main/webapp/index.html deleted file mode 100644 index eb15de324c..0000000000 --- a/helloworld/src/main/webapp/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - diff --git a/helloworld/src/test/java/org/jboss/as/quickstarts/helloworld/HelloWorldServletIT.java b/helloworld/src/test/java/org/jboss/as/quickstarts/helloworld/HelloWorldServletIT.java deleted file mode 100644 index 39507d19da..0000000000 --- a/helloworld/src/test/java/org/jboss/as/quickstarts/helloworld/HelloWorldServletIT.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2022 JBoss by Red Hat. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.helloworld; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.http.HttpClient; -import java.net.http.HttpClient.Redirect; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.net.http.HttpResponse.BodyHandlers; -import java.time.Duration; -import java.util.Optional; -import org.junit.Test; - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -public class HelloWorldServletIT { - - protected URI getHTTPEndpoint() { - String host = getServerHost(); - if (host == null) { - host = "http://localhost:8080/helloworld"; - } - try { - return new URI(host + "/HelloWorld"); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } - - private String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host"); - } - return host; - } - - @Test - public void testHelloWorld() throws IOException, InterruptedException { - HttpClient client = HttpClient.newBuilder() - .followRedirects(Redirect.ALWAYS) - .connectTimeout(Duration.ofMinutes(1)) - .build(); - HttpRequest request = HttpRequest.newBuilder() - .uri(getHTTPEndpoint()) - .GET() - .build(); - HttpResponse response = client.send(request, BodyHandlers.ofString()); - assertEquals(200, response.statusCode()); - Optional contentType = response.headers().firstValue("Content-Type"); - assertTrue(contentType.isPresent()); - assertEquals("text/html;charset=ISO-8859-1", contentType.get()); - String[] content = response.body().split(getLineSeparator()); - assertEquals(3, content.length); - assertEquals("helloworld", content[0].trim()); - assertEquals("

Hello World!

", content[1].trim()); - assertEquals("", content[2].trim()); - } - - protected String getLineSeparator() { - return"\n"; - } -} diff --git a/helloworld/src/test/java/org/jboss/as/quickstarts/helloworld/managed/ManagedHelloWorldServletIT.java b/helloworld/src/test/java/org/jboss/as/quickstarts/helloworld/managed/ManagedHelloWorldServletIT.java deleted file mode 100644 index d03fef8c31..0000000000 --- a/helloworld/src/test/java/org/jboss/as/quickstarts/helloworld/managed/ManagedHelloWorldServletIT.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 JBoss by Red Hat. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.helloworld.managed; - -import java.net.URI; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.as.arquillian.api.ContainerResource; -import org.jboss.as.arquillian.container.ManagementClient; -import org.jboss.as.quickstarts.helloworld.HelloWorldServletIT; -import org.junit.runner.RunWith; - - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -@RunWith(Arquillian.class) -@RunAsClient -public class ManagedHelloWorldServletIT extends HelloWorldServletIT { - @ContainerResource - private ManagementClient managementClient; - - @Override - protected URI getHTTPEndpoint() { - return managementClient.getWebUri().resolve("/HelloWorld"); - } - - @Override - protected String getLineSeparator() { - return System.lineSeparator(); - } -} diff --git a/helloworld/src/test/resources/arquillian.xml b/helloworld/src/test/resources/arquillian.xml deleted file mode 100644 index 31d4c3cc43..0000000000 --- a/helloworld/src/test/resources/arquillian.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - diff --git a/jaxrs-client/README-source.adoc b/jaxrs-client/README-source.adoc deleted file mode 100644 index 059b09ff80..0000000000 --- a/jaxrs-client/README-source.adoc +++ /dev/null @@ -1,112 +0,0 @@ -include::../shared-doc/attributes.adoc[] - -= jaxrs-client: JAX-RS Client API example -:author: Rafael Benevides -:level: Beginner -:technologies: JAX-RS -:openshift: true - -[abstract] -The `jaxrs-client` quickstart demonstrates JAX-RS Client API, which interacts with a JAX-RS Web service that runs on {productName}. - -:standalone-server-type: default -:archiveType: war - -== What is it? - -The `jaxrs-client` quickstart demonstrates the JAX-RS Client API which interacts with a JAX-RS Web service. - -This client "calls" many `POST`, `GET`, and `DELETE` operations using different ways: synchronized, asynchronous, delayed and filtered invocations. - -// System Requirements -include::../shared-doc/system-requirements.adoc[leveloffset=+1] -// Use of {jbossHomeName} -include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1] - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Start the {productName} Standalone Server -include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+2] -// Build and Deploy the Quickstart -include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+2] -// Testing with Arquillian -include::../shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc[leveloffset=+2] - -=== Investigate the Console Output - -When you run the Arquillian tests, Maven prints summary of the performed tests to the console. You should see the following results. - -[source,options="nowrap"] ----- -------------------------------------------------------- -T E S T S -------------------------------------------------------- -Running org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest -INFO: ### Testing Request and Response Filters ### -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest -INFO: dropping all contacts -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest -INFO: Invoking create new contact using a ClientRequestFilter -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest -INFO: Invoking list all contacts using a ClientResponseFilter -org.jboss.as.quickstarts.jaxrsclient.test.LogResponseFilter filter -INFO: Date: Mon Dec 29 15:34:45 BRST 2014- Status: 200 -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest -INFO: ### Testing Delayed invocaton ### -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest -INFO: dropping all contacts -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest -INFO: Creating a new contact invocation -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest -INFO: Creating list all contacts invocation -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest -INFO: invoking the new contact -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest -INFO: invoking list all contacts ASYNC -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest -INFO: ### CRUD tests ASYNC ### -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest -INFO: dropping all contacts ASYNC -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest -INFO: creating a new contact ASYNC -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest -INFO: delete a contact by id ASYNC -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest -INFO: fetching all contacts ASYNC -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest -INFO: ### Testing invocation callback ### -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest -INFO: dropping all contacts -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest -INFO: Creating a InvocationCallback -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest -INFO: Invoking a service using the InvocationCallback -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest -INFO: ### CRUD tests ### -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest -INFO: dropping all contacts -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest -INFO: creating a new contact -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest -INFO: fetching a contact by id -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest -INFO: fetching all contacts -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest -INFO: delete a contact by id -Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.51 sec - in org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest - -Results : - -Tests run: 5, Failures: 0, Errors: 0, Skipped: 0 ----- - -// Undeploy the Quickstart -include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2] - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1] \ No newline at end of file diff --git a/jaxrs-client/README.adoc b/jaxrs-client/README.adoc deleted file mode 100644 index 236f8d01af..0000000000 --- a/jaxrs-client/README.adoc +++ /dev/null @@ -1,896 +0,0 @@ -ifdef::env-github[] -:artifactId: jaxrs-client -endif::[] - -//*********************************************************************************** -// Enable the following flag to build README.html files for JBoss EAP product builds. -// Comment it out for WildFly builds. -//*********************************************************************************** -:ProductRelease: - -//*********************************************************************************** -// Enable the following flag to build README.html files for EAP XP product builds. -// Comment it out for WildFly or JBoss EAP product builds. -//*********************************************************************************** -//:EAPXPRelease: - -// This is a universal name for all releases -:ProductShortName: JBoss EAP -// Product names and links are dependent on whether it is a product release (CD or JBoss) -// or the WildFly project. -// The "DocInfo*" attributes are used to build the book links to the product documentation - -ifdef::ProductRelease[] -// JBoss EAP release -:productName: JBoss EAP -:productNameFull: Red Hat JBoss Enterprise Application Platform -:productVersion: 8.0 -:DocInfoProductNumber: {productVersion} -:WildFlyQuickStartRepoTag: 8.0.x -:productImageVersion: 8.0.0 -:helmChartName: jboss-eap/eap8 -endif::[] - -ifdef::EAPXPRelease[] -// JBoss EAP XP release -:productName: JBoss EAP XP -:productNameFull: Red Hat JBoss Enterprise Application Platform expansion pack -:productVersion: 3.0 -:DocInfoProductNumber: 7.4 -:WildFlyQuickStartRepoTag: XP_3.0.0.GA -:productImageVersion: 3.0 -:helmChartName: jboss-eap/eap-xp3 -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -:githubRepoUrl: https://github.com/jboss-developer/jboss-eap-quickstarts/ -:githubRepoCodeUrl: https://github.com/jboss-developer/jboss-eap-quickstarts.git -:jbossHomeName: EAP_HOME -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:quickstartDownloadName: {productNameFull} {productVersion} Quickstarts -:quickstartDownloadUrl: https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=appplatform&downloadType=distributions -:helmRepoName: jboss-eap -:helmRepoUrl: https://jbossas.github.io/eap-charts/ -// END ifdef::ProductRelease,EAPXPRelease[] -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -// WildFly project -:productName: WildFly -:productNameFull: WildFly Application Server -:ProductShortName: {productName} -:jbossHomeName: WILDFLY_HOME -:productVersion: 28 -:productImageVersion: 28.0 -:githubRepoUrl: https://github.com/wildfly/quickstart/ -:githubRepoCodeUrl: https://github.com/wildfly/quickstart.git -:WildFlyQuickStartRepoTag: 28.0.1.Final -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -// Do not update the following until after the 7.4 docs are published! -:DocInfoProductNumber: 7.4 -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:helmRepoName: wildfly -:helmRepoUrl: http://docs.wildfly.org/wildfly-charts/ -:helmChartName: wildfly/wildfly -// END ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -endif::[] - -:source: {githubRepoUrl} - -// Values for Openshift S2i sections attributes -:CDProductName: {productNameFull} for OpenShift -:CDProductShortName: {ProductShortName} for OpenShift -:CDProductTitle: {CDProductName} -:CDProductNameSentence: Openshift release for {ProductShortName} -:CDProductAcronym: {CDProductShortName} -:CDProductVersion: {productVersion} -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {EapForOpenshiftBookName} Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {xpaasproduct} Online -:xpaasproduct-shortname: {CDProductShortName} -:xpaasproductOpenShiftOnline-shortname: {xpaasproduct-shortname} Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: Getting Started with {ProductShortName} for OpenShift Container Platform -:EapForOpenshiftOnlineBookName: Getting Started with {ProductShortName} for OpenShift Online -:OpenShiftOnlinePlatformName: Red Hat OpenShift Container Platform -:OpenShiftOnlineName: Red Hat OpenShift Online -:ImagePrefixVersion: eap80 -:ImageandTemplateImportBaseURL: https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift - -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepo: https://github.com/jboss-developer/jboss-eap-quickstarts -:EAPQuickStartRepoRef: 8.0.x -:EAPQuickStartRepoTag: EAP_8.0.0.GA -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_container_platform/ -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_online/ - -ifdef::EAPXPRelease[] -// Attributes for XP releases -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {productNameFull} for OpenShift Online -:xpaasproduct-shortname: {ProductShortName} for OpenShift -:xpaasproductOpenShiftOnline-shortname: {ProductShortName} for OpenShift Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:ImagePrefixVersion: eap-xp3 -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepoRef: xp-3.0.x -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -endif::[] - -ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -:ImageandTemplateImportURL: https://raw.githubusercontent.com/wildfly/wildfly-s2i/v{productVersion}.0/ -endif::[] - -//************************* -// Other values -//************************* -:buildRequirements: Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later -:jbdsEapServerName: Red Hat JBoss Enterprise Application Platform 7.3 -:javaVersion: Jakarta EE 10 -ifdef::EAPXPRelease[] -:javaVersion: Eclipse MicroProfile -endif::[] -:githubRepoBranch: master -:guidesBaseUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/ -:useEclipseUrl: {guidesBaseUrl}USE_JBDS.adoc#use_red_hat_jboss_developer_studio_or_eclipse_to_run_the_quickstarts -:useEclipseDeployJavaClientDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_containing_server_and_java_client_projects -:useEclipseDeployEARDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_ear_project -:useProductHomeDocUrl: {guidesBaseUrl}USE_OF_{jbossHomeName}.adoc#use_of_product_home_and_jboss_home_variables -:configureMavenDocUrl: {guidesBaseUrl}CONFIGURE_MAVEN_JBOSS_EAP.adoc#configure_maven_to_build_and_deploy_the_quickstarts -:arquillianTestsDocUrl: {guidesBaseUrl}RUN_ARQUILLIAN_TESTS.adoc#run_the_arquillian_tests -:addUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#create_users_required_by_the_quickstarts -:addApplicationUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_application_user -:addManagementUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_management_user -:startServerDocUrl: {guidesBaseUrl}START_JBOSS_EAP.adoc#start_the_jboss_eap_server -:configurePostgresDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_database_for_use_with_the_quickstarts -:configurePostgresDownloadDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#download_and_install_postgresql -:configurePostgresCreateUserDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#create_a_database_user -:configurePostgresAddModuleDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#add_the_postgres_module_to_the_jboss_eap_server -:configurePostgresDriverDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_driver_in_the_jboss_eap_server -:configureBytemanDownloadDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#download_and_configure_byteman -:configureBytemanDisableDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#disable_the_byteman_script -:configureBytemanClearDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#clear_the_transaction_object_store -:configureBytemanQuickstartDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts -:configureBytemanHaltDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#use_byteman_to_halt_the_application[ -:configureBytemanQuickstartsDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts - -:EESubsystemNamespace: urn:jboss:domain:ee:4.0 -:IiopOpenJdkSubsystemNamespace: urn:jboss:domain:iiop-openjdk:2.0 -:MailSubsystemNamespace: urn:jboss:domain:mail:3.0 -:SingletonSubsystemNamespace: urn:jboss:domain:singleton:1.0 -:TransactionsSubsystemNamespace: urn:jboss:domain:transactions:4.0 - -// LinkProductDocHome: https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/ -:LinkProductDocHome: https://access.redhat.com/documentation/en/jboss-enterprise-application-platform-continuous-delivery -:LinkConfigGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/configuration_guide/ -:LinkDevelopmentGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/development_guide/ -:LinkGettingStartedGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_guide/ -:LinkOpenShiftWelcome: https://docs.openshift.com/online/welcome/index.html -:LinkOpenShiftSignup: https://docs.openshift.com/online/getting_started/choose_a_plan.html -:OpenShiftTemplateName: JBoss EAP CD (no https) - -:ConfigBookName: Configuration Guide -:DevelopmentBookName: Development Guide -:GettingStartedBookName: Getting Started Guide - -:JBDSProductName: Red Hat CodeReady Studio -:JBDSVersion: 12.15 -:LinkJBDSInstall: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/installation_guide/ -:JBDSInstallBookName: Installation Guide -:LinkJBDSGettingStarted: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/getting_started_with_codeready_studio_tools/ -:JBDSGettingStartedBookName: Getting Started with CodeReady Studio Tools - -= jaxrs-client: JAX-RS Client API example -:author: Rafael Benevides -:level: Beginner -:technologies: JAX-RS -:openshift: true - -[abstract] -The `jaxrs-client` quickstart demonstrates JAX-RS Client API, which interacts with a JAX-RS Web service that runs on {productName}. - -:standalone-server-type: default -:archiveType: war - -== What is it? - -The `jaxrs-client` quickstart demonstrates the JAX-RS Client API which interacts with a JAX-RS Web service. - -This client "calls" many `POST`, `GET`, and `DELETE` operations using different ways: synchronized, asynchronous, delayed and filtered invocations. - -// System Requirements -:leveloffset: +1 - -[[system_requirements]] -= System Requirements -//****************************************************************************** -// Include this template to describe the standard system requirements for -// running the quickstarts. -// -// The Forge quickstarts define a `forge-from-scratch` attribute because they -// run entirely in CodeReady Studio and have different requirements . -//****************************************************************************** - -The application this project produces is designed to be run on {productNameFull} {productVersion} or later. - -All you need to build this project is {buildRequirements}. See link:{configureMavenDocUrl}[Configure Maven to Build and Deploy the Quickstarts] to make sure you are configured correctly for testing the quickstarts. - -:leveloffset!: -// Use of {jbossHomeName} -:leveloffset: +1 - -ifdef::requires-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -This quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifdef::optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -When deploying this quickstart to a managed domain, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When deploying this quickstart to multiple standalone servers, this quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifndef::requires-multiple-servers,optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName} and QUICKSTART_HOME Variables - -In the following instructions, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -:leveloffset!: - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Start the {productName} Standalone Server -:leveloffset: +2 - -[[start_the_eap_standalone_server]] -= Start the {productName} Standalone Server -//****************************************************************************** -// Include this template if your quickstart requires a normal start of a single -// standalone server. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// custom -// -// * For mobile applications, you can define the `mobileApp` variable in the -// `README.adoc` file to add `-b 0.0.0.0` to the command line. This allows -// external clients, such as phones, tablets, and desktops, to connect -// to the application through through your local network -// ::mobileApp: {artifactId}-service -// -//****************************************************************************** - -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -. Open a terminal and navigate to the root of the {productName} directory. -. Start the {productName} server with the {serverProfile} by typing the following command. -+ -ifdef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __JAEGER_REPORTER_LOG_SPANS=true JAEGER_SAMPLER_TYPE=const JAEGER_SAMPLER_PARAM=1__ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -ifndef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\standalone.bat` script. - -ifdef::mobileApp[] -+ -Adding `-b 0.0.0.0` to the above command allows external clients, such as phones, tablets, and desktops, to connect through your local network. For example: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} -b 0.0.0.0 ----- -endif::[] - -:leveloffset!: -// Build and Deploy the Quickstart -:leveloffset: +2 - -[[build_and_deploy_the_quickstart]] -= Build and Deploy the Quickstart -//****************************************************************************** -// Include this template if your quickstart does a normal deployment of a archive. -// -// * Define the `archiveType` variable in the quickstart README file. -// Supported values: -// :archiveType: ear -// :archiveType: war -// :archiveType: jar -// -// * To override the archive name, which defaults to the {artifactId), -// define the `archiveName` variable, for example: -// :archiveName: {artifactId}-service -// -// * To override the archive output directory, -// define the `archiveDir` variable, for example: -// :archiveDir: ear/target -// -// * To override the Maven command, define the `mavenCommand` variable, -// for example: -// :mavenCommand: clean install wildfly:deploy -//****************************************************************************** - -// The archive name defaults to the artifactId if not overridden -ifndef::archiveName[] -:archiveName: {artifactId} -endif::archiveName[] - -// The archive type defaults to war if not overridden -ifndef::archiveType[] -:archiveType: war -endif::archiveType[] - -// Define the archive file name as the concatenation of "archiveName" + "." + "archiveType+ -:archiveFileName: {archiveName}.{archiveType} - -// If they have not defined the target archive directory, make it the default for the archive type. -ifndef::archiveDir[] - -ifeval::["{archiveType}"=="ear"] -:archiveDir: {artifactId}/ear/target -endif::[] - -ifeval::["{archiveType}"=="war"] -:archiveDir: {artifactId}/target -endif::[] - -ifeval::["{archiveType}"=="jar"] -:archiveDir: {artifactId}/target -endif::[] - -endif::archiveDir[] - -ifndef::mavenCommand[] -ifeval::["{archiveType}"=="ear"] -:mavenCommand: clean install -endif::[] - -ifeval::["{archiveType}"=="war"] -:mavenCommand: clean package -endif::[] - -ifeval::["{archiveType}"=="jar"] -:mavenCommand: clean install -endif::[] - -endif::mavenCommand[] - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -ifdef::reactive-messaging[] -. Run this command to enable the MicroProfile Reactive Messaging functionality on the server -+ -[source,subs="attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=enable-reactive-messaging.cli ----- -endif::reactive-messaging[] -. Type the following command to build the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn {mavenCommand} ----- - -. Type the following command to deploy the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn wildfly:deploy ----- - -ifdef::rest-client-qs[] -This builds and deploys the `country-server` and `country-client` to the running instance of the server. - -You should see a message in the server log indicating that the archives deployed successfully. -endif::[] -ifndef::rest-client-qs[] -This deploys the `{archiveDir}/{archiveFileName}` to the running instance of the server. - -You should see a message in the server log indicating that the archive deployed successfully. -endif::[] - - -:leveloffset!: -// Testing with Arquillian -:leveloffset: +2 - -[[run_the_arquillian_integration_tests_with_server_distribution]] -= Run the Arquillian Integration Tests -//****************************************************************************** -// Include this template if your quickstart provides standard Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -Follow these steps to run the integration tests. - -. Make sure you start the {productName} server, as previously described. - -. Make sure you build and deploy the quickstart, as previously described. - -. Type the following command to run the `verify` goal with the `arq-remote` profile activated. -+ -[source,options="nowrap"] ----- -$ mvn verify -Parq-remote ----- - -[NOTE] -==== -You may also use the environment variable `SERVER_HOST` or the system property `server.host` to define the target host of the tests. -==== - -:leveloffset!: - -=== Investigate the Console Output - -When you run the Arquillian tests, Maven prints summary of the performed tests to the console. You should see the following results. - -[source,options="nowrap"] ----- -------------------------------------------------------- -T E S T S -------------------------------------------------------- -Running org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest -INFO: ### Testing Request and Response Filters ### -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest -INFO: dropping all contacts -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest -INFO: Invoking create new contact using a ClientRequestFilter -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest -INFO: Invoking list all contacts using a ClientResponseFilter -org.jboss.as.quickstarts.jaxrsclient.test.LogResponseFilter filter -INFO: Date: Mon Dec 29 15:34:45 BRST 2014- Status: 200 -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest -INFO: ### Testing Delayed invocaton ### -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest -INFO: dropping all contacts -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest -INFO: Creating a new contact invocation -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest -INFO: Creating list all contacts invocation -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest -INFO: invoking the new contact -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest -INFO: invoking list all contacts ASYNC -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest -INFO: ### CRUD tests ASYNC ### -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest -INFO: dropping all contacts ASYNC -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest -INFO: creating a new contact ASYNC -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest -INFO: delete a contact by id ASYNC -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest -INFO: fetching all contacts ASYNC -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest -INFO: ### Testing invocation callback ### -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest -INFO: dropping all contacts -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest -INFO: Creating a InvocationCallback -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest -INFO: Invoking a service using the InvocationCallback -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest -INFO: ### CRUD tests ### -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest -INFO: dropping all contacts -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest -INFO: creating a new contact -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest -INFO: fetching a contact by id -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest -INFO: fetching all contacts -org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest -INFO: delete a contact by id -Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.51 sec - in org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest - -Results : - -Tests run: 5, Failures: 0, Errors: 0, Skipped: 0 ----- - -// Undeploy the Quickstart -:leveloffset: +2 - -[[undeploy_the_quickstart]] -= Undeploy the Quickstart - -//******************************************************************************* -// Include this template if your quickstart does a normal undeployment of an archive. -//******************************************************************************* -When you are finished testing the quickstart, follow these steps to undeploy the archive. - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -. Type this command to undeploy the archive: -+ -[source,options="nowrap"] ----- -$ mvn wildfly:undeploy ----- - -:leveloffset!: - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -:leveloffset: +1 - -[[build_and_run_the_quickstart_on_openshift]] -= Building and running the quickstart application with OpenShift -// The openshift profile -:leveloffset: +1 - -[[build-the-quickstart-for-openshift]] -== Build the {productName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -On OpenShift, the S2I build with Apache Maven will use an `openshift` profile used to provision a {productName} server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named `openshift` when building the quickstart: - -[source,subs="attributes+",options="nowrap"] ----- -$ mvn clean package -Popenshift ----- - -The provisioned {productName} server for OpenShift, with the quickstart deployed, can then be found in the `target/server` directory, and its usage is similar to a standard server distribution. -ifndef::ProductRelease,EAPXPRelease[] -You may note that unlike the `provisioned-server` profile it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the WildFly Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.wildfly:wildfly-galleon-pack:${version.server} - - - org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp} - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -[NOTE] -==== -Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`. -==== - -:leveloffset: 1 -// Getting Started with Helm -:leveloffset: +1 - -[[getting_started_with_helm]] -= Getting Started with {xpaasproduct-shortname} and Helm Charts - -This section contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} using Helm Charts. - -[[prerequisites_helm_openshift]] -== Prerequisites - -* You must be logged in OpenShift and have an `oc` client to connect to OpenShift -* https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. - -Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}. - -ifndef::ProductRelease,EAPXPRelease[] -[source,options="nowrap"] ----- -$ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ -"wildfly" has been added to your repositories -$ helm search repo wildfly -NAME CHART VERSION APP VERSION DESCRIPTION -wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift -wildfly/wildfly-common ... ... A library chart for WildFly-based applications ----- -endif::[] -ifdef::ProductRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP {productVersion} applications ----- -endif::[] -ifdef::EAPXPRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP XP {productVersion} applications ----- -endif::[] - -:leveloffset: 1 -//Prepare Helm for Quickstart Deployment -:leveloffset: +1 - -[[deploy_helm]] -== Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -Log in to your OpenShift instance using the `oc login` command. -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -Navigate to the root directory of this quickstart and run the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm install {artifactId} -f charts/helm.yaml {helmChartName} -NAME: {artifactId} -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17: - -[source,options="nowrap",subs="+attributes"] ----- -build: - uri: {githubRepoCodeUrl} - ref: {WildFlyQuickStartRepoTag} - contextDir: {artifactId} -deploy: - replicas: 1 ----- - -This will create a new deployment on OpenShift and deploy the application. - -If you want to see all the configuration elements to customize your deployment you can use the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let’s wait for the application to be built and deployed: -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment {artifactId} -w -NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE -{artifactId} 1 1 1 0 12s -... -{artifactId} 1 1 1 1 2m ----- - -Get the URL of the route to the deployment. - -[source,options="nowrap",subs="+attributes"] ----- -$ oc get route {artifactId} -o jsonpath="{.spec.host}" ----- -Access the application in your web browser using the displayed URL. - -[NOTE] -==== -The Maven profile named `openshift` is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the `/{artifactId}` path segment after `HOST:PORT`. -==== - -[[undeploy_helm]] -== Undeploy the {ProductShortName} Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts - - -[source,options="nowrap",subs="+attributes"] ----- -$ helm uninstall {artifactId} ----- - -:leveloffset: 1 -// Testing on Openshift -:leveloffset: +1 - -[[run_the_arquillian_integration_tests_with_openshift]] -= Run the Arquillian Integration Tests with OpenShift -//****************************************************************************** -// Include this template if your quickstart provides Openshift Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -[NOTE] -==== -The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin. -==== - -Run the integration tests using the following command to run the `verify` goal with the `arq-remote` profile activated and the proper URL: -[source,options="nowrap",subs="+attributes"] ----- -$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route {artifactId} --template='{{ .spec.host }}') ----- - -[NOTE] -==== -The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from. -==== - -:leveloffset: 1 - -:leveloffset!: diff --git a/jaxrs-client/README.html b/jaxrs-client/README.html deleted file mode 100644 index 30e428f450..0000000000 --- a/jaxrs-client/README.html +++ /dev/null @@ -1,939 +0,0 @@ - - - - - - - - -jaxrs-client: JAX-RS Client API example - - - - - -
-
-
-
-
-The jaxrs-client quickstart demonstrates JAX-RS Client API, which interacts with a JAX-RS Web service that runs on JBoss EAP. -
-
-
-
-
-

What is it?

-
-
-

The jaxrs-client quickstart demonstrates the JAX-RS Client API which interacts with a JAX-RS Web service.

-
-
-

This client "calls" many POST, GET, and DELETE operations using different ways: synchronized, asynchronous, delayed and filtered invocations.

-
-
-
-
-

System Requirements

-
-
-

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 8.0 or later.

-
-
-

All you need to build this project is Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later. See Configure Maven to Build and Deploy the Quickstarts to make sure you are configured correctly for testing the quickstarts.

-
-
-
-
-

Use of the EAP_HOME and QUICKSTART_HOME Variables

-
-
-

In the following instructions, replace EAP_HOME with the actual path to your JBoss EAP installation. The installation path is described in detail here: Use of EAP_HOME and JBOSS_HOME Variables.

-
-
-

When you see the replaceable variable QUICKSTART_HOME, replace it with the path to the root directory of all of the quickstarts.

-
-
-
-
-

Building and running the quickstart application with a JBoss EAP server distribution

-
-
-

Start the JBoss EAP Standalone Server

-
-
    -
  1. -

    Open a terminal and navigate to the root of the JBoss EAP directory.

    -
  2. -
  3. -

    Start the JBoss EAP server with the default profile by typing the following command.

    -
    -
    -
    $ EAP_HOME/bin/standalone.sh 
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\standalone.bat script. -
    -
    -
  4. -
-
-
-
-

Build and Deploy the Quickstart

-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type the following command to build the quickstart.

    -
    -
    -
    $ mvn clean package
    -
    -
    -
  6. -
  7. -

    Type the following command to deploy the quickstart.

    -
    -
    -
    $ mvn wildfly:deploy
    -
    -
    -
  8. -
-
-
-

This deploys the jaxrs-client/target/jaxrs-client.war to the running instance of the server.

-
-
-

You should see a message in the server log indicating that the archive deployed successfully.

-
-
-
-

Run the Arquillian Integration Tests

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
-

Follow these steps to run the integration tests.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server, as previously described.

    -
  2. -
  3. -

    Make sure you build and deploy the quickstart, as previously described.

    -
  4. -
  5. -

    Type the following command to run the verify goal with the arq-remote profile activated.

    -
    -
    -
    $ mvn verify -Parq-remote
    -
    -
    -
  6. -
-
-
- - - - - -
-
Note
-
-
-

You may also use the environment variable SERVER_HOST or the system property server.host to define the target host of the tests.

-
-
-
-
-
-

Investigate the Console Output

-
-

When you run the Arquillian tests, Maven prints summary of the performed tests to the console. You should see the following results.

-
-
-
-
-------------------------------------------------------
-T E S T S
--------------------------------------------------------
-Running org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest
-INFO: ### Testing Request and Response Filters ###
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest
-INFO: dropping all contacts
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest
-INFO: Invoking create new contact using a ClientRequestFilter
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest requestResponseFiltersTest
-INFO: Invoking list all contacts using a ClientResponseFilter
-org.jboss.as.quickstarts.jaxrsclient.test.LogResponseFilter filter
-INFO: Date: Mon Dec 29 15:34:45 BRST 2014- Status: 200
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest
-INFO: ### Testing Delayed invocaton ###
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest
-INFO: dropping all contacts
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest
-INFO: Creating a new contact invocation
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest
-INFO: Creating list all contacts invocation
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest
-INFO: invoking the new contact
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest delayedInvocationTest
-INFO: invoking list all contacts ASYNC
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest
-INFO: ### CRUD tests  ASYNC ###
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest
-INFO: dropping all contacts ASYNC
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest
-INFO: creating a new contact ASYNC
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest
-INFO: delete a contact by id ASYNC
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest asyncCrudTest
-INFO: fetching all contacts ASYNC
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest
-INFO: ### Testing invocation callback ###
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest
-INFO: dropping all contacts
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest
-INFO: Creating a InvocationCallback
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest invocationCallBackTest
-INFO: Invoking a service using the InvocationCallback
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest
-INFO: ### CRUD tests ###
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest
-INFO: dropping all contacts
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest
-INFO: creating a new contact
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest
-INFO: fetching a contact by id
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest
-INFO: fetching all contacts
-org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest cruedTest
-INFO: delete a contact by id
-Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.51 sec - in org.jboss.as.quickstarts.jaxrsclient.test.ContactsRestClientTest
-
-Results :
-
-Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
-
-
-
-
-

Undeploy the Quickstart

-
-

When you are finished testing the quickstart, follow these steps to undeploy the archive.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type this command to undeploy the archive:

    -
    -
    -
    $ mvn wildfly:undeploy
    -
    -
    -
  6. -
-
-
-
-
-
-

Building and running the quickstart application with OpenShift

-
-
-

Build the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

On OpenShift, the S2I build with Apache Maven will use an openshift profile used to provision a JBoss EAP server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named openshift when building the quickstart:

-
-
-
-
$ mvn clean package -Popenshift
-
-
-
-

The provisioned JBoss EAP server for OpenShift, with the quickstart deployed, can then be found in the target/server directory, and its usage is similar to a standard server distribution. -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.

-
-
-

The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart pom.xml:

-
-
-
-
        <profile>
-            <id>openshift</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.jboss.eap.plugins</groupId>
-                        <artifactId>eap-maven-plugin</artifactId>
-                        <version>${version.eap.maven.plugin}</version>
-                        <configuration>
-                            <feature-packs>
-                                <feature-pack>
-                                    <location>org.jboss.eap:wildfly-ee-galleon-pack</location>
-                                </feature-pack>
-                                <feature-pack>
-                                    <location>org.jboss.eap.cloud:eap-cloud-galleon-pack</location>
-                                </feature-pack>
-                            </feature-packs>
-                            <layers>
-                                <layer>cloud-server</layer>
-                            </layers>
-                            <filename>ROOT.war</filename>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>package</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-
-
-
- - - - - -
-
Note
-
-
-

Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the /jaxrs-client path segment after HOST:PORT.

-
-
-
-
-
-

Getting Started with JBoss EAP for OpenShift and Helm Charts

-
-

This section contains the basic instructions to build and deploy this quickstart to JBoss EAP for OpenShift or JBoss EAP for OpenShift Online using Helm Charts.

-
-
-

Prerequisites

-
-
    -
  • -

    You must be logged in OpenShift and have an oc client to connect to OpenShift

    -
  • -
  • -

    Helm must be installed to deploy the backend on OpenShift.

    -
  • -
-
-
-

Once you have installed Helm, you need to add the repository that provides Helm Charts for JBoss EAP.

-
-
-
-
$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/
-"jboss-eap" has been added to your repositories
-$ helm search repo jboss-eap
-NAME                    CHART VERSION   APP VERSION     DESCRIPTION
-jboss-eap/eap8         ...             ...             A Helm chart to build and deploy EAP 8.0 applications
-
-
-
-
-

Deploy the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

Log in to your OpenShift instance using the oc login command. -The backend will be built and deployed on OpenShift with a Helm Chart for JBoss EAP.

-
-
-

Navigate to the root directory of this quickstart and run the following command:

-
-
-
-
$ helm install jaxrs-client -f charts/helm.yaml jboss-eap/eap8
-NAME: jaxrs-client
-...
-STATUS: deployed
-REVISION: 1
-
-
-
-

The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17:

-
-
-
-
build:
-  uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git
-  ref: 8.0.x
-  contextDir: jaxrs-client
-deploy:
-  replicas: 1
-
-
-
-

This will create a new deployment on OpenShift and deploy the application.

-
-
-

If you want to see all the configuration elements to customize your deployment you can use the following command:

-
-
-
-
$ helm show readme jboss-eap/eap8
-
-
-
-

Let’s wait for the application to be built and deployed:

-
-
-
-
$ oc get deployment jaxrs-client -w
-NAME         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
-jaxrs-client   1         1         1            0           12s
-...
-jaxrs-client   1         1         1            1           2m
-
-
-
-

Get the URL of the route to the deployment.

-
-
-
-
$ oc get route jaxrs-client -o jsonpath="{.spec.host}"
-
-
-
-

Access the application in your web browser using the displayed URL.

-
-
- - - - - -
-
Note
-
-
-

The Maven profile named openshift is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the /jaxrs-client path segment after HOST:PORT.

-
-
-
-
-
-

Undeploy the JBoss EAP Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts

-
-
-
$ helm uninstall jaxrs-client
-
-
-
-
-
-

Run the Arquillian Integration Tests with OpenShift

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
- - - - - -
-
Note
-
-
-

The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin.

-
-
-
-
-

Run the integration tests using the following command to run the verify goal with the arq-remote profile activated and the proper URL:

-
-
-
-
$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route jaxrs-client --template='{{ .spec.host }}')
-
-
-
- - - - - -
-
Note
-
-
-

The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from.

-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/jaxrs-client/charts/helm.yaml b/jaxrs-client/charts/helm.yaml deleted file mode 100644 index 138b3cff50..0000000000 --- a/jaxrs-client/charts/helm.yaml +++ /dev/null @@ -1,6 +0,0 @@ -build: - uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git - ref: 8.0.x - contextDir: jaxrs-client -deploy: - replicas: 1 \ No newline at end of file diff --git a/jaxrs-client/pom.xml b/jaxrs-client/pom.xml deleted file mode 100644 index 3adac8678f..0000000000 --- a/jaxrs-client/pom.xml +++ /dev/null @@ -1,289 +0,0 @@ - - - - 4.0.0 - - - org.jboss.eap.quickstarts - jboss-eap-quickstart-parent - - 6.0.0.redhat-00001 - - - jaxrs-client - 8.0.0.GA - war - Quickstart: jaxrs-client - A JAX-RS Client API project - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - 8.0.0.GA-redhat-00009 - 1.0.0.Final-redhat-00014 - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - never - - default - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - never - - - true - never - - default - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - - - true - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - - - true - - - - - - - - - org.jboss.bom - jboss-eap-ee-with-tools - ${version.server.bom} - pom - import - - - - - - - - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - - - junit - junit - test - - - - - org.apache.httpcomponents - httpclient - test - - - - - org.jboss.resteasy - resteasy-client - test - - - - org.jboss.resteasy - resteasy-jackson2-provider - test - - - - - jakarta.annotation - jakarta.annotation-api - provided - - - - - jakarta.ws.rs - jakarta.ws.rs-api - provided - - - - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet-jakarta - test - - - - jakarta.xml.bind - jakarta.xml.bind-api - test - - - - org.jboss.logging - commons-logging-jboss-logging - test - - - - - - - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - - org.jboss.eap.channels - eap-8.0 - - - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - - - - arq-remote - - - org.wildfly.arquillian - wildfly-arquillian-container-remote - test - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} - - - **/RemoteContactsRestClientIT - - - **/ManagedContactsRestClientIT - **/ProvisionedManagedContactRestClientIT - - - - - - integration-test - verify - - - - - - - - - - diff --git a/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/model/Contact.java b/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/model/Contact.java deleted file mode 100644 index f900476486..0000000000 --- a/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/model/Contact.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.jaxrsclient.model; - -public class Contact { - - private Long id; - - private String name; - - private String phoneNumber; - - private String savedBy; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - - public String getSavedBy() { - return savedBy; - } - - public void setSavedBy(String savedBy) { - this.savedBy = savedBy; - } - -} diff --git a/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/rest/ContactResourceRESTService.java b/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/rest/ContactResourceRESTService.java deleted file mode 100644 index beaf59603d..0000000000 --- a/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/rest/ContactResourceRESTService.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.jaxrsclient.rest; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.DELETE; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.POST; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.PathParam; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; - -import org.jboss.as.quickstarts.jaxrsclient.model.Contact; - -@Path("/contacts") -public class ContactResourceRESTService { - - private static Map contactsRepository = new HashMap<>(); - - /** - * Creates a new contact from the values provided and will return a JAX-RS response with either 200 ok, or 400 (BAD REQUEST) - * in case of errors. - */ - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - public Response createContact(Contact contact) { - - Response.ResponseBuilder builder = null; - Long nextId = contactsRepository.keySet().size() + 1L; - try { - // Store the contact - contact.setId(nextId); - contactsRepository.put(nextId, contact); - - // Create an "ok" response with the persisted contact - builder = Response.ok(contact); - } catch (Exception e) { - // Handle generic exceptions - builder = Response.status(Response.Status.BAD_REQUEST).entity(e.getMessage()); - } - - return builder.build(); - } - - // delete all contacts - @DELETE - public Response removeAllContacts() { - contactsRepository.clear(); - return Response.ok().build(); - } - - // delete a specific contact - @DELETE - @Path("/{id}") - public Response removeContact(final @PathParam("id") Long id) { - contactsRepository.remove(id); - return Response.ok().build(); - } - - // Fetch all contacts - @GET - @Produces(MediaType.APPLICATION_JSON) - public Response getAll() { - Collection allcontacts = contactsRepository.values(); - return Response.ok(allcontacts).build(); - } - - // Fetch a specific contact - @GET - @Path("/{id}") - @Produces(MediaType.APPLICATION_JSON) - public Response getById(final @PathParam("id") Long id) { - Contact contact = contactsRepository.get(id); - return Response.ok(contact).build(); - } -} diff --git a/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/rest/JaxRsActivator.java b/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/rest/JaxRsActivator.java deleted file mode 100644 index a432a1da83..0000000000 --- a/jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/rest/JaxRsActivator.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.jaxrsclient.rest; - -import jakarta.ws.rs.ApplicationPath; -import jakarta.ws.rs.core.Application; - -/** - * A class extending {@link Application} and annotated with @ApplicationPath is the Jakarta EE "no XML" approach to activating - * JAX-RS. - *

- *

- * Resources are served relative to the servlet path specified in the {@link ApplicationPath} annotation. - *

- */ -@ApplicationPath("/rest") -public class JaxRsActivator extends Application { - /* class body intentionally left blank */ -} diff --git a/jaxrs-client/src/main/webapp/WEB-INF/beans.xml b/jaxrs-client/src/main/webapp/WEB-INF/beans.xml deleted file mode 100644 index d3ddf148e7..0000000000 --- a/jaxrs-client/src/main/webapp/WEB-INF/beans.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/AbstractContactsRestClient.java b/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/AbstractContactsRestClient.java deleted file mode 100644 index 42d13ee13a..0000000000 --- a/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/AbstractContactsRestClient.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2022, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.jaxrsclient.test; - -import jakarta.ws.rs.client.ClientBuilder; -import jakarta.ws.rs.client.Entity; -import jakarta.ws.rs.client.Invocation; -import jakarta.ws.rs.client.InvocationCallback; -import jakarta.ws.rs.core.GenericType; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; -import java.util.List; -import java.util.concurrent.Future; -import java.util.logging.Logger; -import org.jboss.as.quickstarts.jaxrsclient.model.Contact; -import org.junit.Assert; -import org.junit.Test; - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -public abstract class AbstractContactsRestClient { - - private static final Logger log = Logger.getLogger(AbstractContactsRestClient.class.getName()); - - private static final String CONTACT_NAME = "New Contact"; - private static final String CONTACT_PHONE = "+55-61-5555-1234"; - - abstract String getRequestUrl(); - - // This test shows basic operations - public void cruedTest() { - log.info("### CRUD tests " + getRequestUrl() + " ###"); - // 1 - drop all contacts - log.info("dropping all contacts"); - Response response = ClientBuilder.newClient().target(getRequestUrl()).request().delete(); - Assert.assertEquals("All contacts should be dropped", Response.ok().build().getStatus(), response.getStatus()); - - // 2 - Create a new contact - log.info("creating a new contact"); - Contact c = new Contact(); - c.setName(CONTACT_NAME); - c.setPhoneNumber(CONTACT_PHONE); - Contact persistedContact = ClientBuilder.newClient().target(getRequestUrl()).request().post(Entity.entity(c, MediaType.APPLICATION_JSON), Contact.class); - Assert.assertEquals("A book should be persisted with Id=1!", (Long) 1L, persistedContact.getId()); - - // 3 - Fetch Contact by Id - log.info("fetching a contact by id"); - Contact fetchContctById - = ClientBuilder.newClient().target(getRequestUrl()).path("/{contactId}").resolveTemplate("contactId", persistedContact.getId()).request().get(Contact.class); - Assert.assertEquals("Fetched book with Id=1!", (Long) 1L, fetchContctById.getId()); - Assert.assertEquals("Fetched book with equal name", CONTACT_NAME, fetchContctById.getName()); - Assert.assertEquals("Fetched book with equal phone", CONTACT_PHONE, fetchContctById.getPhoneNumber()); - - // 4 - Fetch all Contacts - log.info("fetching all contacts"); - GenericType> contactsListType = new GenericType>() { - }; - List allContacts = ClientBuilder.newClient().target(getRequestUrl()).request().get(contactsListType); - Assert.assertEquals("Should have a single contact", 1, allContacts.size()); - - // 5 - Delete a Contact - log.info("delete a contact by id"); - response = ClientBuilder.newClient().target(getRequestUrl()).path("/{contactId}").resolveTemplate("contactId", persistedContact.getId()).request().delete(); - Assert.assertEquals("Contact 1 should be dropped", Response.ok().build().getStatus(), response.getStatus()); - } - - // This test shows some basic operations using ASYNC invocations and java.util.concurrent.Future - public void asyncCrudTest() throws Exception { - log.info("### CRUD tests ASYNC ###"); - - // 1 - drop all contacts ASYNC - log.info("dropping all contacts ASYNC"); - Response response = ClientBuilder.newClient().target(getRequestUrl()).request().async().delete().get(); - Assert.assertEquals("All contacts should be dropped", Response.ok().build().getStatus(), response.getStatus()); - - // 2 - Create a new Contact ASYNC - log.info("creating a new contact ASYNC"); - Contact c = new Contact(); - c.setName(CONTACT_NAME); - c.setPhoneNumber(CONTACT_PHONE); - - Future futureContact = ClientBuilder.newClient().target(getRequestUrl()).request().async().post(Entity.entity(c, MediaType.APPLICATION_JSON), Contact.class); - - Contact persistedContact = futureContact.get(); - Assert.assertEquals("A contact should be persisted with Id=1!", (Long) 1L, persistedContact.getId()); - - // 3 - Delete a contact ASYNC - log.info("delete a contact by id ASYNC"); - ClientBuilder.newClient().target(getRequestUrl()).path("{contactId}").resolveTemplate("contactId", persistedContact.getId()).request().async().delete().get(); - - // 4 - Fetch All Contacts ASYNC - log.info("fetching all contacts ASYNC"); - Future> futureContacts = ClientBuilder.newClient().target(getRequestUrl()).request().async().get(new GenericType>() { - }); - List allContacts = futureContacts.get(); - Assert.assertEquals("Should have no contacts", 0, allContacts.size()); - } - - // This test shows how to use jakarta.ws.rs.client.InvocationCallback - @Test - public void invocationCallBackTest() throws Exception { - log.info("### Testing invocation callback ###"); - - // 1 - drop all contacts - log.info("dropping all contacts"); - Response response = ClientBuilder.newClient().target(getRequestUrl()).request().delete(); - Assert.assertEquals("All contacts should be dropped", Response.ok().build().getStatus(), response.getStatus()); - - // 2 - Create a InvocationCallback - log.info("Creating a InvocationCallback"); - InvocationCallback> invocationCallback = new InvocationCallback>() { - - @Override - public void completed(List allContacts) { - // Completed the invocation with no contact - Assert.assertEquals("Should have no contacts", 0, allContacts.size()); - } - - @Override - public void failed(Throwable throwable) { - // It should fail - Assert.fail(throwable.getMessage()); - - } - }; - // 3 - Invoke the service - log.info("Invoking a service using the InvocationCallback"); - ClientBuilder.newClient().target(getRequestUrl()).request().async().get(invocationCallback).get(); - } - - // Shows how to use a delayed REST invocation - public void delayedInvocationTest() throws Exception { - log.info("### Testing Delayed invocaton ###"); - - // 1 - Drop all contacts - log.info("dropping all contacts"); - Response response = ClientBuilder.newClient().target(getRequestUrl()).request().delete(); - Assert.assertEquals("All contacts should be dropped", Response.ok().build().getStatus(), response.getStatus()); - - // 2 - Create a new Contact Invocation - log.info("Creating a new contact invocation"); - Contact c = new Contact(); - c.setName(CONTACT_NAME); - c.setPhoneNumber(CONTACT_PHONE); - Invocation saveContactInvocation = ClientBuilder.newClient().target(getRequestUrl()).request().buildPost(Entity.entity(c, MediaType.APPLICATION_JSON)); - - // 3 - Create a new list Contacts Invocation - log.info("Creating list all contacts invocation"); - Invocation listContactsInvocation = ClientBuilder.newClient().target(getRequestUrl()).request().buildGet(); - - // 4 - Synch Save contact - log.info("invoking the new contact"); - Contact persistedContact = saveContactInvocation.invoke(Contact.class); - Assert.assertEquals("A contacts should be persisted with Id=1!", (Long) 1L, (Long) persistedContact.getId()); - - // 5 - Async List contacts - log.info("invoking list all contacts ASYNC"); - GenericType> contactsListType = new GenericType>() { - }; - Future> futureAllContacts = listContactsInvocation.submit(contactsListType); - List allContacts = futureAllContacts.get(); - Assert.assertEquals("Should have a single contact", 1, allContacts.size()); - } - - // Shows how to use Request and Response filters - public void requestResponseFiltersTest() { - log.info("### Testing Request and Response Filters ###"); - - // 1 - Drop all contacts - log.info("dropping all contacts"); - Response response = ClientBuilder.newClient().target(getRequestUrl()).request().delete(); - Assert.assertEquals("All contacts should be dropped", Response.ok().build().getStatus(), response.getStatus()); - - // 2 - Create a new Contact Invocation - log.info("Invoking create new contact using a ClientRequestFilter"); - Contact c = new Contact(); - c.setName(CONTACT_NAME); - c.setPhoneNumber(CONTACT_PHONE); - Contact persistedContact - = ClientBuilder.newClient().register(SavedByClientRequestFilter.class).target(getRequestUrl()).request() - .post(Entity.entity(c, MediaType.APPLICATION_JSON), Contact.class); - Assert.assertEquals("A contact should be persisted with savedBy", SavedByClientRequestFilter.USERNAME, persistedContact.getSavedBy()); - - // 3 - Fetch all Contacts - log.info("Invoking list all contacts using a ClientResponseFilter"); - GenericType> contactsListType = new GenericType>() { - }; - List allContacts = ClientBuilder.newClient().register(LogResponseFilter.class).target(getRequestUrl()).request().get(contactsListType); - Assert.assertEquals("Should have a single contact", 1, allContacts.size()); - } -} diff --git a/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/ContactsRestClient.java b/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/ContactsRestClient.java deleted file mode 100644 index 5554ab314c..0000000000 --- a/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/ContactsRestClient.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.jaxrsclient.test; - -public class ContactsRestClient extends AbstractContactsRestClient { - - private static final String REST_TARGET_URL = "http://localhost:8080/jaxrs-client/rest/contacts"; - - public static void main(String[] args) throws Exception { - ContactsRestClient client = new ContactsRestClient(); - client.cruedTest(); - client.asyncCrudTest(); - client.delayedInvocationTest(); - client.invocationCallBackTest(); - client.requestResponseFiltersTest(); - - } - - private String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host"); - } - return host; - } - - ; - - @Override - String getRequestUrl() { - String host = getServerHost(); - if (host == null) { - host = REST_TARGET_URL; - } - return "http://" + host + "/jaxrs-client/rest/contacts"; - } -} diff --git a/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/LogResponseFilter.java b/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/LogResponseFilter.java deleted file mode 100644 index 7707f4eac2..0000000000 --- a/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/LogResponseFilter.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.jaxrsclient.test; - -import java.io.IOException; -import java.util.logging.Logger; - -import jakarta.ws.rs.client.ClientRequestContext; -import jakarta.ws.rs.client.ClientResponseContext; -import jakarta.ws.rs.client.ClientResponseFilter; -import java.util.logging.Level; - -//This filter will log response date and status -public class LogResponseFilter implements ClientResponseFilter { - - private static final Logger log = Logger.getLogger(LogResponseFilter.class.getName()); - - @Override - public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException { - log.log(Level.INFO, "Date: {0}- Status: {1}", new Object[]{responseContext.getDate(), responseContext.getStatus()}); - } -} diff --git a/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/ManagedContactsRestClientIT.java b/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/ManagedContactsRestClientIT.java deleted file mode 100644 index 9266684937..0000000000 --- a/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/ManagedContactsRestClientIT.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.jaxrsclient.test; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.as.quickstarts.jaxrsclient.model.Contact; -import org.jboss.as.quickstarts.jaxrsclient.rest.JaxRsActivator; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Test; -import org.junit.runner.RunWith; - -@RunWith(Arquillian.class) -@RunAsClient -public class ManagedContactsRestClientIT extends AbstractContactsRestClient { - - @ArquillianResource - private URL deploymentUrl; - - @Deployment - public static WebArchive createDeployment() { - WebArchive war = ShrinkWrap.create(WebArchive.class, "managed-executor-service.war") - .addPackage(JaxRsActivator.class.getPackage()) - .addPackage(Contact.class.getPackage()) - .addClass(AbstractContactsRestClient.class) - .addAsWebInfResource(new StringAsset("\n" - + ""), "beans.xml"); - return war; - } - - @Override - protected String getRequestUrl() { - return new StringBuilder(deploymentUrl.toString()) - .append("rest/contacts") - .toString(); - } - - - // This test shows basic operations - @Test - @Override - public void cruedTest() { - super.cruedTest(); - } - - // This test shows some basic operations using ASYNC invocations and java.util.concurrent.Future - @Test - @Override - public void asyncCrudTest() throws Exception { - super.asyncCrudTest(); - } - - // This test shows how to use jakarta.ws.rs.client.InvocationCallback - @Test - @Override - public void invocationCallBackTest() throws Exception { - super.invocationCallBackTest(); - } - - // Shows how to use a delayed REST invocation - @Test - @Override - public void delayedInvocationTest() throws Exception { - super.delayedInvocationTest(); - } - - // Shows how to use Request and Response filters - @Test - @Override - public void requestResponseFiltersTest() { - super.requestResponseFiltersTest(); - } -} diff --git a/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/ProvisionedManagedContactRestClientIT.java b/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/ProvisionedManagedContactRestClientIT.java deleted file mode 100644 index f25148662c..0000000000 --- a/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/ProvisionedManagedContactRestClientIT.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2022 Red Hat, Inc. - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jboss.as.quickstarts.jaxrsclient.test; - -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -@RunWith(Arquillian.class) -@RunAsClient -public class ProvisionedManagedContactRestClientIT extends AbstractContactsRestClient { - private static final String REST_TARGET_URL = "http://localhost:8080"; - - private String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host"); - } - return host; - } - - @Override - String getRequestUrl() { - String host = getServerHost(); - if (host == null) { - host = REST_TARGET_URL; - } - try { - return new URI(host + "/rest/contacts").toURL().toString(); - } catch (URISyntaxException | MalformedURLException ex) { - throw new RuntimeException(ex); - } - } - - - // This test shows basic operations - @Test - @Override - public void cruedTest() { - super.cruedTest(); - } - - // This test shows some basic operations using ASYNC invocations and java.util.concurrent.Future - @Test - @Override - public void asyncCrudTest() throws Exception { - super.asyncCrudTest(); - } - - // This test shows how to use jakarta.ws.rs.client.InvocationCallback - @Test - @Override - public void invocationCallBackTest() throws Exception { - super.invocationCallBackTest(); - } - - // Shows how to use a delayed REST invocation - @Test - @Override - public void delayedInvocationTest() throws Exception { - super.delayedInvocationTest(); - } - - // Shows how to use Request and Response filters - @Test - @Override - public void requestResponseFiltersTest() { - super.requestResponseFiltersTest(); - } -} diff --git a/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/RemoteContactsRestClientIT.java b/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/RemoteContactsRestClientIT.java deleted file mode 100644 index 655c241ce4..0000000000 --- a/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/RemoteContactsRestClientIT.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2022, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.jaxrsclient.test; - -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import org.junit.Test; - -public class RemoteContactsRestClientIT extends AbstractContactsRestClient { - - private static final String REST_TARGET_URL = "http://localhost:8080/jaxrs-client"; - - private String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host"); - } - return host; - } - - @Override - String getRequestUrl() { - String host = getServerHost(); - if (host == null) { - host = REST_TARGET_URL; - } - try { - return new URI(host + "/rest/contacts").toURL().toString(); - } catch (URISyntaxException | MalformedURLException ex) { - throw new RuntimeException(ex); - } - } - - - // This test shows basic operations - @Test - @Override - public void cruedTest() { - super.cruedTest(); - } - - // This test shows some basic operations using ASYNC invocations and java.util.concurrent.Future - @Test - @Override - public void asyncCrudTest() throws Exception { - super.asyncCrudTest(); - } - - // This test shows how to use jakarta.ws.rs.client.InvocationCallback - @Test - @Override - public void invocationCallBackTest() throws Exception { - super.invocationCallBackTest(); - } - - // Shows how to use a delayed REST invocation - @Test - @Override - public void delayedInvocationTest() throws Exception { - super.delayedInvocationTest(); - } - - // Shows how to use Request and Response filters - @Test - @Override - public void requestResponseFiltersTest() { - super.requestResponseFiltersTest(); - } -} diff --git a/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/SavedByClientRequestFilter.java b/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/SavedByClientRequestFilter.java deleted file mode 100644 index df80be4844..0000000000 --- a/jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/SavedByClientRequestFilter.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.jaxrsclient.test; - -import static jakarta.ws.rs.HttpMethod.POST; -import java.io.IOException; - -import jakarta.ws.rs.client.ClientRequestContext; -import jakarta.ws.rs.client.ClientRequestFilter; - -import org.jboss.as.quickstarts.jaxrsclient.model.Contact; - -//This filter adds a username to SavedBy field -public class SavedByClientRequestFilter implements ClientRequestFilter { - - public static final String USERNAME = "quickstartUser"; - - @Override - public void filter(ClientRequestContext requestContext) throws IOException { - String method = requestContext.getMethod(); - if (POST.equals(method) && requestContext.hasEntity()) { - Contact contact = (Contact) requestContext.getEntity(); - contact.setSavedBy(USERNAME); - requestContext.setEntity(contact); - } - - } - -} diff --git a/jaxrs-client/src/test/resources/arquillian.xml b/jaxrs-client/src/test/resources/arquillian.xml deleted file mode 100644 index 31d4c3cc43..0000000000 --- a/jaxrs-client/src/test/resources/arquillian.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - diff --git a/kitchensink/README-source.adoc b/kitchensink/README-source.adoc deleted file mode 100644 index 17f2c20b74..0000000000 --- a/kitchensink/README-source.adoc +++ /dev/null @@ -1,60 +0,0 @@ -include::../shared-doc/attributes.adoc[] - -= kitchensink: Assortment of technologies including Arquillian -:author: Pete Muir -:level: Intermediate -:technologies: CDI, JSF, JPA, EJB, JAX-RS, BV -:openshift: true - -[abstract] -The `kitchensink` quickstart demonstrates a {javaVersion} web-enabled database application using JSF, CDI, EJB, JPA, and Bean Validation. - -:standalone-server-type: default -:archiveType: war -:uses-h2: -:uses-ds-xml: - -== What is it? - -The `kitchensink` quickstart is a deployable Maven 3 project designed to help you get your foot in the door developing with {javaVersion} on {productNameFull}. - -It demonstrates how to create a compliant {javaVersion} application using JSF, CDI, JAX-RS, EJB, JPA, and Bean Validation. It also includes a persistence unit and some sample persistence and transaction code to introduce you to database access in enterprise Java. - -// Considerations for Use in a Production Environment -include::../shared-doc/development-shortcuts.adoc[leveloffset=+1] -// System Requirements -include::../shared-doc/system-requirements.adoc[leveloffset=+1] -// Use of {jbossHomeName} -include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1] - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Start the {productName} Standalone Server -include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+2] -// Build and Deploy the Quickstart -include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+2] - -=== Access the Application - -The application will be running at the following URL: http://localhost:8080/{artifactId}/. - -=== Server Log: Expected Warnings and Errors - -You will see the following warnings in the server log. You can ignore these warnings. - -[source,options="nowrap"] ----- -WFLYJCA0091: -ds.xml file deployments are deprecated. Support may be removed in a future version. ----- - -// Testing with Arquillian -include::../shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc[leveloffset=+2] -// Undeploy the Quickstart -include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2] - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1] diff --git a/kitchensink/README.adoc b/kitchensink/README.adoc deleted file mode 100644 index 412e7f9aa7..0000000000 --- a/kitchensink/README.adoc +++ /dev/null @@ -1,873 +0,0 @@ -ifdef::env-github[] -:artifactId: kitchensink -endif::[] - -//*********************************************************************************** -// Enable the following flag to build README.html files for JBoss EAP product builds. -// Comment it out for WildFly builds. -//*********************************************************************************** -:ProductRelease: - -//*********************************************************************************** -// Enable the following flag to build README.html files for EAP XP product builds. -// Comment it out for WildFly or JBoss EAP product builds. -//*********************************************************************************** -//:EAPXPRelease: - -// This is a universal name for all releases -:ProductShortName: JBoss EAP -// Product names and links are dependent on whether it is a product release (CD or JBoss) -// or the WildFly project. -// The "DocInfo*" attributes are used to build the book links to the product documentation - -ifdef::ProductRelease[] -// JBoss EAP release -:productName: JBoss EAP -:productNameFull: Red Hat JBoss Enterprise Application Platform -:productVersion: 8.0 -:DocInfoProductNumber: {productVersion} -:WildFlyQuickStartRepoTag: 8.0.x -:productImageVersion: 8.0.0 -:helmChartName: jboss-eap/eap8 -endif::[] - -ifdef::EAPXPRelease[] -// JBoss EAP XP release -:productName: JBoss EAP XP -:productNameFull: Red Hat JBoss Enterprise Application Platform expansion pack -:productVersion: 3.0 -:DocInfoProductNumber: 7.4 -:WildFlyQuickStartRepoTag: XP_3.0.0.GA -:productImageVersion: 3.0 -:helmChartName: jboss-eap/eap-xp3 -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -:githubRepoUrl: https://github.com/jboss-developer/jboss-eap-quickstarts/ -:githubRepoCodeUrl: https://github.com/jboss-developer/jboss-eap-quickstarts.git -:jbossHomeName: EAP_HOME -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:quickstartDownloadName: {productNameFull} {productVersion} Quickstarts -:quickstartDownloadUrl: https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=appplatform&downloadType=distributions -:helmRepoName: jboss-eap -:helmRepoUrl: https://jbossas.github.io/eap-charts/ -// END ifdef::ProductRelease,EAPXPRelease[] -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -// WildFly project -:productName: WildFly -:productNameFull: WildFly Application Server -:ProductShortName: {productName} -:jbossHomeName: WILDFLY_HOME -:productVersion: 28 -:productImageVersion: 28.0 -:githubRepoUrl: https://github.com/wildfly/quickstart/ -:githubRepoCodeUrl: https://github.com/wildfly/quickstart.git -:WildFlyQuickStartRepoTag: 28.0.1.Final -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -// Do not update the following until after the 7.4 docs are published! -:DocInfoProductNumber: 7.4 -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:helmRepoName: wildfly -:helmRepoUrl: http://docs.wildfly.org/wildfly-charts/ -:helmChartName: wildfly/wildfly -// END ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -endif::[] - -:source: {githubRepoUrl} - -// Values for Openshift S2i sections attributes -:CDProductName: {productNameFull} for OpenShift -:CDProductShortName: {ProductShortName} for OpenShift -:CDProductTitle: {CDProductName} -:CDProductNameSentence: Openshift release for {ProductShortName} -:CDProductAcronym: {CDProductShortName} -:CDProductVersion: {productVersion} -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {EapForOpenshiftBookName} Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {xpaasproduct} Online -:xpaasproduct-shortname: {CDProductShortName} -:xpaasproductOpenShiftOnline-shortname: {xpaasproduct-shortname} Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: Getting Started with {ProductShortName} for OpenShift Container Platform -:EapForOpenshiftOnlineBookName: Getting Started with {ProductShortName} for OpenShift Online -:OpenShiftOnlinePlatformName: Red Hat OpenShift Container Platform -:OpenShiftOnlineName: Red Hat OpenShift Online -:ImagePrefixVersion: eap80 -:ImageandTemplateImportBaseURL: https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift - -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepo: https://github.com/jboss-developer/jboss-eap-quickstarts -:EAPQuickStartRepoRef: 8.0.x -:EAPQuickStartRepoTag: EAP_8.0.0.GA -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_container_platform/ -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_online/ - -ifdef::EAPXPRelease[] -// Attributes for XP releases -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {productNameFull} for OpenShift Online -:xpaasproduct-shortname: {ProductShortName} for OpenShift -:xpaasproductOpenShiftOnline-shortname: {ProductShortName} for OpenShift Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:ImagePrefixVersion: eap-xp3 -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepoRef: xp-3.0.x -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -endif::[] - -ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -:ImageandTemplateImportURL: https://raw.githubusercontent.com/wildfly/wildfly-s2i/v{productVersion}.0/ -endif::[] - -//************************* -// Other values -//************************* -:buildRequirements: Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later -:jbdsEapServerName: Red Hat JBoss Enterprise Application Platform 7.3 -:javaVersion: Jakarta EE 10 -ifdef::EAPXPRelease[] -:javaVersion: Eclipse MicroProfile -endif::[] -:githubRepoBranch: master -:guidesBaseUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/ -:useEclipseUrl: {guidesBaseUrl}USE_JBDS.adoc#use_red_hat_jboss_developer_studio_or_eclipse_to_run_the_quickstarts -:useEclipseDeployJavaClientDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_containing_server_and_java_client_projects -:useEclipseDeployEARDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_ear_project -:useProductHomeDocUrl: {guidesBaseUrl}USE_OF_{jbossHomeName}.adoc#use_of_product_home_and_jboss_home_variables -:configureMavenDocUrl: {guidesBaseUrl}CONFIGURE_MAVEN_JBOSS_EAP.adoc#configure_maven_to_build_and_deploy_the_quickstarts -:arquillianTestsDocUrl: {guidesBaseUrl}RUN_ARQUILLIAN_TESTS.adoc#run_the_arquillian_tests -:addUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#create_users_required_by_the_quickstarts -:addApplicationUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_application_user -:addManagementUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_management_user -:startServerDocUrl: {guidesBaseUrl}START_JBOSS_EAP.adoc#start_the_jboss_eap_server -:configurePostgresDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_database_for_use_with_the_quickstarts -:configurePostgresDownloadDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#download_and_install_postgresql -:configurePostgresCreateUserDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#create_a_database_user -:configurePostgresAddModuleDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#add_the_postgres_module_to_the_jboss_eap_server -:configurePostgresDriverDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_driver_in_the_jboss_eap_server -:configureBytemanDownloadDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#download_and_configure_byteman -:configureBytemanDisableDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#disable_the_byteman_script -:configureBytemanClearDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#clear_the_transaction_object_store -:configureBytemanQuickstartDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts -:configureBytemanHaltDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#use_byteman_to_halt_the_application[ -:configureBytemanQuickstartsDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts - -:EESubsystemNamespace: urn:jboss:domain:ee:4.0 -:IiopOpenJdkSubsystemNamespace: urn:jboss:domain:iiop-openjdk:2.0 -:MailSubsystemNamespace: urn:jboss:domain:mail:3.0 -:SingletonSubsystemNamespace: urn:jboss:domain:singleton:1.0 -:TransactionsSubsystemNamespace: urn:jboss:domain:transactions:4.0 - -// LinkProductDocHome: https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/ -:LinkProductDocHome: https://access.redhat.com/documentation/en/jboss-enterprise-application-platform-continuous-delivery -:LinkConfigGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/configuration_guide/ -:LinkDevelopmentGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/development_guide/ -:LinkGettingStartedGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_guide/ -:LinkOpenShiftWelcome: https://docs.openshift.com/online/welcome/index.html -:LinkOpenShiftSignup: https://docs.openshift.com/online/getting_started/choose_a_plan.html -:OpenShiftTemplateName: JBoss EAP CD (no https) - -:ConfigBookName: Configuration Guide -:DevelopmentBookName: Development Guide -:GettingStartedBookName: Getting Started Guide - -:JBDSProductName: Red Hat CodeReady Studio -:JBDSVersion: 12.15 -:LinkJBDSInstall: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/installation_guide/ -:JBDSInstallBookName: Installation Guide -:LinkJBDSGettingStarted: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/getting_started_with_codeready_studio_tools/ -:JBDSGettingStartedBookName: Getting Started with CodeReady Studio Tools - -= kitchensink: Assortment of technologies including Arquillian -:author: Pete Muir -:level: Intermediate -:technologies: CDI, JSF, JPA, EJB, JAX-RS, BV -:openshift: true - -[abstract] -The `kitchensink` quickstart demonstrates a {javaVersion} web-enabled database application using JSF, CDI, EJB, JPA, and Bean Validation. - -:standalone-server-type: default -:archiveType: war -:uses-h2: -:uses-ds-xml: - -== What is it? - -The `kitchensink` quickstart is a deployable Maven 3 project designed to help you get your foot in the door developing with {javaVersion} on {productNameFull}. - -It demonstrates how to create a compliant {javaVersion} application using JSF, CDI, JAX-RS, EJB, JPA, and Bean Validation. It also includes a persistence unit and some sample persistence and transaction code to introduce you to database access in enterprise Java. - -// Considerations for Use in a Production Environment -:leveloffset: +1 - -[[considerations_for_use_in_a_production_environment]] -= Considerations for Use in a Production Environment -//****************************************************************************** -// Include this template if your quickstart: -// * Uses the h2 database: Be sure to define the `uses-h2` attribute. -// * Uses an `*-ds.xml file`: Be sure to define the `uses-ds-xml` attribute. -// * Has performance or scalability concerns: Be sure to define the `uses-ds-xml` attribute. -//****************************************************************************** - -ifdef::uses-h2[] - -H2 Database:: This quickstart uses the H2 database included with {productNameFull} {productVersion}. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment. - -endif::uses-h2[] - -ifdef::uses-ds-xml[] - -Datasource Configuration File:: This quickstart uses a `*-ds.xml` datasource configuration file for convenience and ease of database configuration. These files are deprecated in {productName} and should not be used in a production environment. Instead, you should configure the datasource using the Management CLI or Management Console. Datasource configuration is documented in the {LinkConfigGuide}[__{ConfigBookName}__]. - -endif::uses-ds-xml[] - -ifdef::performance-scalability[] - -Performance and Scalability:: A Jakarta EE container is designed with robustness in mind, so you should carefully analyze the scalabiltiy, concurrency, and performance needs of your application before taking advantage of these techniques in your own applications. - -endif::performance-scalability[] - -:leveloffset!: -// System Requirements -:leveloffset: +1 - -[[system_requirements]] -= System Requirements -//****************************************************************************** -// Include this template to describe the standard system requirements for -// running the quickstarts. -// -// The Forge quickstarts define a `forge-from-scratch` attribute because they -// run entirely in CodeReady Studio and have different requirements . -//****************************************************************************** - -The application this project produces is designed to be run on {productNameFull} {productVersion} or later. - -All you need to build this project is {buildRequirements}. See link:{configureMavenDocUrl}[Configure Maven to Build and Deploy the Quickstarts] to make sure you are configured correctly for testing the quickstarts. - -:leveloffset!: -// Use of {jbossHomeName} -:leveloffset: +1 - -ifdef::requires-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -This quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifdef::optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -When deploying this quickstart to a managed domain, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When deploying this quickstart to multiple standalone servers, this quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifndef::requires-multiple-servers,optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName} and QUICKSTART_HOME Variables - -In the following instructions, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -:leveloffset!: - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Start the {productName} Standalone Server -:leveloffset: +2 - -[[start_the_eap_standalone_server]] -= Start the {productName} Standalone Server -//****************************************************************************** -// Include this template if your quickstart requires a normal start of a single -// standalone server. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// custom -// -// * For mobile applications, you can define the `mobileApp` variable in the -// `README.adoc` file to add `-b 0.0.0.0` to the command line. This allows -// external clients, such as phones, tablets, and desktops, to connect -// to the application through through your local network -// ::mobileApp: {artifactId}-service -// -//****************************************************************************** - -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -. Open a terminal and navigate to the root of the {productName} directory. -. Start the {productName} server with the {serverProfile} by typing the following command. -+ -ifdef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __JAEGER_REPORTER_LOG_SPANS=true JAEGER_SAMPLER_TYPE=const JAEGER_SAMPLER_PARAM=1__ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -ifndef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\standalone.bat` script. - -ifdef::mobileApp[] -+ -Adding `-b 0.0.0.0` to the above command allows external clients, such as phones, tablets, and desktops, to connect through your local network. For example: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} -b 0.0.0.0 ----- -endif::[] - -:leveloffset!: -// Build and Deploy the Quickstart -:leveloffset: +2 - -[[build_and_deploy_the_quickstart]] -= Build and Deploy the Quickstart -//****************************************************************************** -// Include this template if your quickstart does a normal deployment of a archive. -// -// * Define the `archiveType` variable in the quickstart README file. -// Supported values: -// :archiveType: ear -// :archiveType: war -// :archiveType: jar -// -// * To override the archive name, which defaults to the {artifactId), -// define the `archiveName` variable, for example: -// :archiveName: {artifactId}-service -// -// * To override the archive output directory, -// define the `archiveDir` variable, for example: -// :archiveDir: ear/target -// -// * To override the Maven command, define the `mavenCommand` variable, -// for example: -// :mavenCommand: clean install wildfly:deploy -//****************************************************************************** - -// The archive name defaults to the artifactId if not overridden -ifndef::archiveName[] -:archiveName: {artifactId} -endif::archiveName[] - -// The archive type defaults to war if not overridden -ifndef::archiveType[] -:archiveType: war -endif::archiveType[] - -// Define the archive file name as the concatenation of "archiveName" + "." + "archiveType+ -:archiveFileName: {archiveName}.{archiveType} - -// If they have not defined the target archive directory, make it the default for the archive type. -ifndef::archiveDir[] - -ifeval::["{archiveType}"=="ear"] -:archiveDir: {artifactId}/ear/target -endif::[] - -ifeval::["{archiveType}"=="war"] -:archiveDir: {artifactId}/target -endif::[] - -ifeval::["{archiveType}"=="jar"] -:archiveDir: {artifactId}/target -endif::[] - -endif::archiveDir[] - -ifndef::mavenCommand[] -ifeval::["{archiveType}"=="ear"] -:mavenCommand: clean install -endif::[] - -ifeval::["{archiveType}"=="war"] -:mavenCommand: clean package -endif::[] - -ifeval::["{archiveType}"=="jar"] -:mavenCommand: clean install -endif::[] - -endif::mavenCommand[] - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -ifdef::reactive-messaging[] -. Run this command to enable the MicroProfile Reactive Messaging functionality on the server -+ -[source,subs="attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=enable-reactive-messaging.cli ----- -endif::reactive-messaging[] -. Type the following command to build the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn {mavenCommand} ----- - -. Type the following command to deploy the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn wildfly:deploy ----- - -ifdef::rest-client-qs[] -This builds and deploys the `country-server` and `country-client` to the running instance of the server. - -You should see a message in the server log indicating that the archives deployed successfully. -endif::[] -ifndef::rest-client-qs[] -This deploys the `{archiveDir}/{archiveFileName}` to the running instance of the server. - -You should see a message in the server log indicating that the archive deployed successfully. -endif::[] - - -:leveloffset!: - -=== Access the Application - -The application will be running at the following URL: http://localhost:8080/{artifactId}/. - -=== Server Log: Expected Warnings and Errors - -You will see the following warnings in the server log. You can ignore these warnings. - -[source,options="nowrap"] ----- -WFLYJCA0091: -ds.xml file deployments are deprecated. Support may be removed in a future version. ----- - -// Testing with Arquillian -:leveloffset: +2 - -[[run_the_arquillian_integration_tests_with_server_distribution]] -= Run the Arquillian Integration Tests -//****************************************************************************** -// Include this template if your quickstart provides standard Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -Follow these steps to run the integration tests. - -. Make sure you start the {productName} server, as previously described. - -. Make sure you build and deploy the quickstart, as previously described. - -. Type the following command to run the `verify` goal with the `arq-remote` profile activated. -+ -[source,options="nowrap"] ----- -$ mvn verify -Parq-remote ----- - -[NOTE] -==== -You may also use the environment variable `SERVER_HOST` or the system property `server.host` to define the target host of the tests. -==== - -:leveloffset!: -// Undeploy the Quickstart -:leveloffset: +2 - -[[undeploy_the_quickstart]] -= Undeploy the Quickstart - -//******************************************************************************* -// Include this template if your quickstart does a normal undeployment of an archive. -//******************************************************************************* -When you are finished testing the quickstart, follow these steps to undeploy the archive. - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -. Type this command to undeploy the archive: -+ -[source,options="nowrap"] ----- -$ mvn wildfly:undeploy ----- - -:leveloffset!: - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -:leveloffset: +1 - -[[build_and_run_the_quickstart_on_openshift]] -= Building and running the quickstart application with OpenShift -// The openshift profile -:leveloffset: +1 - -[[build-the-quickstart-for-openshift]] -== Build the {productName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -On OpenShift, the S2I build with Apache Maven will use an `openshift` profile used to provision a {productName} server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named `openshift` when building the quickstart: - -[source,subs="attributes+",options="nowrap"] ----- -$ mvn clean package -Popenshift ----- - -The provisioned {productName} server for OpenShift, with the quickstart deployed, can then be found in the `target/server` directory, and its usage is similar to a standard server distribution. -ifndef::ProductRelease,EAPXPRelease[] -You may note that unlike the `provisioned-server` profile it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the WildFly Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.wildfly:wildfly-galleon-pack:${version.server} - - - org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp} - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -[NOTE] -==== -Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`. -==== - -:leveloffset: 1 -// Getting Started with Helm -:leveloffset: +1 - -[[getting_started_with_helm]] -= Getting Started with {xpaasproduct-shortname} and Helm Charts - -This section contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} using Helm Charts. - -[[prerequisites_helm_openshift]] -== Prerequisites - -* You must be logged in OpenShift and have an `oc` client to connect to OpenShift -* https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. - -Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}. - -ifndef::ProductRelease,EAPXPRelease[] -[source,options="nowrap"] ----- -$ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ -"wildfly" has been added to your repositories -$ helm search repo wildfly -NAME CHART VERSION APP VERSION DESCRIPTION -wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift -wildfly/wildfly-common ... ... A library chart for WildFly-based applications ----- -endif::[] -ifdef::ProductRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP {productVersion} applications ----- -endif::[] -ifdef::EAPXPRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP XP {productVersion} applications ----- -endif::[] - -:leveloffset: 1 -//Prepare Helm for Quickstart Deployment -:leveloffset: +1 - -[[deploy_helm]] -== Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -Log in to your OpenShift instance using the `oc login` command. -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -Navigate to the root directory of this quickstart and run the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm install {artifactId} -f charts/helm.yaml {helmChartName} -NAME: {artifactId} -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17: - -[source,options="nowrap",subs="+attributes"] ----- -build: - uri: {githubRepoCodeUrl} - ref: {WildFlyQuickStartRepoTag} - contextDir: {artifactId} -deploy: - replicas: 1 ----- - -This will create a new deployment on OpenShift and deploy the application. - -If you want to see all the configuration elements to customize your deployment you can use the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let’s wait for the application to be built and deployed: -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment {artifactId} -w -NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE -{artifactId} 1 1 1 0 12s -... -{artifactId} 1 1 1 1 2m ----- - -Get the URL of the route to the deployment. - -[source,options="nowrap",subs="+attributes"] ----- -$ oc get route {artifactId} -o jsonpath="{.spec.host}" ----- -Access the application in your web browser using the displayed URL. - -[NOTE] -==== -The Maven profile named `openshift` is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the `/{artifactId}` path segment after `HOST:PORT`. -==== - -[[undeploy_helm]] -== Undeploy the {ProductShortName} Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts - - -[source,options="nowrap",subs="+attributes"] ----- -$ helm uninstall {artifactId} ----- - -:leveloffset: 1 -// Testing on Openshift -:leveloffset: +1 - -[[run_the_arquillian_integration_tests_with_openshift]] -= Run the Arquillian Integration Tests with OpenShift -//****************************************************************************** -// Include this template if your quickstart provides Openshift Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -[NOTE] -==== -The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin. -==== - -Run the integration tests using the following command to run the `verify` goal with the `arq-remote` profile activated and the proper URL: -[source,options="nowrap",subs="+attributes"] ----- -$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route {artifactId} --template='{{ .spec.host }}') ----- - -[NOTE] -==== -The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from. -==== - -:leveloffset: 1 - -:leveloffset!: diff --git a/kitchensink/README.html b/kitchensink/README.html deleted file mode 100644 index b22575eaa5..0000000000 --- a/kitchensink/README.html +++ /dev/null @@ -1,902 +0,0 @@ - - - - - - - - -kitchensink: Assortment of technologies including Arquillian - - - - - -
-
-
-
-
-The kitchensink quickstart demonstrates a Jakarta EE 10 web-enabled database application using JSF, CDI, EJB, JPA, and Bean Validation. -
-
-
-
-
-

What is it?

-
-
-

The kitchensink quickstart is a deployable Maven 3 project designed to help you get your foot in the door developing with Jakarta EE 10 on Red Hat JBoss Enterprise Application Platform.

-
-
-

It demonstrates how to create a compliant Jakarta EE 10 application using JSF, CDI, JAX-RS, EJB, JPA, and Bean Validation. It also includes a persistence unit and some sample persistence and transaction code to introduce you to database access in enterprise Java.

-
-
-
-
-

Considerations for Use in a Production Environment

-
-
-
-
H2 Database
-
-

This quickstart uses the H2 database included with Red Hat JBoss Enterprise Application Platform 8.0. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment.

-
-
Datasource Configuration File
-
-

This quickstart uses a *-ds.xml datasource configuration file for convenience and ease of database configuration. These files are deprecated in JBoss EAP and should not be used in a production environment. Instead, you should configure the datasource using the Management CLI or Management Console. Datasource configuration is documented in the Configuration Guide.

-
-
-
-
-
-
-

System Requirements

-
-
-

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 8.0 or later.

-
-
-

All you need to build this project is Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later. See Configure Maven to Build and Deploy the Quickstarts to make sure you are configured correctly for testing the quickstarts.

-
-
-
-
-

Use of the EAP_HOME and QUICKSTART_HOME Variables

-
-
-

In the following instructions, replace EAP_HOME with the actual path to your JBoss EAP installation. The installation path is described in detail here: Use of EAP_HOME and JBOSS_HOME Variables.

-
-
-

When you see the replaceable variable QUICKSTART_HOME, replace it with the path to the root directory of all of the quickstarts.

-
-
-
-
-

Building and running the quickstart application with a JBoss EAP server distribution

-
-
-

Start the JBoss EAP Standalone Server

-
-
    -
  1. -

    Open a terminal and navigate to the root of the JBoss EAP directory.

    -
  2. -
  3. -

    Start the JBoss EAP server with the default profile by typing the following command.

    -
    -
    -
    $ EAP_HOME/bin/standalone.sh 
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\standalone.bat script. -
    -
    -
  4. -
-
-
-
-

Build and Deploy the Quickstart

-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type the following command to build the quickstart.

    -
    -
    -
    $ mvn clean package
    -
    -
    -
  6. -
  7. -

    Type the following command to deploy the quickstart.

    -
    -
    -
    $ mvn wildfly:deploy
    -
    -
    -
  8. -
-
-
-

This deploys the kitchensink/target/kitchensink.war to the running instance of the server.

-
-
-

You should see a message in the server log indicating that the archive deployed successfully.

-
-
-
-

Access the Application

-
-

The application will be running at the following URL: http://localhost:8080/kitchensink/.

-
-
-
-

Server Log: Expected Warnings and Errors

-
-

You will see the following warnings in the server log. You can ignore these warnings.

-
-
-
-
WFLYJCA0091: -ds.xml file deployments are deprecated. Support may be removed in a future version.
-
-
-
-
-

Run the Arquillian Integration Tests

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
-

Follow these steps to run the integration tests.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server, as previously described.

    -
  2. -
  3. -

    Make sure you build and deploy the quickstart, as previously described.

    -
  4. -
  5. -

    Type the following command to run the verify goal with the arq-remote profile activated.

    -
    -
    -
    $ mvn verify -Parq-remote
    -
    -
    -
  6. -
-
-
- - - - - -
-
Note
-
-
-

You may also use the environment variable SERVER_HOST or the system property server.host to define the target host of the tests.

-
-
-
-
-
-

Undeploy the Quickstart

-
-

When you are finished testing the quickstart, follow these steps to undeploy the archive.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type this command to undeploy the archive:

    -
    -
    -
    $ mvn wildfly:undeploy
    -
    -
    -
  6. -
-
-
-
-
-
-

Building and running the quickstart application with OpenShift

-
-
-

Build the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

On OpenShift, the S2I build with Apache Maven will use an openshift profile used to provision a JBoss EAP server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named openshift when building the quickstart:

-
-
-
-
$ mvn clean package -Popenshift
-
-
-
-

The provisioned JBoss EAP server for OpenShift, with the quickstart deployed, can then be found in the target/server directory, and its usage is similar to a standard server distribution. -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.

-
-
-

The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart pom.xml:

-
-
-
-
        <profile>
-            <id>openshift</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.jboss.eap.plugins</groupId>
-                        <artifactId>eap-maven-plugin</artifactId>
-                        <version>${version.eap.maven.plugin}</version>
-                        <configuration>
-                            <feature-packs>
-                                <feature-pack>
-                                    <location>org.jboss.eap:wildfly-ee-galleon-pack</location>
-                                </feature-pack>
-                                <feature-pack>
-                                    <location>org.jboss.eap.cloud:eap-cloud-galleon-pack</location>
-                                </feature-pack>
-                            </feature-packs>
-                            <layers>
-                                <layer>cloud-server</layer>
-                            </layers>
-                            <filename>ROOT.war</filename>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>package</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-
-
-
- - - - - -
-
Note
-
-
-

Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the /kitchensink path segment after HOST:PORT.

-
-
-
-
-
-

Getting Started with JBoss EAP for OpenShift and Helm Charts

-
-

This section contains the basic instructions to build and deploy this quickstart to JBoss EAP for OpenShift or JBoss EAP for OpenShift Online using Helm Charts.

-
-
-

Prerequisites

-
-
    -
  • -

    You must be logged in OpenShift and have an oc client to connect to OpenShift

    -
  • -
  • -

    Helm must be installed to deploy the backend on OpenShift.

    -
  • -
-
-
-

Once you have installed Helm, you need to add the repository that provides Helm Charts for JBoss EAP.

-
-
-
-
$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/
-"jboss-eap" has been added to your repositories
-$ helm search repo jboss-eap
-NAME                    CHART VERSION   APP VERSION     DESCRIPTION
-jboss-eap/eap8         ...             ...             A Helm chart to build and deploy EAP 8.0 applications
-
-
-
-
-

Deploy the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

Log in to your OpenShift instance using the oc login command. -The backend will be built and deployed on OpenShift with a Helm Chart for JBoss EAP.

-
-
-

Navigate to the root directory of this quickstart and run the following command:

-
-
-
-
$ helm install kitchensink -f charts/helm.yaml jboss-eap/eap8
-NAME: kitchensink
-...
-STATUS: deployed
-REVISION: 1
-
-
-
-

The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17:

-
-
-
-
build:
-  uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git
-  ref: 8.0.x
-  contextDir: kitchensink
-deploy:
-  replicas: 1
-
-
-
-

This will create a new deployment on OpenShift and deploy the application.

-
-
-

If you want to see all the configuration elements to customize your deployment you can use the following command:

-
-
-
-
$ helm show readme jboss-eap/eap8
-
-
-
-

Let’s wait for the application to be built and deployed:

-
-
-
-
$ oc get deployment kitchensink -w
-NAME         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
-kitchensink   1         1         1            0           12s
-...
-kitchensink   1         1         1            1           2m
-
-
-
-

Get the URL of the route to the deployment.

-
-
-
-
$ oc get route kitchensink -o jsonpath="{.spec.host}"
-
-
-
-

Access the application in your web browser using the displayed URL.

-
-
- - - - - -
-
Note
-
-
-

The Maven profile named openshift is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the /kitchensink path segment after HOST:PORT.

-
-
-
-
-
-

Undeploy the JBoss EAP Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts

-
-
-
$ helm uninstall kitchensink
-
-
-
-
-
-

Run the Arquillian Integration Tests with OpenShift

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
- - - - - -
-
Note
-
-
-

The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin.

-
-
-
-
-

Run the integration tests using the following command to run the verify goal with the arq-remote profile activated and the proper URL:

-
-
-
-
$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route kitchensink --template='{{ .spec.host }}')
-
-
-
- - - - - -
-
Note
-
-
-

The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from.

-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/kitchensink/pom.xml b/kitchensink/pom.xml deleted file mode 100644 index 315d9f17e6..0000000000 --- a/kitchensink/pom.xml +++ /dev/null @@ -1,338 +0,0 @@ - - - - 4.0.0 - - org.jboss.eap.quickstarts - jboss-eap-quickstart-parent - - 6.0.0.redhat-00001 - - - kitchensink - 8.0.0.GA - war - Quickstart: kitchensink - A starter Jakarta EE web application project for use in JBoss EAP - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - 8.0.0.GA-redhat-00009 - 1.0.0.Final-redhat-00014 - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - never - - default - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - never - - - true - never - - default - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - - - true - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - - - true - - - - - - - - - org.jboss.bom - jboss-eap-ee-with-tools - ${version.server.bom} - pom - import - - - - - - - - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - - - junit - junit - test - - - - - - - org.hibernate.orm - hibernate-jpamodelgen - provided - - - - jakarta.activation - jakarta.activation-api - provided - - - - - org.hibernate.validator - hibernate-validator - provided - - - - jakarta.validation - jakarta.validation-api - provided - - - - - org.hibernate.validator - hibernate-validator-annotation-processor - provided - - - - - jakarta.persistence - jakarta.persistence-api - provided - - - - - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet-jakarta - test - - - - - jakarta.annotation - jakarta.annotation-api - provided - - - - - jakarta.ejb - jakarta.ejb-api - provided - - - - - jakarta.faces - jakarta.faces-api - provided - - - - - jakarta.ws.rs - jakarta.ws.rs-api - provided - - - - jakarta.xml.bind - jakarta.xml.bind-api - provided - - - - jakarta.json - jakarta.json-api - test - - - org.eclipse.parsson - parsson - test - - - - - - - - arq-remote - - - org.wildfly.arquillian - wildfly-arquillian-container-remote - test - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} - - - **/RemoteMemberRegistrationIT - - - **/MemberRegistrationIT - - - - - - integration-test - verify - - - - - - - - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - - org.jboss.eap.channels - eap-8.0 - - - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - h2-driver - ejb - jsf - - ROOT.war - - - - - package - - - - - - - - - - diff --git a/kitchensink/src/main/webapp/WEB-INF/beans.xml b/kitchensink/src/main/webapp/WEB-INF/beans.xml deleted file mode 100644 index d3ddf148e7..0000000000 --- a/kitchensink/src/main/webapp/WEB-INF/beans.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/kitchensink/src/test/resources/arquillian.xml b/kitchensink/src/test/resources/arquillian.xml deleted file mode 100644 index fdeb809fee..0000000000 --- a/kitchensink/src/test/resources/arquillian.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/numberguess/README-source.adoc b/numberguess/README-source.adoc deleted file mode 100644 index d6d0743424..0000000000 --- a/numberguess/README-source.adoc +++ /dev/null @@ -1,45 +0,0 @@ -include::../shared-doc/attributes.adoc[] - -= numberguess: Example Using CDI and JSF -:author: Pete Muir -:level: Beginner -:technologies: CDI, JSF -:openshift: true - -[abstract] -The `numberguess` quickstart demonstrates the use of CDI (Contexts and Dependency Injection) and JSF (JavaServer Faces) in {productName}. - -:standalone-server-type: default -:archiveType: war - -== What is it? - -The `numberguess` quickstart demonstrates the use of CDI (Contexts and Dependency Injection) and JSF (JavaServer Faces) in {productNameFull}. - -// System Requirements -include::../shared-doc/system-requirements.adoc[leveloffset=+1] -// Use of {jbossHomeName} -include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1] - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Start the {productName} Standalone Server -include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+2] -// Build and Deploy the Quickstart -include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+2] - -=== Access the Application - -The application will be running at the following URL: http://localhost:8080/{artifactId}/. - -// Testing with Arquillian -include::../shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc[leveloffset=+2] -// Undeploy the Quickstart -include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2] - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1] \ No newline at end of file diff --git a/numberguess/README.adoc b/numberguess/README.adoc deleted file mode 100644 index aafb0460b0..0000000000 --- a/numberguess/README.adoc +++ /dev/null @@ -1,829 +0,0 @@ -ifdef::env-github[] -:artifactId: numberguess -endif::[] - -//*********************************************************************************** -// Enable the following flag to build README.html files for JBoss EAP product builds. -// Comment it out for WildFly builds. -//*********************************************************************************** -:ProductRelease: - -//*********************************************************************************** -// Enable the following flag to build README.html files for EAP XP product builds. -// Comment it out for WildFly or JBoss EAP product builds. -//*********************************************************************************** -//:EAPXPRelease: - -// This is a universal name for all releases -:ProductShortName: JBoss EAP -// Product names and links are dependent on whether it is a product release (CD or JBoss) -// or the WildFly project. -// The "DocInfo*" attributes are used to build the book links to the product documentation - -ifdef::ProductRelease[] -// JBoss EAP release -:productName: JBoss EAP -:productNameFull: Red Hat JBoss Enterprise Application Platform -:productVersion: 8.0 -:DocInfoProductNumber: {productVersion} -:WildFlyQuickStartRepoTag: 8.0.x -:productImageVersion: 8.0.0 -:helmChartName: jboss-eap/eap8 -endif::[] - -ifdef::EAPXPRelease[] -// JBoss EAP XP release -:productName: JBoss EAP XP -:productNameFull: Red Hat JBoss Enterprise Application Platform expansion pack -:productVersion: 3.0 -:DocInfoProductNumber: 7.4 -:WildFlyQuickStartRepoTag: XP_3.0.0.GA -:productImageVersion: 3.0 -:helmChartName: jboss-eap/eap-xp3 -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -:githubRepoUrl: https://github.com/jboss-developer/jboss-eap-quickstarts/ -:githubRepoCodeUrl: https://github.com/jboss-developer/jboss-eap-quickstarts.git -:jbossHomeName: EAP_HOME -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:quickstartDownloadName: {productNameFull} {productVersion} Quickstarts -:quickstartDownloadUrl: https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=appplatform&downloadType=distributions -:helmRepoName: jboss-eap -:helmRepoUrl: https://jbossas.github.io/eap-charts/ -// END ifdef::ProductRelease,EAPXPRelease[] -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -// WildFly project -:productName: WildFly -:productNameFull: WildFly Application Server -:ProductShortName: {productName} -:jbossHomeName: WILDFLY_HOME -:productVersion: 28 -:productImageVersion: 28.0 -:githubRepoUrl: https://github.com/wildfly/quickstart/ -:githubRepoCodeUrl: https://github.com/wildfly/quickstart.git -:WildFlyQuickStartRepoTag: 28.0.1.Final -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -// Do not update the following until after the 7.4 docs are published! -:DocInfoProductNumber: 7.4 -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:helmRepoName: wildfly -:helmRepoUrl: http://docs.wildfly.org/wildfly-charts/ -:helmChartName: wildfly/wildfly -// END ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -endif::[] - -:source: {githubRepoUrl} - -// Values for Openshift S2i sections attributes -:CDProductName: {productNameFull} for OpenShift -:CDProductShortName: {ProductShortName} for OpenShift -:CDProductTitle: {CDProductName} -:CDProductNameSentence: Openshift release for {ProductShortName} -:CDProductAcronym: {CDProductShortName} -:CDProductVersion: {productVersion} -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {EapForOpenshiftBookName} Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {xpaasproduct} Online -:xpaasproduct-shortname: {CDProductShortName} -:xpaasproductOpenShiftOnline-shortname: {xpaasproduct-shortname} Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: Getting Started with {ProductShortName} for OpenShift Container Platform -:EapForOpenshiftOnlineBookName: Getting Started with {ProductShortName} for OpenShift Online -:OpenShiftOnlinePlatformName: Red Hat OpenShift Container Platform -:OpenShiftOnlineName: Red Hat OpenShift Online -:ImagePrefixVersion: eap80 -:ImageandTemplateImportBaseURL: https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift - -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepo: https://github.com/jboss-developer/jboss-eap-quickstarts -:EAPQuickStartRepoRef: 8.0.x -:EAPQuickStartRepoTag: EAP_8.0.0.GA -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_container_platform/ -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_online/ - -ifdef::EAPXPRelease[] -// Attributes for XP releases -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {productNameFull} for OpenShift Online -:xpaasproduct-shortname: {ProductShortName} for OpenShift -:xpaasproductOpenShiftOnline-shortname: {ProductShortName} for OpenShift Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:ImagePrefixVersion: eap-xp3 -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepoRef: xp-3.0.x -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -endif::[] - -ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -:ImageandTemplateImportURL: https://raw.githubusercontent.com/wildfly/wildfly-s2i/v{productVersion}.0/ -endif::[] - -//************************* -// Other values -//************************* -:buildRequirements: Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later -:jbdsEapServerName: Red Hat JBoss Enterprise Application Platform 7.3 -:javaVersion: Jakarta EE 10 -ifdef::EAPXPRelease[] -:javaVersion: Eclipse MicroProfile -endif::[] -:githubRepoBranch: master -:guidesBaseUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/ -:useEclipseUrl: {guidesBaseUrl}USE_JBDS.adoc#use_red_hat_jboss_developer_studio_or_eclipse_to_run_the_quickstarts -:useEclipseDeployJavaClientDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_containing_server_and_java_client_projects -:useEclipseDeployEARDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_ear_project -:useProductHomeDocUrl: {guidesBaseUrl}USE_OF_{jbossHomeName}.adoc#use_of_product_home_and_jboss_home_variables -:configureMavenDocUrl: {guidesBaseUrl}CONFIGURE_MAVEN_JBOSS_EAP.adoc#configure_maven_to_build_and_deploy_the_quickstarts -:arquillianTestsDocUrl: {guidesBaseUrl}RUN_ARQUILLIAN_TESTS.adoc#run_the_arquillian_tests -:addUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#create_users_required_by_the_quickstarts -:addApplicationUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_application_user -:addManagementUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_management_user -:startServerDocUrl: {guidesBaseUrl}START_JBOSS_EAP.adoc#start_the_jboss_eap_server -:configurePostgresDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_database_for_use_with_the_quickstarts -:configurePostgresDownloadDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#download_and_install_postgresql -:configurePostgresCreateUserDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#create_a_database_user -:configurePostgresAddModuleDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#add_the_postgres_module_to_the_jboss_eap_server -:configurePostgresDriverDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_driver_in_the_jboss_eap_server -:configureBytemanDownloadDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#download_and_configure_byteman -:configureBytemanDisableDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#disable_the_byteman_script -:configureBytemanClearDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#clear_the_transaction_object_store -:configureBytemanQuickstartDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts -:configureBytemanHaltDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#use_byteman_to_halt_the_application[ -:configureBytemanQuickstartsDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts - -:EESubsystemNamespace: urn:jboss:domain:ee:4.0 -:IiopOpenJdkSubsystemNamespace: urn:jboss:domain:iiop-openjdk:2.0 -:MailSubsystemNamespace: urn:jboss:domain:mail:3.0 -:SingletonSubsystemNamespace: urn:jboss:domain:singleton:1.0 -:TransactionsSubsystemNamespace: urn:jboss:domain:transactions:4.0 - -// LinkProductDocHome: https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/ -:LinkProductDocHome: https://access.redhat.com/documentation/en/jboss-enterprise-application-platform-continuous-delivery -:LinkConfigGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/configuration_guide/ -:LinkDevelopmentGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/development_guide/ -:LinkGettingStartedGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_guide/ -:LinkOpenShiftWelcome: https://docs.openshift.com/online/welcome/index.html -:LinkOpenShiftSignup: https://docs.openshift.com/online/getting_started/choose_a_plan.html -:OpenShiftTemplateName: JBoss EAP CD (no https) - -:ConfigBookName: Configuration Guide -:DevelopmentBookName: Development Guide -:GettingStartedBookName: Getting Started Guide - -:JBDSProductName: Red Hat CodeReady Studio -:JBDSVersion: 12.15 -:LinkJBDSInstall: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/installation_guide/ -:JBDSInstallBookName: Installation Guide -:LinkJBDSGettingStarted: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/getting_started_with_codeready_studio_tools/ -:JBDSGettingStartedBookName: Getting Started with CodeReady Studio Tools - -= numberguess: Example Using CDI and JSF -:author: Pete Muir -:level: Beginner -:technologies: CDI, JSF -:openshift: true - -[abstract] -The `numberguess` quickstart demonstrates the use of CDI (Contexts and Dependency Injection) and JSF (JavaServer Faces) in {productName}. - -:standalone-server-type: default -:archiveType: war - -== What is it? - -The `numberguess` quickstart demonstrates the use of CDI (Contexts and Dependency Injection) and JSF (JavaServer Faces) in {productNameFull}. - -// System Requirements -:leveloffset: +1 - -[[system_requirements]] -= System Requirements -//****************************************************************************** -// Include this template to describe the standard system requirements for -// running the quickstarts. -// -// The Forge quickstarts define a `forge-from-scratch` attribute because they -// run entirely in CodeReady Studio and have different requirements . -//****************************************************************************** - -The application this project produces is designed to be run on {productNameFull} {productVersion} or later. - -All you need to build this project is {buildRequirements}. See link:{configureMavenDocUrl}[Configure Maven to Build and Deploy the Quickstarts] to make sure you are configured correctly for testing the quickstarts. - -:leveloffset!: -// Use of {jbossHomeName} -:leveloffset: +1 - -ifdef::requires-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -This quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifdef::optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -When deploying this quickstart to a managed domain, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When deploying this quickstart to multiple standalone servers, this quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifndef::requires-multiple-servers,optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName} and QUICKSTART_HOME Variables - -In the following instructions, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -:leveloffset!: - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Start the {productName} Standalone Server -:leveloffset: +2 - -[[start_the_eap_standalone_server]] -= Start the {productName} Standalone Server -//****************************************************************************** -// Include this template if your quickstart requires a normal start of a single -// standalone server. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// custom -// -// * For mobile applications, you can define the `mobileApp` variable in the -// `README.adoc` file to add `-b 0.0.0.0` to the command line. This allows -// external clients, such as phones, tablets, and desktops, to connect -// to the application through through your local network -// ::mobileApp: {artifactId}-service -// -//****************************************************************************** - -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -. Open a terminal and navigate to the root of the {productName} directory. -. Start the {productName} server with the {serverProfile} by typing the following command. -+ -ifdef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __JAEGER_REPORTER_LOG_SPANS=true JAEGER_SAMPLER_TYPE=const JAEGER_SAMPLER_PARAM=1__ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -ifndef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\standalone.bat` script. - -ifdef::mobileApp[] -+ -Adding `-b 0.0.0.0` to the above command allows external clients, such as phones, tablets, and desktops, to connect through your local network. For example: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} -b 0.0.0.0 ----- -endif::[] - -:leveloffset!: -// Build and Deploy the Quickstart -:leveloffset: +2 - -[[build_and_deploy_the_quickstart]] -= Build and Deploy the Quickstart -//****************************************************************************** -// Include this template if your quickstart does a normal deployment of a archive. -// -// * Define the `archiveType` variable in the quickstart README file. -// Supported values: -// :archiveType: ear -// :archiveType: war -// :archiveType: jar -// -// * To override the archive name, which defaults to the {artifactId), -// define the `archiveName` variable, for example: -// :archiveName: {artifactId}-service -// -// * To override the archive output directory, -// define the `archiveDir` variable, for example: -// :archiveDir: ear/target -// -// * To override the Maven command, define the `mavenCommand` variable, -// for example: -// :mavenCommand: clean install wildfly:deploy -//****************************************************************************** - -// The archive name defaults to the artifactId if not overridden -ifndef::archiveName[] -:archiveName: {artifactId} -endif::archiveName[] - -// The archive type defaults to war if not overridden -ifndef::archiveType[] -:archiveType: war -endif::archiveType[] - -// Define the archive file name as the concatenation of "archiveName" + "." + "archiveType+ -:archiveFileName: {archiveName}.{archiveType} - -// If they have not defined the target archive directory, make it the default for the archive type. -ifndef::archiveDir[] - -ifeval::["{archiveType}"=="ear"] -:archiveDir: {artifactId}/ear/target -endif::[] - -ifeval::["{archiveType}"=="war"] -:archiveDir: {artifactId}/target -endif::[] - -ifeval::["{archiveType}"=="jar"] -:archiveDir: {artifactId}/target -endif::[] - -endif::archiveDir[] - -ifndef::mavenCommand[] -ifeval::["{archiveType}"=="ear"] -:mavenCommand: clean install -endif::[] - -ifeval::["{archiveType}"=="war"] -:mavenCommand: clean package -endif::[] - -ifeval::["{archiveType}"=="jar"] -:mavenCommand: clean install -endif::[] - -endif::mavenCommand[] - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -ifdef::reactive-messaging[] -. Run this command to enable the MicroProfile Reactive Messaging functionality on the server -+ -[source,subs="attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=enable-reactive-messaging.cli ----- -endif::reactive-messaging[] -. Type the following command to build the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn {mavenCommand} ----- - -. Type the following command to deploy the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn wildfly:deploy ----- - -ifdef::rest-client-qs[] -This builds and deploys the `country-server` and `country-client` to the running instance of the server. - -You should see a message in the server log indicating that the archives deployed successfully. -endif::[] -ifndef::rest-client-qs[] -This deploys the `{archiveDir}/{archiveFileName}` to the running instance of the server. - -You should see a message in the server log indicating that the archive deployed successfully. -endif::[] - - -:leveloffset!: - -=== Access the Application - -The application will be running at the following URL: http://localhost:8080/{artifactId}/. - -// Testing with Arquillian -:leveloffset: +2 - -[[run_the_arquillian_integration_tests_with_server_distribution]] -= Run the Arquillian Integration Tests -//****************************************************************************** -// Include this template if your quickstart provides standard Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -Follow these steps to run the integration tests. - -. Make sure you start the {productName} server, as previously described. - -. Make sure you build and deploy the quickstart, as previously described. - -. Type the following command to run the `verify` goal with the `arq-remote` profile activated. -+ -[source,options="nowrap"] ----- -$ mvn verify -Parq-remote ----- - -[NOTE] -==== -You may also use the environment variable `SERVER_HOST` or the system property `server.host` to define the target host of the tests. -==== - -:leveloffset!: -// Undeploy the Quickstart -:leveloffset: +2 - -[[undeploy_the_quickstart]] -= Undeploy the Quickstart - -//******************************************************************************* -// Include this template if your quickstart does a normal undeployment of an archive. -//******************************************************************************* -When you are finished testing the quickstart, follow these steps to undeploy the archive. - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -. Type this command to undeploy the archive: -+ -[source,options="nowrap"] ----- -$ mvn wildfly:undeploy ----- - -:leveloffset!: - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -:leveloffset: +1 - -[[build_and_run_the_quickstart_on_openshift]] -= Building and running the quickstart application with OpenShift -// The openshift profile -:leveloffset: +1 - -[[build-the-quickstart-for-openshift]] -== Build the {productName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -On OpenShift, the S2I build with Apache Maven will use an `openshift` profile used to provision a {productName} server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named `openshift` when building the quickstart: - -[source,subs="attributes+",options="nowrap"] ----- -$ mvn clean package -Popenshift ----- - -The provisioned {productName} server for OpenShift, with the quickstart deployed, can then be found in the `target/server` directory, and its usage is similar to a standard server distribution. -ifndef::ProductRelease,EAPXPRelease[] -You may note that unlike the `provisioned-server` profile it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the WildFly Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.wildfly:wildfly-galleon-pack:${version.server} - - - org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp} - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -[NOTE] -==== -Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`. -==== - -:leveloffset: 1 -// Getting Started with Helm -:leveloffset: +1 - -[[getting_started_with_helm]] -= Getting Started with {xpaasproduct-shortname} and Helm Charts - -This section contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} using Helm Charts. - -[[prerequisites_helm_openshift]] -== Prerequisites - -* You must be logged in OpenShift and have an `oc` client to connect to OpenShift -* https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. - -Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}. - -ifndef::ProductRelease,EAPXPRelease[] -[source,options="nowrap"] ----- -$ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ -"wildfly" has been added to your repositories -$ helm search repo wildfly -NAME CHART VERSION APP VERSION DESCRIPTION -wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift -wildfly/wildfly-common ... ... A library chart for WildFly-based applications ----- -endif::[] -ifdef::ProductRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP {productVersion} applications ----- -endif::[] -ifdef::EAPXPRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP XP {productVersion} applications ----- -endif::[] - -:leveloffset: 1 -//Prepare Helm for Quickstart Deployment -:leveloffset: +1 - -[[deploy_helm]] -== Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -Log in to your OpenShift instance using the `oc login` command. -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -Navigate to the root directory of this quickstart and run the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm install {artifactId} -f charts/helm.yaml {helmChartName} -NAME: {artifactId} -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17: - -[source,options="nowrap",subs="+attributes"] ----- -build: - uri: {githubRepoCodeUrl} - ref: {WildFlyQuickStartRepoTag} - contextDir: {artifactId} -deploy: - replicas: 1 ----- - -This will create a new deployment on OpenShift and deploy the application. - -If you want to see all the configuration elements to customize your deployment you can use the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let’s wait for the application to be built and deployed: -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment {artifactId} -w -NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE -{artifactId} 1 1 1 0 12s -... -{artifactId} 1 1 1 1 2m ----- - -Get the URL of the route to the deployment. - -[source,options="nowrap",subs="+attributes"] ----- -$ oc get route {artifactId} -o jsonpath="{.spec.host}" ----- -Access the application in your web browser using the displayed URL. - -[NOTE] -==== -The Maven profile named `openshift` is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the `/{artifactId}` path segment after `HOST:PORT`. -==== - -[[undeploy_helm]] -== Undeploy the {ProductShortName} Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts - - -[source,options="nowrap",subs="+attributes"] ----- -$ helm uninstall {artifactId} ----- - -:leveloffset: 1 -// Testing on Openshift -:leveloffset: +1 - -[[run_the_arquillian_integration_tests_with_openshift]] -= Run the Arquillian Integration Tests with OpenShift -//****************************************************************************** -// Include this template if your quickstart provides Openshift Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -[NOTE] -==== -The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin. -==== - -Run the integration tests using the following command to run the `verify` goal with the `arq-remote` profile activated and the proper URL: -[source,options="nowrap",subs="+attributes"] ----- -$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route {artifactId} --template='{{ .spec.host }}') ----- - -[NOTE] -==== -The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from. -==== - -:leveloffset: 1 - -:leveloffset!: diff --git a/numberguess/README.html b/numberguess/README.html deleted file mode 100644 index d1d3da66fe..0000000000 --- a/numberguess/README.html +++ /dev/null @@ -1,871 +0,0 @@ - - - - - - - - -numberguess: Example Using CDI and JSF - - - - - -
-
-
-
-
-The numberguess quickstart demonstrates the use of CDI (Contexts and Dependency Injection) and JSF (JavaServer Faces) in JBoss EAP. -
-
-
-
-
-

What is it?

-
-
-

The numberguess quickstart demonstrates the use of CDI (Contexts and Dependency Injection) and JSF (JavaServer Faces) in Red Hat JBoss Enterprise Application Platform.

-
-
-
-
-

System Requirements

-
-
-

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 8.0 or later.

-
-
-

All you need to build this project is Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later. See Configure Maven to Build and Deploy the Quickstarts to make sure you are configured correctly for testing the quickstarts.

-
-
-
-
-

Use of the EAP_HOME and QUICKSTART_HOME Variables

-
-
-

In the following instructions, replace EAP_HOME with the actual path to your JBoss EAP installation. The installation path is described in detail here: Use of EAP_HOME and JBOSS_HOME Variables.

-
-
-

When you see the replaceable variable QUICKSTART_HOME, replace it with the path to the root directory of all of the quickstarts.

-
-
-
-
-

Building and running the quickstart application with a JBoss EAP server distribution

-
-
-

Start the JBoss EAP Standalone Server

-
-
    -
  1. -

    Open a terminal and navigate to the root of the JBoss EAP directory.

    -
  2. -
  3. -

    Start the JBoss EAP server with the default profile by typing the following command.

    -
    -
    -
    $ EAP_HOME/bin/standalone.sh 
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\standalone.bat script. -
    -
    -
  4. -
-
-
-
-

Build and Deploy the Quickstart

-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type the following command to build the quickstart.

    -
    -
    -
    $ mvn clean package
    -
    -
    -
  6. -
  7. -

    Type the following command to deploy the quickstart.

    -
    -
    -
    $ mvn wildfly:deploy
    -
    -
    -
  8. -
-
-
-

This deploys the numberguess/target/numberguess.war to the running instance of the server.

-
-
-

You should see a message in the server log indicating that the archive deployed successfully.

-
-
-
-

Access the Application

-
-

The application will be running at the following URL: http://localhost:8080/numberguess/.

-
-
-
-

Run the Arquillian Integration Tests

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
-

Follow these steps to run the integration tests.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server, as previously described.

    -
  2. -
  3. -

    Make sure you build and deploy the quickstart, as previously described.

    -
  4. -
  5. -

    Type the following command to run the verify goal with the arq-remote profile activated.

    -
    -
    -
    $ mvn verify -Parq-remote
    -
    -
    -
  6. -
-
-
- - - - - -
-
Note
-
-
-

You may also use the environment variable SERVER_HOST or the system property server.host to define the target host of the tests.

-
-
-
-
-
-

Undeploy the Quickstart

-
-

When you are finished testing the quickstart, follow these steps to undeploy the archive.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type this command to undeploy the archive:

    -
    -
    -
    $ mvn wildfly:undeploy
    -
    -
    -
  6. -
-
-
-
-
-
-

Building and running the quickstart application with OpenShift

-
-
-

Build the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

On OpenShift, the S2I build with Apache Maven will use an openshift profile used to provision a JBoss EAP server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named openshift when building the quickstart:

-
-
-
-
$ mvn clean package -Popenshift
-
-
-
-

The provisioned JBoss EAP server for OpenShift, with the quickstart deployed, can then be found in the target/server directory, and its usage is similar to a standard server distribution. -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.

-
-
-

The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart pom.xml:

-
-
-
-
        <profile>
-            <id>openshift</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.jboss.eap.plugins</groupId>
-                        <artifactId>eap-maven-plugin</artifactId>
-                        <version>${version.eap.maven.plugin}</version>
-                        <configuration>
-                            <feature-packs>
-                                <feature-pack>
-                                    <location>org.jboss.eap:wildfly-ee-galleon-pack</location>
-                                </feature-pack>
-                                <feature-pack>
-                                    <location>org.jboss.eap.cloud:eap-cloud-galleon-pack</location>
-                                </feature-pack>
-                            </feature-packs>
-                            <layers>
-                                <layer>cloud-server</layer>
-                            </layers>
-                            <filename>ROOT.war</filename>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>package</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-
-
-
- - - - - -
-
Note
-
-
-

Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the /numberguess path segment after HOST:PORT.

-
-
-
-
-
-

Getting Started with JBoss EAP for OpenShift and Helm Charts

-
-

This section contains the basic instructions to build and deploy this quickstart to JBoss EAP for OpenShift or JBoss EAP for OpenShift Online using Helm Charts.

-
-
-

Prerequisites

-
-
    -
  • -

    You must be logged in OpenShift and have an oc client to connect to OpenShift

    -
  • -
  • -

    Helm must be installed to deploy the backend on OpenShift.

    -
  • -
-
-
-

Once you have installed Helm, you need to add the repository that provides Helm Charts for JBoss EAP.

-
-
-
-
$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/
-"jboss-eap" has been added to your repositories
-$ helm search repo jboss-eap
-NAME                    CHART VERSION   APP VERSION     DESCRIPTION
-jboss-eap/eap8         ...             ...             A Helm chart to build and deploy EAP 8.0 applications
-
-
-
-
-

Deploy the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

Log in to your OpenShift instance using the oc login command. -The backend will be built and deployed on OpenShift with a Helm Chart for JBoss EAP.

-
-
-

Navigate to the root directory of this quickstart and run the following command:

-
-
-
-
$ helm install numberguess -f charts/helm.yaml jboss-eap/eap8
-NAME: numberguess
-...
-STATUS: deployed
-REVISION: 1
-
-
-
-

The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17:

-
-
-
-
build:
-  uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git
-  ref: 8.0.x
-  contextDir: numberguess
-deploy:
-  replicas: 1
-
-
-
-

This will create a new deployment on OpenShift and deploy the application.

-
-
-

If you want to see all the configuration elements to customize your deployment you can use the following command:

-
-
-
-
$ helm show readme jboss-eap/eap8
-
-
-
-

Let’s wait for the application to be built and deployed:

-
-
-
-
$ oc get deployment numberguess -w
-NAME         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
-numberguess   1         1         1            0           12s
-...
-numberguess   1         1         1            1           2m
-
-
-
-

Get the URL of the route to the deployment.

-
-
-
-
$ oc get route numberguess -o jsonpath="{.spec.host}"
-
-
-
-

Access the application in your web browser using the displayed URL.

-
-
- - - - - -
-
Note
-
-
-

The Maven profile named openshift is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the /numberguess path segment after HOST:PORT.

-
-
-
-
-
-

Undeploy the JBoss EAP Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts

-
-
-
$ helm uninstall numberguess
-
-
-
-
-
-

Run the Arquillian Integration Tests with OpenShift

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
- - - - - -
-
Note
-
-
-

The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin.

-
-
-
-
-

Run the integration tests using the following command to run the verify goal with the arq-remote profile activated and the proper URL:

-
-
-
-
$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route numberguess --template='{{ .spec.host }}')
-
-
-
- - - - - -
-
Note
-
-
-

The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from.

-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/numberguess/charts/helm.yaml b/numberguess/charts/helm.yaml deleted file mode 100644 index 328cbb520b..0000000000 --- a/numberguess/charts/helm.yaml +++ /dev/null @@ -1,6 +0,0 @@ -build: - uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git - ref: 8.0.x - contextDir: numberguess -deploy: - replicas: 1 \ No newline at end of file diff --git a/numberguess/pom.xml b/numberguess/pom.xml deleted file mode 100644 index fa8405a21a..0000000000 --- a/numberguess/pom.xml +++ /dev/null @@ -1,253 +0,0 @@ - - - - 4.0.0 - - org.jboss.eap.quickstarts - jboss-eap-quickstart-parent - - 6.0.0.redhat-00001 - - - numberguess - 8.0.0.GA - war - Quickstart: numberguess - The numberguess project demonstrates the use of CDI and JSF in JBoss EAP - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - 8.0.0.GA-redhat-00009 - 1.0.0.Final-redhat-00014 - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - never - - default - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - never - - - true - never - - default - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - - - true - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - - - true - - - - - - - - - org.jboss.bom - jboss-eap-ee-with-tools - ${version.server.bom} - pom - import - - - - - - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - - - jakarta.annotation - jakarta.annotation-api - provided - - - - - jakarta.faces - jakarta.faces-api - provided - - - - - org.junit.jupiter - junit-jupiter-api - 5.9.1 - test - - - - org.junit.jupiter - junit-jupiter-params - 5.9.1 - test - - - - org.junit.jupiter - junit-jupiter-engine - 5.9.1 - test - - - - org.jboss.arquillian.junit5 - arquillian-junit5-container - test - - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet-jakarta - test - - - - - - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - - org.jboss.eap.channels - eap-8.0 - - - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - jsf - - ROOT.war - - - - - package - - - - - - - - - arq-remote - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} - - - **/RemoteNumberGuessIT - - - **/ProvisionedManagedNumberGuessIT - - - - - - integration-test - verify - - - - - - - - - diff --git a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Game.java b/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Game.java deleted file mode 100644 index 3a25af8a2b..0000000000 --- a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Game.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.numberguess; - -import java.io.Serializable; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.inject.Instance; -import jakarta.faces.application.FacesMessage; -import jakarta.faces.component.UIComponent; -import jakarta.faces.component.UIInput; -import jakarta.faces.context.FacesContext; -import jakarta.inject.Inject; -import jakarta.inject.Named; - -/** - *

- * {@link Game} contains all the business logic for the application, and also serves as the controller for the JSF view. - *

- *

- * It contains properties for the number to be guessed, the current guess, the smallest - * and biggest numbers guessed so far (as this is a higher/lower game we can prevent them entering numbers that - * they should know are wrong), and the number of remainingGuesses. - *

- *

- * The {@link #check()} method, and {@link #reset()} methods provide the business logic whilst the - * {@link #validateNumberRange(FacesContext, UIComponent, Object)} method provides feedback to the user. - *

- * - * @author Pete Muir - * - */ -@SuppressWarnings("serial") -@Named -@SessionScoped -public class Game implements Serializable { - - /** - * The number that the user needs to guess - */ - private int number; - - /** - * The users latest guess - */ - private int guess; - - /** - * The smallest number guessed so far (so we can track the valid guess range). - */ - private int smallest; - - /** - * The largest number guessed so far - */ - private int biggest; - - /** - * The number of guesses remaining - */ - private int remainingGuesses; - - /** - * The maximum number we should ask them to guess - */ - @Inject - @MaxNumber - private int maxNumber; - - /** - * The random number to guess - */ - @Inject - @Random - Instance randomNumber; - - public Game() { - } - - public int getNumber() { - return number; - } - - public int getGuess() { - return guess; - } - - public void setGuess(int guess) { - this.guess = guess; - } - - public int getSmallest() { - return smallest; - } - - public int getBiggest() { - return biggest; - } - - public int getRemainingGuesses() { - return remainingGuesses; - } - - /** - * Check whether the current guess is correct, and update the biggest/smallest guesses as needed. Give feedback to the user - * if they are correct. - */ - public void check() { - if (guess > number) { - biggest = guess - 1; - } else if (guess < number) { - smallest = guess + 1; - } else if (guess == number) { - FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Correct!")); - } - remainingGuesses--; - } - - /** - * Reset the game, by putting all values back to their defaults, and getting a new random number. We also call this method - * when the user starts playing for the first time using {@linkplain PostConstruct @PostConstruct} to set the initial - * values. - */ - @PostConstruct - public void reset() { - this.smallest = 0; - this.guess = 0; - this.remainingGuesses = 10; - this.biggest = maxNumber; - this.number = randomNumber.get(); - } - - /** - * A JSF validation method which checks whether the guess is valid. It might not be valid because there are no guesses left, - * or because the guess is not in range. - * - */ - public void validateNumberRange(FacesContext context, UIComponent toValidate, Object value) { - if (remainingGuesses <= 0) { - FacesMessage message = new FacesMessage("No guesses left!"); - context.addMessage(toValidate.getClientId(context), message); - ((UIInput) toValidate).setValid(false); - return; - } - int input = (Integer) value; - - if (input < smallest || input > biggest) { - ((UIInput) toValidate).setValid(false); - - FacesMessage message = new FacesMessage("Invalid guess"); - context.addMessage(toValidate.getClientId(context), message); - } - } -} diff --git a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Generator.java b/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Generator.java deleted file mode 100644 index 7213a55722..0000000000 --- a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Generator.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.numberguess; - -import java.io.Serializable; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.Produces; - -/** - *

- * Random number generator. - *

- * - *

- * Placing the random number generation, as well as the configuring the maximum number allows for a more loosely coupled - * application. We can now change out the implementation of number generation without any effect on the client code. We also - * produce a more intuitive design - both are identified by the fact they are numbers (int) and that they are qualified as the - * maximum number or a random number. - *

- * - *

- * We use the application scope to store the random number generator so that we use the same seed. - *

- * - * @author Pete Muir - * - */ -@SuppressWarnings("serial") -@ApplicationScoped -public class Generator implements Serializable { - - private java.util.Random random = new java.util.Random(System.currentTimeMillis()); - - private int maxNumber = 100; - - java.util.Random getRandom() { - return random; - } - - @Produces - @Random - int next() { - // a number between 1 and 100 - return getRandom().nextInt(maxNumber - 1) + 1; - } - - @Produces - @MaxNumber - int getMaxNumber() { - return maxNumber; - } -} diff --git a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/MaxNumber.java b/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/MaxNumber.java deleted file mode 100644 index afae997505..0000000000 --- a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/MaxNumber.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.numberguess; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -/** - * Qualifier for the maximum number - * - * @author Pete Muir - * - */ -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface MaxNumber { - -} diff --git a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Random.java b/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Random.java deleted file mode 100644 index 4ecf7c9e83..0000000000 --- a/numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Random.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.numberguess; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -/** - * Qualifier for random numbers - * - * @author Pete Muir - * - */ -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Random { - -} diff --git a/numberguess/src/main/webapp/WEB-INF/beans.xml b/numberguess/src/main/webapp/WEB-INF/beans.xml deleted file mode 100644 index d3ddf148e7..0000000000 --- a/numberguess/src/main/webapp/WEB-INF/beans.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/numberguess/src/main/webapp/WEB-INF/faces-config.xml b/numberguess/src/main/webapp/WEB-INF/faces-config.xml deleted file mode 100644 index 0e98f602ce..0000000000 --- a/numberguess/src/main/webapp/WEB-INF/faces-config.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - diff --git a/numberguess/src/main/webapp/home.xhtml b/numberguess/src/main/webapp/home.xhtml deleted file mode 100644 index 3c2fe83fe4..0000000000 --- a/numberguess/src/main/webapp/home.xhtml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - numberguess - - - -
-

Guess a number...

- - - -
- - - -
- - -
- I'm thinking of a number between #{game.smallest} and #{game.biggest}. You have - #{game.remainingGuesses} guesses remaining. -
- - - -
- Your guess: - - -
-
- -
-
- -
- -
- - - diff --git a/numberguess/src/main/webapp/index.html b/numberguess/src/main/webapp/index.html deleted file mode 100644 index 0897d6b00e..0000000000 --- a/numberguess/src/main/webapp/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - diff --git a/numberguess/src/test/java/org/jboss/as/quickstarts/numberguess/ProvisionedManagedNumberGuessIT.java b/numberguess/src/test/java/org/jboss/as/quickstarts/numberguess/ProvisionedManagedNumberGuessIT.java deleted file mode 100644 index 84a0019897..0000000000 --- a/numberguess/src/test/java/org/jboss/as/quickstarts/numberguess/ProvisionedManagedNumberGuessIT.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.numberguess; - - -import java.net.URI; -import java.net.URISyntaxException; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit5.ArquillianExtension; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; - -@ExtendWith(ArquillianExtension.class) -@RunAsClient -public class ProvisionedManagedNumberGuessIT extends RemoteNumberGuessIT { - - @Override - protected URI getHTTPEndpoint(String path) { - String host = getServerHost(); - if (host == null) { - host = "http://localhost:8080/"; - } - try { - return new URI(host + path); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } - - @Test - @Override - public void testGuessNumber() throws Exception { - guessNumber(); - } - -} diff --git a/numberguess/src/test/java/org/jboss/as/quickstarts/numberguess/RemoteNumberGuessIT.java b/numberguess/src/test/java/org/jboss/as/quickstarts/numberguess/RemoteNumberGuessIT.java deleted file mode 100644 index f813572724..0000000000 --- a/numberguess/src/test/java/org/jboss/as/quickstarts/numberguess/RemoteNumberGuessIT.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.numberguess; - -import java.io.IOException; -import java.net.CookieManager; -import java.net.CookiePolicy; -import java.util.logging.Logger; - -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URLEncoder; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.net.http.HttpRequest.BodyPublisher; -import java.net.http.HttpRequest.BodyPublishers; -import java.net.http.HttpResponse; -import java.nio.charset.StandardCharsets; -import java.util.Map; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class RemoteNumberGuessIT { - - private java.util.Random random = new java.util.Random(System.currentTimeMillis()); - private static final Logger log = Logger.getLogger(RemoteNumberGuessIT.class.getName()); - - protected URI getHTTPEndpoint(String path) { - String host = getServerHost(); - if (host == null) { - host = "http://localhost:8080/numberguess"; - } - try { - return new URI(host + path); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } - - protected String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host"); - } - return host; - } - - @Test - public void testGuessNumber() throws Exception { - guessNumber(); - } - - public void guessNumber() throws IOException, InterruptedException { - HttpClient client = HttpClient.newBuilder() - .followRedirects(HttpClient.Redirect.ALWAYS) - .cookieHandler(new CookieManager(null, CookiePolicy.ACCEPT_ALL)) - .build(); - HttpRequest request = HttpRequest.newBuilder(getHTTPEndpoint("/home.jsf")) - .POST(ofFormData(Map.of("numberGuess:inputGuess", (Object) getNumber()))) - .build(); - HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); - Assertions.assertEquals(200, response.statusCode()); - Assertions.assertTrue(response.body().toString().contains("
data) { - StringBuilder builder = new StringBuilder(); - for (Map.Entry entry : data.entrySet()) { - if (builder.length() > 0) { - builder.append("&"); - } - builder - .append(URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8)); - builder.append("="); - builder - .append(URLEncoder.encode(entry.getValue().toString(), StandardCharsets.UTF_8)); - } - return BodyPublishers.ofString(builder.toString()); - } - -} diff --git a/pom.xml b/pom.xml index 4d485c23e7..315d9f17e6 100644 --- a/pom.xml +++ b/pom.xml @@ -15,28 +15,24 @@ See the License for the specific language governing permissions and limitations under the License. --> - + 4.0.0 - - org.jboss - jboss-parent - 39 - - - org.jboss.eap.quickstarts - quickstart-aggregator - + 6.0.0.redhat-00001 + + + kitchensink 8.0.0.GA - - pom - - Quickstart: Aggregator - Quickstart's aggregator - https://github.com/jboss-developer/jboss-eap-quickstarts + war + Quickstart: kitchensink + A starter Jakarta EE web application project for use in JBoss EAP @@ -47,23 +43,9 @@ - ${project.basedir} - EAP8_HOME - JBoss EAP - 8.0.0.GA - - 2.1.0 + + 8.0.0.GA-redhat-00009 1.0.0.Final-redhat-00014 - 1.0.7.Final - 2.3.0.Final - - 3.0 - 8.5 - - UTF-8 - false @@ -123,256 +105,227 @@ - - - ${project.artifactId} - - - com.mycila - license-maven-plugin - ${version.com.mycyla.license} - -
${basedir}/dist/license.txt
- true - true - - target/** - .clover/** - **/*.sql - **/LICENSE* - **/license* - - **/jquery* - **/angular* - **/qunit* - **/backbone* - **/lodash* - **/modernizr* - **/yepnope* - **/mobile-nav* - - **/*glyphicons*/** - **/*cordova*/** - - UTF-8 - - dist/headerdefinition.xml - -
-
- - org.apache.maven.plugins - maven-checkstyle-plugin - -
- - - - org.asciidoctor - asciidoctor-maven-plugin - ${version.org.asciidoctor.asciidoctor-maven-plugin} - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${version.checkstyle.plugin} - - wildfly-checkstyle/checkstyle.xml - true - - ${project.build.sourceDirectory} - - **/*.properties,**/*.xml - true - true - true - true - true - - - - org.wildfly.checkstyle - wildfly-checkstyle-config - ${version.org.wildfly.checkstyle-config} - - - - - check-style - compile - - checkstyle - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - com.redhat.rcm.maven.plugin - - - buildmetadata-maven-plugin - - - [1.7.0,) - - - - provide-buildmetadata - - - - - - - - - - - org.commonjava.maven.plugins - - - project-sources-maven-plugin - - - [0.3,) - - - archive - - - - - - - - - - org.jboss.ws.plugins - - - jaxws-tools-maven-plugin - - - [1.2.0.Final,) - - - wsconsume - - - - - - - - - - - - -
+ + + + + org.jboss.bom + jboss-eap-ee-with-tools + ${version.server.bom} + pom + import + + + + + + + + + + + jakarta.enterprise + jakarta.enterprise.cdi-api + provided + + + + + junit + junit + test + + + + + + + org.hibernate.orm + hibernate-jpamodelgen + provided + + + + jakarta.activation + jakarta.activation-api + provided + + + + + org.hibernate.validator + hibernate-validator + provided + + + + jakarta.validation + jakarta.validation-api + provided + + + + + org.hibernate.validator + hibernate-validator-annotation-processor + provided + + + + + jakarta.persistence + jakarta.persistence-api + provided + + + + + + org.jboss.arquillian.junit + arquillian-junit-container + test + + + + org.jboss.arquillian.protocol + arquillian-protocol-servlet-jakarta + test + + + + + jakarta.annotation + jakarta.annotation-api + provided + + + + + jakarta.ejb + jakarta.ejb-api + provided + + + + + jakarta.faces + jakarta.faces-api + provided + + + + + jakarta.ws.rs + jakarta.ws.rs-api + provided + + + + jakarta.xml.bind + jakarta.xml.bind-api + provided + + + + jakarta.json + jakarta.json-api + test + + + org.eclipse.parsson + parsson + test + + + - - default - - true - - default - !disabled - - - - - cmt - ee-security - helloworld - helloworld-ws - jaxrs-client - kitchensink - numberguess - remote-helloworld-mdb - servlet-security - temperature-converter - todo-backend - thread-racing - websocket-hello - - - - docs - - - release - - + + arq-remote + + + org.wildfly.arquillian + wildfly-arquillian-container-remote + test + + - org.wildfly.maven.plugins - quickstart-documentation-plugin - ${version.org.wildfly.quickstarts.documentation.plugin} - false + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} - . - README.adoc + + **/RemoteMemberRegistrationIT + + + **/MemberRegistrationIT + - generate-toc - generate-resources - table-of-contents + integration-test + verify + + + + + openshift + + - org.asciidoctor - asciidoctor-maven-plugin + org.jboss.eap.plugins + eap-maven-plugin + ${version.eap.maven.plugin} - html5 - - ${project.artifactId} - - - - . - - **/* - - - - article - . - README.adoc - README.html - . + + + + org.jboss.eap.channels + eap-8.0 + + + + + + org.jboss.eap:wildfly-ee-galleon-pack + + + org.jboss.eap.cloud:eap-cloud-galleon-pack + + + + cloud-server + h2-driver + ejb + jsf + + ROOT.war - output-html - generate-resources - process-asciidoc + package @@ -380,27 +333,6 @@ - - adoc - - - README.adoc - - - - true - - - - dist - - - release - - - - dist - - +
diff --git a/remote-helloworld-mdb/README-source.adoc b/remote-helloworld-mdb/README-source.adoc deleted file mode 100644 index e771bef8f0..0000000000 --- a/remote-helloworld-mdb/README-source.adoc +++ /dev/null @@ -1,190 +0,0 @@ -include::../shared-doc/attributes.adoc[] - -= remote-helloworld-mdb: Helloworld Using an MDB (Message-Driven Bean) and a Remote Artemis broker -:author: Serge Pagop, Andy Taylor, Jeff Mesnil -:level: Intermediate -:technologies: JMS, EJB, MDB -:openshift: true - -:standalone-server-type: full -:archiveType: war -:restoreScriptName: remove-remote-broker.cli -ifdef::ProductRelease,EAPXPRelease[] -:BrokerImageName: registry.redhat.io/amq7/amq-broker-rhel8:7.10 -:BrokerProductName: Red Hat AMQ -endif::[] -ifndef::ProductRelease,EAPXPRelease[] -:BrokerImageName: quay.io/artemiscloud/activemq-artemis-broker-kubernetes -:BrokerProductName: Apache Artemis -endif::[] - -[abstract] -The `remote-helloworld-mdb` quickstart demonstrates the use of JMS and EJB Message-Driven Bean in {productName} with a remote broker. - -== What is it? - -The `remote-helloworld-mdb` quickstart demonstrates the use of JMS and EJB Message-Driven Bean in {productNameFull} with a remote {BrokerProductName} broker. - -This project uses two JMS resources on a remote broker: - -* A queue named `HELLOWORLDMDBQueue` bound in JNDI as `java:/queue/HELLOWORLDMDBQueue` -* A topic named `HELLOWORLDMDBTopic` bound in JNDI as `java:/topic/HELLOWORLDMDBTopic` - -//************************************************* -// Product Release content only -//************************************************* - -// System Requirements -include::../shared-doc/system-requirements.adoc[leveloffset=+1] -// Use of {jbossHomeName} -include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1] -//Start the {BrokerProductName} broker. - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution - -=== Run the {BrokerProductName} broker locally - -You can run {BrokerProductName} broker locally using docker or podman: - -[source,options="nowrap",subs="+attributes"] ----- -$ docker run --rm --name artemis -e AMQ_USER=admin -e AMQ_PASSWORD=admin -p8161:8161 -p61616:61616 -e AMQ_DATA_DIR=/home/jboss/data {BrokerImageName} ----- - -You can access the console of {BrokerProductName} at the URL: http://localhost:8161/console with *admin/admin* to authenticate. - -// Back Up the {productName} Standalone Server Configuration -include::../shared-doc/back-up-server-standalone-configuration.adoc[leveloffset=+2] - -// Start the {productName} Standalone Server -include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+2] - -[[configure_the_server]] -=== Configure the {productName} Server - -You configure the JMS connection factory to the remote broker by running JBoss CLI commands. For your convenience, this quickstart batches the commands into a `configure-remote-broker.cli` script provided in the root directory of this quickstart. - -. Before you begin, make sure you do the following: - -* xref:back_up_standalone_server_configuration[Back up the {productName} standalone server configuration] as described above. -* xref:start_the_eap_standalone_server[Start the {productName} server with the standalone full profile] as described above. - -. Review the `configure-remote-broker.cli` file in the root of this quickstart directory. This script adds the `test` queue to the `messaging-activemq` subsystem in the server configuration file. -. Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing __{jbossHomeName}__ with the path to your server: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=configure-remote-broker.cli ----- -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. - -. You should see the following result when you run the script: -+ -[source,options="nowrap"] ----- -"outcome" => "success", -"response-headers" => {"process-state" => "reload-required"} ----- - -. Stop the {productName} server. - -=== Review the Modified Server Configuration - -After stopping the server, open the `__{jbossHomeName}__/standalone/configuration/standalone-full.xml` file and review the changes. - -The following `testQueue` jms-queue was configured in the configuration of the `messaging-activemq` subsystem. - -[source,xml,options="nowrap"] ----- - - ----- - - - -// Build and Deploy the Quickstart -include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+2] - -=== Access the Application - -The application will be running at the following URL: http://localhost:8080/{artifactId}/. - -=== Investigate the Server Console Output - -Look at the {productName} console or Server log and you should see log messages like the following: - -[source,options="nowrap"] ----- -INFO [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-9 (ActiveMQ-client-global-threads-1189700957)) Received Message from queue: This is message 1 -INFO [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-6 (ActiveMQ-client-global-threads-1189700957)) Received Message from queue: This is message 2 -INFO [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-7 (ActiveMQ-client-global-threads-1189700957)) Received Message from queue: This is message 3 -INFO [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-5 (ActiveMQ-client-global-threads-1189700957)) Received Message from queue: This is message 4 -INFO [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-4 (ActiveMQ-client-global-threads-1189700957)) Received Message from queue: This is message 5 ----- - -// Testing with Arquillian -include::../shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc[leveloffset=+2] -// Undeploy the Quickstart -include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2] -// Restore the {productName} Standalone Server Configuration -include::../shared-doc/restore-standalone-server-configuration.adoc[leveloffset=+2] - -// Additional information about this script -This script removes the remote broker connection from the `messaging-activemq` subsystem and restore the `default` internal broker. You should see the following result when you run the script: - -[source,options="nowrap"] ----- -"outcome" => "success", -"response-headers" => { - "operation-requires-reload" => true, - "process-state" => "reload-required" -} ----- - -// Restore the {productName} Standalone Server Configuration Manually -include::../shared-doc/restore-standalone-server-configuration-manual.adoc[leveloffset=+3] - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -[NOTE] -==== -The Arquillian integration tests expect a running {BrokerProductName} broker, so make sure you have started the broker before you begin. -==== - -endif::[] - -== Building and running the quickstart application with OpenShift - -=== Deploy a {BrokerProductName} instance on OpenShift - -[source,options="nowrap",subs="+attributes"] ----- -$ oc run artemis --env AMQ_USER=admin --env AMQ_PASSWORD=admin --image={BrokerImageName} --port=61616 --expose=true ----- - -This will create a broker instance named `artemis` on OpenShift that can be accessed on the port `61616` on the service `artemis` with the account *admin/admin*. -//Prepare Helm for Quickstart Deployment - -// Getting Started with Helm -include::../shared-doc/helm-getting-started-overview.adoc[leveloffset=+2] -//Prepare Helm for Quickstart Deployment -include::../shared-doc/helm-deploy-project.adoc[leveloffset=+2] -// Testing on Openshift -include::../shared-doc/run-arquillian-integration-tests-with-openshift.adoc[leveloffset=+2] - -==== Clean Up - -The broker instance can be deleted from OpenShift by running the command: - -[source,options="nowrap"] ----- -$ oc delete service artemis -service "artemis" deleted -$ oc delete pod artemis -pod "artemis" deleted ----- - diff --git a/remote-helloworld-mdb/README.adoc b/remote-helloworld-mdb/README.adoc deleted file mode 100644 index fef0a0726d..0000000000 --- a/remote-helloworld-mdb/README.adoc +++ /dev/null @@ -1,1038 +0,0 @@ -ifdef::env-github[] -:artifactId: remote-helloworld-mdb -endif::[] - -//*********************************************************************************** -// Enable the following flag to build README.html files for JBoss EAP product builds. -// Comment it out for WildFly builds. -//*********************************************************************************** -:ProductRelease: - -//*********************************************************************************** -// Enable the following flag to build README.html files for EAP XP product builds. -// Comment it out for WildFly or JBoss EAP product builds. -//*********************************************************************************** -//:EAPXPRelease: - -// This is a universal name for all releases -:ProductShortName: JBoss EAP -// Product names and links are dependent on whether it is a product release (CD or JBoss) -// or the WildFly project. -// The "DocInfo*" attributes are used to build the book links to the product documentation - -ifdef::ProductRelease[] -// JBoss EAP release -:productName: JBoss EAP -:productNameFull: Red Hat JBoss Enterprise Application Platform -:productVersion: 8.0 -:DocInfoProductNumber: {productVersion} -:WildFlyQuickStartRepoTag: 8.0.x -:productImageVersion: 8.0.0 -:helmChartName: jboss-eap/eap8 -endif::[] - -ifdef::EAPXPRelease[] -// JBoss EAP XP release -:productName: JBoss EAP XP -:productNameFull: Red Hat JBoss Enterprise Application Platform expansion pack -:productVersion: 3.0 -:DocInfoProductNumber: 7.4 -:WildFlyQuickStartRepoTag: XP_3.0.0.GA -:productImageVersion: 3.0 -:helmChartName: jboss-eap/eap-xp3 -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -:githubRepoUrl: https://github.com/jboss-developer/jboss-eap-quickstarts/ -:githubRepoCodeUrl: https://github.com/jboss-developer/jboss-eap-quickstarts.git -:jbossHomeName: EAP_HOME -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:quickstartDownloadName: {productNameFull} {productVersion} Quickstarts -:quickstartDownloadUrl: https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=appplatform&downloadType=distributions -:helmRepoName: jboss-eap -:helmRepoUrl: https://jbossas.github.io/eap-charts/ -// END ifdef::ProductRelease,EAPXPRelease[] -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -// WildFly project -:productName: WildFly -:productNameFull: WildFly Application Server -:ProductShortName: {productName} -:jbossHomeName: WILDFLY_HOME -:productVersion: 28 -:productImageVersion: 28.0 -:githubRepoUrl: https://github.com/wildfly/quickstart/ -:githubRepoCodeUrl: https://github.com/wildfly/quickstart.git -:WildFlyQuickStartRepoTag: 28.0.1.Final -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -// Do not update the following until after the 7.4 docs are published! -:DocInfoProductNumber: 7.4 -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:helmRepoName: wildfly -:helmRepoUrl: http://docs.wildfly.org/wildfly-charts/ -:helmChartName: wildfly/wildfly -// END ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -endif::[] - -:source: {githubRepoUrl} - -// Values for Openshift S2i sections attributes -:CDProductName: {productNameFull} for OpenShift -:CDProductShortName: {ProductShortName} for OpenShift -:CDProductTitle: {CDProductName} -:CDProductNameSentence: Openshift release for {ProductShortName} -:CDProductAcronym: {CDProductShortName} -:CDProductVersion: {productVersion} -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {EapForOpenshiftBookName} Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {xpaasproduct} Online -:xpaasproduct-shortname: {CDProductShortName} -:xpaasproductOpenShiftOnline-shortname: {xpaasproduct-shortname} Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: Getting Started with {ProductShortName} for OpenShift Container Platform -:EapForOpenshiftOnlineBookName: Getting Started with {ProductShortName} for OpenShift Online -:OpenShiftOnlinePlatformName: Red Hat OpenShift Container Platform -:OpenShiftOnlineName: Red Hat OpenShift Online -:ImagePrefixVersion: eap80 -:ImageandTemplateImportBaseURL: https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift - -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepo: https://github.com/jboss-developer/jboss-eap-quickstarts -:EAPQuickStartRepoRef: 8.0.x -:EAPQuickStartRepoTag: EAP_8.0.0.GA -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_container_platform/ -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_online/ - -ifdef::EAPXPRelease[] -// Attributes for XP releases -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {productNameFull} for OpenShift Online -:xpaasproduct-shortname: {ProductShortName} for OpenShift -:xpaasproductOpenShiftOnline-shortname: {ProductShortName} for OpenShift Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:ImagePrefixVersion: eap-xp3 -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepoRef: xp-3.0.x -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -endif::[] - -ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -:ImageandTemplateImportURL: https://raw.githubusercontent.com/wildfly/wildfly-s2i/v{productVersion}.0/ -endif::[] - -//************************* -// Other values -//************************* -:buildRequirements: Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later -:jbdsEapServerName: Red Hat JBoss Enterprise Application Platform 7.3 -:javaVersion: Jakarta EE 10 -ifdef::EAPXPRelease[] -:javaVersion: Eclipse MicroProfile -endif::[] -:githubRepoBranch: master -:guidesBaseUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/ -:useEclipseUrl: {guidesBaseUrl}USE_JBDS.adoc#use_red_hat_jboss_developer_studio_or_eclipse_to_run_the_quickstarts -:useEclipseDeployJavaClientDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_containing_server_and_java_client_projects -:useEclipseDeployEARDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_ear_project -:useProductHomeDocUrl: {guidesBaseUrl}USE_OF_{jbossHomeName}.adoc#use_of_product_home_and_jboss_home_variables -:configureMavenDocUrl: {guidesBaseUrl}CONFIGURE_MAVEN_JBOSS_EAP.adoc#configure_maven_to_build_and_deploy_the_quickstarts -:arquillianTestsDocUrl: {guidesBaseUrl}RUN_ARQUILLIAN_TESTS.adoc#run_the_arquillian_tests -:addUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#create_users_required_by_the_quickstarts -:addApplicationUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_application_user -:addManagementUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_management_user -:startServerDocUrl: {guidesBaseUrl}START_JBOSS_EAP.adoc#start_the_jboss_eap_server -:configurePostgresDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_database_for_use_with_the_quickstarts -:configurePostgresDownloadDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#download_and_install_postgresql -:configurePostgresCreateUserDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#create_a_database_user -:configurePostgresAddModuleDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#add_the_postgres_module_to_the_jboss_eap_server -:configurePostgresDriverDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_driver_in_the_jboss_eap_server -:configureBytemanDownloadDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#download_and_configure_byteman -:configureBytemanDisableDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#disable_the_byteman_script -:configureBytemanClearDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#clear_the_transaction_object_store -:configureBytemanQuickstartDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts -:configureBytemanHaltDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#use_byteman_to_halt_the_application[ -:configureBytemanQuickstartsDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts - -:EESubsystemNamespace: urn:jboss:domain:ee:4.0 -:IiopOpenJdkSubsystemNamespace: urn:jboss:domain:iiop-openjdk:2.0 -:MailSubsystemNamespace: urn:jboss:domain:mail:3.0 -:SingletonSubsystemNamespace: urn:jboss:domain:singleton:1.0 -:TransactionsSubsystemNamespace: urn:jboss:domain:transactions:4.0 - -// LinkProductDocHome: https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/ -:LinkProductDocHome: https://access.redhat.com/documentation/en/jboss-enterprise-application-platform-continuous-delivery -:LinkConfigGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/configuration_guide/ -:LinkDevelopmentGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/development_guide/ -:LinkGettingStartedGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_guide/ -:LinkOpenShiftWelcome: https://docs.openshift.com/online/welcome/index.html -:LinkOpenShiftSignup: https://docs.openshift.com/online/getting_started/choose_a_plan.html -:OpenShiftTemplateName: JBoss EAP CD (no https) - -:ConfigBookName: Configuration Guide -:DevelopmentBookName: Development Guide -:GettingStartedBookName: Getting Started Guide - -:JBDSProductName: Red Hat CodeReady Studio -:JBDSVersion: 12.15 -:LinkJBDSInstall: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/installation_guide/ -:JBDSInstallBookName: Installation Guide -:LinkJBDSGettingStarted: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/getting_started_with_codeready_studio_tools/ -:JBDSGettingStartedBookName: Getting Started with CodeReady Studio Tools - -= remote-helloworld-mdb: Helloworld Using an MDB (Message-Driven Bean) and a Remote Artemis broker -:author: Serge Pagop, Andy Taylor, Jeff Mesnil -:level: Intermediate -:technologies: JMS, EJB, MDB -:openshift: true - -:standalone-server-type: full -:archiveType: war -:restoreScriptName: remove-remote-broker.cli -ifdef::ProductRelease,EAPXPRelease[] -:BrokerImageName: registry.redhat.io/amq7/amq-broker-rhel8:7.10 -:BrokerProductName: Red Hat AMQ -endif::[] -ifndef::ProductRelease,EAPXPRelease[] -:BrokerImageName: quay.io/artemiscloud/activemq-artemis-broker-kubernetes -:BrokerProductName: Apache Artemis -endif::[] - -[abstract] -The `remote-helloworld-mdb` quickstart demonstrates the use of JMS and EJB Message-Driven Bean in {productName} with a remote broker. - -== What is it? - -The `remote-helloworld-mdb` quickstart demonstrates the use of JMS and EJB Message-Driven Bean in {productNameFull} with a remote {BrokerProductName} broker. - -This project uses two JMS resources on a remote broker: - -* A queue named `HELLOWORLDMDBQueue` bound in JNDI as `java:/queue/HELLOWORLDMDBQueue` -* A topic named `HELLOWORLDMDBTopic` bound in JNDI as `java:/topic/HELLOWORLDMDBTopic` - -//************************************************* -// Product Release content only -//************************************************* - -// System Requirements -:leveloffset: +1 - -[[system_requirements]] -= System Requirements -//****************************************************************************** -// Include this template to describe the standard system requirements for -// running the quickstarts. -// -// The Forge quickstarts define a `forge-from-scratch` attribute because they -// run entirely in CodeReady Studio and have different requirements . -//****************************************************************************** - -The application this project produces is designed to be run on {productNameFull} {productVersion} or later. - -All you need to build this project is {buildRequirements}. See link:{configureMavenDocUrl}[Configure Maven to Build and Deploy the Quickstarts] to make sure you are configured correctly for testing the quickstarts. - -:leveloffset!: -// Use of {jbossHomeName} -:leveloffset: +1 - -ifdef::requires-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -This quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifdef::optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -When deploying this quickstart to a managed domain, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When deploying this quickstart to multiple standalone servers, this quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifndef::requires-multiple-servers,optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName} and QUICKSTART_HOME Variables - -In the following instructions, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -:leveloffset!: -//Start the {BrokerProductName} broker. - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution - -=== Run the {BrokerProductName} broker locally - -You can run {BrokerProductName} broker locally using docker or podman: - -[source,options="nowrap",subs="+attributes"] ----- -$ docker run --rm --name artemis -e AMQ_USER=admin -e AMQ_PASSWORD=admin -p8161:8161 -p61616:61616 -e AMQ_DATA_DIR=/home/jboss/data {BrokerImageName} ----- - -You can access the console of {BrokerProductName} at the URL: http://localhost:8161/console with *admin/admin* to authenticate. - -// Back Up the {productName} Standalone Server Configuration -:leveloffset: +2 - -[[back_up_standalone_server_configuration]] -= Back Up the {productName} Standalone Server Configuration -//****************************************************************************** -// Include this template if your quickstart runs in a standalone server and -// needs to back up the server configuration file before running -// a CLI script to modify the server. -//****************************************************************************** -// Define the attributes needed for this topic. -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -Before you begin, back up your server configuration file. - -. If it is running, stop the {productName} server. -. Back up the `__{jbossHomeName}__/{configFileName}` file. - -After you have completed testing this quickstart, you can replace this file to restore the server to its original configuration. - -:leveloffset!: - -// Start the {productName} Standalone Server -:leveloffset: +2 - -[[start_the_eap_standalone_server]] -= Start the {productName} Standalone Server -//****************************************************************************** -// Include this template if your quickstart requires a normal start of a single -// standalone server. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// custom -// -// * For mobile applications, you can define the `mobileApp` variable in the -// `README.adoc` file to add `-b 0.0.0.0` to the command line. This allows -// external clients, such as phones, tablets, and desktops, to connect -// to the application through through your local network -// ::mobileApp: {artifactId}-service -// -//****************************************************************************** - -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -. Open a terminal and navigate to the root of the {productName} directory. -. Start the {productName} server with the {serverProfile} by typing the following command. -+ -ifdef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __JAEGER_REPORTER_LOG_SPANS=true JAEGER_SAMPLER_TYPE=const JAEGER_SAMPLER_PARAM=1__ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -ifndef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\standalone.bat` script. - -ifdef::mobileApp[] -+ -Adding `-b 0.0.0.0` to the above command allows external clients, such as phones, tablets, and desktops, to connect through your local network. For example: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} -b 0.0.0.0 ----- -endif::[] - -:leveloffset!: - -[[configure_the_server]] -=== Configure the {productName} Server - -You configure the JMS connection factory to the remote broker by running JBoss CLI commands. For your convenience, this quickstart batches the commands into a `configure-remote-broker.cli` script provided in the root directory of this quickstart. - -. Before you begin, make sure you do the following: - -* xref:back_up_standalone_server_configuration[Back up the {productName} standalone server configuration] as described above. -* xref:start_the_eap_standalone_server[Start the {productName} server with the standalone full profile] as described above. - -. Review the `configure-remote-broker.cli` file in the root of this quickstart directory. This script adds the `test` queue to the `messaging-activemq` subsystem in the server configuration file. -. Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing __{jbossHomeName}__ with the path to your server: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=configure-remote-broker.cli ----- -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. - -. You should see the following result when you run the script: -+ -[source,options="nowrap"] ----- -"outcome" => "success", -"response-headers" => {"process-state" => "reload-required"} ----- - -. Stop the {productName} server. - -=== Review the Modified Server Configuration - -After stopping the server, open the `__{jbossHomeName}__/standalone/configuration/standalone-full.xml` file and review the changes. - -The following `testQueue` jms-queue was configured in the configuration of the `messaging-activemq` subsystem. - -[source,xml,options="nowrap"] ----- - - ----- - - - -// Build and Deploy the Quickstart -:leveloffset: +2 - -[[build_and_deploy_the_quickstart]] -= Build and Deploy the Quickstart -//****************************************************************************** -// Include this template if your quickstart does a normal deployment of a archive. -// -// * Define the `archiveType` variable in the quickstart README file. -// Supported values: -// :archiveType: ear -// :archiveType: war -// :archiveType: jar -// -// * To override the archive name, which defaults to the {artifactId), -// define the `archiveName` variable, for example: -// :archiveName: {artifactId}-service -// -// * To override the archive output directory, -// define the `archiveDir` variable, for example: -// :archiveDir: ear/target -// -// * To override the Maven command, define the `mavenCommand` variable, -// for example: -// :mavenCommand: clean install wildfly:deploy -//****************************************************************************** - -// The archive name defaults to the artifactId if not overridden -ifndef::archiveName[] -:archiveName: {artifactId} -endif::archiveName[] - -// The archive type defaults to war if not overridden -ifndef::archiveType[] -:archiveType: war -endif::archiveType[] - -// Define the archive file name as the concatenation of "archiveName" + "." + "archiveType+ -:archiveFileName: {archiveName}.{archiveType} - -// If they have not defined the target archive directory, make it the default for the archive type. -ifndef::archiveDir[] - -ifeval::["{archiveType}"=="ear"] -:archiveDir: {artifactId}/ear/target -endif::[] - -ifeval::["{archiveType}"=="war"] -:archiveDir: {artifactId}/target -endif::[] - -ifeval::["{archiveType}"=="jar"] -:archiveDir: {artifactId}/target -endif::[] - -endif::archiveDir[] - -ifndef::mavenCommand[] -ifeval::["{archiveType}"=="ear"] -:mavenCommand: clean install -endif::[] - -ifeval::["{archiveType}"=="war"] -:mavenCommand: clean package -endif::[] - -ifeval::["{archiveType}"=="jar"] -:mavenCommand: clean install -endif::[] - -endif::mavenCommand[] - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -ifdef::reactive-messaging[] -. Run this command to enable the MicroProfile Reactive Messaging functionality on the server -+ -[source,subs="attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=enable-reactive-messaging.cli ----- -endif::reactive-messaging[] -. Type the following command to build the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn {mavenCommand} ----- - -. Type the following command to deploy the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn wildfly:deploy ----- - -ifdef::rest-client-qs[] -This builds and deploys the `country-server` and `country-client` to the running instance of the server. - -You should see a message in the server log indicating that the archives deployed successfully. -endif::[] -ifndef::rest-client-qs[] -This deploys the `{archiveDir}/{archiveFileName}` to the running instance of the server. - -You should see a message in the server log indicating that the archive deployed successfully. -endif::[] - - -:leveloffset!: - -=== Access the Application - -The application will be running at the following URL: http://localhost:8080/{artifactId}/. - -=== Investigate the Server Console Output - -Look at the {productName} console or Server log and you should see log messages like the following: - -[source,options="nowrap"] ----- -INFO [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-9 (ActiveMQ-client-global-threads-1189700957)) Received Message from queue: This is message 1 -INFO [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-6 (ActiveMQ-client-global-threads-1189700957)) Received Message from queue: This is message 2 -INFO [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-7 (ActiveMQ-client-global-threads-1189700957)) Received Message from queue: This is message 3 -INFO [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-5 (ActiveMQ-client-global-threads-1189700957)) Received Message from queue: This is message 4 -INFO [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-4 (ActiveMQ-client-global-threads-1189700957)) Received Message from queue: This is message 5 ----- - -// Testing with Arquillian -:leveloffset: +2 - -[[run_the_arquillian_integration_tests_with_server_distribution]] -= Run the Arquillian Integration Tests -//****************************************************************************** -// Include this template if your quickstart provides standard Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -Follow these steps to run the integration tests. - -. Make sure you start the {productName} server, as previously described. - -. Make sure you build and deploy the quickstart, as previously described. - -. Type the following command to run the `verify` goal with the `arq-remote` profile activated. -+ -[source,options="nowrap"] ----- -$ mvn verify -Parq-remote ----- - -[NOTE] -==== -You may also use the environment variable `SERVER_HOST` or the system property `server.host` to define the target host of the tests. -==== - -:leveloffset!: -// Undeploy the Quickstart -:leveloffset: +2 - -[[undeploy_the_quickstart]] -= Undeploy the Quickstart - -//******************************************************************************* -// Include this template if your quickstart does a normal undeployment of an archive. -//******************************************************************************* -When you are finished testing the quickstart, follow these steps to undeploy the archive. - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -. Type this command to undeploy the archive: -+ -[source,options="nowrap"] ----- -$ mvn wildfly:undeploy ----- - -:leveloffset!: -// Restore the {productName} Standalone Server Configuration -:leveloffset: +2 - -[[restore_the_standalone_server_configuration]] -= Restore the {productName} Standalone Server Configuration -//****************************************************************************** -// Include this template if your quickstart does a normal restoration of a single -// standalone server configuration. -// * It provides a CLI script. -// * You can manually restore the backup copy. -// -// You must define the script file name using the `restoreScriptName` attribute. -// For example: -// :restoreScriptName: remove-configuration.cli -//****************************************************************************** - -You can restore the original server configuration using either of the following methods. - -* You can xref:restore_standalone_server_configuration_using_cli[run the `{restoreScriptName}` script] provided in the root directory of this quickstart. -* You can xref:restore_standalone_server_configuration_manually[manually restore the configuration] using the backup copy of the configuration file. - -[[restore_standalone_server_configuration_using_cli]] -== Restore the {productName} Standalone Server Configuration by Running the JBoss CLI Script - -. xref:start_the_eap_standalone_server[Start the {productName} server] as described above. -. Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing `__{jbossHomeName}__` with the path to your server: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file={restoreScriptName} ----- -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. - -:leveloffset!: - -// Additional information about this script -This script removes the remote broker connection from the `messaging-activemq` subsystem and restore the `default` internal broker. You should see the following result when you run the script: - -[source,options="nowrap"] ----- -"outcome" => "success", -"response-headers" => { - "operation-requires-reload" => true, - "process-state" => "reload-required" -} ----- - -// Restore the {productName} Standalone Server Configuration Manually -:leveloffset: +3 - -[[restore_standalone_server_configuration_manually]] -= Restore the {productName} Standalone Server Configuration Manually -//****************************************************************************** -// Include this template if your quickstart does a normal manual restoration -// of a single standalone server. -//****************************************************************************** - -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -When you have completed testing the quickstart, you can restore the original server configuration by manually restoring the backup copy the configuration file. - -. If it is running, stop the {productName} server. -. Replace the `__{jbossHomeName}__/{configFileName}` file with the backup copy of the file. - -:leveloffset!: - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -[NOTE] -==== -The Arquillian integration tests expect a running {BrokerProductName} broker, so make sure you have started the broker before you begin. -==== - -endif::[] - -== Building and running the quickstart application with OpenShift - -=== Deploy a {BrokerProductName} instance on OpenShift - -[source,options="nowrap",subs="+attributes"] ----- -$ oc run artemis --env AMQ_USER=admin --env AMQ_PASSWORD=admin --image={BrokerImageName} --port=61616 --expose=true ----- - -This will create a broker instance named `artemis` on OpenShift that can be accessed on the port `61616` on the service `artemis` with the account *admin/admin*. -//Prepare Helm for Quickstart Deployment - -// Getting Started with Helm -:leveloffset: +2 - -[[getting_started_with_helm]] -= Getting Started with {xpaasproduct-shortname} and Helm Charts - -This section contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} using Helm Charts. - -[[prerequisites_helm_openshift]] -== Prerequisites - -* You must be logged in OpenShift and have an `oc` client to connect to OpenShift -* https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. - -Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}. - -ifndef::ProductRelease,EAPXPRelease[] -[source,options="nowrap"] ----- -$ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ -"wildfly" has been added to your repositories -$ helm search repo wildfly -NAME CHART VERSION APP VERSION DESCRIPTION -wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift -wildfly/wildfly-common ... ... A library chart for WildFly-based applications ----- -endif::[] -ifdef::ProductRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP {productVersion} applications ----- -endif::[] -ifdef::EAPXPRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP XP {productVersion} applications ----- -endif::[] - -:leveloffset!: -//Prepare Helm for Quickstart Deployment -:leveloffset: +2 - -[[deploy_helm]] -== Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -Log in to your OpenShift instance using the `oc login` command. -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -Navigate to the root directory of this quickstart and run the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm install {artifactId} -f charts/helm.yaml {helmChartName} -NAME: {artifactId} -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17: - -[source,options="nowrap",subs="+attributes"] ----- -build: - uri: {githubRepoCodeUrl} - ref: {WildFlyQuickStartRepoTag} - contextDir: {artifactId} -deploy: - replicas: 1 ----- - -This will create a new deployment on OpenShift and deploy the application. - -If you want to see all the configuration elements to customize your deployment you can use the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let’s wait for the application to be built and deployed: -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment {artifactId} -w -NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE -{artifactId} 1 1 1 0 12s -... -{artifactId} 1 1 1 1 2m ----- - -Get the URL of the route to the deployment. - -[source,options="nowrap",subs="+attributes"] ----- -$ oc get route {artifactId} -o jsonpath="{.spec.host}" ----- -Access the application in your web browser using the displayed URL. - -[NOTE] -==== -The Maven profile named `openshift` is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the `/{artifactId}` path segment after `HOST:PORT`. -==== - -[[undeploy_helm]] -== Undeploy the {ProductShortName} Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts - - -[source,options="nowrap",subs="+attributes"] ----- -$ helm uninstall {artifactId} ----- - -:leveloffset!: -// Testing on Openshift -:leveloffset: +2 - -[[run_the_arquillian_integration_tests_with_openshift]] -= Run the Arquillian Integration Tests with OpenShift -//****************************************************************************** -// Include this template if your quickstart provides Openshift Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -[NOTE] -==== -The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin. -==== - -Run the integration tests using the following command to run the `verify` goal with the `arq-remote` profile activated and the proper URL: -[source,options="nowrap",subs="+attributes"] ----- -$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route {artifactId} --template='{{ .spec.host }}') ----- - -[NOTE] -==== -The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from. -==== - -:leveloffset!: - -==== Clean Up - -The broker instance can be deleted from OpenShift by running the command: - -[source,options="nowrap"] ----- -$ oc delete service artemis -service "artemis" deleted -$ oc delete pod artemis -pod "artemis" deleted ----- diff --git a/remote-helloworld-mdb/README.html b/remote-helloworld-mdb/README.html deleted file mode 100644 index 07161c4355..0000000000 --- a/remote-helloworld-mdb/README.html +++ /dev/null @@ -1,1034 +0,0 @@ - - - - - - - - -remote-helloworld-mdb: Helloworld Using an MDB (Message-Driven Bean) and a Remote Artemis broker - - - - - -
-
-
-
-
-The remote-helloworld-mdb quickstart demonstrates the use of JMS and EJB Message-Driven Bean in JBoss EAP with a remote broker. -
-
-
-
-
-

What is it?

-
-
-

The remote-helloworld-mdb quickstart demonstrates the use of JMS and EJB Message-Driven Bean in Red Hat JBoss Enterprise Application Platform with a remote Red Hat AMQ broker.

-
-
-

This project uses two JMS resources on a remote broker:

-
-
-
    -
  • -

    A queue named HELLOWORLDMDBQueue bound in JNDI as java:/queue/HELLOWORLDMDBQueue

    -
  • -
  • -

    A topic named HELLOWORLDMDBTopic bound in JNDI as java:/topic/HELLOWORLDMDBTopic

    -
  • -
-
-
-
-
-

System Requirements

-
-
-

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 8.0 or later.

-
-
-

All you need to build this project is Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later. See Configure Maven to Build and Deploy the Quickstarts to make sure you are configured correctly for testing the quickstarts.

-
-
-
-
-

Use of the EAP_HOME and QUICKSTART_HOME Variables

-
-
-

In the following instructions, replace EAP_HOME with the actual path to your JBoss EAP installation. The installation path is described in detail here: Use of EAP_HOME and JBOSS_HOME Variables.

-
-
-

When you see the replaceable variable QUICKSTART_HOME, replace it with the path to the root directory of all of the quickstarts.

-
-
-
-
-

Building and running the quickstart application with a JBoss EAP server distribution

-
-
-

Run the Red Hat AMQ broker locally

-
-

You can run Red Hat AMQ broker locally using docker or podman:

-
-
-
-
$ docker run --rm --name artemis -e AMQ_USER=admin -e AMQ_PASSWORD=admin -p8161:8161 -p61616:61616 -e AMQ_DATA_DIR=/home/jboss/data registry.redhat.io/amq7/amq-broker-rhel8:7.10
-
-
-
-

You can access the console of Red Hat AMQ at the URL: http://localhost:8161/console with admin/admin to authenticate.

-
-
-
-

Back Up the JBoss EAP Standalone Server Configuration

-
-

Before you begin, back up your server configuration file.

-
-
-
    -
  1. -

    If it is running, stop the JBoss EAP server.

    -
  2. -
  3. -

    Back up the EAP_HOME/standalone/configuration/standalone-full.xml file.

    -
  4. -
-
-
-

After you have completed testing this quickstart, you can replace this file to restore the server to its original configuration.

-
-
-
-

Start the JBoss EAP Standalone Server

-
-
    -
  1. -

    Open a terminal and navigate to the root of the JBoss EAP directory.

    -
  2. -
  3. -

    Start the JBoss EAP server with the full profile by typing the following command.

    -
    -
    -
    $ EAP_HOME/bin/standalone.sh -c standalone-full.xml
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\standalone.bat script. -
    -
    -
  4. -
-
-
-
-

Configure the JBoss EAP Server

-
-

You configure the JMS connection factory to the remote broker by running JBoss CLI commands. For your convenience, this quickstart batches the commands into a configure-remote-broker.cli script provided in the root directory of this quickstart.

-
-
-
    -
  1. -

    Before you begin, make sure you do the following:

    - -
  2. -
  3. -

    Review the configure-remote-broker.cli file in the root of this quickstart directory. This script adds the test queue to the messaging-activemq subsystem in the server configuration file.

    -
  4. -
  5. -

    Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing EAP_HOME with the path to your server:

    -
    -
    -
    $ EAP_HOME/bin/jboss-cli.sh --connect --file=configure-remote-broker.cli
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\jboss-cli.bat script. -
    -
    -
  6. -
  7. -

    You should see the following result when you run the script:

    -
    -
    -
    "outcome" => "success",
    -"response-headers" => {"process-state" => "reload-required"}
    -
    -
    -
  8. -
  9. -

    Stop the JBoss EAP server.

    -
  10. -
-
-
-
-

Review the Modified Server Configuration

-
-

After stopping the server, open the EAP_HOME/standalone/configuration/standalone-full.xml file and review the changes.

-
-
-

The following testQueue jms-queue was configured in the configuration of the messaging-activemq subsystem.

-
-
-
-
<remote-connector name="artemis" socket-binding="remote-artemis"/>
-<pooled-connection-factory name="RemoteConnectionFactory" entries="java:jboss/RemoteConnectionFactory java:jboss/exported/jms/RemoteConnectionFactory" connectors="artemis" user="admin" password="admin" enable-amq1-prefix="false"/>
-
-
-
-
-

Build and Deploy the Quickstart

-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type the following command to build the quickstart.

    -
    -
    -
    $ mvn clean package
    -
    -
    -
  6. -
  7. -

    Type the following command to deploy the quickstart.

    -
    -
    -
    $ mvn wildfly:deploy
    -
    -
    -
  8. -
-
-
-

This deploys the remote-helloworld-mdb/target/remote-helloworld-mdb.war to the running instance of the server.

-
-
-

You should see a message in the server log indicating that the archive deployed successfully.

-
-
-
-

Access the Application

-
-

The application will be running at the following URL: http://localhost:8080/remote-helloworld-mdb/.

-
-
-
-

Investigate the Server Console Output

-
-

Look at the JBoss EAP console or Server log and you should see log messages like the following:

-
-
-
-
INFO  [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-9 (ActiveMQ-client-global-threads-1189700957)) Received Message from queue: This is message 1
-INFO  [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-6 (ActiveMQ-client-global-threads-1189700957)) Received Message from queue: This is message 2
-INFO  [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-7 (ActiveMQ-client-global-threads-1189700957)) Received Message from queue: This is message 3
-INFO  [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-5 (ActiveMQ-client-global-threads-1189700957)) Received Message from queue: This is message 4
-INFO  [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-4 (ActiveMQ-client-global-threads-1189700957)) Received Message from queue: This is message 5
-
-
-
-
-

Run the Arquillian Integration Tests

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
-

Follow these steps to run the integration tests.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server, as previously described.

    -
  2. -
  3. -

    Make sure you build and deploy the quickstart, as previously described.

    -
  4. -
  5. -

    Type the following command to run the verify goal with the arq-remote profile activated.

    -
    -
    -
    $ mvn verify -Parq-remote
    -
    -
    -
  6. -
-
-
- - - - - -
-
Note
-
-
-

You may also use the environment variable SERVER_HOST or the system property server.host to define the target host of the tests.

-
-
-
-
-
-

Undeploy the Quickstart

-
-

When you are finished testing the quickstart, follow these steps to undeploy the archive.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type this command to undeploy the archive:

    -
    -
    -
    $ mvn wildfly:undeploy
    -
    -
    -
  6. -
-
-
-
-

Restore the JBoss EAP Standalone Server Configuration

-
-

You can restore the original server configuration using either of the following methods.

-
-
- -
-
-

Restore the JBoss EAP Standalone Server Configuration by Running the JBoss CLI Script

-
-
    -
  1. -

    Start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing EAP_HOME with the path to your server:

    -
    -
    -
    $ EAP_HOME/bin/jboss-cli.sh --connect --file=remove-remote-broker.cli
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\jboss-cli.bat script. -
    -
    -
  4. -
-
-
-

This script removes the remote broker connection from the messaging-activemq subsystem and restore the default internal broker. You should see the following result when you run the script:

-
-
-
-
"outcome" => "success",
-"response-headers" => {
-    "operation-requires-reload" => true,
-    "process-state" => "reload-required"
-}
-
-
-
-
-

Restore the JBoss EAP Standalone Server Configuration Manually

-
-

When you have completed testing the quickstart, you can restore the original server configuration by manually restoring the backup copy the configuration file.

-
-
-
    -
  1. -

    If it is running, stop the JBoss EAP server.

    -
  2. -
  3. -

    Replace the EAP_HOME/standalone/configuration/standalone-full.xml file with the backup copy of the file.

    -
  4. -
-
-
-
-
-
-
-

Building and running the quickstart application with OpenShift

-
-
-

Deploy a Red Hat AMQ instance on OpenShift

-
-
-
$ oc run artemis --env AMQ_USER=admin --env AMQ_PASSWORD=admin --image=registry.redhat.io/amq7/amq-broker-rhel8:7.10  --port=61616 --expose=true
-
-
-
-

This will create a broker instance named artemis on OpenShift that can be accessed on the port 61616 on the service artemis with the account admin/admin.

-
-
-
-

Getting Started with JBoss EAP for OpenShift and Helm Charts

-
-

This section contains the basic instructions to build and deploy this quickstart to JBoss EAP for OpenShift or JBoss EAP for OpenShift Online using Helm Charts.

-
-
-

Prerequisites

-
-
    -
  • -

    You must be logged in OpenShift and have an oc client to connect to OpenShift

    -
  • -
  • -

    Helm must be installed to deploy the backend on OpenShift.

    -
  • -
-
-
-

Once you have installed Helm, you need to add the repository that provides Helm Charts for JBoss EAP.

-
-
-
-
$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/
-"jboss-eap" has been added to your repositories
-$ helm search repo jboss-eap
-NAME                    CHART VERSION   APP VERSION     DESCRIPTION
-jboss-eap/eap8         ...             ...             A Helm chart to build and deploy EAP 8.0 applications
-
-
-
-
-

Deploy the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

Log in to your OpenShift instance using the oc login command. -The backend will be built and deployed on OpenShift with a Helm Chart for JBoss EAP.

-
-
-

Navigate to the root directory of this quickstart and run the following command:

-
-
-
-
$ helm install remote-helloworld-mdb -f charts/helm.yaml jboss-eap/eap8
-NAME: remote-helloworld-mdb
-...
-STATUS: deployed
-REVISION: 1
-
-
-
-

The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17:

-
-
-
-
build:
-  uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git
-  ref: 8.0.x
-  contextDir: remote-helloworld-mdb
-deploy:
-  replicas: 1
-
-
-
-

This will create a new deployment on OpenShift and deploy the application.

-
-
-

If you want to see all the configuration elements to customize your deployment you can use the following command:

-
-
-
-
$ helm show readme jboss-eap/eap8
-
-
-
-

Let’s wait for the application to be built and deployed:

-
-
-
-
$ oc get deployment remote-helloworld-mdb -w
-NAME         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
-remote-helloworld-mdb   1         1         1            0           12s
-...
-remote-helloworld-mdb   1         1         1            1           2m
-
-
-
-

Get the URL of the route to the deployment.

-
-
-
-
$ oc get route remote-helloworld-mdb -o jsonpath="{.spec.host}"
-
-
-
-

Access the application in your web browser using the displayed URL.

-
-
- - - - - -
-
Note
-
-
-

The Maven profile named openshift is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the /remote-helloworld-mdb path segment after HOST:PORT.

-
-
-
-
-
-

Undeploy the JBoss EAP Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts

-
-
-
$ helm uninstall remote-helloworld-mdb
-
-
-
-
-
-

Run the Arquillian Integration Tests with OpenShift

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
- - - - - -
-
Note
-
-
-

The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin.

-
-
-
-
-

Run the integration tests using the following command to run the verify goal with the arq-remote profile activated and the proper URL:

-
-
-
-
$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route remote-helloworld-mdb --template='{{ .spec.host }}')
-
-
-
- - - - - -
-
Note
-
-
-

The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from.

-
-
-
-
-

Clean Up

-
-

The broker instance can be deleted from OpenShift by running the command:

-
-
-
-
$ oc delete service artemis
-service "artemis" deleted
-$ oc delete pod artemis
-pod "artemis" deleted
-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/remote-helloworld-mdb/charts/helm.yaml b/remote-helloworld-mdb/charts/helm.yaml deleted file mode 100644 index 83ecbe43f2..0000000000 --- a/remote-helloworld-mdb/charts/helm.yaml +++ /dev/null @@ -1,12 +0,0 @@ -build: - uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git - ref: 8.0.x - contextDir: remote-helloworld-mdb -deploy: - replicas: 1 - env: - # Env vars to connect to Artemis - - name: JBOSS_MESSAGING_CONNECTOR_HOST - value: "artemis" - - name: JBOSS_MESSAGING_CONNECTOR_PORT - value: "61616" \ No newline at end of file diff --git a/remote-helloworld-mdb/configure-remote-broker.cli b/remote-helloworld-mdb/configure-remote-broker.cli deleted file mode 100644 index ee0a399f0d..0000000000 --- a/remote-helloworld-mdb/configure-remote-broker.cli +++ /dev/null @@ -1,13 +0,0 @@ -echo Adding configuration to connect to remote broker -# Define a socket binding to the remote broker -/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=remote-artemis:add(host=localhost, port=61616) -# Removing the internal broker -/subsystem=messaging-activemq/server=default:remove -# Define the connector to the remote broker -/subsystem=messaging-activemq/remote-connector=artemis:add(socket-binding=remote-artemis) -# Add a resource adapter to the remote broker with the 'enable-amq1-prefix' set to false (since we are not connecting to a legacy broker). -/subsystem=messaging-activemq/pooled-connection-factory=RemoteConnectionFactory:add(connectors=[artemis],entries=[java:jboss/RemoteConnectionFactory,java:jboss/exported/jms/RemoteConnectionFactory],enable-amq1-prefix=false, user=admin, password=admin) -# Ensure that the resource adapter to the remote broker is used by default by EJBs -/subsystem=ejb3:write-attribute(name=default-resource-adapter-name, value=RemoteConnectionFactory) -# Ensure that the default resource adapter used for JMS is the resource adapter to the remote broker -/subsystem=ee/service=default-bindings:write-attribute(name=jms-connection-factory, value=java:jboss/RemoteConnectionFactory) \ No newline at end of file diff --git a/remote-helloworld-mdb/pom.xml b/remote-helloworld-mdb/pom.xml deleted file mode 100644 index 7a6f30b412..0000000000 --- a/remote-helloworld-mdb/pom.xml +++ /dev/null @@ -1,263 +0,0 @@ - - - - 4.0.0 - - org.jboss.eap.quickstarts - jboss-eap-quickstart-parent - - 6.0.0.redhat-00001 - - - - remote-helloworld-mdb - 8.0.0.GA - war - Quickstart: remote-helloworld-mdb - This project demonstrates a hello world Message-Driven Bean with Servlet 6.0 as client to a remote Artemis instance - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - 8.0.0.GA-redhat-00009 - 1.0.0.Final-redhat-00014 - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - never - - default - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - never - - - true - never - - default - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - - - true - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - - - true - - - - - - - - - org.jboss.bom - jboss-eap-ee-with-tools - ${version.server.bom} - pom - import - - - - - - - jakarta.ejb - jakarta.ejb-api - provided - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - jakarta.jms - jakarta.jms-api - provided - - - - jakarta.servlet - jakarta.servlet-api - provided - - - jakarta.annotation - jakarta.annotation-api - provided - - - - - junit - junit - test - jar - - - org.jboss.arquillian.container - arquillian-container-test-api - test - jar - - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet-jakarta - test - - - org.wildfly.arquillian - wildfly-arquillian-common - test - - - - - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - - org.jboss.eap.channels - eap-8.0 - - - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - ejb - remote-activemq - - ROOT.war - - - - - package - - - - - - - - - - arq-remote - - - org.wildfly.arquillian - wildfly-arquillian-container-remote - test - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} - - - - integration-test - verify - - - - - - **/RemoteMDBServletIT - - - **/ProvisionedManagedMDBServletIT - - - - - - - - diff --git a/remote-helloworld-mdb/remove-remote-broker.cli b/remote-helloworld-mdb/remove-remote-broker.cli deleted file mode 100644 index f83c01ed19..0000000000 --- a/remote-helloworld-mdb/remove-remote-broker.cli +++ /dev/null @@ -1,42 +0,0 @@ -echo Restore default internal broker configuration and remove remote broker connection - -/subsystem=messaging-activemq/pooled-connection-factory=RemoteConnectionFactory:remove - -/subsystem=messaging-activemq/remote-connector=artemis:remove - -/subsystem=messaging-activemq/server=default:add(elytron-domain=ApplicationDomain, statistics-enabled="${wildfly.messaging-activemq.statistics-enabled:${wildfly.statistics-enabled:false}}") - -/subsystem=messaging-activemq/server=default/address-setting=#:add(dead-letter-address="jms.queue.DLQ", expiry-address="jms.queue.ExpiryQueue", max-size-bytes=10485760, page-size-bytes=2097152, message-counter-history-day-limit=10) - -/subsystem=messaging-activemq/server=default/security-setting=#:add() - -/subsystem=messaging-activemq/server=default/security-setting=#/role=guest:add(send, consume, create-non-durable-queue, delete-non-durable-queue) - -/subsystem=messaging-activemq/server=default/http-connector=http-connector:add(socket-binding=http, endpoint=http-acceptor) - -/subsystem=messaging-activemq/server=default/http-connector=http-connector-throughput:add(socket-binding=http, endpoint=http-acceptor-throughput, params={batch-delay=50} - -/subsystem=messaging-activemq/server=default/in-vm-connector=in-vm:add(server-id=0, params={buffer-pooling=false} - -/subsystem=messaging-activemq/server=default/http-acceptor=http-acceptor:add(http-listener=default) - -/subsystem=messaging-activemq/server=default/http-acceptor=http-acceptor-throughput:add(http-listener=default, params={batch-delay=50, direct-deliver=false}) - -/subsystem=messaging-activemq/server=default/in-vm-acceptor=in-vm:add(server-id=0, params={buffer-pooling=false} - -/subsystem=messaging-activemq/server=default/jms-queue=ExpiryQueue:add(entries=["java:/jms/queue/ExpiryQueue"]) - - -/subsystem=messaging-activemq/server=default/jms-queue=DLQ:add(entries=["java:/jms/queue/DLQ"]) - -/subsystem=messaging-activemq/server=default/connection-factory=InVmConnectionFactory:add(connectors=[in-vm], entries=["java:/ConnectionFactory"]) - -/subsystem=messaging-activemq/server=default/connection-factory=RemoteConnectionFactory:add(connectors=[http-connector], entries=["java:jboss/exported/jms/RemoteConnectionFactory"]) - -/subsystem=messaging-activemq/server=default/pooled-connection-factory=activemq-ra:add(transaction=xa, connectors=[in-vm], entries=["java:/JmsXA","java:jboss/DefaultJMSConnectionFactory"]) - -/subsystem=ejb3:write-attribute(name=default-resource-adapter-name, value=${ejb.resource-adapter-name:activemq-ra.rar}) - -/subsystem=ee/service=default-bindings:write-attribute(name=jms-connection-factory, value=java:jboss/DefaultJMSConnectionFactory) - -/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=remote-artemis:remove() \ No newline at end of file diff --git a/remote-helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldQueueMDB.java b/remote-helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldQueueMDB.java deleted file mode 100644 index 9b4e04865f..0000000000 --- a/remote-helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldQueueMDB.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mdb; - -import java.util.logging.Logger; -import jakarta.ejb.ActivationConfigProperty; -import jakarta.ejb.MessageDriven; -import jakarta.jms.JMSException; -import jakarta.jms.Message; -import jakarta.jms.MessageListener; -import jakarta.jms.TextMessage; - -/** - *

- * A simple Message Driven Bean that asynchronously receives and processes the messages that are sent to the queue. - *

- * - * @author Serge Pagop (spagop@redhat.com) - */ -@MessageDriven(name = "HelloWorldQueueMDB", activationConfig = { - @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "queue/HELLOWORLDMDBQueue"), - @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "jakarta.jms.Queue"), - @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge")}) -public class HelloWorldQueueMDB implements MessageListener { - - private static final Logger LOGGER = Logger.getLogger(HelloWorldQueueMDB.class.toString()); - - /** - * @see MessageListener#onMessage(Message) - */ - public void onMessage(Message rcvMessage) { - TextMessage msg = null; - try { - if (rcvMessage instanceof TextMessage) { - msg = (TextMessage) rcvMessage; - LOGGER.info("Received Message from queue: " + msg.getText()); - } else { - LOGGER.warning("Message of wrong type: " + rcvMessage.getClass().getName()); - } - } catch (JMSException e) { - throw new RuntimeException(e); - } - } -} diff --git a/remote-helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldTopicMDB.java b/remote-helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldTopicMDB.java deleted file mode 100644 index 21b34f09db..0000000000 --- a/remote-helloworld-mdb/src/main/java/org/jboss/as/quickstarts/mdb/HelloWorldTopicMDB.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mdb; - -import java.util.logging.Logger; -import jakarta.ejb.ActivationConfigProperty; -import jakarta.ejb.MessageDriven; -import jakarta.jms.JMSException; -import jakarta.jms.Message; -import jakarta.jms.MessageListener; -import jakarta.jms.TextMessage; - -/** - *

- * A simple Message Driven Bean that asynchronously receives and processes the messages that are sent to the topic. - *

- * - * @author Serge Pagop (spagop@redhat.com) - */ -@MessageDriven(name = "HelloWorldQTopicMDB", activationConfig = { - @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "topic/HELLOWORLDMDBTopic"), - @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "jakarta.jms.Topic"), - @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge")}) -public class HelloWorldTopicMDB implements MessageListener { - - private static final Logger LOGGER = Logger.getLogger(HelloWorldTopicMDB.class.toString()); - - /** - * @see MessageListener#onMessage(Message) - */ - public void onMessage(Message rcvMessage) { - TextMessage msg = null; - try { - if (rcvMessage instanceof TextMessage) { - msg = (TextMessage) rcvMessage; - LOGGER.info("Received Message from topic: " + msg.getText()); - } else { - LOGGER.warning("Message of wrong type: " + rcvMessage.getClass().getName()); - } - } catch (JMSException e) { - throw new RuntimeException(e); - } - } -} diff --git a/remote-helloworld-mdb/src/main/java/org/jboss/as/quickstarts/servlet/HelloWorldMDBServletClient.java b/remote-helloworld-mdb/src/main/java/org/jboss/as/quickstarts/servlet/HelloWorldMDBServletClient.java deleted file mode 100644 index 0b43de93f5..0000000000 --- a/remote-helloworld-mdb/src/main/java/org/jboss/as/quickstarts/servlet/HelloWorldMDBServletClient.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.servlet; - -import java.io.IOException; -import java.io.PrintWriter; - -import jakarta.annotation.Resource; -import jakarta.inject.Inject; -import jakarta.jms.Destination; -import jakarta.jms.JMSContext; -import jakarta.jms.JMSDestinationDefinition; -import jakarta.jms.JMSDestinationDefinitions; -import jakarta.jms.Queue; -import jakarta.jms.Topic; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -/** - * Definition of the two JMS destinations used by the quickstart - * (one queue and one topic). - */ -@JMSDestinationDefinitions( - value = { - @JMSDestinationDefinition( - name = "java:/queue/HELLOWORLDMDBQueue", - interfaceName = "jakarta.jms.Queue", - destinationName = "HelloWorldMDBQueue", - properties = {"enable-amq1-prefix=false"} - ), - @JMSDestinationDefinition( - name = "java:/topic/HELLOWORLDMDBTopic", - interfaceName = "jakarta.jms.Topic", - destinationName = "HelloWorldMDBTopic", - properties = {"enable-amq1-prefix=false"} - ) - } -) - -/** - * A simple servlet as client that sends several messages to a queue or a topic. - * @author Emmanuel Hugonnet (c) 2023 Red Hat, Inc. - */ -@WebServlet("/HelloWorldMDBServletClient") -public class HelloWorldMDBServletClient extends HttpServlet { - - private static final long serialVersionUID = -8314035702649252239L; - - private static final int MSG_COUNT = 5; - - @Inject - private transient JMSContext context; - - @Resource(lookup = "java:/queue/HELLOWORLDMDBQueue") - private transient Queue queue; - - @Resource(lookup = "java:/topic/HELLOWORLDMDBTopic") - private transient Topic topic; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.setContentType("text/html"); - try (PrintWriter out = resp.getWriter()) { - out.println("

Quickstart: Example demonstrates the use of Jakarta Messaging 3.1 and Jakarta Enterprise Beans 4.0 Message-Driven Bean in a JakartaEE server.

"); - boolean useTopic = req.getParameterMap().keySet().contains("topic"); - final Destination destination = useTopic ? topic : queue; - - out.println("

Sending messages to " + destination + "

"); - out.println("

The following messages will be sent to the destination:

"); - for (int i = 0; i < MSG_COUNT; i++) { - String text = "This is message " + (i + 1); - context.createProducer().send(destination, text); - out.println("Message (" + i + "): " + text + "
"); - } - out.println("

Go to your JakartaEE server console or server log to see the result of messages processing.

"); - } - } - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - doGet(req, resp); - } -} diff --git a/remote-helloworld-mdb/src/main/webapp/WEB-INF/beans.xml b/remote-helloworld-mdb/src/main/webapp/WEB-INF/beans.xml deleted file mode 100644 index e45663eff5..0000000000 --- a/remote-helloworld-mdb/src/main/webapp/WEB-INF/beans.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - diff --git a/remote-helloworld-mdb/src/main/webapp/index.html b/remote-helloworld-mdb/src/main/webapp/index.html deleted file mode 100644 index 1b75ef9155..0000000000 --- a/remote-helloworld-mdb/src/main/webapp/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - diff --git a/remote-helloworld-mdb/src/test/java/org/jboss/as/quickstarts/mdb/AbstractMDBServletIT.java b/remote-helloworld-mdb/src/test/java/org/jboss/as/quickstarts/mdb/AbstractMDBServletIT.java deleted file mode 100644 index f1ac1c854f..0000000000 --- a/remote-helloworld-mdb/src/test/java/org/jboss/as/quickstarts/mdb/AbstractMDBServletIT.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2023 JBoss by Red Hat. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mdb; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.net.URI; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.time.Duration; -import java.util.Optional; -import org.junit.Test; - -/** - * - * @author Emmanuel Hugonnet (c) 2023 Red Hat, Inc. - */ -public abstract class AbstractMDBServletIT { - - protected abstract URI getHTTPEndpoint(); - - @Test - public void testSendToQueue() throws IOException, InterruptedException { - HttpClient client = HttpClient.newBuilder() - .followRedirects(HttpClient.Redirect.ALWAYS) - .connectTimeout(Duration.ofMinutes(1)) - .build(); - HttpRequest request = HttpRequest.newBuilder() - .uri(getHTTPEndpoint()) - .GET() - .build(); - HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); - assertEquals(200, response.statusCode()); - Optional contentType = response.headers().firstValue("Content-Type"); - assertTrue(contentType.isPresent()); - assertEquals("text/html;charset=ISO-8859-1", contentType.get()); - String[] content = response.body().split(getLineSeparator()); - assertEquals(9, content.length); - assertEquals("

Quickstart: Example demonstrates the use of Jakarta Messaging 3.1 and Jakarta Enterprise Beans 4.0 Message-Driven Bean in a JakartaEE server.

", content[0].trim()); - assertEquals("

Sending messages to ActiveMQQueue[HelloWorldMDBQueue]

", content[1].trim()); - assertEquals("

The following messages will be sent to the destination:

", content[2].trim()); - assertEquals("Message (0): This is message 1
", content[3].trim()); - assertEquals("Message (1): This is message 2
", content[4].trim()); - assertEquals("Message (2): This is message 3
", content[5].trim()); - assertEquals("Message (3): This is message 4
", content[6].trim()); - assertEquals("Message (4): This is message 5
", content[7].trim()); - assertEquals("

Go to your JakartaEE server console or server log to see the result of messages processing.

", content[8].trim()); - } - - @Test - public void testSendToTopic() throws IOException, InterruptedException { - HttpClient client = HttpClient.newBuilder() - .followRedirects(HttpClient.Redirect.ALWAYS) - .connectTimeout(Duration.ofMinutes(1)) - .build(); - HttpRequest request = HttpRequest.newBuilder() - .uri(URI.create(getHTTPEndpoint().toString() + "?topic")) - .GET() - .build(); - HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); - assertEquals(200, response.statusCode()); - Optional contentType = response.headers().firstValue("Content-Type"); - assertTrue(contentType.isPresent()); - assertEquals("text/html;charset=ISO-8859-1", contentType.get()); - String[] content = response.body().split(getLineSeparator()); - assertEquals(9, content.length); - assertEquals("

Quickstart: Example demonstrates the use of Jakarta Messaging 3.1 and Jakarta Enterprise Beans 4.0 Message-Driven Bean in a JakartaEE server.

", content[0].trim()); - assertEquals("

Sending messages to ActiveMQTopic[HelloWorldMDBTopic]

", content[1].trim()); - assertEquals("

The following messages will be sent to the destination:

", content[2].trim()); - assertEquals("Message (0): This is message 1
", content[3].trim()); - assertEquals("Message (1): This is message 2
", content[4].trim()); - assertEquals("Message (2): This is message 3
", content[5].trim()); - assertEquals("Message (3): This is message 4
", content[6].trim()); - assertEquals("Message (4): This is message 5
", content[7].trim()); - assertEquals("

Go to your JakartaEE server console or server log to see the result of messages processing.

", content[8].trim()); - } - - protected String getLineSeparator() { - return "\n"; - } -} diff --git a/remote-helloworld-mdb/src/test/java/org/jboss/as/quickstarts/mdb/ProvisionedManagedMDBServletIT.java b/remote-helloworld-mdb/src/test/java/org/jboss/as/quickstarts/mdb/ProvisionedManagedMDBServletIT.java deleted file mode 100644 index fc2a6fa1db..0000000000 --- a/remote-helloworld-mdb/src/test/java/org/jboss/as/quickstarts/mdb/ProvisionedManagedMDBServletIT.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2022 JBoss by Red Hat. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mdb; - -import java.net.URI; -import java.net.URISyntaxException; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.junit.runner.RunWith; - -/** - * - * @author Emmanuel Hugonnet (c) 2023 Red Hat, Inc. - */ -@RunWith(Arquillian.class) -@RunAsClient -public class ProvisionedManagedMDBServletIT extends AbstractMDBServletIT { - - @Override - protected URI getHTTPEndpoint() { - String host = getServerHost(); - if (host == null) { - host = "http://localhost:8080"; - } - try { - return new URI(host + "/HelloWorldMDBServletClient"); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } - - private String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host"); - } - return host; - } - -} diff --git a/remote-helloworld-mdb/src/test/java/org/jboss/as/quickstarts/mdb/RemoteMDBServletIT.java b/remote-helloworld-mdb/src/test/java/org/jboss/as/quickstarts/mdb/RemoteMDBServletIT.java deleted file mode 100644 index 8df9c3ebd0..0000000000 --- a/remote-helloworld-mdb/src/test/java/org/jboss/as/quickstarts/mdb/RemoteMDBServletIT.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 JBoss by Red Hat. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.mdb; - -import java.net.URI; -import java.net.URISyntaxException; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.junit.runner.RunWith; - -/** - * - * @author Emmanuel Hugonnet (c) 2023 Red Hat, Inc. - */ -@RunWith(Arquillian.class) -@RunAsClient -public class RemoteMDBServletIT extends AbstractMDBServletIT { - - - private String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host", "http://localhost:8080/remote-helloworld-mdb"); - } - return host; - } - - @Override - protected URI getHTTPEndpoint() { - try { - return new URI(getServerHost() + "/HelloWorldMDBServletClient"); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } -} diff --git a/remote-helloworld-mdb/src/test/resources/arquillian.xml b/remote-helloworld-mdb/src/test/resources/arquillian.xml deleted file mode 100644 index f20100c13e..0000000000 --- a/remote-helloworld-mdb/src/test/resources/arquillian.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/servlet-security/README-source.adoc b/servlet-security/README-source.adoc deleted file mode 100644 index d1e2af45a2..0000000000 --- a/servlet-security/README-source.adoc +++ /dev/null @@ -1,221 +0,0 @@ -include::../shared-doc/attributes.adoc[] - -= servlet-security: Using Jakarta EE Declarative Security to Control Servlet Access -:author: Sherif F. Makary, Pedro Igor, Stefan Guilhen -:level: Intermediate -:technologies: Servlet, Security -:openshift: true - -[abstract] -The `servlet-security` quickstart demonstrates the use of Jakarta EE declarative security to control access to Servlets and Security in {productName}. - -:standalone-server-type: default -:archiveType: war -:uses-h2: -:restoreScriptName: restore-configuration.cli - -== What is it? - -The `servlet-security` quickstart demonstrates the use of Jakarta EE declarative security to control access to Servlets and Security in {productNameFull}. - -When you deploy this example, two users are automatically created for you: user `quickstartUser` with password `quickstartPwd1!` and user `guest` with password `guestPwd1!`. This data is located in the `src/main/resources/import.sql` file. - -This quickstart takes the following steps to implement Servlet security: - -. Web Application: -** Adds a security constraint to the Servlet using the `@ServletSecurity` and `@HttpConstraint` annotations. -** Adds a security domain reference to `WEB-INF/jboss-web.xml`. -** Adds a `login-config` that sets the `auth-method` to `BASIC` in the `WEB-INF/web.xml`. -. Application Server (`standalone.xml`): -** Defines a security domain in the `elytron` subsystem that uses the JDBC security realm to obtain the security data used to authenticate and authorize users. -** Adds an `application-security-domain` mapping in the `undertow` subsystem to map the Servlet security domain to the security domain defined in step 1. -. Database Configuration: -** Adds an application user with access rights to the application. -+ -[source,options="nowrap"] ----- -User Name: quickstartUser -Password: quickstartPwd1! -Role: quickstarts ----- - -** Adds another user with no access rights to the application. -+ -[source,options="nowrap"] ----- -User Name: guest -Password: guestPwd1! -Role: notauthorized ----- - -// Considerations for Use in a Production Environment -include::../shared-doc/development-shortcuts.adoc[leveloffset=+1] -// System Requirements -include::../shared-doc/system-requirements.adoc[leveloffset=+1] -// Use of {jbossHomeName} -include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1] - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Back Up the {productName} Standalone Server Configuration -include::../shared-doc/back-up-server-standalone-configuration.adoc[leveloffset=+2] -// Start the {productName} Standalone Server -include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+2] - -[[configure_the_server]] -=== Configure the Server - -You can configure the server by running JBoss CLI commands. For your convenience, this quickstart batches the commands into a `configure-server.cli` script provided in the root directory of this quickstart. - -. Before you begin, make sure you do the following: - -* xref:back_up_standalone_server_configuration[Back up the {productName} standalone server configuration] as described above. -* xref:start_the_eap_standalone_server[Start the {productName} server with the standalone default profile] as described above. - -. Review the `configure-server.cli` file in the root of this quickstart directory. This script adds security domain and HTTP authentication factory to the `elytron` subsystem in the server configuration and also configures the `undertow` subsystem to use the configured HTTP authentication factory for the Web application. -. Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing `__{jbossHomeName}__` with the path to your server: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=configure-server.cli ----- -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. - -+ -You should see the following result when you run the script: -+ -[source,options="nowrap"] ----- -The batch executed successfully ----- - -. Stop the {productName} server. - -=== Review the Modified Server Configuration - -After stopping the server, open the `__{jbossHomeName}__/standalone/configuration/standalone.xml` file and review the changes. - -. The following datasource was added to the `datasources` subsystem. -+ -[source,xml,options="nowrap"] ----- - - jdbc:h2:mem:servlet-security;DB_CLOSE_ON_EXIT=FALSE - h2 - - sa - sa - - ----- - -. The following `security-realm` was added to the `elytron` subsystem. -+ -[source,xml,options="nowrap"] ----- - - - - - - - - - - ----- -+ -The `security-realm` is responsible for verifying the credentials for a given principal and for obtaining security attributes (like roles) that are associated with the authenticated identity. - -. The `jdbc-realm` in this quickstart stores the roles associated with a principal in an attribute named `Roles`. -+ -Other realms might use different attributes for roles (such as `group`). -If an attribute name other than "Roles" is used to store the roles, a `role-decoder` can be configured as follows: -+ -``` -/subsystem=elytron/simple-role-decoder=from-roles-attribute:add(attribute=ATTRIBUTE_NAME) -``` -+ -The command to create a `security-domain` could then be updated to reference this `role-decoder`: -+ -``` -/subsystem=elytron/security-domain=servlet-security-quickstart-sd:add(default-realm=servlet-security-jdbc-realm, realms=[{realm=servlet-security-jdbc-realm, role-decoder=from-roles-attribute}], permission-mapper=default-permission-mapper) -``` -+ -The purpose of a `role-decoder` is to instruct the security domain how roles are to be retrieved from an authorized identity. - - -. The following `security-domain` was added to the `elytron` subsystem. -+ -[source,xml,options="nowrap"] ----- - - - ----- - -. The following `application-security-domain` was added to the `undertow` subsystem. -+ -[source,xml,options="nowrap"] ----- - - - ----- - -This configuration tells `Undertow` that applications with the `servlet-security-quickstart` security domain, as defined in the `jboss-web.xml` or by using the `@SecurityDomain` annotation in the Servlet class, should use the `security-domain` named `servlet-security-quickstart-sd`. - -// Build and Deploy the Quickstart -include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+2] - -=== Access the Application - -The application will be running at the following URL http://localhost:8080/{artifactId}/. - -When you access the application, you should get a browser login challenge. - -Log in using the username `quickstartUser` and password `quickstartPwd1!`. The browser will display the following security info: - -[source,options="nowrap"] ----- -Successfully called Secured Servlet - -Principal : quickstartUser -Remote User : quickstartUser -Authentication Type : BASIC ----- - -Now close the browser. Open a new browser and log in with username `guest` and password `guestPwd1!`. The browser will display the following error: - -[source,options="nowrap"] ----- -Forbidden ----- - -// Testing with Arquillian -include::../shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc[leveloffset=+2] -// Undeploy the Quickstart -include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2] - -// Restore the {productName} Standalone Server Configuration -include::../shared-doc/restore-standalone-server-configuration.adoc[leveloffset=+2] - -// Additional information about this script -This script removes the `application-security-domain` configuration from the `undertow` subsystem, the `http-authentication-factory`, `security-domain`, `security-realm` and `role-decoder` configuration from the `elytron` subsystem and it also removes the datasource used for this quickstart. You should see the following result when you run the script: - -[source,options="nowrap"] ----- -The batch executed successfully -process-state: reload-required ----- - -// Restore the {productName} Standalone Server Configuration Manually -include::../shared-doc/restore-standalone-server-configuration-manual.adoc[leveloffset=+3] - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1] diff --git a/servlet-security/README.adoc b/servlet-security/README.adoc deleted file mode 100644 index 61125c795f..0000000000 --- a/servlet-security/README.adoc +++ /dev/null @@ -1,1224 +0,0 @@ -ifdef::env-github[] -:artifactId: servlet-security -endif::[] - -//*********************************************************************************** -// Enable the following flag to build README.html files for JBoss EAP product builds. -// Comment it out for WildFly builds. -//*********************************************************************************** -:ProductRelease: - -//*********************************************************************************** -// Enable the following flag to build README.html files for EAP XP product builds. -// Comment it out for WildFly or JBoss EAP product builds. -//*********************************************************************************** -//:EAPXPRelease: - -// This is a universal name for all releases -:ProductShortName: JBoss EAP -// Product names and links are dependent on whether it is a product release (CD or JBoss) -// or the WildFly project. -// The "DocInfo*" attributes are used to build the book links to the product documentation - -ifdef::ProductRelease[] -// JBoss EAP release -:productName: JBoss EAP -:productNameFull: Red Hat JBoss Enterprise Application Platform -:productVersion: 8.0 -:DocInfoProductNumber: {productVersion} -:WildFlyQuickStartRepoTag: 8.0.x -:productImageVersion: 8.0.0 -:helmChartName: jboss-eap/eap8 -endif::[] - -ifdef::EAPXPRelease[] -// JBoss EAP XP release -:productName: JBoss EAP XP -:productNameFull: Red Hat JBoss Enterprise Application Platform expansion pack -:productVersion: 3.0 -:DocInfoProductNumber: 7.4 -:WildFlyQuickStartRepoTag: XP_3.0.0.GA -:productImageVersion: 3.0 -:helmChartName: jboss-eap/eap-xp3 -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -:githubRepoUrl: https://github.com/jboss-developer/jboss-eap-quickstarts/ -:githubRepoCodeUrl: https://github.com/jboss-developer/jboss-eap-quickstarts.git -:jbossHomeName: EAP_HOME -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:quickstartDownloadName: {productNameFull} {productVersion} Quickstarts -:quickstartDownloadUrl: https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=appplatform&downloadType=distributions -:helmRepoName: jboss-eap -:helmRepoUrl: https://jbossas.github.io/eap-charts/ -// END ifdef::ProductRelease,EAPXPRelease[] -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -// WildFly project -:productName: WildFly -:productNameFull: WildFly Application Server -:ProductShortName: {productName} -:jbossHomeName: WILDFLY_HOME -:productVersion: 28 -:productImageVersion: 28.0 -:githubRepoUrl: https://github.com/wildfly/quickstart/ -:githubRepoCodeUrl: https://github.com/wildfly/quickstart.git -:WildFlyQuickStartRepoTag: 28.0.1.Final -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -// Do not update the following until after the 7.4 docs are published! -:DocInfoProductNumber: 7.4 -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:helmRepoName: wildfly -:helmRepoUrl: http://docs.wildfly.org/wildfly-charts/ -:helmChartName: wildfly/wildfly -// END ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -endif::[] - -:source: {githubRepoUrl} - -// Values for Openshift S2i sections attributes -:CDProductName: {productNameFull} for OpenShift -:CDProductShortName: {ProductShortName} for OpenShift -:CDProductTitle: {CDProductName} -:CDProductNameSentence: Openshift release for {ProductShortName} -:CDProductAcronym: {CDProductShortName} -:CDProductVersion: {productVersion} -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {EapForOpenshiftBookName} Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {xpaasproduct} Online -:xpaasproduct-shortname: {CDProductShortName} -:xpaasproductOpenShiftOnline-shortname: {xpaasproduct-shortname} Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: Getting Started with {ProductShortName} for OpenShift Container Platform -:EapForOpenshiftOnlineBookName: Getting Started with {ProductShortName} for OpenShift Online -:OpenShiftOnlinePlatformName: Red Hat OpenShift Container Platform -:OpenShiftOnlineName: Red Hat OpenShift Online -:ImagePrefixVersion: eap80 -:ImageandTemplateImportBaseURL: https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift - -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepo: https://github.com/jboss-developer/jboss-eap-quickstarts -:EAPQuickStartRepoRef: 8.0.x -:EAPQuickStartRepoTag: EAP_8.0.0.GA -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_container_platform/ -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_online/ - -ifdef::EAPXPRelease[] -// Attributes for XP releases -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {productNameFull} for OpenShift Online -:xpaasproduct-shortname: {ProductShortName} for OpenShift -:xpaasproductOpenShiftOnline-shortname: {ProductShortName} for OpenShift Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:ImagePrefixVersion: eap-xp3 -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepoRef: xp-3.0.x -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -endif::[] - -ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -:ImageandTemplateImportURL: https://raw.githubusercontent.com/wildfly/wildfly-s2i/v{productVersion}.0/ -endif::[] - -//************************* -// Other values -//************************* -:buildRequirements: Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later -:jbdsEapServerName: Red Hat JBoss Enterprise Application Platform 7.3 -:javaVersion: Jakarta EE 10 -ifdef::EAPXPRelease[] -:javaVersion: Eclipse MicroProfile -endif::[] -:githubRepoBranch: master -:guidesBaseUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/ -:useEclipseUrl: {guidesBaseUrl}USE_JBDS.adoc#use_red_hat_jboss_developer_studio_or_eclipse_to_run_the_quickstarts -:useEclipseDeployJavaClientDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_containing_server_and_java_client_projects -:useEclipseDeployEARDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_ear_project -:useProductHomeDocUrl: {guidesBaseUrl}USE_OF_{jbossHomeName}.adoc#use_of_product_home_and_jboss_home_variables -:configureMavenDocUrl: {guidesBaseUrl}CONFIGURE_MAVEN_JBOSS_EAP.adoc#configure_maven_to_build_and_deploy_the_quickstarts -:arquillianTestsDocUrl: {guidesBaseUrl}RUN_ARQUILLIAN_TESTS.adoc#run_the_arquillian_tests -:addUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#create_users_required_by_the_quickstarts -:addApplicationUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_application_user -:addManagementUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_management_user -:startServerDocUrl: {guidesBaseUrl}START_JBOSS_EAP.adoc#start_the_jboss_eap_server -:configurePostgresDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_database_for_use_with_the_quickstarts -:configurePostgresDownloadDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#download_and_install_postgresql -:configurePostgresCreateUserDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#create_a_database_user -:configurePostgresAddModuleDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#add_the_postgres_module_to_the_jboss_eap_server -:configurePostgresDriverDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_driver_in_the_jboss_eap_server -:configureBytemanDownloadDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#download_and_configure_byteman -:configureBytemanDisableDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#disable_the_byteman_script -:configureBytemanClearDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#clear_the_transaction_object_store -:configureBytemanQuickstartDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts -:configureBytemanHaltDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#use_byteman_to_halt_the_application[ -:configureBytemanQuickstartsDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts - -:EESubsystemNamespace: urn:jboss:domain:ee:4.0 -:IiopOpenJdkSubsystemNamespace: urn:jboss:domain:iiop-openjdk:2.0 -:MailSubsystemNamespace: urn:jboss:domain:mail:3.0 -:SingletonSubsystemNamespace: urn:jboss:domain:singleton:1.0 -:TransactionsSubsystemNamespace: urn:jboss:domain:transactions:4.0 - -// LinkProductDocHome: https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/ -:LinkProductDocHome: https://access.redhat.com/documentation/en/jboss-enterprise-application-platform-continuous-delivery -:LinkConfigGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/configuration_guide/ -:LinkDevelopmentGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/development_guide/ -:LinkGettingStartedGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_guide/ -:LinkOpenShiftWelcome: https://docs.openshift.com/online/welcome/index.html -:LinkOpenShiftSignup: https://docs.openshift.com/online/getting_started/choose_a_plan.html -:OpenShiftTemplateName: JBoss EAP CD (no https) - -:ConfigBookName: Configuration Guide -:DevelopmentBookName: Development Guide -:GettingStartedBookName: Getting Started Guide - -:JBDSProductName: Red Hat CodeReady Studio -:JBDSVersion: 12.15 -:LinkJBDSInstall: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/installation_guide/ -:JBDSInstallBookName: Installation Guide -:LinkJBDSGettingStarted: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/getting_started_with_codeready_studio_tools/ -:JBDSGettingStartedBookName: Getting Started with CodeReady Studio Tools - -= servlet-security: Using Jakarta EE Declarative Security to Control Servlet Access -:author: Sherif F. Makary, Pedro Igor, Stefan Guilhen -:level: Intermediate -:technologies: Servlet, Security -:openshift: true - -[abstract] -The `servlet-security` quickstart demonstrates the use of Jakarta EE declarative security to control access to Servlets and Security in {productName}. - -:standalone-server-type: default -:archiveType: war -:uses-h2: -:restoreScriptName: restore-configuration.cli - -== What is it? - -The `servlet-security` quickstart demonstrates the use of Jakarta EE declarative security to control access to Servlets and Security in {productNameFull}. - -When you deploy this example, two users are automatically created for you: user `quickstartUser` with password `quickstartPwd1!` and user `guest` with password `guestPwd1!`. This data is located in the `src/main/resources/import.sql` file. - -This quickstart takes the following steps to implement Servlet security: - -. Web Application: -** Adds a security constraint to the Servlet using the `@ServletSecurity` and `@HttpConstraint` annotations. -** Adds a security domain reference to `WEB-INF/jboss-web.xml`. -** Adds a `login-config` that sets the `auth-method` to `BASIC` in the `WEB-INF/web.xml`. -. Application Server (`standalone.xml`): -** Defines a security domain in the `elytron` subsystem that uses the JDBC security realm to obtain the security data used to authenticate and authorize users. -** Adds an `application-security-domain` mapping in the `undertow` subsystem to map the Servlet security domain to the security domain defined in step 1. -. Database Configuration: -** Adds an application user with access rights to the application. -+ -[source,options="nowrap"] ----- -User Name: quickstartUser -Password: quickstartPwd1! -Role: quickstarts ----- - -** Adds another user with no access rights to the application. -+ -[source,options="nowrap"] ----- -User Name: guest -Password: guestPwd1! -Role: notauthorized ----- - -// Considerations for Use in a Production Environment -:leveloffset: +1 - -[[considerations_for_use_in_a_production_environment]] -= Considerations for Use in a Production Environment -//****************************************************************************** -// Include this template if your quickstart: -// * Uses the h2 database: Be sure to define the `uses-h2` attribute. -// * Uses an `*-ds.xml file`: Be sure to define the `uses-ds-xml` attribute. -// * Has performance or scalability concerns: Be sure to define the `uses-ds-xml` attribute. -//****************************************************************************** - -ifdef::uses-h2[] - -H2 Database:: This quickstart uses the H2 database included with {productNameFull} {productVersion}. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment. - -endif::uses-h2[] - -ifdef::uses-ds-xml[] - -Datasource Configuration File:: This quickstart uses a `*-ds.xml` datasource configuration file for convenience and ease of database configuration. These files are deprecated in {productName} and should not be used in a production environment. Instead, you should configure the datasource using the Management CLI or Management Console. Datasource configuration is documented in the {LinkConfigGuide}[__{ConfigBookName}__]. - -endif::uses-ds-xml[] - -ifdef::performance-scalability[] - -Performance and Scalability:: A Jakarta EE container is designed with robustness in mind, so you should carefully analyze the scalabiltiy, concurrency, and performance needs of your application before taking advantage of these techniques in your own applications. - -endif::performance-scalability[] - -:leveloffset!: -// System Requirements -:leveloffset: +1 - -[[system_requirements]] -= System Requirements -//****************************************************************************** -// Include this template to describe the standard system requirements for -// running the quickstarts. -// -// The Forge quickstarts define a `forge-from-scratch` attribute because they -// run entirely in CodeReady Studio and have different requirements . -//****************************************************************************** - -The application this project produces is designed to be run on {productNameFull} {productVersion} or later. - -All you need to build this project is {buildRequirements}. See link:{configureMavenDocUrl}[Configure Maven to Build and Deploy the Quickstarts] to make sure you are configured correctly for testing the quickstarts. - -:leveloffset!: -// Use of {jbossHomeName} -:leveloffset: +1 - -ifdef::requires-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -This quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifdef::optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -When deploying this quickstart to a managed domain, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When deploying this quickstart to multiple standalone servers, this quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifndef::requires-multiple-servers,optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName} and QUICKSTART_HOME Variables - -In the following instructions, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -:leveloffset!: - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Back Up the {productName} Standalone Server Configuration -:leveloffset: +2 - -[[back_up_standalone_server_configuration]] -= Back Up the {productName} Standalone Server Configuration -//****************************************************************************** -// Include this template if your quickstart runs in a standalone server and -// needs to back up the server configuration file before running -// a CLI script to modify the server. -//****************************************************************************** -// Define the attributes needed for this topic. -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -Before you begin, back up your server configuration file. - -. If it is running, stop the {productName} server. -. Back up the `__{jbossHomeName}__/{configFileName}` file. - -After you have completed testing this quickstart, you can replace this file to restore the server to its original configuration. - -:leveloffset!: -// Start the {productName} Standalone Server -:leveloffset: +2 - -[[start_the_eap_standalone_server]] -= Start the {productName} Standalone Server -//****************************************************************************** -// Include this template if your quickstart requires a normal start of a single -// standalone server. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// custom -// -// * For mobile applications, you can define the `mobileApp` variable in the -// `README.adoc` file to add `-b 0.0.0.0` to the command line. This allows -// external clients, such as phones, tablets, and desktops, to connect -// to the application through through your local network -// ::mobileApp: {artifactId}-service -// -//****************************************************************************** - -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -. Open a terminal and navigate to the root of the {productName} directory. -. Start the {productName} server with the {serverProfile} by typing the following command. -+ -ifdef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __JAEGER_REPORTER_LOG_SPANS=true JAEGER_SAMPLER_TYPE=const JAEGER_SAMPLER_PARAM=1__ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -ifndef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\standalone.bat` script. - -ifdef::mobileApp[] -+ -Adding `-b 0.0.0.0` to the above command allows external clients, such as phones, tablets, and desktops, to connect through your local network. For example: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} -b 0.0.0.0 ----- -endif::[] - -:leveloffset!: - -[[configure_the_server]] -=== Configure the Server - -You can configure the server by running JBoss CLI commands. For your convenience, this quickstart batches the commands into a `configure-server.cli` script provided in the root directory of this quickstart. - -. Before you begin, make sure you do the following: - -* xref:back_up_standalone_server_configuration[Back up the {productName} standalone server configuration] as described above. -* xref:start_the_eap_standalone_server[Start the {productName} server with the standalone default profile] as described above. - -. Review the `configure-server.cli` file in the root of this quickstart directory. This script adds security domain and HTTP authentication factory to the `elytron` subsystem in the server configuration and also configures the `undertow` subsystem to use the configured HTTP authentication factory for the Web application. -. Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing `__{jbossHomeName}__` with the path to your server: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=configure-server.cli ----- -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. - -+ -You should see the following result when you run the script: -+ -[source,options="nowrap"] ----- -The batch executed successfully ----- - -. Stop the {productName} server. - -=== Review the Modified Server Configuration - -After stopping the server, open the `__{jbossHomeName}__/standalone/configuration/standalone.xml` file and review the changes. - -. The following datasource was added to the `datasources` subsystem. -+ -[source,xml,options="nowrap"] ----- - - jdbc:h2:mem:servlet-security;DB_CLOSE_ON_EXIT=FALSE - h2 - - sa - sa - - ----- - -. The following `security-realm` was added to the `elytron` subsystem. -+ -[source,xml,options="nowrap"] ----- - - - - - - - - - - ----- -+ -The `security-realm` is responsible for verifying the credentials for a given principal and for obtaining security attributes (like roles) that are associated with the authenticated identity. - -. The `jdbc-realm` in this quickstart stores the roles associated with a principal in an attribute named `Roles`. -+ -Other realms might use different attributes for roles (such as `group`). -If an attribute name other than "Roles" is used to store the roles, a `role-decoder` can be configured as follows: -+ -``` -/subsystem=elytron/simple-role-decoder=from-roles-attribute:add(attribute=ATTRIBUTE_NAME) -``` -+ -The command to create a `security-domain` could then be updated to reference this `role-decoder`: -+ -``` -/subsystem=elytron/security-domain=servlet-security-quickstart-sd:add(default-realm=servlet-security-jdbc-realm, realms=[{realm=servlet-security-jdbc-realm, role-decoder=from-roles-attribute}], permission-mapper=default-permission-mapper) -``` -+ -The purpose of a `role-decoder` is to instruct the security domain how roles are to be retrieved from an authorized identity. - - -. The following `security-domain` was added to the `elytron` subsystem. -+ -[source,xml,options="nowrap"] ----- - - - ----- - -. The following `application-security-domain` was added to the `undertow` subsystem. -+ -[source,xml,options="nowrap"] ----- - - - ----- - -This configuration tells `Undertow` that applications with the `servlet-security-quickstart` security domain, as defined in the `jboss-web.xml` or by using the `@SecurityDomain` annotation in the Servlet class, should use the `security-domain` named `servlet-security-quickstart-sd`. - -// Build and Deploy the Quickstart -:leveloffset: +2 - -[[build_and_deploy_the_quickstart]] -= Build and Deploy the Quickstart -//****************************************************************************** -// Include this template if your quickstart does a normal deployment of a archive. -// -// * Define the `archiveType` variable in the quickstart README file. -// Supported values: -// :archiveType: ear -// :archiveType: war -// :archiveType: jar -// -// * To override the archive name, which defaults to the {artifactId), -// define the `archiveName` variable, for example: -// :archiveName: {artifactId}-service -// -// * To override the archive output directory, -// define the `archiveDir` variable, for example: -// :archiveDir: ear/target -// -// * To override the Maven command, define the `mavenCommand` variable, -// for example: -// :mavenCommand: clean install wildfly:deploy -//****************************************************************************** - -// The archive name defaults to the artifactId if not overridden -ifndef::archiveName[] -:archiveName: {artifactId} -endif::archiveName[] - -// The archive type defaults to war if not overridden -ifndef::archiveType[] -:archiveType: war -endif::archiveType[] - -// Define the archive file name as the concatenation of "archiveName" + "." + "archiveType+ -:archiveFileName: {archiveName}.{archiveType} - -// If they have not defined the target archive directory, make it the default for the archive type. -ifndef::archiveDir[] - -ifeval::["{archiveType}"=="ear"] -:archiveDir: {artifactId}/ear/target -endif::[] - -ifeval::["{archiveType}"=="war"] -:archiveDir: {artifactId}/target -endif::[] - -ifeval::["{archiveType}"=="jar"] -:archiveDir: {artifactId}/target -endif::[] - -endif::archiveDir[] - -ifndef::mavenCommand[] -ifeval::["{archiveType}"=="ear"] -:mavenCommand: clean install -endif::[] - -ifeval::["{archiveType}"=="war"] -:mavenCommand: clean package -endif::[] - -ifeval::["{archiveType}"=="jar"] -:mavenCommand: clean install -endif::[] - -endif::mavenCommand[] - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -ifdef::reactive-messaging[] -. Run this command to enable the MicroProfile Reactive Messaging functionality on the server -+ -[source,subs="attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=enable-reactive-messaging.cli ----- -endif::reactive-messaging[] -. Type the following command to build the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn {mavenCommand} ----- - -. Type the following command to deploy the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn wildfly:deploy ----- - -ifdef::rest-client-qs[] -This builds and deploys the `country-server` and `country-client` to the running instance of the server. - -You should see a message in the server log indicating that the archives deployed successfully. -endif::[] -ifndef::rest-client-qs[] -This deploys the `{archiveDir}/{archiveFileName}` to the running instance of the server. - -You should see a message in the server log indicating that the archive deployed successfully. -endif::[] - - -:leveloffset!: - -=== Access the Application - -The application will be running at the following URL http://localhost:8080/{artifactId}/. - -When you access the application, you should get a browser login challenge. - -Log in using the username `quickstartUser` and password `quickstartPwd1!`. The browser will display the following security info: - -[source,options="nowrap"] ----- -Successfully called Secured Servlet - -Principal : quickstartUser -Remote User : quickstartUser -Authentication Type : BASIC ----- - -Now close the browser. Open a new browser and log in with username `guest` and password `guestPwd1!`. The browser will display the following error: - -[source,options="nowrap"] ----- -Forbidden ----- - -// Testing with Arquillian -:leveloffset: +2 - -[[run_the_arquillian_integration_tests_with_server_distribution]] -= Run the Arquillian Integration Tests -//****************************************************************************** -// Include this template if your quickstart provides standard Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -Follow these steps to run the integration tests. - -. Make sure you start the {productName} server, as previously described. - -. Make sure you build and deploy the quickstart, as previously described. - -. Type the following command to run the `verify` goal with the `arq-remote` profile activated. -+ -[source,options="nowrap"] ----- -$ mvn verify -Parq-remote ----- - -[NOTE] -==== -You may also use the environment variable `SERVER_HOST` or the system property `server.host` to define the target host of the tests. -==== - -:leveloffset!: -// Undeploy the Quickstart -:leveloffset: +2 - -[[undeploy_the_quickstart]] -= Undeploy the Quickstart - -//******************************************************************************* -// Include this template if your quickstart does a normal undeployment of an archive. -//******************************************************************************* -When you are finished testing the quickstart, follow these steps to undeploy the archive. - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -. Type this command to undeploy the archive: -+ -[source,options="nowrap"] ----- -$ mvn wildfly:undeploy ----- - -:leveloffset!: - -// Restore the {productName} Standalone Server Configuration -:leveloffset: +2 - -[[restore_the_standalone_server_configuration]] -= Restore the {productName} Standalone Server Configuration -//****************************************************************************** -// Include this template if your quickstart does a normal restoration of a single -// standalone server configuration. -// * It provides a CLI script. -// * You can manually restore the backup copy. -// -// You must define the script file name using the `restoreScriptName` attribute. -// For example: -// :restoreScriptName: remove-configuration.cli -//****************************************************************************** - -You can restore the original server configuration using either of the following methods. - -* You can xref:restore_standalone_server_configuration_using_cli[run the `{restoreScriptName}` script] provided in the root directory of this quickstart. -* You can xref:restore_standalone_server_configuration_manually[manually restore the configuration] using the backup copy of the configuration file. - -[[restore_standalone_server_configuration_using_cli]] -== Restore the {productName} Standalone Server Configuration by Running the JBoss CLI Script - -. xref:start_the_eap_standalone_server[Start the {productName} server] as described above. -. Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing `__{jbossHomeName}__` with the path to your server: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file={restoreScriptName} ----- -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. - -:leveloffset!: - -// Additional information about this script -This script removes the `application-security-domain` configuration from the `undertow` subsystem, the `http-authentication-factory`, `security-domain`, `security-realm` and `role-decoder` configuration from the `elytron` subsystem and it also removes the datasource used for this quickstart. You should see the following result when you run the script: - -[source,options="nowrap"] ----- -The batch executed successfully -process-state: reload-required ----- - -// Restore the {productName} Standalone Server Configuration Manually -:leveloffset: +3 - -[[restore_standalone_server_configuration_manually]] -= Restore the {productName} Standalone Server Configuration Manually -//****************************************************************************** -// Include this template if your quickstart does a normal manual restoration -// of a single standalone server. -//****************************************************************************** - -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -When you have completed testing the quickstart, you can restore the original server configuration by manually restoring the backup copy the configuration file. - -. If it is running, stop the {productName} server. -. Replace the `__{jbossHomeName}__/{configFileName}` file with the backup copy of the file. - -:leveloffset!: - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -:leveloffset: +1 - -[[build_and_run_the_quickstart_on_openshift]] -= Building and running the quickstart application with OpenShift -// The openshift profile -:leveloffset: +1 - -[[build-the-quickstart-for-openshift]] -== Build the {productName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -On OpenShift, the S2I build with Apache Maven will use an `openshift` profile used to provision a {productName} server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named `openshift` when building the quickstart: - -[source,subs="attributes+",options="nowrap"] ----- -$ mvn clean package -Popenshift ----- - -The provisioned {productName} server for OpenShift, with the quickstart deployed, can then be found in the `target/server` directory, and its usage is similar to a standard server distribution. -ifndef::ProductRelease,EAPXPRelease[] -You may note that unlike the `provisioned-server` profile it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the WildFly Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.wildfly:wildfly-galleon-pack:${version.server} - - - org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp} - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -[NOTE] -==== -Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`. -==== - -:leveloffset: 1 -// Getting Started with Helm -:leveloffset: +1 - -[[getting_started_with_helm]] -= Getting Started with {xpaasproduct-shortname} and Helm Charts - -This section contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} using Helm Charts. - -[[prerequisites_helm_openshift]] -== Prerequisites - -* You must be logged in OpenShift and have an `oc` client to connect to OpenShift -* https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. - -Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}. - -ifndef::ProductRelease,EAPXPRelease[] -[source,options="nowrap"] ----- -$ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ -"wildfly" has been added to your repositories -$ helm search repo wildfly -NAME CHART VERSION APP VERSION DESCRIPTION -wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift -wildfly/wildfly-common ... ... A library chart for WildFly-based applications ----- -endif::[] -ifdef::ProductRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP {productVersion} applications ----- -endif::[] -ifdef::EAPXPRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP XP {productVersion} applications ----- -endif::[] - -:leveloffset: 1 -//Prepare Helm for Quickstart Deployment -:leveloffset: +1 - -[[deploy_helm]] -== Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -Log in to your OpenShift instance using the `oc login` command. -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -Navigate to the root directory of this quickstart and run the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm install {artifactId} -f charts/helm.yaml {helmChartName} -NAME: {artifactId} -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17: - -[source,options="nowrap",subs="+attributes"] ----- -build: - uri: {githubRepoCodeUrl} - ref: {WildFlyQuickStartRepoTag} - contextDir: {artifactId} -deploy: - replicas: 1 ----- - -This will create a new deployment on OpenShift and deploy the application. - -If you want to see all the configuration elements to customize your deployment you can use the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let’s wait for the application to be built and deployed: -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment {artifactId} -w -NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE -{artifactId} 1 1 1 0 12s -... -{artifactId} 1 1 1 1 2m ----- - -Get the URL of the route to the deployment. - -[source,options="nowrap",subs="+attributes"] ----- -$ oc get route {artifactId} -o jsonpath="{.spec.host}" ----- -Access the application in your web browser using the displayed URL. - -[NOTE] -==== -The Maven profile named `openshift` is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the `/{artifactId}` path segment after `HOST:PORT`. -==== - -[[undeploy_helm]] -== Undeploy the {ProductShortName} Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts - - -[source,options="nowrap",subs="+attributes"] ----- -$ helm uninstall {artifactId} ----- - -:leveloffset: 1 -// Testing on Openshift -:leveloffset: +1 - -[[run_the_arquillian_integration_tests_with_openshift]] -= Run the Arquillian Integration Tests with OpenShift -//****************************************************************************** -// Include this template if your quickstart provides Openshift Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -[NOTE] -==== -The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin. -==== - -Run the integration tests using the following command to run the `verify` goal with the `arq-remote` profile activated and the proper URL: -[source,options="nowrap",subs="+attributes"] ----- -$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route {artifactId} --template='{{ .spec.host }}') ----- - -[NOTE] -==== -The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from. -==== - -:leveloffset: 1 - -:leveloffset!: diff --git a/servlet-security/README.html b/servlet-security/README.html deleted file mode 100644 index 914152360f..0000000000 --- a/servlet-security/README.html +++ /dev/null @@ -1,1211 +0,0 @@ - - - - - - - - -servlet-security: Using Jakarta EE Declarative Security to Control Servlet Access - - - - - -
-
-
-
-
-The servlet-security quickstart demonstrates the use of Jakarta EE declarative security to control access to Servlets and Security in JBoss EAP. -
-
-
-
-
-

What is it?

-
-
-

The servlet-security quickstart demonstrates the use of Jakarta EE declarative security to control access to Servlets and Security in Red Hat JBoss Enterprise Application Platform.

-
-
-

When you deploy this example, two users are automatically created for you: user quickstartUser with password quickstartPwd1! and user guest with password guestPwd1!. This data is located in the src/main/resources/import.sql file.

-
-
-

This quickstart takes the following steps to implement Servlet security:

-
-
-
    -
  1. -

    Web Application:

    -
    -
      -
    • -

      Adds a security constraint to the Servlet using the @ServletSecurity and @HttpConstraint annotations.

      -
    • -
    • -

      Adds a security domain reference to WEB-INF/jboss-web.xml.

      -
    • -
    • -

      Adds a login-config that sets the auth-method to BASIC in the WEB-INF/web.xml.

      -
    • -
    -
    -
  2. -
  3. -

    Application Server (standalone.xml):

    -
    -
      -
    • -

      Defines a security domain in the elytron subsystem that uses the JDBC security realm to obtain the security data used to authenticate and authorize users.

      -
    • -
    • -

      Adds an application-security-domain mapping in the undertow subsystem to map the Servlet security domain to the security domain defined in step 1.

      -
    • -
    -
    -
  4. -
  5. -

    Database Configuration:

    -
    -
      -
    • -

      Adds an application user with access rights to the application.

      -
      -
      -
      User Name: quickstartUser
      -Password: quickstartPwd1!
      -Role: quickstarts
      -
      -
      -
    • -
    • -

      Adds another user with no access rights to the application.

      -
      -
      -
      User Name: guest
      -Password: guestPwd1!
      -Role: notauthorized
      -
      -
      -
    • -
    -
    -
  6. -
-
-
-
-
-

Considerations for Use in a Production Environment

-
-
-
-
H2 Database
-
-

This quickstart uses the H2 database included with Red Hat JBoss Enterprise Application Platform 8.0. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment.

-
-
-
-
-
-
-

System Requirements

-
-
-

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 8.0 or later.

-
-
-

All you need to build this project is Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later. See Configure Maven to Build and Deploy the Quickstarts to make sure you are configured correctly for testing the quickstarts.

-
-
-
-
-

Use of the EAP_HOME and QUICKSTART_HOME Variables

-
-
-

In the following instructions, replace EAP_HOME with the actual path to your JBoss EAP installation. The installation path is described in detail here: Use of EAP_HOME and JBOSS_HOME Variables.

-
-
-

When you see the replaceable variable QUICKSTART_HOME, replace it with the path to the root directory of all of the quickstarts.

-
-
-
-
-

Building and running the quickstart application with a JBoss EAP server distribution

-
-
-

Back Up the JBoss EAP Standalone Server Configuration

-
-

Before you begin, back up your server configuration file.

-
-
-
    -
  1. -

    If it is running, stop the JBoss EAP server.

    -
  2. -
  3. -

    Back up the EAP_HOME/standalone/configuration/standalone.xml file.

    -
  4. -
-
-
-

After you have completed testing this quickstart, you can replace this file to restore the server to its original configuration.

-
-
-
-

Start the JBoss EAP Standalone Server

-
-
    -
  1. -

    Open a terminal and navigate to the root of the JBoss EAP directory.

    -
  2. -
  3. -

    Start the JBoss EAP server with the default profile by typing the following command.

    -
    -
    -
    $ EAP_HOME/bin/standalone.sh 
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\standalone.bat script. -
    -
    -
  4. -
-
-
-
-

Configure the Server

-
-

You can configure the server by running JBoss CLI commands. For your convenience, this quickstart batches the commands into a configure-server.cli script provided in the root directory of this quickstart.

-
-
-
    -
  1. -

    Before you begin, make sure you do the following:

    - -
  2. -
  3. -

    Review the configure-server.cli file in the root of this quickstart directory. This script adds security domain and HTTP authentication factory to the elytron subsystem in the server configuration and also configures the undertow subsystem to use the configured HTTP authentication factory for the Web application.

    -
  4. -
  5. -

    Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing EAP_HOME with the path to your server:

    -
    -
    -
    $ EAP_HOME/bin/jboss-cli.sh --connect --file=configure-server.cli
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\jboss-cli.bat script. -
    -
    -
    -

    You should see the following result when you run the script:

    -
    -
    -
    -
    The batch executed successfully
    -
    -
    -
  6. -
  7. -

    Stop the JBoss EAP server.

    -
  8. -
-
-
-
-

Review the Modified Server Configuration

-
-

After stopping the server, open the EAP_HOME/standalone/configuration/standalone.xml file and review the changes.

-
-
-
    -
  1. -

    The following datasource was added to the datasources subsystem.

    -
    -
    -
    <datasource jndi-name="java:jboss/datasources/ServletSecurityDS" pool-name="ServletSecurityDS">
    -    <connection-url>jdbc:h2:mem:servlet-security;DB_CLOSE_ON_EXIT=FALSE</connection-url>
    -    <driver>h2</driver>
    -    <security>
    -        <user-name>sa</user-name>
    -        <password>sa</password>
    -    </security>
    -</datasource>
    -
    -
    -
  2. -
  3. -

    The following security-realm was added to the elytron subsystem.

    -
    -
    -
    <jdbc-realm name="servlet-security-jdbc-realm">
    -    <principal-query sql="SELECT PASSWORD FROM USERS WHERE USERNAME = ?" data-source="ServletSecurityDS">
    -        <clear-password-mapper password-index="1"/>
    -    </principal-query>
    -    <principal-query sql="SELECT R.NAME, 'Roles' FROM USERS_ROLES UR INNER JOIN ROLES R ON R.ID = UR.ROLE_ID INNER JOIN USERS U ON U.ID = UR.USER_ID WHERE U.USERNAME = ?" data-source="ServletSecurityDS">
    -        <attribute-mapping>
    -            <attribute to="roles" index="1"/>
    -        </attribute-mapping>
    -    </principal-query>
    -</jdbc-realm>
    -
    -
    -
    -

    The security-realm is responsible for verifying the credentials for a given principal and for obtaining security attributes (like roles) that are associated with the authenticated identity.

    -
    -
  4. -
  5. -

    The jdbc-realm in this quickstart stores the roles associated with a principal in an attribute named Roles.

    -
    -

    Other realms might use different attributes for roles (such as group). -If an attribute name other than "Roles" is used to store the roles, a role-decoder can be configured as follows:

    -
    -
    -
    -
    /subsystem=elytron/simple-role-decoder=from-roles-attribute:add(attribute=ATTRIBUTE_NAME)
    -
    -
    -
    -

    The command to create a security-domain could then be updated to reference this role-decoder:

    -
    -
    -
    -
    /subsystem=elytron/security-domain=servlet-security-quickstart-sd:add(default-realm=servlet-security-jdbc-realm, realms=[{realm=servlet-security-jdbc-realm, role-decoder=from-roles-attribute}], permission-mapper=default-permission-mapper)
    -
    -
    -
    -

    The purpose of a role-decoder is to instruct the security domain how roles are to be retrieved from an authorized identity.

    -
    -
  6. -
  7. -

    The following security-domain was added to the elytron subsystem.

    -
    -
    -
    <security-domain name="servlet-security-quickstart-sd" default-realm="servlet-security-jdbc-realm" permission-mapper="default-permission-mapper">
    -    <realm name="servlet-security-jdbc-realm"/>
    -</security-domain>
    -
    -
    -
  8. -
  9. -

    The following application-security-domain was added to the undertow subsystem.

    -
    -
    -
    <application-security-domains>
    -    <application-security-domain name="servlet-security-quickstart" security-domain="servlet-security-quickstart-sd"/>
    -</application-security-domains>
    -
    -
    -
  10. -
-
-
-

This configuration tells Undertow that applications with the servlet-security-quickstart security domain, as defined in the jboss-web.xml or by using the @SecurityDomain annotation in the Servlet class, should use the security-domain named servlet-security-quickstart-sd.

-
-
-
-

Build and Deploy the Quickstart

-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type the following command to build the quickstart.

    -
    -
    -
    $ mvn clean package
    -
    -
    -
  6. -
  7. -

    Type the following command to deploy the quickstart.

    -
    -
    -
    $ mvn wildfly:deploy
    -
    -
    -
  8. -
-
-
-

This deploys the servlet-security/target/servlet-security.war to the running instance of the server.

-
-
-

You should see a message in the server log indicating that the archive deployed successfully.

-
-
-
-

Access the Application

-
-

The application will be running at the following URL http://localhost:8080/servlet-security/.

-
-
-

When you access the application, you should get a browser login challenge.

-
-
-

Log in using the username quickstartUser and password quickstartPwd1!. The browser will display the following security info:

-
-
-
-
Successfully called Secured Servlet
-
-Principal : quickstartUser
-Remote User : quickstartUser
-Authentication Type : BASIC
-
-
-
-

Now close the browser. Open a new browser and log in with username guest and password guestPwd1!. The browser will display the following error:

-
-
-
-
Forbidden
-
-
-
-
-

Run the Arquillian Integration Tests

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
-

Follow these steps to run the integration tests.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server, as previously described.

    -
  2. -
  3. -

    Make sure you build and deploy the quickstart, as previously described.

    -
  4. -
  5. -

    Type the following command to run the verify goal with the arq-remote profile activated.

    -
    -
    -
    $ mvn verify -Parq-remote
    -
    -
    -
  6. -
-
-
- - - - - -
-
Note
-
-
-

You may also use the environment variable SERVER_HOST or the system property server.host to define the target host of the tests.

-
-
-
-
-
-

Undeploy the Quickstart

-
-

When you are finished testing the quickstart, follow these steps to undeploy the archive.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type this command to undeploy the archive:

    -
    -
    -
    $ mvn wildfly:undeploy
    -
    -
    -
  6. -
-
-
-
-

Restore the JBoss EAP Standalone Server Configuration

-
-

You can restore the original server configuration using either of the following methods.

-
-
- -
-
-

Restore the JBoss EAP Standalone Server Configuration by Running the JBoss CLI Script

-
-
    -
  1. -

    Start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing EAP_HOME with the path to your server:

    -
    -
    -
    $ EAP_HOME/bin/jboss-cli.sh --connect --file=restore-configuration.cli
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\jboss-cli.bat script. -
    -
    -
  4. -
-
-
-

This script removes the application-security-domain configuration from the undertow subsystem, the http-authentication-factory, security-domain, security-realm and role-decoder configuration from the elytron subsystem and it also removes the datasource used for this quickstart. You should see the following result when you run the script:

-
-
-
-
The batch executed successfully
-process-state: reload-required
-
-
-
-
-

Restore the JBoss EAP Standalone Server Configuration Manually

-
-

When you have completed testing the quickstart, you can restore the original server configuration by manually restoring the backup copy the configuration file.

-
-
-
    -
  1. -

    If it is running, stop the JBoss EAP server.

    -
  2. -
  3. -

    Replace the EAP_HOME/standalone/configuration/standalone.xml file with the backup copy of the file.

    -
  4. -
-
-
-
-
-
-
-

Building and running the quickstart application with OpenShift

-
-
-

Build the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

On OpenShift, the S2I build with Apache Maven will use an openshift profile used to provision a JBoss EAP server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named openshift when building the quickstart:

-
-
-
-
$ mvn clean package -Popenshift
-
-
-
-

The provisioned JBoss EAP server for OpenShift, with the quickstart deployed, can then be found in the target/server directory, and its usage is similar to a standard server distribution. -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.

-
-
-

The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart pom.xml:

-
-
-
-
        <profile>
-            <id>openshift</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.jboss.eap.plugins</groupId>
-                        <artifactId>eap-maven-plugin</artifactId>
-                        <version>${version.eap.maven.plugin}</version>
-                        <configuration>
-                            <feature-packs>
-                                <feature-pack>
-                                    <location>org.jboss.eap:wildfly-ee-galleon-pack</location>
-                                </feature-pack>
-                                <feature-pack>
-                                    <location>org.jboss.eap.cloud:eap-cloud-galleon-pack</location>
-                                </feature-pack>
-                            </feature-packs>
-                            <layers>
-                                <layer>cloud-server</layer>
-                            </layers>
-                            <filename>ROOT.war</filename>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>package</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-
-
-
- - - - - -
-
Note
-
-
-

Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the /servlet-security path segment after HOST:PORT.

-
-
-
-
-
-

Getting Started with JBoss EAP for OpenShift and Helm Charts

-
-

This section contains the basic instructions to build and deploy this quickstart to JBoss EAP for OpenShift or JBoss EAP for OpenShift Online using Helm Charts.

-
-
-

Prerequisites

-
-
    -
  • -

    You must be logged in OpenShift and have an oc client to connect to OpenShift

    -
  • -
  • -

    Helm must be installed to deploy the backend on OpenShift.

    -
  • -
-
-
-

Once you have installed Helm, you need to add the repository that provides Helm Charts for JBoss EAP.

-
-
-
-
$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/
-"jboss-eap" has been added to your repositories
-$ helm search repo jboss-eap
-NAME                    CHART VERSION   APP VERSION     DESCRIPTION
-jboss-eap/eap8         ...             ...             A Helm chart to build and deploy EAP 8.0 applications
-
-
-
-
-

Deploy the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

Log in to your OpenShift instance using the oc login command. -The backend will be built and deployed on OpenShift with a Helm Chart for JBoss EAP.

-
-
-

Navigate to the root directory of this quickstart and run the following command:

-
-
-
-
$ helm install servlet-security -f charts/helm.yaml jboss-eap/eap8
-NAME: servlet-security
-...
-STATUS: deployed
-REVISION: 1
-
-
-
-

The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17:

-
-
-
-
build:
-  uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git
-  ref: 8.0.x
-  contextDir: servlet-security
-deploy:
-  replicas: 1
-
-
-
-

This will create a new deployment on OpenShift and deploy the application.

-
-
-

If you want to see all the configuration elements to customize your deployment you can use the following command:

-
-
-
-
$ helm show readme jboss-eap/eap8
-
-
-
-

Let’s wait for the application to be built and deployed:

-
-
-
-
$ oc get deployment servlet-security -w
-NAME         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
-servlet-security   1         1         1            0           12s
-...
-servlet-security   1         1         1            1           2m
-
-
-
-

Get the URL of the route to the deployment.

-
-
-
-
$ oc get route servlet-security -o jsonpath="{.spec.host}"
-
-
-
-

Access the application in your web browser using the displayed URL.

-
-
- - - - - -
-
Note
-
-
-

The Maven profile named openshift is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the /servlet-security path segment after HOST:PORT.

-
-
-
-
-
-

Undeploy the JBoss EAP Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts

-
-
-
$ helm uninstall servlet-security
-
-
-
-
-
-

Run the Arquillian Integration Tests with OpenShift

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
- - - - - -
-
Note
-
-
-

The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin.

-
-
-
-
-

Run the integration tests using the following command to run the verify goal with the arq-remote profile activated and the proper URL:

-
-
-
-
$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route servlet-security --template='{{ .spec.host }}')
-
-
-
- - - - - -
-
Note
-
-
-

The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from.

-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/servlet-security/charts/helm.yaml b/servlet-security/charts/helm.yaml deleted file mode 100644 index 07a36225f1..0000000000 --- a/servlet-security/charts/helm.yaml +++ /dev/null @@ -1,6 +0,0 @@ -build: - uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git - ref: 8.0.x - contextDir: servlet-security -deploy: - replicas: 1 diff --git a/servlet-security/configure-server.cli b/servlet-security/configure-server.cli deleted file mode 100644 index 95ceea1bf3..0000000000 --- a/servlet-security/configure-server.cli +++ /dev/null @@ -1,23 +0,0 @@ -# Batch script to configure the security domain and define the database query used to authenticate users -batch - - -# Start by creating the JDBC datasource -/subsystem=datasources/data-source=ServletSecurityDS:add(connection-url="jdbc:h2:mem:servlet-security;DB_CLOSE_ON_EXIT=FALSE", jndi-name="java:jboss/datasources/ServletSecurityDS", driver-name=h2, user-name="sa", password="sa") - -# Add the JDBC security realm creation -/subsystem=elytron/jdbc-realm=servlet-security-jdbc-realm:add(principal-query=[{sql="SELECT PASSWORD FROM USERS WHERE USERNAME = ?", data-source="ServletSecurityDS", clear-password-mapper={password-index=1}},{sql="SELECT R.NAME, 'Roles' FROM USERS_ROLES UR INNER JOIN ROLES R ON R.ID = UR.ROLE_ID INNER JOIN USERS U ON U.ID = UR.USER_ID WHERE U.USERNAME = ?", data-source="ServletSecurityDS", attribute-mapping=[{index=1, to=Roles}]}]) - -# Configure the servlet-security-quickstart security domain -/subsystem=elytron/security-domain=servlet-security-quickstart-sd:add(default-realm=servlet-security-jdbc-realm, realms=[{realm=servlet-security-jdbc-realm}], permission-mapper=default-permission-mapper) - -# Configure Undertow's application security domain -/subsystem=undertow/application-security-domain=servlet-security-quickstart:add(security-domain=servlet-security-quickstart-sd) - -# Run the batch commands -run-batch - -# Reload the server configuration -#reload - - diff --git a/servlet-security/pom.xml b/servlet-security/pom.xml deleted file mode 100644 index d07873986d..0000000000 --- a/servlet-security/pom.xml +++ /dev/null @@ -1,259 +0,0 @@ - - - - 4.0.0 - - org.jboss.eap.quickstarts - jboss-eap-quickstart-parent - - 6.0.0.redhat-00001 - - - - servlet-security - 8.0.0.GA - war - Quickstart: servlet-security - This project demonstrates servlet security in JBoss EAP - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - 8.0.0.GA-redhat-00009 - 1.0.0.Final-redhat-00014 - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - never - - default - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - never - - - true - never - - default - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - - - true - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - - - true - - - - - - - - - org.jboss.bom - jboss-eap-ee-with-tools - ${version.server.bom} - pom - import - - - - - - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - - - jakarta.annotation - jakarta.annotation-api - provided - - - - - jakarta.servlet - jakarta.servlet-api - provided - - - - jakarta.persistence - jakarta.persistence-api - provided - - - - - junit - junit - test - - - - - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet-jakarta - test - - - - - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - - org.jboss.eap.channels - eap-8.0 - - - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - org.jboss.eap:eap-datasources-galleon-pack - - - - cloud-server - h2-datasource - - ROOT.war - - - - - - - false - - - - - - - package - - - - - - - - - arq-remote - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} - - - **/RemoteSecureIT - - - **/ProvisionedManagedSecureIT - - - - - - integration-test - verify - - - - - - - - - diff --git a/servlet-security/restore-configuration.cli b/servlet-security/restore-configuration.cli deleted file mode 100644 index 860d151489..0000000000 --- a/servlet-security/restore-configuration.cli +++ /dev/null @@ -1,27 +0,0 @@ -# Batch script to remove the servlet-security-quickstart domain from the server configuration file - -# Start batching commands -batch - -# Remove Undertow's application security domain -/subsystem=undertow/application-security-domain=servlet-security-quickstart:remove() - -# Remove the servlet-security-quickstart security domain -/subsystem=elytron/security-domain=servlet-security-quickstart-sd:remove() - -# Remove the JDBC security realm creation -/subsystem=elytron/jdbc-realm=servlet-security-jdbc-realm:remove() - -# Remove the JDBC datasource -/subsystem=datasources/data-source=ServletSecurityDS:remove() - -# The README file contains instructions to undeploy the application. -# If you prefer, you can uncomment the following to undeploy the application using this script. -# undeploy jboss-servlet-security.war - -# Run the batch commands -run-batch - -# Reload the server configuration -reload - diff --git a/servlet-security/src/main/java/org/jboss/as/quickstarts/servlet_security/DummyEntity.java b/servlet-security/src/main/java/org/jboss/as/quickstarts/servlet_security/DummyEntity.java deleted file mode 100644 index 2d7ff2dfc5..0000000000 --- a/servlet-security/src/main/java/org/jboss/as/quickstarts/servlet_security/DummyEntity.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2022, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.servlet_security; - -import java.io.Serializable; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; - -@SuppressWarnings("serial") -@Entity -// This class should be removed once https://issues.redhat.com/browse/WFLY-16871 is resolved -public class DummyEntity implements Serializable { - - @Id - @GeneratedValue - private Long id; -} diff --git a/servlet-security/src/main/java/org/jboss/as/quickstarts/servlet_security/SecuredServlet.java b/servlet-security/src/main/java/org/jboss/as/quickstarts/servlet_security/SecuredServlet.java deleted file mode 100644 index 9ca07b46ba..0000000000 --- a/servlet-security/src/main/java/org/jboss/as/quickstarts/servlet_security/SecuredServlet.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.servlet_security; - -import java.io.IOException; -import java.io.PrintWriter; -import java.security.Principal; - -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.HttpConstraint; -import jakarta.servlet.annotation.ServletSecurity; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -/** - * A simple secured Servlet. Upon successful authentication and authorization the Servlet will print details of the user and - * authentication. Servlet security is implemented using annotations. - * - * @author Sherif Makary - * - */ -@SuppressWarnings("serial") -@WebServlet("/SecuredServlet") -@ServletSecurity(@HttpConstraint(rolesAllowed = { "quickstarts" })) -public class SecuredServlet extends HttpServlet { - - private static String PAGE_HEADER = "servlet-security"; - - private static String PAGE_FOOTER = ""; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - PrintWriter writer = resp.getWriter(); - // Get security principal - Principal principal = req.getUserPrincipal(); - // Get user name from login principal - String remoteUser = req.getRemoteUser(); - // Get authentication type - String authType = req.getAuthType(); - - writer.println(PAGE_HEADER); - writer.println("

" + "Successfully called Secured Servlet " + "

"); - writer.println("

" + "Principal : " + principal.getName() + "

"); - writer.println("

" + "Remote User : " + remoteUser + "

"); - writer.println("

" + "Authentication Type : " + authType + "

"); - writer.println(PAGE_FOOTER); - writer.close(); - } - -} diff --git a/servlet-security/src/main/resources/META-INF/persistence.xml b/servlet-security/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index 548be6c5f4..0000000000 --- a/servlet-security/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - java:jboss/datasources/ServletSecurityDS - - - - - - - diff --git a/servlet-security/src/main/resources/import.sql b/servlet-security/src/main/resources/import.sql deleted file mode 100644 index 815550dc78..0000000000 --- a/servlet-security/src/main/resources/import.sql +++ /dev/null @@ -1,29 +0,0 @@ --- --- JBoss, Home of Professional Open Source --- Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual --- contributors by the @authors tag. See the copyright.txt in the --- distribution for a full listing of individual contributors. --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- http://www.apache.org/licenses/LICENSE-2.0 --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- - -CREATE TABLE USERS (ID INT, USERNAME VARCHAR(20), PASSWORD VARCHAR(20)); -CREATE TABLE ROLES (ID INT, NAME VARCHAR(20)); -CREATE TABLE USERS_ROLES (USER_ID INT, ROLE_ID INT); - -INSERT INTO USERS (ID, USERNAME, PASSWORD) VALUES (1, 'quickstartUser', 'quickstartPwd1!'); -INSERT INTO USERS (ID, USERNAME, PASSWORD) VALUES (2, 'guest', 'guestPwd1!'); - -INSERT INTO ROLES (ID, NAME) VALUES (1, 'quickstarts'); -INSERT INTO ROLES (ID, NAME) VALUES (2, 'guest'); - -INSERT INTO USERS_ROLES (USER_ID, ROLE_ID) VALUES (1,1); -INSERT INTO USERS_ROLES (USER_ID, ROLE_ID) VALUES (2,2); diff --git a/servlet-security/src/main/webapp/WEB-INF/beans.xml b/servlet-security/src/main/webapp/WEB-INF/beans.xml deleted file mode 100644 index d3ddf148e7..0000000000 --- a/servlet-security/src/main/webapp/WEB-INF/beans.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/servlet-security/src/main/webapp/WEB-INF/jboss-web.xml b/servlet-security/src/main/webapp/WEB-INF/jboss-web.xml deleted file mode 100644 index 8b52eaf9d5..0000000000 --- a/servlet-security/src/main/webapp/WEB-INF/jboss-web.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - servlet-security-quickstart - true - diff --git a/servlet-security/src/main/webapp/WEB-INF/web.xml b/servlet-security/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 0aa0d49031..0000000000 --- a/servlet-security/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - BASIC - RealmUsersRoles - - - diff --git a/servlet-security/src/main/webapp/index.html b/servlet-security/src/main/webapp/index.html deleted file mode 100644 index 4206889a5d..0000000000 --- a/servlet-security/src/main/webapp/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - diff --git a/servlet-security/src/test/java/org/jboss/as/quickstarts/servlet_security/ProvisionedManagedSecureIT.java b/servlet-security/src/test/java/org/jboss/as/quickstarts/servlet_security/ProvisionedManagedSecureIT.java deleted file mode 100644 index ba24ab246c..0000000000 --- a/servlet-security/src/test/java/org/jboss/as/quickstarts/servlet_security/ProvisionedManagedSecureIT.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 Red Hat, Inc. - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jboss.as.quickstarts.servlet_security; - -import java.net.URI; -import java.net.URISyntaxException; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.junit.runner.RunWith; - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -@RunWith(Arquillian.class) -@RunAsClient -public class ProvisionedManagedSecureIT extends RemoteSecureIT { - - @Override - protected URI getHTTPEndpoint() { - String host = getServerHost(); - if (host == null) { - host = "http://localhost:8080"; - } - try { - return new URI(host + "/SecuredServlet"); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } -} diff --git a/servlet-security/src/test/java/org/jboss/as/quickstarts/servlet_security/RemoteSecureIT.java b/servlet-security/src/test/java/org/jboss/as/quickstarts/servlet_security/RemoteSecureIT.java deleted file mode 100644 index ddd7426592..0000000000 --- a/servlet-security/src/test/java/org/jboss/as/quickstarts/servlet_security/RemoteSecureIT.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2022 Red Hat, Inc. - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jboss.as.quickstarts.servlet_security; - -import java.io.IOException; -import java.net.Authenticator; -import java.net.PasswordAuthentication; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import org.junit.Assert; -import org.junit.Test; - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ - -public class RemoteSecureIT { - - protected URI getHTTPEndpoint() { - String host = getServerHost(); - if (host == null) { - host = "http://localhost:8080/servlet-security"; - } - try { - return new URI(host + "/SecuredServlet"); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } - - protected static String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host"); - } - return host; - } - - @Test - public void testConnectOk() throws IOException, InterruptedException { - HttpRequest request = HttpRequest.newBuilder(getHTTPEndpoint()) - .GET() - .build(); - HttpClient client = HttpClient.newBuilder().authenticator(new Authenticator() { - @Override - protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication("quickstartUser", "quickstartPwd1!".toCharArray()); - } - }).build(); - HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); - Assert.assertEquals(200, response.statusCode()); - String[] lines = response.body().toString().split(System.lineSeparator()); - Assert.assertEquals("

Successfully called Secured Servlet

", lines[1].trim()); - Assert.assertEquals("

Principal : quickstartUser

", lines[2].trim()); - Assert.assertEquals("

Remote User : quickstartUser

", lines[3].trim()); - Assert.assertEquals("

Authentication Type : BASIC

", lines[4].trim()); - } - - @Test - public void testConnectNotOk() throws IOException, InterruptedException { - HttpRequest request = HttpRequest.newBuilder(getHTTPEndpoint()) - .GET() - .build(); - HttpClient client = HttpClient.newBuilder().authenticator(new Authenticator() { - @Override - protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication("guest", "guestPwd1!".toCharArray()); - } - }).build(); - HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); - Assert.assertEquals(403, response.statusCode()); - } -} diff --git a/shared-doc/add-application-and-management-users.adoc b/shared-doc/add-application-and-management-users.adoc deleted file mode 100644 index e99c11d6f0..0000000000 --- a/shared-doc/add-application-and-management-users.adoc +++ /dev/null @@ -1,49 +0,0 @@ -[[add_the_application_management_users]] -= Add the Authorized Application and Management Users - -// Note: The group ID syntax must be defined in the calling topic. -// using the document attribute :app-user-groups: -// Use a comma-delimited list to define more than one group. -// -// :app-user-groups: guest, users -// :admin-user-groups: admin, superusers - -ifdef::app-user-groups[] -:app-group-list: {app-user-groups} -:app-group-command: -g '{app-user-groups}' -endif::app-user-groups[] - -ifndef::app-user-groups[] -:app-group-list: -:app-group-command: -endif::app-user-groups[] - -ifdef::admin-user-groups[] -:admin-group-list: {admin-user-groups} -:admin-group-command: -g '{admin-user-groups}' -endif::admin-user-groups[] - -ifndef::admin-user-groups[] -:admin-group-list: -:admin-group-command: -endif::admin-user-groups[] -This quickstart uses secured management interfaces and requires that you create the following application user to access the running application. - -[cols="20%,20%,20%,40%",options="headers"] -|=== -|UserName |Realm |Password |Roles - -|quickstartUser |ApplicationRealm |quickstartPwd1! |{app-group-list} -|quickstartAdmin | ManagementRealm | adminPwd1! | {admin-group-list} -|=== - -To add the application user, open a terminal and type the following command: -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/add-user.sh -a -u 'quickstartUser' -p 'quickstartPwd1!' {app-group-command} -$ __{jbossHomeName}__/bin/add-user.sh -a -u 'quickstartAdmin' -p 'adminPwd1!' {admin-group-command} ----- -NOTE: For Windows, use the `__{jbossHomeName}__\bin\add-user.bat` script. - -If you prefer, you can use the `add-user` utility interactively. -For an example of how to use the add-user utility, see the instructions located here: link:{addApplicationUserDocUrl}[Add an Application User]. diff --git a/shared-doc/add-application-user.adoc b/shared-doc/add-application-user.adoc deleted file mode 100644 index 87988ab46f..0000000000 --- a/shared-doc/add-application-user.adoc +++ /dev/null @@ -1,37 +0,0 @@ -[[add_the_application_user]] -= Add the Authorized Application User - -// Note: The group ID syntax must be defined in the calling topic. -// using the document attribute :app-user-groups: -// Use a comma-delimited list to define more than one group. -// -// :app-user-groups: guest, users - -ifdef::app-user-groups[] -:app-group-list: {app-user-groups} -:app-group-command: -g '{app-user-groups}' -endif::app-user-groups[] - -ifndef::app-user-groups[] -:app-group-list: -:app-group-command: -endif::app-user-groups[] - -This quickstart uses secured application interfaces and requires that you create the following application user to access the running application. - -[cols="20%,20%,20%,40%",options="headers"] -|=== -|UserName |Realm |Password |Roles - -|quickstartUser |ApplicationRealm |quickstartPwd1! |{app-group-list} -|=== - -To add the application user, open a terminal and type the following command: -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/add-user.sh -a -u 'quickstartUser' -p 'quickstartPwd1!' {app-group-command} ----- -NOTE: For Windows, use the `__{jbossHomeName}__\bin\add-user.bat` script. - -If you prefer, you can use the `add-user` utility interactively. -For an example of how to use the add-user utility, see the instructions located here: link:{addApplicationUserDocUrl}[Add an Application User]. diff --git a/shared-doc/attributes.adoc b/shared-doc/attributes.adoc deleted file mode 100644 index a941aba236..0000000000 --- a/shared-doc/attributes.adoc +++ /dev/null @@ -1,194 +0,0 @@ -//*********************************************************************************** -// Enable the following flag to build README.html files for JBoss EAP product builds. -// Comment it out for WildFly builds. -//*********************************************************************************** -:ProductRelease: - -//*********************************************************************************** -// Enable the following flag to build README.html files for EAP XP product builds. -// Comment it out for WildFly or JBoss EAP product builds. -//*********************************************************************************** -//:EAPXPRelease: - -// This is a universal name for all releases -:ProductShortName: JBoss EAP -// Product names and links are dependent on whether it is a product release (CD or JBoss) -// or the WildFly project. -// The "DocInfo*" attributes are used to build the book links to the product documentation - -ifdef::ProductRelease[] -// JBoss EAP release -:productName: JBoss EAP -:productNameFull: Red Hat JBoss Enterprise Application Platform -:productVersion: 8.0 -:DocInfoProductNumber: {productVersion} -:WildFlyQuickStartRepoTag: 8.0.x -:productImageVersion: 8.0.0 -:helmChartName: jboss-eap/eap8 -endif::[] - -ifdef::EAPXPRelease[] -// JBoss EAP XP release -:productName: JBoss EAP XP -:productNameFull: Red Hat JBoss Enterprise Application Platform expansion pack -:productVersion: 3.0 -:DocInfoProductNumber: 7.4 -:WildFlyQuickStartRepoTag: XP_3.0.0.GA -:productImageVersion: 3.0 -:helmChartName: jboss-eap/eap-xp3 -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -:githubRepoUrl: https://github.com/jboss-developer/jboss-eap-quickstarts/ -:githubRepoCodeUrl: https://github.com/jboss-developer/jboss-eap-quickstarts.git -:jbossHomeName: EAP_HOME -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:quickstartDownloadName: {productNameFull} {productVersion} Quickstarts -:quickstartDownloadUrl: https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=appplatform&downloadType=distributions -:helmRepoName: jboss-eap -:helmRepoUrl: https://jbossas.github.io/eap-charts/ -// END ifdef::ProductRelease,EAPXPRelease[] -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -// WildFly project -:productName: WildFly -:productNameFull: WildFly Application Server -:ProductShortName: {productName} -:jbossHomeName: WILDFLY_HOME -:productVersion: 28 -:productImageVersion: 28.0 -:githubRepoUrl: https://github.com/wildfly/quickstart/ -:githubRepoCodeUrl: https://github.com/wildfly/quickstart.git -:WildFlyQuickStartRepoTag: 28.0.1.Final -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -// Do not update the following until after the 7.4 docs are published! -:DocInfoProductNumber: 7.4 -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:helmRepoName: wildfly -:helmRepoUrl: http://docs.wildfly.org/wildfly-charts/ -:helmChartName: wildfly/wildfly -// END ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -endif::[] - -:source: {githubRepoUrl} - -// Values for Openshift S2i sections attributes -:CDProductName: {productNameFull} for OpenShift -:CDProductShortName: {ProductShortName} for OpenShift -:CDProductTitle: {CDProductName} -:CDProductNameSentence: Openshift release for {ProductShortName} -:CDProductAcronym: {CDProductShortName} -:CDProductVersion: {productVersion} -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {EapForOpenshiftBookName} Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {xpaasproduct} Online -:xpaasproduct-shortname: {CDProductShortName} -:xpaasproductOpenShiftOnline-shortname: {xpaasproduct-shortname} Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: Getting Started with {ProductShortName} for OpenShift Container Platform -:EapForOpenshiftOnlineBookName: Getting Started with {ProductShortName} for OpenShift Online -:OpenShiftOnlinePlatformName: Red Hat OpenShift Container Platform -:OpenShiftOnlineName: Red Hat OpenShift Online -:ImagePrefixVersion: eap80 -:ImageandTemplateImportBaseURL: https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift - -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepo: https://github.com/jboss-developer/jboss-eap-quickstarts -:EAPQuickStartRepoRef: 8.0.x -:EAPQuickStartRepoTag: EAP_8.0.0.GA -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_container_platform/ -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_online/ - -ifdef::EAPXPRelease[] -// Attributes for XP releases -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {productNameFull} for OpenShift Online -:xpaasproduct-shortname: {ProductShortName} for OpenShift -:xpaasproductOpenShiftOnline-shortname: {ProductShortName} for OpenShift Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:ImagePrefixVersion: eap-xp3 -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepoRef: xp-3.0.x -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -endif::[] - -ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -:ImageandTemplateImportURL: https://raw.githubusercontent.com/wildfly/wildfly-s2i/v{productVersion}.0/ -endif::[] - -//************************* -// Other values -//************************* -:buildRequirements: Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later -:jbdsEapServerName: Red Hat JBoss Enterprise Application Platform 7.3 -:javaVersion: Jakarta EE 10 -ifdef::EAPXPRelease[] -:javaVersion: Eclipse MicroProfile -endif::[] -:githubRepoBranch: master -:guidesBaseUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/ -:useEclipseUrl: {guidesBaseUrl}USE_JBDS.adoc#use_red_hat_jboss_developer_studio_or_eclipse_to_run_the_quickstarts -:useEclipseDeployJavaClientDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_containing_server_and_java_client_projects -:useEclipseDeployEARDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_ear_project -:useProductHomeDocUrl: {guidesBaseUrl}USE_OF_{jbossHomeName}.adoc#use_of_product_home_and_jboss_home_variables -:configureMavenDocUrl: {guidesBaseUrl}CONFIGURE_MAVEN_JBOSS_EAP.adoc#configure_maven_to_build_and_deploy_the_quickstarts -:arquillianTestsDocUrl: {guidesBaseUrl}RUN_ARQUILLIAN_TESTS.adoc#run_the_arquillian_tests -:addUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#create_users_required_by_the_quickstarts -:addApplicationUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_application_user -:addManagementUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_management_user -:startServerDocUrl: {guidesBaseUrl}START_JBOSS_EAP.adoc#start_the_jboss_eap_server -:configurePostgresDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_database_for_use_with_the_quickstarts -:configurePostgresDownloadDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#download_and_install_postgresql -:configurePostgresCreateUserDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#create_a_database_user -:configurePostgresAddModuleDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#add_the_postgres_module_to_the_jboss_eap_server -:configurePostgresDriverDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_driver_in_the_jboss_eap_server -:configureBytemanDownloadDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#download_and_configure_byteman -:configureBytemanDisableDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#disable_the_byteman_script -:configureBytemanClearDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#clear_the_transaction_object_store -:configureBytemanQuickstartDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts -:configureBytemanHaltDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#use_byteman_to_halt_the_application[ -:configureBytemanQuickstartsDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts - -:EESubsystemNamespace: urn:jboss:domain:ee:4.0 -:IiopOpenJdkSubsystemNamespace: urn:jboss:domain:iiop-openjdk:2.0 -:MailSubsystemNamespace: urn:jboss:domain:mail:3.0 -:SingletonSubsystemNamespace: urn:jboss:domain:singleton:1.0 -:TransactionsSubsystemNamespace: urn:jboss:domain:transactions:4.0 - -// LinkProductDocHome: https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/ -:LinkProductDocHome: https://access.redhat.com/documentation/en/jboss-enterprise-application-platform-continuous-delivery -:LinkConfigGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/configuration_guide/ -:LinkDevelopmentGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/development_guide/ -:LinkGettingStartedGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_guide/ -:LinkOpenShiftWelcome: https://docs.openshift.com/online/welcome/index.html -:LinkOpenShiftSignup: https://docs.openshift.com/online/getting_started/choose_a_plan.html -:OpenShiftTemplateName: JBoss EAP CD (no https) - -:ConfigBookName: Configuration Guide -:DevelopmentBookName: Development Guide -:GettingStartedBookName: Getting Started Guide - -:JBDSProductName: Red Hat CodeReady Studio -:JBDSVersion: 12.15 -:LinkJBDSInstall: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/installation_guide/ -:JBDSInstallBookName: Installation Guide -:LinkJBDSGettingStarted: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/getting_started_with_codeready_studio_tools/ -:JBDSGettingStartedBookName: Getting Started with CodeReady Studio Tools \ No newline at end of file diff --git a/shared-doc/available-quickstarts.adoc b/shared-doc/available-quickstarts.adoc deleted file mode 100644 index d842f2ce9f..0000000000 --- a/shared-doc/available-quickstarts.adoc +++ /dev/null @@ -1,104 +0,0 @@ -[[available_quickstarts]] -= Available Quickstarts - -All available quickstarts, which are listed in the following table, can be found here: {githubRepoUrl}. - -Each quickstart provides the list of technologies demonstrated by the quickstart and the required experience level needed to build and deploy it. Click on the quickstart link in the table to see more detailed information about how to run it. Some quickstarts require deployment of other quickstarts. This information is noted in the `Prerequisites` section of the quickstart `README.html` file. - -NOTE: Some of these quickstarts use the H2 database included with {productName}. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment! - -// -[cols="1,1,2,1,1", options="header"] -|=== -| Quickstart Name | Demonstrated Technologies | Description | Experience Level Required | Prerequisites -| link:app-client/README{outfilesuffix}[app-client]|EJB, EAR, AppClient | The `app-client` quickstart demonstrates how to code and package a client app and use the {productName} client container to start the client `Main` program. | Intermediate | _none_ -| link:batch-processing/README{outfilesuffix}[batch-processing]|CDI, Batch 1.0, JSF | The `batch-processing` quickstart shows how to use chunk oriented batch jobs to import a file to a database. | Intermediate | _none_ -| link:bean-validation/README{outfilesuffix}[bean-validation]|CDI, JPA, BV | The `bean-validation` quickstart provides Arquillian tests to demonstrate how to use CDI, JPA, and Bean Validation. | Beginner | _none_ -| link:bean-validation-custom-constraint/README{outfilesuffix}[bean-validation-custom-constraint]|CDI, JPA, BV | The `bean-validation-custom-constraint` quickstart demonstrates how to use the Bean Validation API to define custom constraints and validators. | Beginner | _none_ -| link:bmt/README{outfilesuffix}[bmt]|EJB, BMT | The `bmt` quickstart demonstrates Bean-Managed Transactions (BMT), showing how to manually manage transaction demarcation while accessing JPA entities. | Intermediate | _none_ -| link:cmt/README{outfilesuffix}[cmt]|EJB, CMT, JMS | The `cmt` quickstart demonstrates Container-Managed Transactions (CMT), showing how to use transactions managed by the container. | Intermediate | _none_ -| link:contacts-jquerymobile/README{outfilesuffix}[contacts-jquerymobile]|jQuery Mobile, jQuery, JavaScript, HTML5, REST | The `contacts-jquerymobile` quickstart demonstrates a {javaVersion} mobile database application using HTML5, jQuery Mobile, JAX-RS, JPA, and REST. | Beginner | _none_ -| link:deltaspike-authorization/README{outfilesuffix}[deltaspike-authorization]|JSF, CDI, Deltaspike | Demonstrate the creation of a custom authorization example using @SecurityBindingType from DeltaSpike | Beginner | _none_ -| link:deltaspike-beanbuilder/README{outfilesuffix}[deltaspike-beanbuilder]|CDI, DeltaSpike | Shows how to create new beans using DeltaSpike utilities. | Advanced | _none_ -| link:deltaspike-projectstage/README{outfilesuffix}[deltaspike-projectstage]|JSF, CDI, Deltaspike | Demonstrate usage of DeltaSpike project stage and shows usage of a conditional @Exclude | Beginner | _none_ -| link:ejb-asynchronous/README{outfilesuffix}[ejb-asynchronous]|Asynchronous EJB | The `ejb-asynchronous` quickstart demonstrates the behavior of asynchronous EJB invocations by a deployed EJB and a remote client and how to handle errors. | Advanced | _none_ -| link:ejb-in-ear/README{outfilesuffix}[ejb-in-ear]|EJB, EAR | The `ejb-in-ear` quickstart demonstrates how to deploy an EAR archive that contains a *JSF* WAR and an EJB JAR. | Intermediate | _none_ -| link:ejb-in-war/README{outfilesuffix}[ejb-in-war]|EJB, JSF, WAR | The `ejb-in-war` quickstart demonstrates how to package an EJB bean in a WAR archive and deploy it to {productName}. Arquillian tests are also provided. | Intermediate | _none_ -| link:ejb-multi-server/README{outfilesuffix}[ejb-multi-server]|EJB, EAR | The `ejb-multi-server` quickstart shows how to communicate between multiple applications deployed to different servers using an EJB to log the invocation. | Advanced | _none_ -| link:ejb-remote/README{outfilesuffix}[ejb-remote]|EJB, JNDI | The `ejb-remote` quickstart uses EJB and JNDI to demonstrate how to access an EJB, deployed to {productName}, from a remote Java client application. | Intermediate | _none_ -| link:ejb-security/README{outfilesuffix}[ejb-security]|EJB, Security | The `ejb-security` quickstart demonstrates the use of Jakarta EE declarative security to control access to EJBs in {productName}. | Intermediate | _none_ -| link:ejb-security-context-propagation/README{outfilesuffix}[ejb-security-context-propagation]|EJB, Security | The `ejb-security-context-propagation` quickstart demonstrates how the security context can be propagated to a remote EJB using a remote outbound connection configuration | Advanced | _none_ -| link:ejb-security-jaas/README{outfilesuffix}[ejb-security-jaas]|EJB, Security | The `ejb-security-jaas` quickstart demonstrates how legacy `JAAS` security domains can be used in conjunction with `Elytron` | Intermediate | _none_ -| link:ejb-security-programmatic-auth/README{outfilesuffix}[ejb-security-programmatic-auth]|EJB, Security | The `ejb-security-programmatic-auth` quickstart demonstrates how to programmatically setup different identities when invoking a remote secured EJB. | Intermediate | _none_ -| link:ejb-throws-exception/README{outfilesuffix}[ejb-throws-exception]|EJB, EAR | The `ejb-throws-exception` quickstart demonstrates how to throw and handle exceptions across JARs in an EAR. | Intermediate | _none_ -| link:ejb-timer/README{outfilesuffix}[ejb-timer]|EJB Timer | The `ejb-timer` quickstart demonstrates how to use the EJB timer service `@Schedule` and `@Timeout` annotations with {productName}. | Beginner | _none_ -| link:greeter/README{outfilesuffix}[greeter]|CDI, JSF, JPA, EJB, JTA | The `greeter` quickstart demonstrates the use of CDI, JPA, JTA, EJB and JSF in {productName}. | Beginner | _none_ -| link:ha-singleton-deployment/README{outfilesuffix}[ha-singleton-deployment]|EJB, Singleton Deployments, Clustering | The `ha-singleton-deployment` quickstart demonstrates the recommended way to deploy any service packaged in an application archive as a cluster-wide singleton. | Advanced | _none_ -| link:ha-singleton-service/README{outfilesuffix}[ha-singleton-service]|MSC, Singleton Service, Clustering | The `ha-singleton-service` quickstart demonstrates how to deploy a cluster-wide singleton MSC service. | Advanced | _none_ -| link:helloworld/README{outfilesuffix}[helloworld]|CDI, Servlet | The `helloworld` quickstart demonstrates the use of CDI and Servlet 3 and is a good starting point to verify {productName} is configured correctly. | Beginner | _none_ -| link:helloworld-classfiletransformer/README{outfilesuffix}[helloworld-classfiletransformer]|ClassLoading | This is a WAR based application showing you how WildFly let you apply a ClassTransformer to the classes in your enterprise archive. | Advanced | _none_ -| link:helloworld-html5/README{outfilesuffix}[helloworld-html5]|CDI, JAX-RS, HTML5 | The `helloworld-html5` quickstart demonstrates the use of CDI 1.2 and JAX-RS 2.0 using the HTML5 architecture and RESTful services on the backend. | Beginner | _none_ -| link:helloworld-jms/README{outfilesuffix}[helloworld-jms]|JMS | The `helloworld-jms` quickstart demonstrates the use of external JMS clients with {productName}. | Intermediate | _none_ -| link:helloworld-mbean/README{outfilesuffix}[helloworld-mbean]|CDI, JMX, MBean | The `helloworld-mbean` quickstart demonstrates the use of CDI and MBean in {productName} and includes JConsole instructions and Arquillian tests. | Intermediate | _none_ -| link:helloworld-mdb/README{outfilesuffix}[helloworld-mdb]|JMS, EJB, MDB | The `helloworld-mdb` quickstart uses JMS and EJB Message-Driven Bean (MDB) to create and deploy JMS topic and queue resources in {productName}. | Intermediate | _none_ -| link:helloworld-mdb-propertysubstitution/README{outfilesuffix}[helloworld-mdb-propertysubstitution]|JMS, EJB, MDB | The `helloworld-mdb-propertysubstitution` quickstart demonstrates the use of JMS and EJB MDB, enabling property substitution with annotations. | Intermediate | _none_ -| link:helloworld-mutual-ssl/README{outfilesuffix}[helloworld-mutual-ssl]|Mutual SSL, Undertow | The `helloworld-mutual-ssl` quickstart is a basic example that demonstrates mutual SSL configuration in {productName} | Intermediate | _none_ -| link:helloworld-mutual-ssl-secured/README{outfilesuffix}[helloworld-mutual-ssl-secured]|Mutual SSL, Security, Undertow | The `helloworld-mutual-ssl-secured` quickstart demonstrates securing a Web application using client mutual SSL authentication and role-based access control | Intermediate | _none_ -| link:helloworld-rf/README{outfilesuffix}[helloworld-rf]|CDI, JSF, RichFaces | Similar to the `helloworld` quickstart, but with a JSF front end. | Beginner | _none_ -| link:helloworld-rs/README{outfilesuffix}[helloworld-rs]|CDI, JAX-RS | The `helloworld-rs` quickstart demonstrates a simple Hello World application, bundled and deployed as a WAR, that uses JAX-RS to say Hello. | Intermediate | _none_ -| link:helloworld-singleton/README{outfilesuffix}[helloworld-singleton]|EJB, Singleton | The `helloworld-singleton` quickstart demonstrates an EJB Singleton Bean that is instantiated once and maintains state for the life of the session. | Beginner | _none_ -| link:helloworld-ssl/README{outfilesuffix}[helloworld-ssl]|SSL, Undertow | The `helloworld-ssl` quickstart is a basic example that demonstrates server side SSL configuration in {productName}. | Beginner | _none_ -| link:helloworld-ws/README{outfilesuffix}[helloworld-ws]|JAX-WS | The `helloworld-ws` quickstart demonstrates a simple Hello World application, bundled and deployed as a WAR, that uses JAX-WS to say Hello. | Beginner | _none_ -| link:hibernate/README{outfilesuffix}[hibernate]|Hibernate | The `hibernate` quickstart demonstrates how to use Hibernate ORM 6 API over JPA, using Hibernate-Core and Hibernate Bean Validation, and EJB. | Intermediate | _none_ -| link:http-custom-mechanism/README{outfilesuffix}[http-custom-mechanism]|EJB, Security | The `http-custom-mechanism` quickstart demonstrates how to implement a custom HTTP authentication mechanism that can be registered with Elytron. | Intermediate | _none_ -| link:inter-app/README{outfilesuffix}[inter-app]|EJB, CDI, JSF | The `inter-app` quickstart shows you how to use a shared API JAR and an EJB to provide inter-application communication between two WAR deployments. | Advanced | _none_ -| link:jaxrs-client/README{outfilesuffix}[jaxrs-client]|JAX-RS | The `jaxrs-client` quickstart demonstrates JAX-RS Client API, which interacts with a JAX-RS Web service that runs on {productName}. | Beginner | _none_ -| link:jaxrs-jwt/README{outfilesuffix}[jaxrs-jwt]|JAX-RS, Security | The `jaxrs-jwt` quickstart demonstrates a JAX-RS secured application using JSON Web Tokens (JWT) with Elytron. | Intermediate | _none_ -| link:jaxws-addressing/README{outfilesuffix}[jaxws-addressing]|JAX-WS | The `jaxws-addressing` quickstart is a working example of the web service using WS-Addressing. | Beginner | _none_ -| link:jaxws-ejb/README{outfilesuffix}[jaxws-ejb]|JAX-WS | The `jaxws-ejb` quickstart is a working example of the web service endpoint created from an EJB. | Beginner | _none_ -| link:jaxws-pojo/README{outfilesuffix}[jaxws-pojo]|JAX-WS | The `jaxws-pojo` quickstart is a working example of the web service endpoint created from a POJO. | Beginner | _none_ -| link:jaxws-retail/README{outfilesuffix}[jaxws-retail]|JAX-WS | The `jaxws-retail` quickstart is a working example of a simple web service endpoint. | Beginner | _none_ -| link:jsonp/README{outfilesuffix}[jsonp]|CDI, JSF, JSON-P | The `jsonp` quickstart demonstrates how to use the JSON-P API to produce object-based structures and then parse and consume them as stream-based JSON strings. | Beginner | _none_ -| link:jta-crash-rec/README{outfilesuffix}[jta-crash-rec]|JTA, Crash Recovery | The `jta-crash-rec` quickstart uses JTA and Byteman to show how to code distributed (XA) transactions in order to preserve ACID properties on server crash. | Advanced | _none_ -| link:jts/README{outfilesuffix}[jts]|JTS, EJB, JMS | The `jts` quickstart shows how to use JTS to perform distributed transactions across multiple containers, fulfilling the properties of an ACID transaction. | Intermediate | link:cmt/README{outfilesuffix}[cmt] -| link:kitchensink/README{outfilesuffix}[kitchensink]|CDI, JSF, JPA, EJB, JAX-RS, BV | The `kitchensink` quickstart demonstrates a {javaVersion} web-enabled database application using JSF, CDI, EJB, JPA, and Bean Validation. | Intermediate | _none_ -| link:kitchensink-angularjs/README{outfilesuffix}[kitchensink-angularjs]|AngularJS, CDI, JPA, EJB, JPA, JAX-RS, BV | The `kitchensink-angularjs` quickstart demonstrates a {javaVersion} application using AngularJS with JAX-RS, CDI, EJB, JPA, and Bean Validation. | Intermediate | _none_ -| link:kitchensink-ear/README{outfilesuffix}[kitchensink-ear]|CDI, JSF, JPA, EJB, JAX-RS, BV, EAR | The `kitchensink-ear` quickstart demonstrates web-enabled database application, using JSF, CDI, EJB, JPA, and Bean Validation, packaged as an EAR. | Intermediate | _none_ -| link:kitchensink-jsp/README{outfilesuffix}[kitchensink-jsp]|JSP, JSTL, CDI, JPA, EJB, JAX-RS, BV | The `kitchensink-jsp` quickstart demonstrates how to use JSP, JSTL, CDI, EJB, JPA, and Bean Validation in {productName}. | Intermediate | _none_ -| link:kitchensink-ml/README{outfilesuffix}[kitchensink-ml]|CDI, JSF, JPA, EJB, JAX-RS, BV, i18n, l10n | The `kitchensink-ml` quickstart demonstrates a localized {javaVersion} compliant application using JSF, CDI, EJB, JPA, and Bean Validation. | Intermediate | _none_ -| link:kitchensink-utjs-angularjs/README{outfilesuffix}[kitchensink-utjs-angularjs]|Undertow.js, Angular.js | Based on kitchensink, but uses a Angular for the front end and Undertow.js for the back end. | Intermediate | _none_ -| link:kitchensink-utjs-mustache/README{outfilesuffix}[kitchensink-utjs-mustache]|Undertow.js, Mustache | Based on kitchensink, but uses Mustache for the front end and Undertow.js for the back end. | Intermediate | _none_ -| link:logging/README{outfilesuffix}[logging]|Logging | The `logging` quickstart demonstrates how to configure different logging levels in {productName}. It also includes an asynchronous logging example. | Intermediate | _none_ -| link:logging-tools/README{outfilesuffix}[logging-tools]|JBoss Logging Tools | The `logging-tools` quickstart shows how to use JBoss Logging Tools to create internationalized loggers, exceptions, and messages and localize them. | Beginner | _none_ -| link:mail/README{outfilesuffix}[mail]|JavaMail, CDI, JSF | The `mail` quickstart demonstrates how to send email using CDI and JSF and the default Mail provider that ships with {productName}. | Beginner | _none_ -| link:managed-executor-service/README{outfilesuffix}[managed-executor-service]|EE Concurrency Utilities, JAX-RS, JAX-RS Client API | The `managed-executor-service` quickstart demonstrates how Jakarta EE applications can submit tasks for asynchronous execution. | Beginner | _none_ -| link:messaging-clustering/README{outfilesuffix}[messaging-clustering]|JMS, MDB | The `messaging-clustering` quickstart does not contain any code and instead uses the `helloworld-mdb` quickstart to demonstrate clustering using ActiveMQ Messaging. | Intermediate | link:helloworld-mdb/README{outfilesuffix}[helloworld-mdb] -| link:messaging-clustering-singleton/README{outfilesuffix}[messaging-clustering-singleton]|JMS, MDB, Clustering | The `messaging-clustering-singleton` quickstart uses a JMS topic and a queue to demonstrate clustering using {productName} messaging with MDB singleton configuration where only one node in the cluster will be active. | Advanced | _none_ -| link:numberguess/README{outfilesuffix}[numberguess]|CDI, JSF | The `numberguess` quickstart demonstrates the use of CDI (Contexts and Dependency Injection) and JSF (JavaServer Faces) in {productName}. | Beginner | _none_ -| link:payment-cdi-event/README{outfilesuffix}[payment-cdi-event]|CDI, JSF | The `payment-cdi-event` quickstart demonstrates how to create credit and debit CDI Events in {productName}, using a JSF front-end client. | Beginner | _none_ -| link:resteasy-jaxrs-client/README{outfilesuffix}[resteasy-jaxrs-client]|JAX-RS, CDI | The `resteasy-jaxrs-client` quickstart demonstrates an external JAX-RS RestEasy client, which interacts with a JAX-RS Web service that uses CDI and JAX-RS. | Intermediate | link:helloworld-rs/README{outfilesuffix}[helloworld-rs] -| link:security-domain-to-domain/README{outfilesuffix}[security-domain-to-domain]|Servlet, EJB, Security | The `security-domain-to-domain` quickstart demonstrates the propagation of an identity across two different deployments using different security domains. | Advanced | _none_ -| link:servlet-async/README{outfilesuffix}[servlet-async]|Asynchronous Servlet, CDI, EJB | The `servlet-async` quickstart demonstrates how to use asynchronous servlets to detach long-running tasks and free up the request processing thread. | Intermediate | _none_ -| link:servlet-filterlistener/README{outfilesuffix}[servlet-filterlistener]|Servlet Filter, Servlet Listener | The `servlet-filterlistener` quickstart demonstrates how to use Servlet filters and listeners in an application. | Intermediate | _none_ -| link:servlet-security/README{outfilesuffix}[servlet-security]|Servlet, Security | The `servlet-security` quickstart demonstrates the use of Jakarta EE declarative security to control access to Servlets and Security in {productName}. | Intermediate | _none_ -| link:shopping-cart/README{outfilesuffix}[shopping-cart]|SFSB EJB | The `shopping-cart` quickstart demonstrates how to deploy and run a simple {javaVersion} shopping cart application that uses a stateful session bean (SFSB). | Intermediate | _none_ -| link:spring-greeter/README{outfilesuffix}[spring-greeter]|Spring MVC, JSP, JPA | The `spring-greeter` quickstart is based on the `greeter` quickstart, but differs in that it uses Spring MVC for Mapping `GET` and `POST` requests. | Beginner | _none_ -| link:spring-kitchensink-basic/README{outfilesuffix}[spring-kitchensink-basic]|JSP, JPA, JSON, Spring, JUnit | The `spring-kitchensink-basic` quickstart is an example of a {javaVersion} application using JSP, JPA and Spring 4.x. | Intermediate | _none_ -| link:spring-kitchensink-springmvctest/README{outfilesuffix}[spring-kitchensink-springmvctest]|JSP, JPA, JSON, Spring, JUnit | The `spring-kitchensink-springmvctest` quickstart demonstrates how to create an MVC application using JSP, JPA and Spring 4.x. | Intermediate | _none_ -| link:spring-resteasy/README{outfilesuffix}[spring-resteasy]|Resteasy, Spring | The `spring-resteasy` quickstart demonstrates how to package and deploy a web application that includes resteasy-spring integration. | Beginner | _none_ -| link:tasks-jsf/README{outfilesuffix}[tasks-jsf]|JSF, JPA | The `tasks-jsf` quickstart demonstrates how to use JPA persistence with JSF as the view layer. | Intermediate | link:tasks/README{outfilesuffix}[tasks] -| link:tasks-rs/README{outfilesuffix}[tasks-rs]|JPA, JAX-RS | The `tasks-rs` quickstart demonstrates how to implement a JAX-RS service that uses JPA persistence. | Intermediate | link:tasks/README{outfilesuffix}[tasks] -| link:temperature-converter/README{outfilesuffix}[temperature-converter]|CDI, JSF, SLSB EJB | The `temperature-converter` quickstart does temperature conversion using an EJB Stateless Session Bean (SLSB), CDI, and a JSF front-end client. | Beginner | _none_ -| link:thread-racing/README{outfilesuffix}[thread-racing]|Batch, CDI, EE Concurrency, JAX-RS, JMS, JPA, JSON, Web Sockets | A thread racing web application that demonstrates technologies introduced or updated in the latest Jakarta EE specification. | Beginner | _none_ -| link:websocket-client/README{outfilesuffix}[websocket-client]|Web Socket, CDI Events, JSON, SSL | Demonstrates use of a Javascript WebSocket client, WebSocket configuration, programmatic binding, and secure WebSocket. | Intermediate | _none_ -| link:websocket-endpoint/README{outfilesuffix}[websocket-endpoint]|CDI, WebSocket, JSON-P | Shows how to use WebSockets with JSON to broadcast information to all open WebSocket sessions in {productName}. | Beginner | _none_ -| link:websocket-hello/README{outfilesuffix}[websocket-hello]|WebSocket, CDI, JSF | The `websocket-hello` quickstart demonstrates how to create a simple WebSocket application. | Beginner | _none_ -| link:wicket-ear/README{outfilesuffix}[wicket-ear]|Apache Wicket, JPA | Demonstrates how to use the Wicket Framework 7.x with the JBoss server using the Wicket Jakarta EE integration, packaged as an EAR | Intermediate | _none_ -| link:wicket-war/README{outfilesuffix}[wicket-war]|Apache Wicket, JPA | Demonstrates how to use the Wicket Framework 7.x with the JBoss server using the Wicket Jakarta EE integration packaged as a WAR | Intermediate | _none_ -| link:wsat-simple/README{outfilesuffix}[wsat-simple]|WS-AT, JAX-WS | The `wsat-simple` quickstart demonstrates a WS-AT (WS-AtomicTransaction) enabled JAX-WS Web service, bundled as a WAR, and deployed to {productName}. | Intermediate | _none_ -| link:wsba-coordinator-completion-simple/README{outfilesuffix}[wsba-coordinator-completion-simple]|WS-BA, JAX-WS | The `wsba-coordinator-completion-simple` quickstart deploys a WS-BA (WS Business Activity) enabled JAX-WS Web service WAR (CoordinatorCompletion protocol). | Intermediate | _none_ -| link:wsba-participant-completion-simple/README{outfilesuffix}[wsba-participant-completion-simple]|WS-BA, JAX-WS | The `wsba-participant-completion-simple` quickstart deploys a WS-BA (WS Business Activity) enabled JAX-WS Web service WAR (ParticipantCompletion Protocol). | Intermediate | _none_ -| link:xml-jaxp/README{outfilesuffix}[xml-jaxp]|JAXP, SAX, DOM, Servlet | The `xml-jaxp` quickstart demonstrates how to use Servlet and JSF to upload an XML file to {productName} and validate and parse it using DOM or SAX. | Intermediate | _none_ -|=== -// - diff --git a/shared-doc/back-up-managed-domain-configuration.adoc b/shared-doc/back-up-managed-domain-configuration.adoc deleted file mode 100644 index 58db47f989..0000000000 --- a/shared-doc/back-up-managed-domain-configuration.adoc +++ /dev/null @@ -1,20 +0,0 @@ -[[back_up_managed_domain_configuration]] -= Back Up the {productName} Managed Domain Configuration -//****************************************************************************** -// Include this template if your quickstart runs in a managed domain and -// needs to back up the server configuration files before running -// a CLI script to modify the server. -//****************************************************************************** - -Before you begin, back up your server configuration files. - -. If it is running, stop the {productName} server. -. Back up the following files: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -__{jbossHomeName}__/domain/configuration/domain.xml -__{jbossHomeName}__/domain/configuration/host.xml ----- - -After you have completed testing this quickstart, you can replace these file to restore the server to its original configuration. diff --git a/shared-doc/back-up-server-standalone-configuration.adoc b/shared-doc/back-up-server-standalone-configuration.adoc deleted file mode 100644 index 15adc1c130..0000000000 --- a/shared-doc/back-up-server-standalone-configuration.adoc +++ /dev/null @@ -1,16 +0,0 @@ -[[back_up_standalone_server_configuration]] -= Back Up the {productName} Standalone Server Configuration -//****************************************************************************** -// Include this template if your quickstart runs in a standalone server and -// needs to back up the server configuration file before running -// a CLI script to modify the server. -//****************************************************************************** -// Define the attributes needed for this topic. -include::define-standalone-server-attributes.adoc[] - -Before you begin, back up your server configuration file. - -. If it is running, stop the {productName} server. -. Back up the `__{jbossHomeName}__/{configFileName}` file. - -After you have completed testing this quickstart, you can replace this file to restore the server to its original configuration. diff --git a/shared-doc/build-and-deploy-the-quickstart.adoc b/shared-doc/build-and-deploy-the-quickstart.adoc deleted file mode 100644 index 79cbb257f2..0000000000 --- a/shared-doc/build-and-deploy-the-quickstart.adoc +++ /dev/null @@ -1,104 +0,0 @@ -[[build_and_deploy_the_quickstart]] -= Build and Deploy the Quickstart -//****************************************************************************** -// Include this template if your quickstart does a normal deployment of a archive. -// -// * Define the `archiveType` variable in the quickstart README file. -// Supported values: -// :archiveType: ear -// :archiveType: war -// :archiveType: jar -// -// * To override the archive name, which defaults to the {artifactId), -// define the `archiveName` variable, for example: -// :archiveName: {artifactId}-service -// -// * To override the archive output directory, -// define the `archiveDir` variable, for example: -// :archiveDir: ear/target -// -// * To override the Maven command, define the `mavenCommand` variable, -// for example: -// :mavenCommand: clean install wildfly:deploy -//****************************************************************************** - -// The archive name defaults to the artifactId if not overridden -ifndef::archiveName[] -:archiveName: {artifactId} -endif::archiveName[] - -// The archive type defaults to war if not overridden -ifndef::archiveType[] -:archiveType: war -endif::archiveType[] - -// Define the archive file name as the concatenation of "archiveName" + "." + "archiveType+ -:archiveFileName: {archiveName}.{archiveType} - -// If they have not defined the target archive directory, make it the default for the archive type. -ifndef::archiveDir[] - -ifeval::["{archiveType}"=="ear"] -:archiveDir: {artifactId}/ear/target -endif::[] - -ifeval::["{archiveType}"=="war"] -:archiveDir: {artifactId}/target -endif::[] - -ifeval::["{archiveType}"=="jar"] -:archiveDir: {artifactId}/target -endif::[] - -endif::archiveDir[] - -ifndef::mavenCommand[] -ifeval::["{archiveType}"=="ear"] -:mavenCommand: clean install -endif::[] - -ifeval::["{archiveType}"=="war"] -:mavenCommand: clean package -endif::[] - -ifeval::["{archiveType}"=="jar"] -:mavenCommand: clean install -endif::[] - -endif::mavenCommand[] - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -ifdef::reactive-messaging[] -. Run this command to enable the MicroProfile Reactive Messaging functionality on the server -+ -[source,subs="attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=enable-reactive-messaging.cli ----- -endif::reactive-messaging[] -. Type the following command to build the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn {mavenCommand} ----- - -. Type the following command to deploy the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn wildfly:deploy ----- - -ifdef::rest-client-qs[] -This builds and deploys the `country-server` and `country-client` to the running instance of the server. - -You should see a message in the server log indicating that the archives deployed successfully. -endif::[] -ifndef::rest-client-qs[] -This deploys the `{archiveDir}/{archiveFileName}` to the running instance of the server. - -You should see a message in the server log indicating that the archive deployed successfully. -endif::[] - diff --git a/shared-doc/build-and-run-the-quickstart-with-bootable-jar.adoc b/shared-doc/build-and-run-the-quickstart-with-bootable-jar.adoc deleted file mode 100644 index 672bb74016..0000000000 --- a/shared-doc/build-and-run-the-quickstart-with-bootable-jar.adoc +++ /dev/null @@ -1,317 +0,0 @@ -[[build_and_run_the_quickstart_with_bootable_jar]] -= Building and running the quickstart application in a bootable JAR - -You can package a {productName} server and an application inside a bootable JAR. You can then run the application on a {productName} bare-metal platform or on a {productName} Openshift platform. - -== On a {productName} bare-metal platform - -You can use the Maven plug-in to build a {productName} bootable JAR, and then you can run the application on a {productName} bare-metal platform. The following example demonstrates a quickstart `pom.xml` file that contains a Maven profile named *bootable-jar*: - -[source,xml,subs="attributes+"] ----- - - bootable-jar - - - - org.wildfly.plugins - wildfly-jar-maven-plugin - - wildfly@maven(org.jboss.universe:community-universe)#${version.server.bootable-jar} - -ifndef::custom-bootable-jar-layers[] - jaxrs-server - microprofile-platform -endif::[] -ifdef::reactive-messaging[] - cloud-server - h2-default-datasource - microprofile-reactive-messaging-kafka -endif::[] - - - true - - - - - - package - - - - - - - ----- - -ifdef::rest-client-qs[] -NOTE: This configuration needs to be added to both the country-server and the country-client modules. -endif::rest-client-qs[] - -.Procedure - -. Build the quickstart bootable JAR with the following command: -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn clean package -Pbootable-jar ----- -+ -. Run the quickstart application contained in the bootable JAR: -ifndef::rest-client-qs[] -+ -[source,subs="attributes+",options="nowrap"] ----- -ifdef::uses-jaeger[] -$ JAEGER_REPORTER_LOG_SPANS=true JAEGER_SAMPLER_TYPE=const JAEGER_SAMPLER_PARAM=1 java -jar target/{artifactId}-bootable.jar -endif::uses-jaeger[] -ifndef::uses-jaeger[] -$ java -jar target/{artifactId}-bootable.jar -endif::uses-jaeger[] ----- -endif::rest-client-qs[] -ifdef::rest-client-qs[] -+ -*Country server* -+ -[source,subs="attributes+",options="nowrap"] ----- -$ java -jar country-server/target/country-server-bootable.jar ----- -+ -*Country client* -+ -[source,subs="attributes+",options="nowrap"] ----- -$ java -jar country-client/target/country-client-bootable.jar -Djboss.socket.binding.port-offset=100 -Dorg.wildfly.quickstarts.microprofile.rest.client.CountriesServiceClient/mp-rest/url=http://localhost:8080 ----- -endif::rest-client-qs[] - -. You can now interact with the quickstart application. - -[NOTE] -==== -After the quickstart application is deployed, the bootable JAR includes the application in the root context. Therefore, any URLs related to the application should not have the `/{artifactId}` path segment after `HOST:PORT`. -==== - -== On a {productName} OpenShift platform - -You can use the Maven plug-in to build a {productName} bootable JAR, and then you can run the application on a {productName} OpenShift platform. The following example demonstrates a quickstart `pom.xml` file that contains a Maven profile named *bootable-jar-openshift*: - -[source,xml,subs="attributes+"] ----- - - bootable-jar-openshift - - - - org.wildfly.plugins - wildfly-jar-maven-plugin - - wildfly@maven(org.jboss.universe:community-universe)#${version.server.bootable-jar} - -ifndef::custom-bootable-jar-layers[] - jaxrs-server - microprofile-platform -endif::[] -ifdef::reactive-messaging[] - cloud-server - h2-default-datasource - microprofile-reactive-messaging-kafka -endif::[] - - - true - - - - - - - package - - - - - - org.eclipse.jkube - openshift-maven-plugin - - - - resource - build - - - - - - - - NodePort - - - -ifdef::reactive-messaging[] - - - - 256 - 96 - - my-cluster-kafka-bootstrap:9092 - - -endif::[] - - - - - -ifdef::reactive-messaging[] - - os-jar-amq-streams - - - - org.eclipse.jkube - openshift-maven-plugin - ${version.jkube.maven.plugin} - - - - - my-cluster-kafka-bootstrap:9092 - - - - - - - - - - os-jar-rhosak - - - - org.wildfly.plugins - wildfly-jar-maven-plugin - ${version.wildfly-jar.maven.plugin} - - - - - - false - - - - - - - - - - -endif::[] ----- -.Procedure - -. Log in to your OpenShift instance using the `oc login` command. - -. Create a new project for the quickstart bootable JAR on OpenShift. For example: -+ -[options="nowrap",subs="attributes"] ----- -$ oc new-project bootable-jar-project ----- -ifdef::reactive-messaging[] -. Depending on which kind of Kafka you would like: - a. Install *AMQ Streams* into the `bootable-jar-project` OpenShift project as outlined link:#install_amq_streams[earlier] in this quickstart. - b. Set up a Kafka instance on *RHOSAK*, and connect it to the `mp-rm-qs` application as outlined link:#install_rhosak[earlier] in this quickstart. The `os-jar-rhosak` profile in the pom.xml triggers running the `src/main/scripts/bootable-jar/initialize-server.cli` when preparing the bootable jar, so that the config map and service binding become part of the configuration provided by the `microprofile-config-smallrye` subsystem. -endif::[] -. Build the quickstart bootable JAR by issuing the following command. This command also completes the following tasks: creates the OpenShift deployment, service and route; generates a docker image and pushes the docker image to OpenShift; and runs the application. -+ -// Bootable jar Deployment -+ -ifndef::reactive-messaging[] -[source,subs="attributes+",options="nowrap"] ----- -$ mvn oc:deploy -Pbootable-jar-openshift ----- -endif::[] -ifdef::reactive-messaging[] -The command to deploy the application is slightly different depending on which Kafka installation you want to target. -+ -First add the Helm repository, if you have not done so already, as described in {helmRepoUrl}. -+ -Then, either: -+ -a. If you are targeting Kafka supplied by *AMQ Streams*, use the following command: -+ -[source,subs="attributes+",options="nowrap"] ----- -$ helm install mp-rm-qs -f ./helm-bootable-jar-amq-streams.yml {helmChartName} --set build.uri={githubRepoCodeUrl} --set build.ref={WildFlyQuickStartRepoTag} ----- -The contents of link:./helm-bootable-jar-amq-streams.yml[`helm-bootable-jar-amq-streams.yml`] are mostly similar to what was discussed for link:./helm-amq-streams.yml[`helm-amq-streams.yml`] earlier. The main difference is that `build.mode` is set to `bootable-jar`, and we specify `-Pbootable-jar-openshift` in the `MAVEN_ARGS_APPEND` environment variable to trigger the `bootable-jar-openshift` Maven profile when building the bootable jar. -+ -NOTE: Although the above command will return quite quickly, it will take a while until the application pod is actually brought up. In the OpenShift console you will see a pod whose name starts with {hemlAppName} in the `ErrImagePull` or `ImagePullBackoff` state until the build has completed. -+ -b. If you are targeting Kafka supplied by *RHOSAK*, use the following commands. -+ -Then install our application: -+ -[source,subs="attributes+",options="nowrap"] ----- -$ helm install mp-rm-qs -f ./helm-bootable-jar-rhosak.yml {helmChartName} --set build.uri={githubRepoCodeUrl} --set build.ref={WildFlyQuickStartRepoTag} ----- -The contents of link:./helm-bootable-jar-rhosak.yml[`helm-bootable-jar-rhosak.yml`] are mostly similar to what was discussed for link:./helm-rhosak.yml[`helm-rhoask.yml`] earlier. The main difference is that `build.mode` is set to `bootable-jar`, and we specify `-Pbootable-jar-openshift,os-jar-rhosak` in the `MAVEN_ARGS_APPEND` environment variable to trigger the `bootable-jar-openshift` and `os-jar-rhosak` Maven profiles when building the bootable jar. For this combination we don't need the `QS_USE_RHOSAK` environment variable as the `os-jar-rhosak` contains the CLI script needed to configure the config map and service binding. - -+ -NOTE: Although the above command will return quite quickly, it will take a while until the application pod is actually brought up. In the OpenShift console you will see a pod whose name starts with {hemlAppName} in the `ErrImagePull` or `ImagePullBackoff` state until the build has completed. -+ -Once the CLI returns, remember to bind the RHOSAK Kafka connection so the service binding is available and the `/bindings/kafka-config` directory gets created on the application pod: -+ -[source,subs="attributes+",options="nowrap"] ----- -rhoas cluster bind --app-name mp-rm-qs --binding-name kafka-config --yes ----- - -endif::[] -+ -// Bootable jar Deployment - END -+ -. Get the URL of the route. -+ -[options="nowrap"] ----- -$ oc get route ----- -+ -. Access the application in your web browser by using a URL. The URL is the value of the `HOST/PORT` field that was provided by the `oc get route` command output. For example, the route of the URL for the quickstart used in this procedure is `https://_HOST_PORT_Value_/`. - - -== Customizing OpenShift resources with resource fragments - -With the Eclipse JKube Maven plug-in, you can customize the generated OpenShift resources, such as deployments, routes, and so on, with YAML file extracts located in the _src/main/jkube_ directory. - -The `route.yml` file, which is located in the _src/main/jkube_ directory, is an example of a resource fragment. You can configure this resource fragment to change the Openshift application service route to use HTTPS: - -[options="nowrap",subs="attributes"] ----- -spec: - tls: - insecureEdgeTerminationPolicy: Redirect - termination: edge - to: - kind: Service - name: {artifactId} ----- - -For more information about resource fragments, see the link:https://www.eclipse.org/jkube/docs/openshift-maven-plugi[Eclipse JKube documentation]. diff --git a/shared-doc/build-and-run-the-quickstart-with-openshift.adoc b/shared-doc/build-and-run-the-quickstart-with-openshift.adoc deleted file mode 100644 index 544d2b8666..0000000000 --- a/shared-doc/build-and-run-the-quickstart-with-openshift.adoc +++ /dev/null @@ -1,10 +0,0 @@ -[[build_and_run_the_quickstart_on_openshift]] -= Building and running the quickstart application with OpenShift -// The openshift profile -include::../shared-doc/build-the-quickstart-for-openshift.adoc[leveloffset=+1] -// Getting Started with Helm -include::../shared-doc/helm-getting-started-overview.adoc[leveloffset=+1] -//Prepare Helm for Quickstart Deployment -include::../shared-doc/helm-deploy-project.adoc[leveloffset=+1] -// Testing on Openshift -include::../shared-doc/run-arquillian-integration-tests-with-openshift.adoc[leveloffset=+1] diff --git a/shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc b/shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc deleted file mode 100644 index 9707170cdf..0000000000 --- a/shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc +++ /dev/null @@ -1,70 +0,0 @@ -[[build_and_run_the_quickstart_with_provisioned_server]] -= Building and running the quickstart application with provisioned {productName} server - -Instead of using a standard {productName} server distribution, you can alternatively provision a {productName} server to deploy and run the quickstart, by activating the Maven profile named `provisioned-server` when building the quickstart: - -ifndef::mavenServerProvisioningCommand[] -ifeval::["{archiveType}"=="ear"] -:mavenServerProvisioningCommand: clean install -endif::[] - -ifeval::["{archiveType}"=="war"] -:mavenServerProvisioningCommand: clean package -endif::[] - -ifeval::["{archiveType}"=="jar"] -:mavenServerProvisioningCommand: clean install -endif::[] - -[source,subs="attributes+",options="nowrap"] ----- -$ mvn {mavenServerProvisioningCommand} -Pprovisioned-server ----- - -The provisioned {productName} server, with the quickstart deployed, can then be found in the `target/server` directory, and its usage is similar to a standard server distribution. - -The server provisioning functionality is provided by the WildFly Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: - -[source,xml,subs="attributes+"] ----- - - provisioned-server - - - - org.jboss.eap.plugins - eap-maven-plugin - - - - org.wildfly:wildfly-galleon-pack:${version.server} - - - - - cloud-server - - - ROOT.war - - - - - package - - - - - - - - ----- - -[NOTE] -==== -Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`. -==== - -// Testing with Arquillian -include::../shared-doc/run-arquillian-integration-tests-with-provisioned-server.adoc[leveloffset=+1] diff --git a/shared-doc/build-the-quickstart-for-openshift.adoc b/shared-doc/build-the-quickstart-for-openshift.adoc deleted file mode 100644 index ff11897ff9..0000000000 --- a/shared-doc/build-the-quickstart-for-openshift.adoc +++ /dev/null @@ -1,109 +0,0 @@ -[[build-the-quickstart-for-openshift]] -== Build the {productName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -On OpenShift, the S2I build with Apache Maven will use an `openshift` profile used to provision a {productName} server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named `openshift` when building the quickstart: - -[source,subs="attributes+",options="nowrap"] ----- -$ mvn clean package -Popenshift ----- - -The provisioned {productName} server for OpenShift, with the quickstart deployed, can then be found in the `target/server` directory, and its usage is similar to a standard server distribution. -ifndef::ProductRelease,EAPXPRelease[] -You may note that unlike the `provisioned-server` profile it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the WildFly Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.wildfly:wildfly-galleon-pack:${version.server} - - - org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp} - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -[NOTE] -==== -Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`. -==== \ No newline at end of file diff --git a/shared-doc/cd-create-project.adoc b/shared-doc/cd-create-project.adoc deleted file mode 100644 index f65ea75561..0000000000 --- a/shared-doc/cd-create-project.adoc +++ /dev/null @@ -1,34 +0,0 @@ - -[[prepare_openshift_for_quickstart_deployment]] -= Prepare OpenShift for Quickstart Deployment - -. Log in to your OpenShift instance using the `oc login` command. -. Create a new project for the quickstart in OpenShift. You can create a project in OpenShift using the following command. -+ -[options="nowrap",subs="attributes"] ----- -$ oc new-project {artifactId}-project ----- -//// -. Create a keystore. -+ -{xpaasproduct-shortname} requires a keystore to be imported to properly install and configure the image on your OpenShift instance. -+ -[WARNING] -==== -The following commands generate a self-signed certificate, but for production environments Red Hat recommends that you use your own SSL certificate purchased from a verified Certificate Authority (CA) for SSL-encrypted connections (HTTPS). -==== -+ -You can use the Java `keytool` command to generate a keystore using the following command. -+ -[options="nowrap",subs="attributes"] ----- -$ keytool -genkey -keyalg RSA -alias {artifactId}-project-selfsigned -keystore keystore.jks -validity 360 -keysize 2048 ----- -. Create a secret from the previously created keystore using the following command. -+ -[options="nowrap",subs="attributes"] ----- -$ oc secrets new eap7-app-secret keystore.jks ----- -//// \ No newline at end of file diff --git a/shared-doc/cd-deploy-project.adoc b/shared-doc/cd-deploy-project.adoc deleted file mode 100644 index ea3834d835..0000000000 --- a/shared-doc/cd-deploy-project.adoc +++ /dev/null @@ -1,43 +0,0 @@ -[[deploy_eap_s2i]] -= Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift - -. Create a new OpenShift application using the {xpaasproduct-shortname} image and the quickstart's source code. Use the following command to use the `{ImagePrefixVersion}-basic-s2i` template with the `{artifactId}` source code on GitHub. -+ -[options="nowrap",subs="+attributes"] ----- -oc new-app --template={ImagePrefixVersion}-basic-s2i {backslash} - -p IMAGE_STREAM_NAMESPACE="{artifactId}-project" {backslash} - -p SOURCE_REPOSITORY_URL="{EAPQuickStartRepo}" {backslash} - -p SOURCE_REPOSITORY_REF="{EAPQuickStartRepoRef}" {backslash} -ifdef::uses-h2[] - -p ENABLE_GENERATE_DEFAULT_DATASOURCE="true" {backslash} -endif::[] - -p CONTEXT_DIR="{artifactId}" ----- -With respect to the command parameters: -* `--template` The template to use. -* `-p IMAGE_STREAM_NAMESPACE` The latest images streams and templates xref:import_imagestreams_templates[were imported into the project's namespace], so you must specify the namespace of where to find the image stream. This is usually the OpenShift project's name. -* `-p SOURCE_REPOSITORY_URL` The URL to the repository containing the application source code. -* `-p SOURCE_REPOSITORY_REF` The Git repository reference to use for the source code. This can be a Git branch or tag reference. -ifdef::uses-h2[] -* `-p ENABLE_GENERATE_DEFAULT_DATASOURCE` Enables the default datasource, which is required by this quickstart. -endif::[] -* `-p CONTEXT_DIR` The directory within the source repository to build. - -+ -NOTE: A template can specify default values for many template parameters, and you might have to override some, or all, of the defaults. To see template information, including a list of parameters and any default values, use the command `oc describe template __TEMPLATE_NAME__`. - -TIP: It is possible to trim down the JBoss EAP image that will be used to run this quickstart. To do so, please add the `-p GALLEON_PROVISION_LAYERS=` argument when creating the new application. Please refer to the JBoss EAP documentation for the list of supported galleon layers. - -. Retrieve the name of the build configuration. -+ -[options="nowrap"] ----- -$ oc get bc -o name ----- -. Use the name of the build configuration from the previous step to view the Maven progress of the build. -+ -[options="nowrap",subs="+quotes"] ----- -$ oc logs -f buildconfig/eap-app ----- diff --git a/shared-doc/cd-import-imagestreams-templates.adoc b/shared-doc/cd-import-imagestreams-templates.adoc deleted file mode 100644 index 4e298cc6ce..0000000000 --- a/shared-doc/cd-import-imagestreams-templates.adoc +++ /dev/null @@ -1,49 +0,0 @@ - -[[import_imagestreams_templates]] -= Import the Latest {xpaasproduct-shortname} Image Streams and Templates - -[IMPORTANT] -==== -If you are building and deploying this quickstart on {xpaasproduct-shortname}, you must configure authentication to the {ContainerRegistryName} before you import the image streams and templates into your namespace. link:{LinkOpenShiftGuide}#container_registry_authentication[_{EapForOpenshiftBookName}_] provides an example of one way to configure authentication to the registry. For additional information, see link:https://access.redhat.com/RegistryAuthentication[Red Hat Container Registry Authentication] on the Red Hat Customer Portal. - -Configuration of authentication to the registry is not necessary if you are building and deploying this quickstart on {xpaasproductOpenShiftOnline-shortname}. -==== - -Use the following command to import the latest {xpaasproduct-shortname} image streams and templates into your OpenShift project's namespace. - -[options="nowrap",subs="+attributes"] ----- -for resource in \ - {ImagePrefixVersion}-image-stream.json \ - {ImagePrefixVersion}-amq-persistent-s2i.json \ - {ImagePrefixVersion}-amq-s2i.json \ - {ImagePrefixVersion}-basic-s2i.json \ - {ImagePrefixVersion}-https-s2i.json \ - {ImagePrefixVersion}-mongodb-persistent-s2i.json \ - {ImagePrefixVersion}-mongodb-s2i.json \ - {ImagePrefixVersion}-mysql-persistent-s2i.json \ - {ImagePrefixVersion}-mysql-s2i.json \ - {ImagePrefixVersion}-postgresql-persistent-s2i.json \ - {ImagePrefixVersion}-postgresql-s2i.json \ -ifndef::eap-openshift-online[ {ImagePrefixVersion}-third-party-db-s2i.json \] -ifndef::eap-openshift-online[ {ImagePrefixVersion}-tx-recovery-s2i.json \] - {ImagePrefixVersion}-sso-s2i.json -do - oc replace --force -f \ -{ImageandTemplateImportURL}${resource} -done ----- - -[NOTE] -==== -The {ProductShortName} image streams and templates imported using the above command are only available within that OpenShift project. - -If you have administrative access to the general `openshift` namespace and want the image streams and templates to be accessible by all projects, add `-n openshift` to the `oc replace` line of the command. For example: - -[options="nowrap"] ----- -... -oc replace -n openshift --force -f \ -... ----- -==== diff --git a/shared-doc/cd-openshift-getting-started-overview.adoc b/shared-doc/cd-openshift-getting-started-overview.adoc deleted file mode 100644 index 03e2186b96..0000000000 --- a/shared-doc/cd-openshift-getting-started-overview.adoc +++ /dev/null @@ -1,8 +0,0 @@ -[[getting_started_with_openshift_overview]] -= Getting Started with {xpaasproduct-shortname} - -Each quickstart `README{outfilesuffix}` file contains the basic instructions to build and deploy the quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname}. - -See link:{LinkOpenShiftGuide}[_{EapForOpenshiftBookName}_] for more detailed information about building and running applications on {xpaasproduct-shortname}. - -See link:{LinkOpenShiftOnlineGuide}[_{EapForOpenshiftOnlineBookName}_] for more detailed information about building and running applications on {xpaasproductOpenShiftOnline-shortname}. diff --git a/shared-doc/cd-post-deployment-tasks.adoc b/shared-doc/cd-post-deployment-tasks.adoc deleted file mode 100644 index 2c5a82e09a..0000000000 --- a/shared-doc/cd-post-deployment-tasks.adoc +++ /dev/null @@ -1,37 +0,0 @@ -[[post_deployment]] -= OpenShift Post Deployment Tasks - -Depending on your application, some tasks might need to be performed after your OpenShift application has been built and deployed. This might include exposing a service so that the application is viewable from outside of OpenShift, or scaling your application to a specific number of replicas. - -. Get the service name of the quickstart application using the following command. -+ -[options="nowrap",subs="+quotes"] ----- -$ oc get service ----- -. Expose the main service as a route so you can access the application from outside of OpenShift. For example, for the `{artifactId}` quickstart, use the following command to expose the required service and port. -+ -[options="nowrap",subs="+quotes"] ----- -$ oc expose service/__eap-app__ --port=__8080__ ----- -+ -[NOTE] -==== -If you used a template to create the application, the route might already exist. If it does, continue on to the next step. -==== -. Get the URL of the route. -+ -[options="nowrap"] ----- -$ oc get route ----- -. Access the application in your web browser using the URL. The URL is the value of the `HOST/PORT` field from previous command's output. -+ -If your application does not use the {ProductShortName} root context, append the context of the application to the URL. For example, for the `kitchensink` quickstart, the URL might be `http://__HOST_PORT_VALUE__/{artifactId}/`. -. Optionally, you can also scale up the application instance by running the following command. This increases the number of replicas to `3`. -+ -[options="nowrap",subs="+quotes"] ----- -$ oc scale deploymentconfig eap-app --replicas=3 ----- diff --git a/shared-doc/debug-the-application.adoc b/shared-doc/debug-the-application.adoc deleted file mode 100644 index a08812b78d..0000000000 --- a/shared-doc/debug-the-application.adoc +++ /dev/null @@ -1,23 +0,0 @@ -[[debug_the_application]] -= Debug the Application -//****************************************************************************** -// Include this template to provide debugging information. -//****************************************************************************** - -If you want to debug the source code of any library in the project, run the following command to pull the source into your local repository. The IDE should then detect it. - ----- -$ mvn dependency:sources ----- - -//// -TODO: I need to investigate whether the following version can be used across all quickstarts. - -If you want to debug the source code or look at the Javadocs of any library in the project, run either of the following commands to pull them into your local repository. The IDE should then detect them. - -[source,options="nowrap"] ----- -$ mvn dependency:sources -$ mvn dependency:resolve -Dclassifier=javadoc ----- -//// diff --git a/shared-doc/define-standalone-server-attributes.adoc b/shared-doc/define-standalone-server-attributes.adoc deleted file mode 100644 index 19262374ac..0000000000 --- a/shared-doc/define-standalone-server-attributes.adoc +++ /dev/null @@ -1,62 +0,0 @@ -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] diff --git a/shared-doc/deploy-to-openshift-online.adoc b/shared-doc/deploy-to-openshift-online.adoc deleted file mode 100644 index bdda27167c..0000000000 --- a/shared-doc/deploy-to-openshift-online.adoc +++ /dev/null @@ -1,68 +0,0 @@ -[[deploy_the_quickstart_to_openshift_online]] -= Deploy the Quickstart to OpenShift Online - -Use these instructions to deploy the quickstart to {OpenShiftOnlineName}. If you do not yet have an OpenShift Online account and are interested in signing up for one, see link:{LinkOpenShiftSignup}[Choose a Plan] in the OpenShift Online documentation located on the Red Hat Customer Portal. For information about running {ProductShortName} on {OpenShiftOnlineName}, see link:{LinkOpenShiftOnlineGuide}[_{EapForOpenshiftOnlineBookName}_], also located on the Red Hat Customer Portal. - -[[create_and_deploy_the_quickstart_project]] -== Create and Deploy the Quickstart Project - -Follow these instructions to deploy this quickstart to OpenShift Online. - -. Browse to OpenShift Online console and login with your credentials. -. On the *View All Projects* or *Welcome to Project* page, click *Create Project*. -. On the *Create Project* page, enter the following information: -+ -[source,subs="+quotes,attributes+"] ----- -*Name:* {artifactId} -*Display Name* {artifactId} -*Description:* {artifactId} ----- - -. Click *Create* to create the project. -. On the *My Projects* page, choose your new *{artifactId}* and click *Browse Catalog*. -. Choose *{OpenShiftTemplateName}* and then click *Next* to view the *Information* page. -. Click *Next* to navigate to the *Configuration* page. . . Enter the following information. You can leave the remaining fields as they are. -+ -[source,subs="+quotes,attributes+"] ----- -*Add to Project:* {artifactId} -*Application Name:* {artifactId} -*Custom http Route Hostname:* (leave blank) -*Git Repository URL:* {githubRepoUrl} -*Git Reference:* {githubRepoBranch} -*Context directory:* {artifactId} ----- - -. Click the *Create* button. -. Click on the *Continue to the project overview* link. - -* You should see "Build #1 is running ..." with the console log below. -+ -[source,subs="+quotes,attributes+"] ----- -Cloning ... -Downloading ... -Building ... -Copying ... -Pushing ... ----- - -* At the end of the build, you should see "Push successful". -* Click *View Full Log* to see the entire log. - -. Click the *Overview* tab to see the `{artifactId}` deployment. -. Click on the application URL on the right side of the page to view the running application. It should be in the following pattern: -+ -[source,subs="+quotes,attributes+"] ----- -http://__APPLICATION_NAME__-__PROJECT_NAME__.__PORT__.__HOST__.openshiftapps.com ----- - -[[delete_the_quickstart_project]] -== Delete the Quickstart Project - -Follow these instructions to delete the project from OpenShift Online. - -. Go to the *View All Projects* page and select *Delete Project* from the drop down list to the right of the *{artifactId}* project. -. Type the name of the project to confirm, and then click *Delete* diff --git a/shared-doc/development-shortcuts.adoc b/shared-doc/development-shortcuts.adoc deleted file mode 100644 index 93efb7779d..0000000000 --- a/shared-doc/development-shortcuts.adoc +++ /dev/null @@ -1,26 +0,0 @@ -[[considerations_for_use_in_a_production_environment]] -= Considerations for Use in a Production Environment -//****************************************************************************** -// Include this template if your quickstart: -// * Uses the h2 database: Be sure to define the `uses-h2` attribute. -// * Uses an `*-ds.xml file`: Be sure to define the `uses-ds-xml` attribute. -// * Has performance or scalability concerns: Be sure to define the `uses-ds-xml` attribute. -//****************************************************************************** - -ifdef::uses-h2[] - -H2 Database:: This quickstart uses the H2 database included with {productNameFull} {productVersion}. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment. - -endif::uses-h2[] - -ifdef::uses-ds-xml[] - -Datasource Configuration File:: This quickstart uses a `*-ds.xml` datasource configuration file for convenience and ease of database configuration. These files are deprecated in {productName} and should not be used in a production environment. Instead, you should configure the datasource using the Management CLI or Management Console. Datasource configuration is documented in the {LinkConfigGuide}[__{ConfigBookName}__]. - -endif::uses-ds-xml[] - -ifdef::performance-scalability[] - -Performance and Scalability:: A Jakarta EE container is designed with robustness in mind, so you should carefully analyze the scalabiltiy, concurrency, and performance needs of your application before taking advantage of these techniques in your own applications. - -endif::performance-scalability[] diff --git a/shared-doc/helm-deploy-project.adoc b/shared-doc/helm-deploy-project.adoc deleted file mode 100644 index f720a1bac7..0000000000 --- a/shared-doc/helm-deploy-project.adoc +++ /dev/null @@ -1,67 +0,0 @@ -[[deploy_helm]] -== Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -Log in to your OpenShift instance using the `oc login` command. -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -Navigate to the root directory of this quickstart and run the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm install {artifactId} -f charts/helm.yaml {helmChartName} -NAME: {artifactId} -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17: - -[source,options="nowrap",subs="+attributes"] ----- -build: - uri: {githubRepoCodeUrl} - ref: {WildFlyQuickStartRepoTag} - contextDir: {artifactId} -deploy: - replicas: 1 ----- - -This will create a new deployment on OpenShift and deploy the application. - -If you want to see all the configuration elements to customize your deployment you can use the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let’s wait for the application to be built and deployed: -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment {artifactId} -w -NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE -{artifactId} 1 1 1 0 12s -... -{artifactId} 1 1 1 1 2m ----- - -Get the URL of the route to the deployment. - -[source,options="nowrap",subs="+attributes"] ----- -$ oc get route {artifactId} -o jsonpath="{.spec.host}" ----- -Access the application in your web browser using the displayed URL. - -[NOTE] -==== -The Maven profile named `openshift` is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the `/{artifactId}` path segment after `HOST:PORT`. -==== - -[[undeploy_helm]] -== Undeploy the {ProductShortName} Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts - - -[source,options="nowrap",subs="+attributes"] ----- -$ helm uninstall {artifactId} ----- \ No newline at end of file diff --git a/shared-doc/helm-getting-started-overview.adoc b/shared-doc/helm-getting-started-overview.adoc deleted file mode 100644 index 2f876b2bd3..0000000000 --- a/shared-doc/helm-getting-started-overview.adoc +++ /dev/null @@ -1,6 +0,0 @@ -[[getting_started_with_helm]] -= Getting Started with {xpaasproduct-shortname} and Helm Charts - -This section contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} using Helm Charts. - -include::../shared-doc/helm-pre-requisites.adoc[] \ No newline at end of file diff --git a/shared-doc/helm-pre-requisites.adoc b/shared-doc/helm-pre-requisites.adoc deleted file mode 100644 index 19d6b9550c..0000000000 --- a/shared-doc/helm-pre-requisites.adoc +++ /dev/null @@ -1,39 +0,0 @@ -[[prerequisites_helm_openshift]] -== Prerequisites - -* You must be logged in OpenShift and have an `oc` client to connect to OpenShift -* https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. - -Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}. - -ifndef::ProductRelease,EAPXPRelease[] -[source,options="nowrap"] ----- -$ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ -"wildfly" has been added to your repositories -$ helm search repo wildfly -NAME CHART VERSION APP VERSION DESCRIPTION -wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift -wildfly/wildfly-common ... ... A library chart for WildFly-based applications ----- -endif::[] -ifdef::ProductRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP {productVersion} applications ----- -endif::[] -ifdef::EAPXPRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP XP {productVersion} applications ----- -endif::[] diff --git a/shared-doc/openshift-create-project.adoc b/shared-doc/openshift-create-project.adoc deleted file mode 100644 index aaeeb01ef6..0000000000 --- a/shared-doc/openshift-create-project.adoc +++ /dev/null @@ -1,46 +0,0 @@ - -[[prepare_openshift_for_quickstart_deployment]] -= Prepare OpenShift for Quickstart Deployment - -. Log in to your OpenShift instance using the `oc login` command. -. Create a new project for the quickstart in OpenShift. You can create a project in OpenShift using the following command. -+ -[options="nowrap",subs="attributes"] ----- -$ oc new-project {artifactId}-project ----- -+ - -Before you can import and use the OpenShift image for {xpaasproduct-shortname} , you must configure authentication to the Red Hat Container Registry. - -Create an authentication token using a registry service account to configure access to the Red Hat Container Registry. You need not use or store your Red Hat account's username and password in your OpenShift configuration when you use an authentication token. - -.Procedure - -. Follow the instructions on Red Hat Customer Portal to create an authentication token using a registry service account. -. Download the YAML file containing the OpenShift secret for the token. -+ -You can download the YAML file from the *OpenShift Secret* tab on your token's *Token Information* page. - -. Create the authentication token secret for your OpenShift project using the YAML file that you downloaded: -+ -[options="nowrap",subs="+quotes"] ----- -oc create -f __1234567_myserviceaccount-secret.yaml__ ----- -+ -. Configure the secret for your OpenShift project using the following commands, replacing the secret name below with the name of your secret created in the previous step. -+ -[options="nowrap",subs="+quotes"] ----- -oc secrets link default __1234567-myserviceaccount-pull-secret__ --for=pull -oc secrets link builder __1234567-myserviceaccount-pull-secret__ --for=pull ----- -.Additional resources - -* link:https://access.redhat.com/RegistryAuthentication#registry-service-accounts-for-shared-environments-4[Create an authentication token using a registry service account] - -* link:https://access.redhat.com/documentation/en-us/openshift_container_platform/3.11/html/developer_guide/dev-guide-managing-images#allowing-pods-to-reference-images-from-other-secured-registries[Configuring access to secured registries] - -* link:https://access.redhat.com/RegistryAuthentication[Configuring authentication to the Red Hat Container Registry] - diff --git a/shared-doc/openshift-deploy-project.adoc b/shared-doc/openshift-deploy-project.adoc deleted file mode 100644 index 2b08601c9d..0000000000 --- a/shared-doc/openshift-deploy-project.adoc +++ /dev/null @@ -1,97 +0,0 @@ -[[deploy_eap_s2i]] -= Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift - -.Procedure - -. Create a new OpenShift application using the {xpaasproduct-shortname} image and the quickstart's source code. Use the following command to use the `{ImagePrefixVersion}-basic-s2i` template with the JDK 8 images and the `{artifactId}` source code on GitHub. -+ -[options="nowrap",subs="+attributes"] ----- -$ oc new-app --template={ImagePrefixVersion}-basic-s2i {backslash} - -p EAP_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk8-openshift:latest {backslash} - -p EAP_RUNTIME_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk8-runtime-openshift:latest {backslash} - -p IMAGE_STREAM_NAMESPACE="{artifactId}-project" {backslash} - -p SOURCE_REPOSITORY_URL="{EAPQuickStartRepo}" {backslash} - -p SOURCE_REPOSITORY_REF="{EAPQuickStartRepoRef}" {backslash} -ifdef::uses-h2[] - -p ENABLE_GENERATE_DEFAULT_DATASOURCE="true" {backslash} -endif::[] - -p CONTEXT_DIR="{artifactId}" ----- -+ --- -* `--template` The template to use. -* `-p IMAGE_STREAM_NAMESPACE` The latest images streams and templates xref:import_imagestreams_templates[were imported into the project's namespace], so you must specify the namespace of where to find the image stream. This is usually the OpenShift project's name. -* `-p SOURCE_REPOSITORY_URL` The URL to the repository containing the application source code. -* `-p SOURCE_REPOSITORY_REF` The Git repository reference to use for the source code. This can be a Git branch or tag reference. -ifdef::uses-h2[] -* `-p ENABLE_GENERATE_DEFAULT_DATASOURCE` Enables the default datasource, which is required by this quickstart. -endif::[] -* `-p CONTEXT_DIR` The directory within the source repository to build. --- -+ -Alternatively, to create the quickstart application using the JDK 11 images enter the following command. -+ -[options="nowrap",subs="+attributes"] ----- -$ oc new-app --template={ImagePrefixVersion}-basic-s2i {backslash} - -p EAP_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk11-openshift:latest \ - -p EAP_RUNTIME_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift:latest \ - -p IMAGE_STREAM_NAMESPACE="{artifactId}-project" {backslash} - -p SOURCE_REPOSITORY_URL="{EAPQuickStartRepo}" {backslash} - -p SOURCE_REPOSITORY_REF="{EAPQuickStartRepoRef}" {backslash} -ifdef::uses-h2[] - -p ENABLE_GENERATE_DEFAULT_DATASOURCE="true" {backslash} -endif::[] - -p CONTEXT_DIR="{artifactId}" ----- -+ --- -* `--template` The template to use. -* `-p IMAGE_STREAM_NAMESPACE` The latest images streams and templates xref:import_imagestreams_templates[were imported into the project's namespace], so you must specify the namespace of where to find the image stream. This is usually the OpenShift project's name. -* `-p SOURCE_REPOSITORY_URL` The URL to the repository containing the application source code. -* `-p SOURCE_REPOSITORY_REF` The Git repository reference to use for the source code. This can be a Git branch or tag reference. -ifdef::uses-h2[] -* `-p ENABLE_GENERATE_DEFAULT_DATASOURCE` Enables the default datasource, which is required by this quickstart. -endif::[] -* `-p CONTEXT_DIR` The directory within the source repository to build. --- - -+ -NOTE: A template can specify default values for many template parameters, and you might have to override some, or all, of the defaults. To see template information, including a list of parameters and any default values, use the command `oc describe template __TEMPLATE_NAME__`. - -+ -TIP: It is possible to trim down the {xpaasproduct-shortname} image that will be used to run this quickstart. To do so, please add the `-p GALLEON_PROVISION_LAYERS=` argument when creating the new application. Please refer to the JBoss EAP documentation for the list of supported galleon layers. - -. Retrieve the name of the build configuration. -+ -[options="nowrap"] ----- -$ oc get bc -o name ----- -+ -. Use the name of the build configurations from the previous step to view the Maven progress of the builds. -+ -[options="nowrap",subs="+quotes"] ----- -$ oc logs -f bc/${APPLICATION_NAME}-build-artifacts - -… -Push successful -$ oc logs -f bc/${APPLICATION_NAME} -… -Push successful ----- -+ -For example, for the previously created application, the following command shows the progress of the Maven builds. -+ -[options="nowrap",subs="+attributes"] ----- -$ oc logs -f bc/{ImagePrefixVersion}-basic-app-build-artifacts - -… -Push successful -$ oc logs -f bc/{ImagePrefixVersion}-basic-app -… -Push successful ----- \ No newline at end of file diff --git a/shared-doc/openshift-getting-started-overview.adoc b/shared-doc/openshift-getting-started-overview.adoc deleted file mode 100644 index 03e2186b96..0000000000 --- a/shared-doc/openshift-getting-started-overview.adoc +++ /dev/null @@ -1,8 +0,0 @@ -[[getting_started_with_openshift_overview]] -= Getting Started with {xpaasproduct-shortname} - -Each quickstart `README{outfilesuffix}` file contains the basic instructions to build and deploy the quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname}. - -See link:{LinkOpenShiftGuide}[_{EapForOpenshiftBookName}_] for more detailed information about building and running applications on {xpaasproduct-shortname}. - -See link:{LinkOpenShiftOnlineGuide}[_{EapForOpenshiftOnlineBookName}_] for more detailed information about building and running applications on {xpaasproductOpenShiftOnline-shortname}. diff --git a/shared-doc/openshift-getting-started.adoc b/shared-doc/openshift-getting-started.adoc deleted file mode 100644 index 64c92ee848..0000000000 --- a/shared-doc/openshift-getting-started.adoc +++ /dev/null @@ -1,8 +0,0 @@ -[[getting_started_with_openshift]] -= Getting Started with {xpaasproduct-shortname} - -This document contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname}. - -See link:{LinkOpenShiftGuide}[_{EapForOpenshiftBookName}_] for more detailed information about building and running applications on {xpaasproduct-shortname}. - -See link:{LinkOpenShiftOnlineGuide}[_{EapForOpenshiftOnlineBookName}_] for more detailed information about building and running applications on {xpaasproductOpenShiftOnline-shortname}. diff --git a/shared-doc/openshift-import-imagestreams-templates.adoc b/shared-doc/openshift-import-imagestreams-templates.adoc deleted file mode 100644 index eaeae62aab..0000000000 --- a/shared-doc/openshift-import-imagestreams-templates.adoc +++ /dev/null @@ -1,71 +0,0 @@ - -[[import_imagestreams_templates]] -= Import the Latest {xpaasproduct-shortname} Imagestreams and Templates - -[IMPORTANT] -==== -If you are building and deploying this quickstart on {xpaasproduct-shortname}, you must configure authentication to the {ContainerRegistryName} before you import the image streams and templates into your namespace. link:{LinkOpenShiftGuide}#container_registry_authentication[_{EapForOpenshiftBookName}_] provides an example of one way to configure authentication to the registry. For additional information, see link:https://access.redhat.com/RegistryAuthentication[Red Hat Container Registry Authentication] on the Red Hat Customer Portal. - -Configuration of authentication to the registry is not necessary if you are building and deploying this quickstart on {xpaasproductOpenShiftOnline-shortname}. -==== - -.Procedure - -. Use the following commands to import the latest JDK 8 and JDK 11 image streams and templates for the OpenShift image for {xpaasproduct-shortname}, into your OpenShift project's namespace. - -.. Import JDK 8 image streams: -+ -[options="nowrap",subs="+attributes"] ----- -oc replace --force -f {ImageandTemplateImportURL}{ImagePrefixVersion}-openjdk8-image-stream.json ----- -+ -This command imports the following imagestreams: - -* The JDK 8 builder imagestream: jboss-{ImagePrefixVersion}-openjdk8-openshift -* The JDK 8 runtime imagestream: jboss-{ImagePrefixVersion}-openjdk8-runtime-openshift -+ -.. Import JDK 11 image stream: -+ -[options="nowrap",subs="+attributes"] ----- -oc replace --force -f {ImageandTemplateImportURL}{ImagePrefixVersion}-openjdk11-image-stream.json ----- -+ -This command imports the following imagestreams: - -* The JDK 11 builder imagestream: jboss-{ImagePrefixVersion}-openjdk11-openshift -* The JDK 11 runtime imagestream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift -+ -.. Import the JDK 8 and JDK 11 templates: -+ -[options="nowrap",subs="+attributes"] ----- -for resource in \ - {ImagePrefixVersion}-amq-persistent-s2i.json \ - {ImagePrefixVersion}-amq-s2i.json \ - {ImagePrefixVersion}-basic-s2i.json \ - {ImagePrefixVersion}-https-s2i.json \ - {ImagePrefixVersion}-sso-s2i.json \ - {ImagePrefixVersion}-starter-s2i.json \ - {ImagePrefixVersion}-third-party-db-s2i.json \ - {ImagePrefixVersion}-tx-recovery-s2i.json -do - oc replace --force -f \ -{ImageandTemplateImportURL}templates/${resource} -done ----- - -[NOTE] -==== -The {ProductShortName} image streams and templates imported using the above command are only available within that OpenShift project. - -If you have administrative access to the general `openshift` namespace and want the image streams and templates to be accessible by all projects, add `-n openshift` to the `oc replace` line of the command. For example: - -[options="nowrap"] ----- -... -oc replace -n openshift --force -f \ -... ----- -==== \ No newline at end of file diff --git a/shared-doc/openshift-incompatibility.adoc b/shared-doc/openshift-incompatibility.adoc deleted file mode 100644 index 025830708e..0000000000 --- a/shared-doc/openshift-incompatibility.adoc +++ /dev/null @@ -1,4 +0,0 @@ -[[openshift_incompatibility]] -= {xpaasproduct-shortname} Incompatibility - -This quickstart is not compatible with {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} templates. \ No newline at end of file diff --git a/shared-doc/openshift-post-deployment-tasks.adoc b/shared-doc/openshift-post-deployment-tasks.adoc deleted file mode 100644 index 8d9bf22745..0000000000 --- a/shared-doc/openshift-post-deployment-tasks.adoc +++ /dev/null @@ -1,61 +0,0 @@ -[[post_deployment]] -= OpenShift Post Deployment Tasks - -Depending on your application, you might need to complete some tasks after your OpenShift application has been built and deployed. - -Examples of post-deployment tasks include the following: - -* Exposing a service so that the application is viewable from outside of OpenShift. -* Scaling your application to a specific number of replicas. - -.Procedure - -. Get the service name of your application using the following command. -+ -[options="nowrap",subs="+quotes"] ----- -$ oc get service ----- - -. *Optional*: Expose the main service as a route so you can access your application from outside of OpenShift. For example, for the previously created application, use the following command to expose the required service and port. -+ -[NOTE] -==== -If you used a template to create the application, the route might already exist. If it does, continue on to the next step. -==== - -+ -[options="nowrap",subs="+attributes"] ----- -$ oc expose service/{ImagePrefixVersion}-basic-app --port=8080 ----- -+ - -. Get the URL of the route. -+ -[options="nowrap"] ----- -$ oc get route ----- -. Access the application in your web browser using the URL. The URL is the value of the `HOST/PORT` field from previous command's output. -+ -[NOTE] -==== - -For example, to interact with this quickstart , the root of its application URLs should be `https://_HOST_PORT_Value_/`. -==== -+ - -. Optionally, you can scale up the application instance by running the following command. This command increases the number of replicas to 3. -+ -[options="nowrap",subs="+quotes"] ----- -$ oc scale deploymentconfig __DEPLOYMENTCONFIG_NAME__ --replicas=3 ----- -+ -For example, for this` quickstart, use the following command to scale up the application. -+ -[options="nowrap",subs="+attributes"] ----- -$ oc scale deploymentconfig/{ImagePrefixVersion}-basic-app --replicas=3 ----- diff --git a/shared-doc/restore-managed-domain-configuration-manual.adoc b/shared-doc/restore-managed-domain-configuration-manual.adoc deleted file mode 100644 index c60d2aaa83..0000000000 --- a/shared-doc/restore-managed-domain-configuration-manual.adoc +++ /dev/null @@ -1,17 +0,0 @@ -[[restore_managed_domain_configuration_manually]] -= Restore the {productName} Managed Domain Configuration Manually -//****************************************************************************** -// Include this template to restore the server configuration if your -// quickstart modified the managed domain configuration files. -//****************************************************************************** - -When you have completed testing the quickstart, you can restore the original server configuration by manually restoring the backup copies the configuration files. - -* If it is running, stop the {productName} server. -* Replace the following files with the backup copies of the files. -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -__{jbossHomeName}__/domain/configuration/domain.xml -__{jbossHomeName}__/domain/configuration/host.xml ----- diff --git a/shared-doc/restore-standalone-server-configuration-manual.adoc b/shared-doc/restore-standalone-server-configuration-manual.adoc deleted file mode 100644 index d9825df0c6..0000000000 --- a/shared-doc/restore-standalone-server-configuration-manual.adoc +++ /dev/null @@ -1,13 +0,0 @@ -[[restore_standalone_server_configuration_manually]] -= Restore the {productName} Standalone Server Configuration Manually -//****************************************************************************** -// Include this template if your quickstart does a normal manual restoration -// of a single standalone server. -//****************************************************************************** - -include::define-standalone-server-attributes.adoc[] - -When you have completed testing the quickstart, you can restore the original server configuration by manually restoring the backup copy the configuration file. - -. If it is running, stop the {productName} server. -. Replace the `__{jbossHomeName}__/{configFileName}` file with the backup copy of the file. diff --git a/shared-doc/restore-standalone-server-configuration.adoc b/shared-doc/restore-standalone-server-configuration.adoc deleted file mode 100644 index 9f6d9d84cb..0000000000 --- a/shared-doc/restore-standalone-server-configuration.adoc +++ /dev/null @@ -1,30 +0,0 @@ -[[restore_the_standalone_server_configuration]] -= Restore the {productName} Standalone Server Configuration -//****************************************************************************** -// Include this template if your quickstart does a normal restoration of a single -// standalone server configuration. -// * It provides a CLI script. -// * You can manually restore the backup copy. -// -// You must define the script file name using the `restoreScriptName` attribute. -// For example: -// :restoreScriptName: remove-configuration.cli -//****************************************************************************** - -You can restore the original server configuration using either of the following methods. - -* You can xref:restore_standalone_server_configuration_using_cli[run the `{restoreScriptName}` script] provided in the root directory of this quickstart. -* You can xref:restore_standalone_server_configuration_manually[manually restore the configuration] using the backup copy of the configuration file. - -[[restore_standalone_server_configuration_using_cli]] -== Restore the {productName} Standalone Server Configuration by Running the JBoss CLI Script - -. xref:start_the_eap_standalone_server[Start the {productName} server] as described above. -. Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing `__{jbossHomeName}__` with the path to your server: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file={restoreScriptName} ----- -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. diff --git a/shared-doc/run-arquillian-functional-tests-remote.adoc b/shared-doc/run-arquillian-functional-tests-remote.adoc deleted file mode 100644 index c9bfbba246..0000000000 --- a/shared-doc/run-arquillian-functional-tests-remote.adoc +++ /dev/null @@ -1,37 +0,0 @@ -[[run_the_arquillian_functional_tests-remote]] -= Run the Arquillian Functional Tests -//****************************************************************************** -// Include this template if your quickstart provides standard Arquillian -// functional tests. -//****************************************************************************** - -This quickstart provides Arquillian functional tests. They are located under the `src/tests/` directory. Functional tests verify that your application behaves correctly from the user's point of view and simulate clicking around the web page as a normal user would do. - -Follow these steps to run the functional tests. - -ifdef::standalone-server-type[] -. xref:start_the_eap_standalone_server[Start the {productName} server] as described above. - -endif::[] - -ifdef::managed-domain-type[] -. xref:start_the_eap_managed_domain[Start the {productName} server] as described above. -endif::[] - -ifdef::standalone-server-type,managed-domain-type[] -. Type the following command to run the `verify` goal with the `arq-remote` profile activated. -endif::[] -ifndef::standalone-server-type,managed-domain-type[] -. You need to start the provisioned server or the bootable jar server, as previously described. -. Type the following command to run the `verify` goal with the `arq-remote` profile activated. -endif::[] - -[source,options="nowrap"] ----- -$ mvn verify -Parq-remote ----- - -[NOTE] -==== -You may also use the environment variable `SERVER_HOST` or the system property `server.host` to define the target host of the tests. -==== diff --git a/shared-doc/run-arquillian-functional-tests.adoc b/shared-doc/run-arquillian-functional-tests.adoc deleted file mode 100644 index 59f54675e4..0000000000 --- a/shared-doc/run-arquillian-functional-tests.adoc +++ /dev/null @@ -1,42 +0,0 @@ -[[run_the_arquillian_functional_tests]] -= Run the Arquillian Functional Tests -//****************************************************************************** -// Include this template if your quickstart provides standard Arquillian -// functional tests. -//****************************************************************************** - -This quickstart provides Arquillian functional tests. They are located under the `functional-tests/` directory. Functional tests verify that your application behaves correctly from the user's point of view and simulate clicking around the web page as a normal user would do. - -NOTE: The Arquillian functional tests deploy the application, so make sure you undeploy the quickstart before you begin. - -Follow these steps to run the functional tests. - -ifdef::standalone-server-type[] -. xref:start_the_eap_standalone_server[Start the {productName} server] as described above. -endif::[] - -ifdef::managed-domain-type[] -. xref:start_the_eap_managed_domain[Start the {productName} server] as described above. -endif::[] - -. Build the quickstart archive. -.. Open a terminal and navigate to the root directory of this quickstart. -.. Build the quickstart archive using the following command: -+ -[source,options="nowrap"] ----- -$ mvn clean package ----- -. Navigate to the `functional-tests/` directory in this quickstart. - -. Type the following command to run the `verify` goal with the `arq-remote` profile activated. -+ -[source,options="nowrap"] ----- -$ mvn clean verify -Parq-remote ----- - -[NOTE] -==== -You can also let Arquillian manage the {productName} server by using the `arq-managed` profile, meaning the tests will start the server for you. This profile requires that you provide Arquillian with the location of the {productName} server, either by setting the `JBOSS_HOME` environment variable, or by setting the `jbossHome` property in the `arquillian.xml` file. For more information, see link:{arquillianTestsDocUrl}[Run the Arquillian Tests]. -==== diff --git a/shared-doc/run-arquillian-integration-tests-with-openshift.adoc b/shared-doc/run-arquillian-integration-tests-with-openshift.adoc deleted file mode 100644 index 27c6f39d52..0000000000 --- a/shared-doc/run-arquillian-integration-tests-with-openshift.adoc +++ /dev/null @@ -1,24 +0,0 @@ -[[run_the_arquillian_integration_tests_with_openshift]] -= Run the Arquillian Integration Tests with OpenShift -//****************************************************************************** -// Include this template if your quickstart provides Openshift Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -[NOTE] -==== -The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin. -==== - -Run the integration tests using the following command to run the `verify` goal with the `arq-remote` profile activated and the proper URL: -[source,options="nowrap",subs="+attributes"] ----- -$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route {artifactId} --template='{{ .spec.host }}') ----- - -[NOTE] -==== -The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from. -==== \ No newline at end of file diff --git a/shared-doc/run-arquillian-integration-tests-with-provisioned-server.adoc b/shared-doc/run-arquillian-integration-tests-with-provisioned-server.adoc deleted file mode 100644 index b6315ca41d..0000000000 --- a/shared-doc/run-arquillian-integration-tests-with-provisioned-server.adoc +++ /dev/null @@ -1,17 +0,0 @@ -[[run_the_arquillian_integration_tests_with_provisioned_server_]] -= Run the Arquillian Integration Tests with a provisioned server -//****************************************************************************** -// Include this template if your quickstart provides standard Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -. Type the following command to run the `verify` goal with the `provisioned-server` profile activated. -+ -[source,options="nowrap"] ----- -$ mvn clean verify -Pprovisioned-server ----- - -This will build the provisioned server with the quickstart application, start it, run the integration tests and stop the server. \ No newline at end of file diff --git a/shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc b/shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc deleted file mode 100644 index d446e08e44..0000000000 --- a/shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc +++ /dev/null @@ -1,26 +0,0 @@ -[[run_the_arquillian_integration_tests_with_server_distribution]] -= Run the Arquillian Integration Tests -//****************************************************************************** -// Include this template if your quickstart provides standard Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -Follow these steps to run the integration tests. - -. Make sure you start the {productName} server, as previously described. - -. Make sure you build and deploy the quickstart, as previously described. - -. Type the following command to run the `verify` goal with the `arq-remote` profile activated. -+ -[source,options="nowrap"] ----- -$ mvn verify -Parq-remote ----- - -[NOTE] -==== -You may also use the environment variable `SERVER_HOST` or the system property `server.host` to define the target host of the tests. -==== \ No newline at end of file diff --git a/shared-doc/run-arquillian-tests.adoc b/shared-doc/run-arquillian-tests.adoc deleted file mode 100644 index 37216a677c..0000000000 --- a/shared-doc/run-arquillian-tests.adoc +++ /dev/null @@ -1,48 +0,0 @@ -[[run_the_arquillian_tests]] -= Run the Arquillian Tests -//****************************************************************************** -// Include this template if your quickstart provides standard Arquillian tests. -//****************************************************************************** - -This quickstart provides Arquillian tests. By default, these tests are configured to be skipped since Arquillian tests require the use of a container. - -NOTE: The Arquillian tests deploy the application, so make sure you undeploy the quickstart before you begin. - -ifdef::arq-prerequisities[] -== Arquillian Tests prerequisities - -{arq-prerequisities} -endif::[] - -Follow these steps to run the tests. - -ifdef::standalone-server-type[] -. xref:start_the_eap_standalone_server[Start the {productName} server] as described above. -endif::[] - -ifdef::managed-domain-type[] -. xref:start_the_eap_managed_domain[Start the {productName} server] as described above. -endif::[] - -. Open a terminal and navigate to the root directory of this quickstart. -. Type the following command to run the `verify` goal with the `arq-remote` profile activated. -+ -[source,options="nowrap"] ----- -$ mvn clean verify -Parq-remote ----- -ifdef::arquillianTestResults[] -You should see the following results: -+ -[source,subs=attributes+,options="nowrap"] ----- -Results : - -{arquillianTestResults} ----- -endif::[] - -[NOTE] -==== -You can also let Arquillian manage the {productName} server by using the `arq-managed` profile, meaning the tests will start the server for you. This profile requires that you provide Arquillian with the location of the {productName} server, either by setting the `JBOSS_HOME` environment variable, or by setting the `jbossHome` property in the `arquillian.xml` file. For more information, see link:{arquillianTestsDocUrl}[Run the Arquillian Tests]. -==== diff --git a/shared-doc/run-the-quickstart-in-jboss-developer-studio.adoc b/shared-doc/run-the-quickstart-in-jboss-developer-studio.adoc deleted file mode 100644 index 5272595257..0000000000 --- a/shared-doc/run-the-quickstart-in-jboss-developer-studio.adoc +++ /dev/null @@ -1,17 +0,0 @@ -[[run_the_quickstart_in_redhat_codeready_studio_or_eclipse]] -= Run the Quickstart in {JBDSProductName} or Eclipse -//****************************************************************************** -// Include this template to provide instructions to run the quickstart -// in Red Hat CodeReady Studio. -// -// If the quickstart is not supported, create the `jbds-not-supported` attribute. -//****************************************************************************** -ifdef::jbds-not-supported[] -This quickstart is not supported in {JBDSProductName}. -endif::jbds-not-supported[] - -ifndef::jbds-not-supported[] -You can also start the server and deploy the quickstarts or run the Arquillian tests in {JBDSProductName} or from Eclipse using JBoss tools. For general information about how to import a quickstart, add a {productName} server, and build and deploy a quickstart, see link:{useEclipseUrl}[Use {JBDSProductName} or Eclipse to Run the Quickstarts]. -endif::jbds-not-supported[] - -// Add additional instructions specific to running this quickstart in an IDE here. diff --git a/shared-doc/setup-repositories.adoc b/shared-doc/setup-repositories.adoc deleted file mode 100644 index 4ff0ecf46f..0000000000 --- a/shared-doc/setup-repositories.adoc +++ /dev/null @@ -1,59 +0,0 @@ -Setup the required Maven repositories (if you don't have them set up in Maven global settings): - -[source,xml] ----- - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public - default - - true - never - - - true - never - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - default - - true - never - - - true - never - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public - - true - - - true - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - - - true - - - ----- diff --git a/shared-doc/start-the-managed-domain.adoc b/shared-doc/start-the-managed-domain.adoc deleted file mode 100644 index 8ea1ba9587..0000000000 --- a/shared-doc/start-the-managed-domain.adoc +++ /dev/null @@ -1,23 +0,0 @@ -[[start_the_eap_managed_domain]] -= Start the {productName} Managed Domain -//****************************************************************************** -// Include this template if your quickstart requires a normal start of a -// managed domain. -// -// This template does not currently support passing arguments for starting -// the domain, but it could be added. -// -// * Define the managed domain profile type. Supported values are: -// :managed-domain-type: default -// -//****************************************************************************** - -. Open a terminal and navigate to the root of the {productName} directory. -. Start the {productName} managed domain by typing the following command. -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/domain.sh ----- -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\domain.bat` script. diff --git a/shared-doc/start-the-standalone-server.adoc b/shared-doc/start-the-standalone-server.adoc deleted file mode 100644 index 2d2aad919b..0000000000 --- a/shared-doc/start-the-standalone-server.adoc +++ /dev/null @@ -1,50 +0,0 @@ -[[start_the_eap_standalone_server]] -= Start the {productName} Standalone Server -//****************************************************************************** -// Include this template if your quickstart requires a normal start of a single -// standalone server. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// custom -// -// * For mobile applications, you can define the `mobileApp` variable in the -// `README.adoc` file to add `-b 0.0.0.0` to the command line. This allows -// external clients, such as phones, tablets, and desktops, to connect -// to the application through through your local network -// ::mobileApp: {artifactId}-service -// -//****************************************************************************** - -include::define-standalone-server-attributes.adoc[] - -. Open a terminal and navigate to the root of the {productName} directory. -. Start the {productName} server with the {serverProfile} by typing the following command. -+ -ifdef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __JAEGER_REPORTER_LOG_SPANS=true JAEGER_SAMPLER_TYPE=const JAEGER_SAMPLER_PARAM=1__ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -ifndef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\standalone.bat` script. - -ifdef::mobileApp[] -+ -Adding `-b 0.0.0.0` to the above command allows external clients, such as phones, tablets, and desktops, to connect through your local network. For example: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} -b 0.0.0.0 ----- -endif::[] diff --git a/shared-doc/system-requirements.adoc b/shared-doc/system-requirements.adoc deleted file mode 100644 index 7c7aaeb038..0000000000 --- a/shared-doc/system-requirements.adoc +++ /dev/null @@ -1,13 +0,0 @@ -[[system_requirements]] -= System Requirements -//****************************************************************************** -// Include this template to describe the standard system requirements for -// running the quickstarts. -// -// The Forge quickstarts define a `forge-from-scratch` attribute because they -// run entirely in CodeReady Studio and have different requirements . -//****************************************************************************** - -The application this project produces is designed to be run on {productNameFull} {productVersion} or later. - -All you need to build this project is {buildRequirements}. See link:{configureMavenDocUrl}[Configure Maven to Build and Deploy the Quickstarts] to make sure you are configured correctly for testing the quickstarts. diff --git a/shared-doc/undeploy-the-quickstart.adoc b/shared-doc/undeploy-the-quickstart.adoc deleted file mode 100644 index 0429ac2e1d..0000000000 --- a/shared-doc/undeploy-the-quickstart.adoc +++ /dev/null @@ -1,16 +0,0 @@ -[[undeploy_the_quickstart]] -= Undeploy the Quickstart - -//******************************************************************************* -// Include this template if your quickstart does a normal undeployment of an archive. -//******************************************************************************* -When you are finished testing the quickstart, follow these steps to undeploy the archive. - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -. Type this command to undeploy the archive: -+ -[source,options="nowrap"] ----- -$ mvn wildfly:undeploy ----- diff --git a/shared-doc/use-of-jboss-home-name.adoc b/shared-doc/use-of-jboss-home-name.adoc deleted file mode 100644 index 77d22ec612..0000000000 --- a/shared-doc/use-of-jboss-home-name.adoc +++ /dev/null @@ -1,30 +0,0 @@ -ifdef::requires-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -This quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifdef::optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -When deploying this quickstart to a managed domain, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When deploying this quickstart to multiple standalone servers, this quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifndef::requires-multiple-servers,optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName} and QUICKSTART_HOME Variables - -In the following instructions, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] diff --git a/shared-doc/xp-create-project.adoc b/shared-doc/xp-create-project.adoc deleted file mode 100644 index aaeeb01ef6..0000000000 --- a/shared-doc/xp-create-project.adoc +++ /dev/null @@ -1,46 +0,0 @@ - -[[prepare_openshift_for_quickstart_deployment]] -= Prepare OpenShift for Quickstart Deployment - -. Log in to your OpenShift instance using the `oc login` command. -. Create a new project for the quickstart in OpenShift. You can create a project in OpenShift using the following command. -+ -[options="nowrap",subs="attributes"] ----- -$ oc new-project {artifactId}-project ----- -+ - -Before you can import and use the OpenShift image for {xpaasproduct-shortname} , you must configure authentication to the Red Hat Container Registry. - -Create an authentication token using a registry service account to configure access to the Red Hat Container Registry. You need not use or store your Red Hat account's username and password in your OpenShift configuration when you use an authentication token. - -.Procedure - -. Follow the instructions on Red Hat Customer Portal to create an authentication token using a registry service account. -. Download the YAML file containing the OpenShift secret for the token. -+ -You can download the YAML file from the *OpenShift Secret* tab on your token's *Token Information* page. - -. Create the authentication token secret for your OpenShift project using the YAML file that you downloaded: -+ -[options="nowrap",subs="+quotes"] ----- -oc create -f __1234567_myserviceaccount-secret.yaml__ ----- -+ -. Configure the secret for your OpenShift project using the following commands, replacing the secret name below with the name of your secret created in the previous step. -+ -[options="nowrap",subs="+quotes"] ----- -oc secrets link default __1234567-myserviceaccount-pull-secret__ --for=pull -oc secrets link builder __1234567-myserviceaccount-pull-secret__ --for=pull ----- -.Additional resources - -* link:https://access.redhat.com/RegistryAuthentication#registry-service-accounts-for-shared-environments-4[Create an authentication token using a registry service account] - -* link:https://access.redhat.com/documentation/en-us/openshift_container_platform/3.11/html/developer_guide/dev-guide-managing-images#allowing-pods-to-reference-images-from-other-secured-registries[Configuring access to secured registries] - -* link:https://access.redhat.com/RegistryAuthentication[Configuring authentication to the Red Hat Container Registry] - diff --git a/shared-doc/xp-deploy-project.adoc b/shared-doc/xp-deploy-project.adoc deleted file mode 100644 index 190e6aaa5b..0000000000 --- a/shared-doc/xp-deploy-project.adoc +++ /dev/null @@ -1,283 +0,0 @@ -ifndef::xp-deploy-project-skip-header[] -[[deploy_eap_s2i]] -= Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift -endif::[] -.Procedure - -ifndef::rest-client-qs[] -. Create a new OpenShift application using the {xpaasproduct-shortname} image and the quickstart's source code. Use the following command to use the `{ImagePrefixVersion}-basic-s2i` template with the JDK 8 images and the `{artifactId}` source code on GitHub. -+ -[options="nowrap",subs="+attributes"] ----- -$ oc new-app --template={ImagePrefixVersion}-basic-s2i {backslash} - -p EAP_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk8-openshift:latest {backslash} - -p EAP_RUNTIME_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk8-runtime-openshift:latest {backslash} - -p IMAGE_STREAM_NAMESPACE="{artifactId}-project" {backslash} - -p SOURCE_REPOSITORY_URL="{EAPQuickStartRepo}" {backslash} - -p SOURCE_REPOSITORY_REF="{EAPQuickStartRepoRef}" {backslash} -ifdef::uses-h2[] - -p ENABLE_GENERATE_DEFAULT_DATASOURCE="true" {backslash} -endif::[] -ifdef::uses-jaeger[] - -p CONTEXT_DIR="{artifactId}" {backslash} - -e WILDFLY_TRACING_ENABLED="true" {backslash} - -e JAEGER_SAMPLER_TYPE="const" {backslash} - -e JAEGER_SAMPLER_PARAM="1" {backslash} - -e JAEGER_AGENT_HOST="jaeger-agent" {backslash} - -e JAEGER_AGENT_PORT="6831" {backslash} - -e JAEGER_SERVICE_NAME="{artifactId}" -endif::[] -ifdef::reactive-messaging-amq-streams[] - -e MP_MESSAGING_CONNECTOR_SMALLRYE_KAFKA_BOOTSTRAP_SERVERS=my-cluster-kafka-bootstrap:9092 {backslash} - -p GALLEON_PROVISION_LAYERS=cloud-server,microprofile-reactive-messaging-kafka,h2-default-datasource {backslash} -endif::[] -ifdef::reactive-messaging-rhosak[] - -e QS_USE_RHOSAK=1 {backslash} - -e APPLICATION_NAME=mp-rm-qs {backslash} -endif::[] -ifndef::uses-jaeger[] - -p CONTEXT_DIR="{artifactId}" -endif::[] ----- -+ --- -* `--template` The template to use. -* `-p IMAGE_STREAM_NAMESPACE` The latest images streams and templates xref:import_imagestreams_templates[were imported into the project's namespace], so you must specify the namespace of where to find the image stream. This is usually the OpenShift project's name. -* `-p SOURCE_REPOSITORY_URL` The URL to the repository containing the application source code. -* `-p SOURCE_REPOSITORY_REF` The Git repository reference to use for the source code. This can be a Git branch or tag reference. -ifdef::uses-h2[] -* `-p ENABLE_GENERATE_DEFAULT_DATASOURCE` Enables the default datasource, which is required by this quickstart. -endif::[] -ifdef::reactive-messaging-amq-streams[] - * `-e MP_MESSAGING_CONNECTOR_SMALLRYE_KAFKA_BOOTSTRAP_SERVERS=my-cluster-kafka-bootstrap:9092` Sets the location of the AMQ Streams cluster. This environment variable resolves to the same as the MicroProfile Config property `mp.messaging.connector.smallrye-kafka.bootstrap.servers=localhost:9092` used in the quickstart source code. However, the environment variable takes precedence. - * `-p GALLEON_PROVISION_LAYERS=cloud-server,microprofile-reactive-messaging-kafka,h2-default-datasource` adds Galleon layers needed for this quickstart to run. Behind the scenes they enable the server functionality to run MicroProfile Reactive Messaging applications backed by Kafka. -endif::[] -ifdef::reactive-messaging-rhosak[] - * `-e QS_USE_RHOSAK=1` This tells the s2i build to include the files from the `extensions/` directory, which end up running the contained `initialize-server.cli` which adds entries to the `microprofile-config-smallrye` subsystem to leverage the ConfigMaps containing the RHOSAK data. - * `-p APPLICATION_NAME=mp-rm-qs` - This names the application `mp-rm-qs` so it matches the earlier service binding we created. -endif::[] -* `-p CONTEXT_DIR` The directory within the source repository to build. --- -+ -Alternatively, to create the quickstart application using the JDK 11 images enter the following command. -+ -[options="nowrap",subs="+attributes"] ----- -$ oc new-app --template={ImagePrefixVersion}-basic-s2i {backslash} - -p EAP_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk11-openshift:latest \ - -p EAP_RUNTIME_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift:latest \ - -p IMAGE_STREAM_NAMESPACE="{artifactId}-project" {backslash} - -p SOURCE_REPOSITORY_URL="{EAPQuickStartRepo}" {backslash} - -p SOURCE_REPOSITORY_REF="{EAPQuickStartRepoRef}" {backslash} -ifdef::uses-h2[] - -p ENABLE_GENERATE_DEFAULT_DATASOURCE="true" {backslash} -endif::[] -ifdef::uses-jaeger[] - -p CONTEXT_DIR="{artifactId}" {backslash} - -e WILDFLY_TRACING_ENABLED="true" {backslash} - -e JAEGER_SAMPLER_TYPE="const" {backslash} - -e JAEGER_SAMPLER_PARAM="1" {backslash} - -e JAEGER_AGENT_HOST="jaeger-agent" {backslash} - -e JAEGER_AGENT_PORT="6831" {backslash} - -e JAEGER_SERVICE_NAME="{artifactId}" -endif::[] -ifdef::reactive-messaging-amq-streams[] - -e MP_MESSAGING_CONNECTOR_SMALLRYE_KAFKA_BOOTSTRAP_SERVERS=my-cluster-kafka-bootstrap:9092 {backslash} - -p GALLEON_PROVISION_LAYERS=cloud-server,microprofile-reactive-messaging-kafka,h2-default-datasource {backslash} -endif::[] -ifdef::reactive-messaging-rhosak[] - -e QS_USE_RHOSAK=1 {backslash} - -e APPLICATION_NAME=mp-rm-qs {backslash} -endif::[] -ifndef::uses-jaeger[] - -p CONTEXT_DIR="{artifactId}" -endif::[] ----- -+ --- -* `--template` The template to use. -* `-p IMAGE_STREAM_NAMESPACE` The latest images streams and templates xref:import_imagestreams_templates[were imported into the project's namespace], so you must specify the namespace of where to find the image stream. This is usually the OpenShift project's name. -* `-p SOURCE_REPOSITORY_URL` The URL to the repository containing the application source code. -* `-p SOURCE_REPOSITORY_REF` The Git repository reference to use for the source code. This can be a Git branch or tag reference. -ifdef::uses-h2[] -* `-p ENABLE_GENERATE_DEFAULT_DATASOURCE` Enables the default datasource, which is required by this quickstart. -endif::[] -ifdef::reactive-messaging-amq-streams[] -* `-e MP_MESSAGING_CONNECTOR_SMALLRYE_KAFKA_BOOTSTRAP_SERVERS=my-cluster-kafka-bootstrap:9092` Sets the location of the AMQ Streams cluster. This environment variable resolves to the same as the MicroProfile Config property `mp.messaging.connector.smallrye-kafka.bootstrap.servers=localhost:9092` used in the quickstart source code. However, the environment variable takes precedence. -* `-p GALLEON_PROVISION_LAYERS=cloud-server,microprofile-reactive-messaging-kafka,h2-default-datasource` adds Galleon layers needed for this quickstart to run. Behind the scenes they enable the server functionality to run MicroProfile Reactive Messaging applications backed by Kafka. -endif::[] -ifdef::reactive-messaging-rhosak[] -* `-e QS_USE_RHOSAK=1` This tells the s2i build to include the files from the `extensions/` directory, which end up running the contained `initialize-server.cli` which adds entries to the `microprofile-config-smallrye` subsystem to leverage the ConfigMaps containing the RHOSAK data. -* `-p APPLICATION_NAME=mp-rm-qs` - This names the application `mp-rm-qs` so it matches the earlier service binding we created. -endif::[] -* `-p CONTEXT_DIR` The directory within the source repository to build. --- -endif::rest-client-qs[] -ifdef::rest-client-qs[] -. Create new OpenShift applications using the {xpaasproduct-shortname} image and the quickstart's source code. Use the following command to use the `{ImagePrefixVersion}-basic-s2i` template with the JDK 8 images and the `{artifactId}` source code on GitHub. -+ -*Country-server application:* -+ -[options="nowrap",subs="+attributes"] ----- -$ oc new-app --template={ImagePrefixVersion}-basic-s2i {backslash} - -p EAP_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk8-openshift:latest {backslash} - -p EAP_RUNTIME_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk8-runtime-openshift:latest {backslash} - -p IMAGE_STREAM_NAMESPACE="{artifactId}-project" {backslash} - -p SOURCE_REPOSITORY_URL="{EAPQuickStartRepo}" {backslash} - -p SOURCE_REPOSITORY_REF="{EAPQuickStartRepoRef}" {backslash} -ifdef::uses-h2[] - -p ENABLE_GENERATE_DEFAULT_DATASOURCE="true" {backslash} -endif::[] - -p CONTEXT_DIR="{artifactId}" \ - -p ARTIFACT_DIR="country-server/target" \ - -p APPLICATION_NAME="country-server" ----- -+ --- -* `--template` The template to use. -* `-p IMAGE_STREAM_NAMESPACE` The latest images streams and templates xref:import_imagestreams_templates[were imported into the project's namespace], so you must specify the namespace of where to find the image stream. This is usually the OpenShift project's name. -* `-p SOURCE_REPOSITORY_URL` The URL to the repository containing the application source code. -* `-p SOURCE_REPOSITORY_REF` The Git repository reference to use for the source code. This can be a Git branch or tag reference. -ifdef::uses-h2[] -* `-p ENABLE_GENERATE_DEFAULT_DATASOURCE` Enables the default datasource, which is required by this quickstart. -endif::[] -* `-p CONTEXT_DIR` The directory within the source repository to build. -* `-P ARTIFACT_DIR` The directory from which to copy the artifact. -* `-p APPLICATION_NAME` The name of the application. --- -+ -Alternatively, to create the *country-server* application using the JDK 11 images enter the following command. -+ -[options="nowrap",subs="+attributes"] ----- -$ oc new-app --template={ImagePrefixVersion}-basic-s2i {backslash} - -p EAP_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk11-openshift:latest \ - -p EAP_RUNTIME_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift:latest \ - -p IMAGE_STREAM_NAMESPACE="{artifactId}-project" {backslash} - -p SOURCE_REPOSITORY_URL="{EAPQuickStartRepo}" {backslash} - -p SOURCE_REPOSITORY_REF="{EAPQuickStartRepoRef}" {backslash} -ifdef::uses-h2[] - -p ENABLE_GENERATE_DEFAULT_DATASOURCE="true" {backslash} -endif::[] - -p CONTEXT_DIR="{artifactId}" \ - -p ARTIFACT_DIR="country-server/target" \ - -p APPLICATION_NAME="country-server" ----- -+ --- -* `--template` The template to use. -* `-p IMAGE_STREAM_NAMESPACE` The latest images streams and templates xref:import_imagestreams_templates[were imported into the project's namespace], so you must specify the namespace of where to find the image stream. This is usually the OpenShift project's name. -* `-p SOURCE_REPOSITORY_URL` The URL to the repository containing the application source code. -* `-p SOURCE_REPOSITORY_REF` The Git repository reference to use for the source code. This can be a Git branch or tag reference. -ifdef::uses-h2[] -* `-p ENABLE_GENERATE_DEFAULT_DATASOURCE` Enables the default datasource, which is required by this quickstart. -endif::[] -* `-p CONTEXT_DIR` The directory within the source repository to build. -* `-P ARTIFACT_DIR` The directory from which to copy the artifact. -* `-p APPLICATION_NAME` The name of the application. --- -+ -*Country-client application:* -+ -[options="nowrap",subs="+attributes"] ----- -$ oc new-app --template={ImagePrefixVersion}-basic-s2i {backslash} - -p EAP_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk8-openshift:latest {backslash} - -p EAP_RUNTIME_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk8-runtime-openshift:latest {backslash} - -p IMAGE_STREAM_NAMESPACE="{artifactId}-project" {backslash} - -p SOURCE_REPOSITORY_URL="{EAPQuickStartRepo}" {backslash} - -p SOURCE_REPOSITORY_REF="{EAPQuickStartRepoRef}" {backslash} -ifdef::uses-h2[] - -p ENABLE_GENERATE_DEFAULT_DATASOURCE="true" {backslash} -endif::[] - -p CONTEXT_DIR="microprofile-rest-client" \ - -p ARTIFACT_DIR="country-client/target" \ - -p APPLICATION_NAME="country-client" \ - -e JAVA_OPTS_APPEND="-Dorg.wildfly.quickstarts.microprofile.rest.client.CountriesServiceClient/mp-rest/url=http://country-server:8080" ----- -+ --- -* `--template` The template to use. -* `-p IMAGE_STREAM_NAMESPACE` The latest images streams and templates xref:import_imagestreams_templates[were imported into the project's namespace], so you must specify the namespace of where to find the image stream. This is usually the OpenShift project's name. -* `-p SOURCE_REPOSITORY_URL` The URL to the repository containing the application source code. -* `-p SOURCE_REPOSITORY_REF` The Git repository reference to use for the source code. This can be a Git branch or tag reference. -ifdef::uses-h2[] -* `-p ENABLE_GENERATE_DEFAULT_DATASOURCE` Enables the default datasource, which is required by this quickstart. -endif::[] -* `-p CONTEXT_DIR` The directory within the source repository to build. -* `-P ARTIFACT_DIR` The directory from which to copy the artifact. -* `-p APPLICATION_NAME` The name of the application. --- -+ -Alternatively, to create the *country-client* application using the JDK 11 images enter the following command. -+ -[options="nowrap",subs="+attributes"] ----- -$ oc new-app --template={ImagePrefixVersion}-basic-s2i {backslash} - -p EAP_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk11-openshift:latest \ - -p EAP_RUNTIME_IMAGE_NAME=jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift:latest \ - -p IMAGE_STREAM_NAMESPACE="{artifactId}-project" {backslash} - -p SOURCE_REPOSITORY_URL="{EAPQuickStartRepo}" {backslash} - -p SOURCE_REPOSITORY_REF="{EAPQuickStartRepoRef}" {backslash} -ifdef::uses-h2[] - -p ENABLE_GENERATE_DEFAULT_DATASOURCE="true" {backslash} -endif::[] - -p CONTEXT_DIR="microprofile-rest-client" \ - -p ARTIFACT_DIR="country-client/target" \ - -p APPLICATION_NAME="country-client" \ - -e JAVA_OPTS_APPEND="-Dorg.wildfly.quickstarts.microprofile.rest.client.CountriesServiceClient/mp-rest/url=http://country-server:8080" ----- -+ --- -* `--template` The template to use. -* `-p IMAGE_STREAM_NAMESPACE` The latest images streams and templates xref:import_imagestreams_templates[were imported into the project's namespace], so you must specify the namespace of where to find the image stream. This is usually the OpenShift project's name. -* `-p SOURCE_REPOSITORY_URL` The URL to the repository containing the application source code. -* `-p SOURCE_REPOSITORY_REF` The Git repository reference to use for the source code. This can be a Git branch or tag reference. -ifdef::uses-h2[] -* `-p ENABLE_GENERATE_DEFAULT_DATASOURCE` Enables the default datasource, which is required by this quickstart. -endif::[] -* `-p CONTEXT_DIR` The directory within the source repository to build. -* `-P ARTIFACT_DIR` The directory from which to copy the artifact. -* `-p APPLICATION_NAME` The name of the application. --- -endif::rest-client-qs[] - -+ -NOTE: A template can specify default values for many template parameters, and you might have to override some, or all, of the defaults. To see template information, including a list of parameters and any default values, use the command `oc describe template __TEMPLATE_NAME__`. - -+ -TIP: It is possible to trim down the {xpaasproduct-shortname} image that will be used to run this quickstart. To do so, please add the `-p GALLEON_PROVISION_LAYERS=` argument when creating the new application. Please refer to the JBoss EAP documentation for the list of supported galleon layers. - -. Retrieve the name of the build configuration. -+ -[options="nowrap"] ----- -$ oc get bc -o name ----- -+ -. Use the name of the build configurations from the previous step to view the Maven progress of the builds. -+ -[options="nowrap",subs="+quotes"] ----- -$ oc logs -f bc/${APPLICATION_NAME}-build-artifacts - -… -Push successful -$ oc logs -f bc/${APPLICATION_NAME} -… -Push successful ----- -+ -For example, for the previously created application, the following command shows the progress of the Maven builds. -+ -[options="nowrap",subs="+attributes"] ----- -$ oc logs -f bc/{ImagePrefixVersion}-basic-app-build-artifacts - -… -Push successful -$ oc logs -f bc/{ImagePrefixVersion}-basic-app -… -Push successful ----- \ No newline at end of file diff --git a/shared-doc/xp-import-imagestreams-templates.adoc b/shared-doc/xp-import-imagestreams-templates.adoc deleted file mode 100644 index beddacc869..0000000000 --- a/shared-doc/xp-import-imagestreams-templates.adoc +++ /dev/null @@ -1,65 +0,0 @@ - -[[import_imagestreams_templates]] -= Import the Latest {xpaasproduct-shortname} Image Streams and Templates - -[IMPORTANT] -==== -If you are building and deploying this quickstart on {xpaasproduct-shortname}, you must configure authentication to the {ContainerRegistryName} before you import the image streams and templates into your namespace. link:{LinkOpenShiftGuide}#container_registry_authentication[_{EapForOpenshiftBookName}_] provides an example of one way to configure authentication to the registry. For additional information, see link:https://access.redhat.com/RegistryAuthentication[Red Hat Container Registry Authentication] on the Red Hat Customer Portal. - -Configuration of authentication to the registry is not necessary if you are building and deploying this quickstart on {xpaasproductOpenShiftOnline-shortname}. -==== - -.Procedure - -. Use the following commands to import the latest JDK 8 and JDK 11 image streams and templates for the OpenShift image for {xpaasproduct-shortname}, into your OpenShift project's namespace. - -.. Import JDK 8 image streams: -+ -[options="nowrap",subs="+attributes"] ----- -oc replace --force -f {ImageandTemplateImportURL}jboss-{ImagePrefixVersion}-openjdk8-openshift.json ----- -+ -This command imports the following imagestreams and templates: - -* The JDK 8 builder imagestream: jboss-{ImagePrefixVersion}-openjdk8-openshift -* The JDK 8 runtime imagestream: jboss-{ImagePrefixVersion}-openjdk8-runtime-openshift -+ -.. Import JDK 11 image stream: -+ -[options="nowrap",subs="+attributes"] ----- -oc replace --force -f {ImageandTemplateImportURL}jboss-{ImagePrefixVersion}-openjdk11-openshift.json ----- -+ -This command imports the following imagestreams and templates: - -* The JDK 11 builder imagestream: jboss-{ImagePrefixVersion}-openjdk11-openshift -* The JDK 11 runtime imagestream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift -+ -.. Import the JDK 8 and JDK 11 templates: -+ -[options="nowrap",subs="+attributes"] ----- -for resource in \ - {ImagePrefixVersion}-basic-s2i.json \ -ifndef::eap-openshift-online[ {ImagePrefixVersion}-third-party-db-s2i.json ] -do - oc replace --force -f \ -{ImageandTemplateImportURL}templates/${resource} -done ----- - -[NOTE] -==== -The {ProductShortName} image streams and templates imported using the above command are only available within that OpenShift project. - -If you have administrative access to the general `openshift` namespace and want the image streams and templates to be accessible by all projects, add `-n openshift` to the `oc replace` line of the command. For example: - -[options="nowrap"] ----- -... -oc replace -n openshift --force -f \ -... ----- -==== diff --git a/shared-doc/xp-install-amq-streams.adoc b/shared-doc/xp-install-amq-streams.adoc deleted file mode 100644 index 32f36b8d1b..0000000000 --- a/shared-doc/xp-install-amq-streams.adoc +++ /dev/null @@ -1,58 +0,0 @@ -:strimzi-version: v1beta2 -[[install_amq_streams]] -= Install AMQ Streams on Openshift - -The functionality of this quickstart depends on a running instance of the -https://access.redhat.com/products/red-hat-amq#streams[AMQ Streams] Operator. AMQ Streams is a Red Hat project based on Apache Kafka. To deploy AMQ Streams in the Openshift environment: - -. Log in into the Openshift console as `kubeadmin` user (or any cluster administrator). -. Navigate to `Operators` -> `OperatorHub`. -. Search for `AMQ Streams` - click on the 'Red Hat Integration - AMQ Streams' operator (works with both community and Red Hat). -Install it with the default values. -. Run the following command to set up a Kafka cluster called `my-cluster` in your project: -+ -[options="nowrap",subs="+attributes"] ----- -$ oc apply -n {artifactId}-project -f - < `OperatorHub`. -. Search for `Jaeger` - click on the Jaeger operator (works with both community and Red Hat). -Install it with the default values. -. Run the following command: -+ -[options="nowrap",subs="+attributes"] ----- -$ oc apply -n {artifactId}-project -f - < - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.wildfly:wildfly-galleon-pack:${version.server} - - - org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp} - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -[NOTE] -==== -Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`. -==== - -:leveloffset: 1 -// Getting Started with Helm -:leveloffset: +1 - -[[getting_started_with_helm]] -= Getting Started with {xpaasproduct-shortname} and Helm Charts - -This section contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} using Helm Charts. - -[[prerequisites_helm_openshift]] -== Prerequisites - -* You must be logged in OpenShift and have an `oc` client to connect to OpenShift -* https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. - -Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}. - -ifndef::ProductRelease,EAPXPRelease[] -[source,options="nowrap"] ----- -$ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ -"wildfly" has been added to your repositories -$ helm search repo wildfly -NAME CHART VERSION APP VERSION DESCRIPTION -wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift -wildfly/wildfly-common ... ... A library chart for WildFly-based applications ----- -endif::[] -ifdef::ProductRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP {productVersion} applications ----- -endif::[] -ifdef::EAPXPRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP XP {productVersion} applications ----- -endif::[] - -:leveloffset: 1 -//Prepare Helm for Quickstart Deployment -:leveloffset: +1 - -[[deploy_helm]] -== Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -Log in to your OpenShift instance using the `oc login` command. -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -Navigate to the root directory of this quickstart and run the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm install {artifactId} -f charts/helm.yaml {helmChartName} -NAME: {artifactId} -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17: - -[source,options="nowrap",subs="+attributes"] ----- -build: - uri: {githubRepoCodeUrl} - ref: {WildFlyQuickStartRepoTag} - contextDir: {artifactId} -deploy: - replicas: 1 ----- - -This will create a new deployment on OpenShift and deploy the application. - -If you want to see all the configuration elements to customize your deployment you can use the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let’s wait for the application to be built and deployed: -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment {artifactId} -w -NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE -{artifactId} 1 1 1 0 12s -... -{artifactId} 1 1 1 1 2m ----- - -Get the URL of the route to the deployment. - -[source,options="nowrap",subs="+attributes"] ----- -$ oc get route {artifactId} -o jsonpath="{.spec.host}" ----- -Access the application in your web browser using the displayed URL. - -[NOTE] -==== -The Maven profile named `openshift` is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the `/{artifactId}` path segment after `HOST:PORT`. -==== - -[[undeploy_helm]] -== Undeploy the {ProductShortName} Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts - - -[source,options="nowrap",subs="+attributes"] ----- -$ helm uninstall {artifactId} ----- - -:leveloffset: 1 -// Testing on Openshift -:leveloffset: +1 - -[[run_the_arquillian_integration_tests_with_openshift]] -= Run the Arquillian Integration Tests with OpenShift -//****************************************************************************** -// Include this template if your quickstart provides Openshift Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -[NOTE] -==== -The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin. -==== - -Run the integration tests using the following command to run the `verify` goal with the `arq-remote` profile activated and the proper URL: -[source,options="nowrap",subs="+attributes"] ----- -$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route {artifactId} --template='{{ .spec.host }}') ----- - -[NOTE] -==== -The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from. -==== - -:leveloffset: 1 - -:leveloffset!: diff --git a/temperature-converter/README.html b/temperature-converter/README.html deleted file mode 100644 index 19c908f6cf..0000000000 --- a/temperature-converter/README.html +++ /dev/null @@ -1,909 +0,0 @@ - - - - - - - - -temperature-converter: Stateless Session EJB (SLSB) - - - - - -
-
-
-
-
-The temperature-converter quickstart does temperature conversion using an EJB Stateless Session Bean (SLSB), CDI, and a JSF front-end client. -
-
-
-
-
-

What is it?

-
-
-

The temperature-converter example demonstrates the use of an EJB Stateless Session Bean (SLSB) and CDI, accessed using a JSF, and deployed to Red Hat JBoss Enterprise Application Platform using a WAR archive.

-
-
-

The application does the following:

-
-
-
    -
  1. -

    The User Interface is a JSF page that asks for a temperature and a scale (Fahrenheit or Celsius).

    -
  2. -
  3. -

    When you click on Convert, the temperature string is passed to the TemperatureConverter controller (managed) bean.

    -
  4. -
  5. -

    The managed bean then invokes the convert() method of the injected TemperatureConvertEJB (notice the field annotated with @Inject).

    -
  6. -
  7. -

    The response from TemperatureConvertEJB is stored in the temperature field of the managed bean.

    -
  8. -
  9. -

    The managed bean is annotated as @SessionScoped, so the same managed bean instance is used for the entire session.

    -
  10. -
-
-
-
-
-

System Requirements

-
-
-

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 8.0 or later.

-
-
-

All you need to build this project is Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later. See Configure Maven to Build and Deploy the Quickstarts to make sure you are configured correctly for testing the quickstarts.

-
-
-
-
-

Use of the EAP_HOME and QUICKSTART_HOME Variables

-
-
-

In the following instructions, replace EAP_HOME with the actual path to your JBoss EAP installation. The installation path is described in detail here: Use of EAP_HOME and JBOSS_HOME Variables.

-
-
-

When you see the replaceable variable QUICKSTART_HOME, replace it with the path to the root directory of all of the quickstarts.

-
-
-
-
-

Building and running the quickstart application with a JBoss EAP server distribution

-
-
-

Start the JBoss EAP Standalone Server

-
-
    -
  1. -

    Open a terminal and navigate to the root of the JBoss EAP directory.

    -
  2. -
  3. -

    Start the JBoss EAP server with the default profile by typing the following command.

    -
    -
    -
    $ EAP_HOME/bin/standalone.sh 
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\standalone.bat script. -
    -
    -
  4. -
-
-
-
-

Build and Deploy the Quickstart

-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type the following command to build the quickstart.

    -
    -
    -
    $ mvn clean package
    -
    -
    -
  6. -
  7. -

    Type the following command to deploy the quickstart.

    -
    -
    -
    $ mvn wildfly:deploy
    -
    -
    -
  8. -
-
-
-

This deploys the temperature-converter/target/temperature-converter.war to the running instance of the server.

-
-
-

You should see a message in the server log indicating that the archive deployed successfully.

-
-
-
-

Access the Application

-
-

The application will be running at the following URL: http://localhost:8080/temperature-converter/.

-
-
-

You will be presented with a simple form for temperature conversion.

-
-
-
    -
  1. -

    Optionally, Select a scale: Celsius or Fahrenheit.

    -
  2. -
  3. -

    Enter a temperature.

    -
  4. -
  5. -

    Press the Convert button to see the results.

    -
  6. -
-
-
-
-

Run the Arquillian Integration Tests

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
-

Follow these steps to run the integration tests.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server, as previously described.

    -
  2. -
  3. -

    Make sure you build and deploy the quickstart, as previously described.

    -
  4. -
  5. -

    Type the following command to run the verify goal with the arq-remote profile activated.

    -
    -
    -
    $ mvn verify -Parq-remote
    -
    -
    -
  6. -
-
-
- - - - - -
-
Note
-
-
-

You may also use the environment variable SERVER_HOST or the system property server.host to define the target host of the tests.

-
-
-
-
-
-

Undeploy the Quickstart

-
-

When you are finished testing the quickstart, follow these steps to undeploy the archive.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type this command to undeploy the archive:

    -
    -
    -
    $ mvn wildfly:undeploy
    -
    -
    -
  6. -
-
-
-
-
-
-

Building and running the quickstart application with OpenShift

-
-
-

Build the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

On OpenShift, the S2I build with Apache Maven will use an openshift profile used to provision a JBoss EAP server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named openshift when building the quickstart:

-
-
-
-
$ mvn clean package -Popenshift
-
-
-
-

The provisioned JBoss EAP server for OpenShift, with the quickstart deployed, can then be found in the target/server directory, and its usage is similar to a standard server distribution. -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.

-
-
-

The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart pom.xml:

-
-
-
-
        <profile>
-            <id>openshift</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.jboss.eap.plugins</groupId>
-                        <artifactId>eap-maven-plugin</artifactId>
-                        <version>${version.eap.maven.plugin}</version>
-                        <configuration>
-                            <feature-packs>
-                                <feature-pack>
-                                    <location>org.jboss.eap:wildfly-ee-galleon-pack</location>
-                                </feature-pack>
-                                <feature-pack>
-                                    <location>org.jboss.eap.cloud:eap-cloud-galleon-pack</location>
-                                </feature-pack>
-                            </feature-packs>
-                            <layers>
-                                <layer>cloud-server</layer>
-                            </layers>
-                            <filename>ROOT.war</filename>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>package</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-
-
-
- - - - - -
-
Note
-
-
-

Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the /temperature-converter path segment after HOST:PORT.

-
-
-
-
-
-

Getting Started with JBoss EAP for OpenShift and Helm Charts

-
-

This section contains the basic instructions to build and deploy this quickstart to JBoss EAP for OpenShift or JBoss EAP for OpenShift Online using Helm Charts.

-
-
-

Prerequisites

-
-
    -
  • -

    You must be logged in OpenShift and have an oc client to connect to OpenShift

    -
  • -
  • -

    Helm must be installed to deploy the backend on OpenShift.

    -
  • -
-
-
-

Once you have installed Helm, you need to add the repository that provides Helm Charts for JBoss EAP.

-
-
-
-
$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/
-"jboss-eap" has been added to your repositories
-$ helm search repo jboss-eap
-NAME                    CHART VERSION   APP VERSION     DESCRIPTION
-jboss-eap/eap8         ...             ...             A Helm chart to build and deploy EAP 8.0 applications
-
-
-
-
-

Deploy the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

Log in to your OpenShift instance using the oc login command. -The backend will be built and deployed on OpenShift with a Helm Chart for JBoss EAP.

-
-
-

Navigate to the root directory of this quickstart and run the following command:

-
-
-
-
$ helm install temperature-converter -f charts/helm.yaml jboss-eap/eap8
-NAME: temperature-converter
-...
-STATUS: deployed
-REVISION: 1
-
-
-
-

The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17:

-
-
-
-
build:
-  uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git
-  ref: 8.0.x
-  contextDir: temperature-converter
-deploy:
-  replicas: 1
-
-
-
-

This will create a new deployment on OpenShift and deploy the application.

-
-
-

If you want to see all the configuration elements to customize your deployment you can use the following command:

-
-
-
-
$ helm show readme jboss-eap/eap8
-
-
-
-

Let’s wait for the application to be built and deployed:

-
-
-
-
$ oc get deployment temperature-converter -w
-NAME         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
-temperature-converter   1         1         1            0           12s
-...
-temperature-converter   1         1         1            1           2m
-
-
-
-

Get the URL of the route to the deployment.

-
-
-
-
$ oc get route temperature-converter -o jsonpath="{.spec.host}"
-
-
-
-

Access the application in your web browser using the displayed URL.

-
-
- - - - - -
-
Note
-
-
-

The Maven profile named openshift is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the /temperature-converter path segment after HOST:PORT.

-
-
-
-
-
-

Undeploy the JBoss EAP Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts

-
-
-
$ helm uninstall temperature-converter
-
-
-
-
-
-

Run the Arquillian Integration Tests with OpenShift

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
- - - - - -
-
Note
-
-
-

The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin.

-
-
-
-
-

Run the integration tests using the following command to run the verify goal with the arq-remote profile activated and the proper URL:

-
-
-
-
$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route temperature-converter --template='{{ .spec.host }}')
-
-
-
- - - - - -
-
Note
-
-
-

The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from.

-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/temperature-converter/charts/helm.yaml b/temperature-converter/charts/helm.yaml deleted file mode 100644 index 6c70fe3b7e..0000000000 --- a/temperature-converter/charts/helm.yaml +++ /dev/null @@ -1,6 +0,0 @@ -build: - uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git - ref: 8.0.x - contextDir: temperature-converter -deploy: - replicas: 1 \ No newline at end of file diff --git a/temperature-converter/pom.xml b/temperature-converter/pom.xml deleted file mode 100644 index 0328a0c70f..0000000000 --- a/temperature-converter/pom.xml +++ /dev/null @@ -1,260 +0,0 @@ - - - - 4.0.0 - - org.jboss.eap.quickstarts - jboss-eap-quickstart-parent - - 6.0.0.redhat-00001 - - - - temperature-converter - 8.0.0.GA - war - Quickstart: temperature-converter - This project is a temperature converter. Given Celsius return Fahrenheit; Given Fahrenheit return Celsius - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - 8.0.0.GA-redhat-00009 - 1.0.0.Final-redhat-00014 - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - never - - default - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - never - - - true - never - - default - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - - - true - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - - - true - - - - - - - - - org.jboss.bom - jboss-eap-ee-with-tools - ${version.server.bom} - pom - import - - - - - - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - - - jakarta.annotation - jakarta.annotation-api - provided - - - - jakarta.ejb - jakarta.ejb-api - provided - - - - - jakarta.faces - jakarta.faces-api - provided - - - - - org.junit.jupiter - junit-jupiter-api - 5.9.1 - test - - - - org.junit.jupiter - junit-jupiter-params - 5.9.1 - test - - - - org.junit.jupiter - junit-jupiter-engine - 5.9.1 - test - - - - org.jboss.arquillian.junit5 - arquillian-junit5-container - test - - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet-jakarta - test - - - - - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - - org.jboss.eap.channels - eap-8.0 - - - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - ejb - jsf - - ROOT.war - - - - - package - - - - - - - - - arq-remote - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} - - - **/RemoteTemperatureConverterIT - - - **/ProvisionedManagedTemperatureConverterIT - - - - - - integration-test - verify - - - - - - - - - diff --git a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/ScaleConverter.java b/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/ScaleConverter.java deleted file mode 100644 index d2c06e8156..0000000000 --- a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/ScaleConverter.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.temperatureconverter.controller; - -import jakarta.faces.component.UIComponent; -import jakarta.faces.context.FacesContext; -import jakarta.faces.convert.Converter; -import jakarta.inject.Named; - -import org.jboss.as.quickstarts.temperatureconverter.ejb.Scale; - -/** - * A JSF converter that can handle the {@link Scale} enum. - * - * @author Pete Muir - * - */ -@Named -public class ScaleConverter implements Converter { - - public Scale[] getScales() { - return Scale.values(); - } - - @Override - public Object getAsObject(FacesContext ctx, UIComponent cmp, String value) { - return Scale.valueOf(value); - } - - @Override - public String getAsString(FacesContext ctx, UIComponent cmp, Object value) { - if (value instanceof Scale) { - return ((Scale) value).name(); - } else { - throw new IllegalStateException(); - } - } - -} diff --git a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/TemperatureConverter.java b/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/TemperatureConverter.java deleted file mode 100644 index 599dd62617..0000000000 --- a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/controller/TemperatureConverter.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.temperatureconverter.controller; - -import java.io.Serializable; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.faces.application.FacesMessage; -import jakarta.faces.context.FacesContext; -import jakarta.inject.Inject; -import jakarta.inject.Named; - -import org.jboss.as.quickstarts.temperatureconverter.ejb.Scale; -import org.jboss.as.quickstarts.temperatureconverter.ejb.Temperature; -import org.jboss.as.quickstarts.temperatureconverter.ejb.TemperatureConvertEJB; - -/** - * A simple managed bean that is used to invoke the TemperatureConvertEJB and store the response. The response is obtained by - * invoking temperatureConvertEJB.convert(). - * - * Code borrowed and modified from another quickstart written by Paul Robinson - * - * @author Bruce Wolfe - */ -@SuppressWarnings("serial") -@Named("temperatureConverter") -@RequestScoped -public class TemperatureConverter implements Serializable { - - /* - * Injected TemperatureConvertEJB client - */ - @Inject - private TemperatureConvertEJB temperatureConvertEJB; - - /* - * Stores the response from the call to temperatureConvertEJB.convert() - */ - private String temperature; - - private String sourceTemperature = "0.0"; - - private Scale defaultScale = Scale.CELSIUS; - - /** - * Invoke temperatureConvertEJB.convert() and store the temperature - * - * @param sourceTemperature The temperature to be converted - * @param defaultScale The default source temperature scale - */ - public void convert() { - try { - temperature = temperatureConvertEJB.convert(Temperature.parse(sourceTemperature, defaultScale)).toString(); - } catch (IllegalArgumentException e) { - temperature = "Invalid temperature"; - FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(e.getMessage())); - } - } - - public String getSourceTemperature() { - return sourceTemperature; - } - - public void setSourceTemperature(String sourceTemperature) { - this.sourceTemperature = sourceTemperature; - } - - public Scale getDefaultScale() { - return defaultScale; - } - - public void setDefaultScale(Scale defaultScale) { - this.defaultScale = defaultScale; - } - - public String getTemperature() { - return temperature; - } - -} diff --git a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Scale.java b/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Scale.java deleted file mode 100644 index 9c7d08c079..0000000000 --- a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Scale.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.temperatureconverter.ejb; - -/** - * The temperature scale. - * - * @author Pete Muir - * - */ -public enum Scale { - - CELSIUS("\u2103"), - FAHRENHEIT("\u2109"); - - private final String symbol; - - /** - * Constructor for a scale, taking the symbol used to represent the temperature scale. - * - * @param symbol - */ - Scale(String symbol) { - this.symbol = symbol; - } - - public static Scale valueOfAbbreviation(String value) { - if (value == null) { - throw new IllegalArgumentException("value must not be null"); - } else if ("C".equals(value.toUpperCase())) { - return CELSIUS; - } else if ("F".equals(value.toUpperCase())) { - return FAHRENHEIT; - } else { - throw new IllegalArgumentException(value + " not recognized as a valid scale"); - } - } - - public String getSymbol() { - return symbol; - } - -} diff --git a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Temperature.java b/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Temperature.java deleted file mode 100644 index f1c94c11c2..0000000000 --- a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/Temperature.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.temperatureconverter.ejb; - -import java.text.DecimalFormat; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * A domain object that can store a temperature and scale. Additionally, it can parse a string to a temperature and scale. - * - * @author Pete Muir - * @author Bruce Wolfe - * - */ -public class Temperature { - - public static final double ABSOLUTE_ZERO_C = -273.150; - public static final double ABSOLUTE_ZERO_F = -459.670; - - /* - * Create a regular expression to extract the temperature and scale (if passed). - */ - private static Pattern PATTERN = Pattern.compile("^([-+]?\\d*\\.?\\d+)\\s*([cCfF]?)"); - - /** - * Parse a string, with an optional scale suffix. If no scale suffix is on the string, the defaultScale will be used. - * - * @param temperature the temperature to parse - * @param defaultScale the default scale to use - */ - public static Temperature parse(String temperature, Scale defaultScale) { - double t; - Scale s; - - /** - * Extract temperature and scale - */ - Matcher matcher = PATTERN.matcher(temperature); - - if (matcher.find()) { - // Extract the temperature - t = Double.parseDouble(matcher.group(1)); - - // Use the scale included with the sourceTemperature OR the defaultScale provided. - if (!matcher.group(2).isEmpty()) { - try { - s = Scale.valueOfAbbreviation(matcher.group(2)); - } catch (IllegalArgumentException e) { - throw new IllegalArgumentException("You must provide a valid temperature to convert."); - } - } else { - s = defaultScale; - } - } else { - throw new IllegalArgumentException("You must provide a valid temperature to convert."); - } - - return new Temperature(t, s); - } - - private final double temperature; - private final Scale scale; - - public Temperature(double temperature, Scale scale) { - this.temperature = temperature; - this.scale = scale; - } - - public Scale getScale() { - return scale; - } - - public double getTemperature() { - return temperature; - } - - @Override - public String toString() { - return new DecimalFormat("###.###").format(temperature) + " " + scale.getSymbol(); - } - -} diff --git a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/TemperatureConvertEJB.java b/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/TemperatureConvertEJB.java deleted file mode 100644 index 487aac8633..0000000000 --- a/temperature-converter/src/main/java/org/jboss/as/quickstarts/temperatureconverter/ejb/TemperatureConvertEJB.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.temperatureconverter.ejb; - -import static org.jboss.as.quickstarts.temperatureconverter.ejb.Scale.CELSIUS; -import static org.jboss.as.quickstarts.temperatureconverter.ejb.Scale.FAHRENHEIT; - -import jakarta.ejb.Stateless; -import jakarta.faces.application.FacesMessage; -import jakarta.faces.context.FacesContext; - -/** - * A simple SLSB EJB. The EJB does not use an interface. - * - * @author Bruce Wolfe - */ -@Stateless -public class TemperatureConvertEJB { - - /** - * This method takes a temperature in Celsius or Fahrenheit and converts it to the other value. - * - * @param source the temperature to convert from - * @return the converted temperature. - */ - public Temperature convert(Temperature source) { - - // Convert our Temperature - if (source.getScale() == CELSIUS) { // Celsius to Fahrenheit - // Easter egg for Absolute Zero. - if (source.getTemperature() < Temperature.ABSOLUTE_ZERO_C) { - FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Below Absolute Zero!")); - } else if (source.getTemperature() == Temperature.ABSOLUTE_ZERO_C) { - FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Absolute Zero!")); - } - return new Temperature((source.getTemperature() * 9 / 5) + 32, FAHRENHEIT); - } else if (source.getScale() == FAHRENHEIT) { // Fahrenheit to Celsius - // Easter egg for Absolute Zero. - if (source.getTemperature() < Temperature.ABSOLUTE_ZERO_F) { - FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Below Absolute Zero!")); - } else if (source.getTemperature() == Temperature.ABSOLUTE_ZERO_F) { - FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Absolute Zero!")); - } - return new Temperature((source.getTemperature() - 32) * 5 / 9, CELSIUS); - } else { // Should never get here! - throw new IllegalStateException("This is embarrassing - this error should NOT occur!"); - } - - } -} diff --git a/temperature-converter/src/main/webapp/WEB-INF/beans.xml b/temperature-converter/src/main/webapp/WEB-INF/beans.xml deleted file mode 100644 index d3ddf148e7..0000000000 --- a/temperature-converter/src/main/webapp/WEB-INF/beans.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/temperature-converter/src/main/webapp/WEB-INF/faces-config.xml b/temperature-converter/src/main/webapp/WEB-INF/faces-config.xml deleted file mode 100644 index 0e98f602ce..0000000000 --- a/temperature-converter/src/main/webapp/WEB-INF/faces-config.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - diff --git a/temperature-converter/src/main/webapp/index.html b/temperature-converter/src/main/webapp/index.html deleted file mode 100644 index f7e00cebc2..0000000000 --- a/temperature-converter/src/main/webapp/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - diff --git a/temperature-converter/src/main/webapp/temperatureconvert.xhtml b/temperature-converter/src/main/webapp/temperatureconvert.xhtml deleted file mode 100644 index c85a0c1bba..0000000000 --- a/temperature-converter/src/main/webapp/temperatureconvert.xhtml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - -temperature-converter - - - - -

JBoss EAP Temperature Converter Service

-

Enter the temperature you wish to convert. - Then click C for Celsius or F for Fahrenheit to choose the temperature scale. -

-
- - - Scale (default): - - - - Temperature: - - - - - - - - Converts to: - - - -
-

How the temperature conversion works:

-
    -
  • The input temperature string is parsed using a regular expression that expects a floating point number. - The parsed temperature value is combined with the selected or default temperature scale to convert the temperature to - the new scale.
  • -
  • If the input temperature is null or can not be converted, an error message is displayed and 'Invalid temperature' is - returned for the result.
  • -
  • Both the parsed input temperature and the resulting converted temperature are truncated to 3 decimal places.
  • -
- -
- - - diff --git a/temperature-converter/src/test/java/org/jboss/as/quickstarts/temperatureconverter/ProvisionedManagedTemperatureConverterIT.java b/temperature-converter/src/test/java/org/jboss/as/quickstarts/temperatureconverter/ProvisionedManagedTemperatureConverterIT.java deleted file mode 100644 index 027257ebf6..0000000000 --- a/temperature-converter/src/test/java/org/jboss/as/quickstarts/temperatureconverter/ProvisionedManagedTemperatureConverterIT.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.temperatureconverter; - - -import java.net.URI; -import java.net.URISyntaxException; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit5.ArquillianExtension; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; - -@ExtendWith(ArquillianExtension.class) -@RunAsClient -public class ProvisionedManagedTemperatureConverterIT extends RemoteTemperatureConverterIT { - - @Override - protected URI getHTTPEndpoint(String path) { - String host = getServerHost(); - if (host == null) { - host = "http://localhost:8080/"; - } - try { - return new URI(host + path); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } - - @Test - @Override - public void testConvertTemperature() throws Exception { - convertTemperature(); - } - -} diff --git a/temperature-converter/src/test/java/org/jboss/as/quickstarts/temperatureconverter/RemoteTemperatureConverterIT.java b/temperature-converter/src/test/java/org/jboss/as/quickstarts/temperatureconverter/RemoteTemperatureConverterIT.java deleted file mode 100644 index 5392b4a558..0000000000 --- a/temperature-converter/src/test/java/org/jboss/as/quickstarts/temperatureconverter/RemoteTemperatureConverterIT.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.temperatureconverter; - -import java.io.IOException; -import java.net.CookieManager; -import java.net.CookiePolicy; -import java.util.logging.Logger; - -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URLEncoder; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.net.http.HttpRequest.BodyPublisher; -import java.net.http.HttpRequest.BodyPublishers; -import java.net.http.HttpResponse; -import java.nio.charset.StandardCharsets; -import java.util.Map; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class RemoteTemperatureConverterIT { - - private static final Logger log = Logger.getLogger(RemoteTemperatureConverterIT.class.getName()); - - protected URI getHTTPEndpoint(String path) { - String host = getServerHost(); - if (host == null) { - host = "http://localhost:8080/temperature-converter"; - } - try { - return new URI(host + path); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } - - protected String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host"); - } - return host; - } - - @Test - public void testConvertTemperature() throws Exception { - convertTemperature(); - } - - public void convertTemperature() throws IOException, InterruptedException { - CookieManager manager = new CookieManager(null, CookiePolicy.ACCEPT_ALL); - HttpClient client = HttpClient.newBuilder() - .followRedirects(HttpClient.Redirect.ALWAYS) - .cookieHandler(manager) - .version(HttpClient.Version.HTTP_1_1) - .build(); - HttpResponse response = client.send(HttpRequest.newBuilder(getHTTPEndpoint("/temperatureconvert.jsf")).GET().build(), HttpResponse.BodyHandlers.ofString()); - String body = response.body().toString(); - Assertions.assertEquals(200, response.statusCode()); - Assertions.assertTrue(body.contains(" data) { - StringBuilder builder = new StringBuilder(); - for (Map.Entry entry : data.entrySet()) { - if (builder.length() > 0) { - builder.append("&"); - } - builder.append(URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8)); - builder.append("="); - builder.append(URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8)); - } - return BodyPublishers.ofString(builder.toString()); - } - -} diff --git a/thread-racing/README-source.adoc b/thread-racing/README-source.adoc deleted file mode 100644 index 06b52e9819..0000000000 --- a/thread-racing/README-source.adoc +++ /dev/null @@ -1,72 +0,0 @@ -include::../shared-doc/attributes.adoc[] - -= thread-racing: A Jakarta EE thread racing web application -:author: Eduardo Martins -:level: Beginner -:technologies: Batch, CDI, EE Concurrency, JAX-RS, JMS, JPA, JSON, Web Sockets -:openshift: true - -[abstract] -A thread racing web application that demonstrates technologies introduced or updated in the latest Jakarta EE specification. - -:standalone-server-type: full -:archiveType: war -:uses-h2: - -== What is it? - -The `thread-racing` quickstart is a web application that demonstrates new and updated technologies introduced by the {javaVersion} specification through simple use cases. - -The web application allows the user to trigger a race between 4 threads and follow, in real time, the progress of each thread until the race ends. - -The race itself consists of multiple stages, each demonstrating the usage of a specific new or updated {javaVersion} technology: - -* Batch 2.1 -* EE Concurrency 3.0 -* JAX-RS 3.1 -* JMS 3.1 -* JSON 2.1 - -WebSockets 2.1 is one of the most relevant new technologies introduced by {javaVersion}. Instead of being used in a race stage, a WebSockets 2.1 ServerEndpoint provides the remote application interface. -A new race is run when a client establishes a session. That session is then used to update the client in real time, with respect to the race progress and results. The `src/main/java/org/jboss/as/quickstarts/threadracing/WebSocketRace.java` file is the WebSocket server endpoint class and is a good entry point when studying how the application code works. - -JPA 3.1 is also present in the application code. Specifically it is used to store race results in the default data source instance, which is also new to Jakarta EE. Further details are included in the `src/main/java/org/jboss/as/quickstarts/threadracing/results/RaceResults.java` class. - - -//************************************************* -// Product Release content only -//************************************************* - -ifndef::EAPCDRelease[] - -// Considerations for Use in a Production Environment -include::../shared-doc/development-shortcuts.adoc[leveloffset=+1] -// System Requirements -include::../shared-doc/system-requirements.adoc[leveloffset=+1] -// Use of {jbossHomeName} -include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1] - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Start the {productName} Standalone Server -include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+2] -// Build and Deploy the Quickstart -include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+2] - -=== Access the application - -The application will be running at the following URL http://localhost:8080/{artifactId}/. - -To start a race press the `Insert Coin` button. The page displays the names of the threads as they join the race. It then tracks the progress of each thread through the Batch, EE Concurrency, JAX-RS, JMS, and JSON stages of the race. Finally, it displays the official race results and championship standings. - -// Testing with Arquillian -include::../shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc[leveloffset=+2] -// Undeploy the Quickstart -include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2] - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1] diff --git a/thread-racing/README.adoc b/thread-racing/README.adoc deleted file mode 100644 index 9e3fbae61d..0000000000 --- a/thread-racing/README.adoc +++ /dev/null @@ -1,885 +0,0 @@ -ifdef::env-github[] -:artifactId: thread-racing -endif::[] - -//*********************************************************************************** -// Enable the following flag to build README.html files for JBoss EAP product builds. -// Comment it out for WildFly builds. -//*********************************************************************************** -:ProductRelease: - -//*********************************************************************************** -// Enable the following flag to build README.html files for EAP XP product builds. -// Comment it out for WildFly or JBoss EAP product builds. -//*********************************************************************************** -//:EAPXPRelease: - -// This is a universal name for all releases -:ProductShortName: JBoss EAP -// Product names and links are dependent on whether it is a product release (CD or JBoss) -// or the WildFly project. -// The "DocInfo*" attributes are used to build the book links to the product documentation - -ifdef::ProductRelease[] -// JBoss EAP release -:productName: JBoss EAP -:productNameFull: Red Hat JBoss Enterprise Application Platform -:productVersion: 8.0 -:DocInfoProductNumber: {productVersion} -:WildFlyQuickStartRepoTag: 8.0.x -:productImageVersion: 8.0.0 -:helmChartName: jboss-eap/eap8 -endif::[] - -ifdef::EAPXPRelease[] -// JBoss EAP XP release -:productName: JBoss EAP XP -:productNameFull: Red Hat JBoss Enterprise Application Platform expansion pack -:productVersion: 3.0 -:DocInfoProductNumber: 7.4 -:WildFlyQuickStartRepoTag: XP_3.0.0.GA -:productImageVersion: 3.0 -:helmChartName: jboss-eap/eap-xp3 -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -:githubRepoUrl: https://github.com/jboss-developer/jboss-eap-quickstarts/ -:githubRepoCodeUrl: https://github.com/jboss-developer/jboss-eap-quickstarts.git -:jbossHomeName: EAP_HOME -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:quickstartDownloadName: {productNameFull} {productVersion} Quickstarts -:quickstartDownloadUrl: https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=appplatform&downloadType=distributions -:helmRepoName: jboss-eap -:helmRepoUrl: https://jbossas.github.io/eap-charts/ -// END ifdef::ProductRelease,EAPXPRelease[] -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -// WildFly project -:productName: WildFly -:productNameFull: WildFly Application Server -:ProductShortName: {productName} -:jbossHomeName: WILDFLY_HOME -:productVersion: 28 -:productImageVersion: 28.0 -:githubRepoUrl: https://github.com/wildfly/quickstart/ -:githubRepoCodeUrl: https://github.com/wildfly/quickstart.git -:WildFlyQuickStartRepoTag: 28.0.1.Final -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -// Do not update the following until after the 7.4 docs are published! -:DocInfoProductNumber: 7.4 -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:helmRepoName: wildfly -:helmRepoUrl: http://docs.wildfly.org/wildfly-charts/ -:helmChartName: wildfly/wildfly -// END ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -endif::[] - -:source: {githubRepoUrl} - -// Values for Openshift S2i sections attributes -:CDProductName: {productNameFull} for OpenShift -:CDProductShortName: {ProductShortName} for OpenShift -:CDProductTitle: {CDProductName} -:CDProductNameSentence: Openshift release for {ProductShortName} -:CDProductAcronym: {CDProductShortName} -:CDProductVersion: {productVersion} -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {EapForOpenshiftBookName} Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {xpaasproduct} Online -:xpaasproduct-shortname: {CDProductShortName} -:xpaasproductOpenShiftOnline-shortname: {xpaasproduct-shortname} Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: Getting Started with {ProductShortName} for OpenShift Container Platform -:EapForOpenshiftOnlineBookName: Getting Started with {ProductShortName} for OpenShift Online -:OpenShiftOnlinePlatformName: Red Hat OpenShift Container Platform -:OpenShiftOnlineName: Red Hat OpenShift Online -:ImagePrefixVersion: eap80 -:ImageandTemplateImportBaseURL: https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift - -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepo: https://github.com/jboss-developer/jboss-eap-quickstarts -:EAPQuickStartRepoRef: 8.0.x -:EAPQuickStartRepoTag: EAP_8.0.0.GA -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_container_platform/ -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_online/ - -ifdef::EAPXPRelease[] -// Attributes for XP releases -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {productNameFull} for OpenShift Online -:xpaasproduct-shortname: {ProductShortName} for OpenShift -:xpaasproductOpenShiftOnline-shortname: {ProductShortName} for OpenShift Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:ImagePrefixVersion: eap-xp3 -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepoRef: xp-3.0.x -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -endif::[] - -ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -:ImageandTemplateImportURL: https://raw.githubusercontent.com/wildfly/wildfly-s2i/v{productVersion}.0/ -endif::[] - -//************************* -// Other values -//************************* -:buildRequirements: Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later -:jbdsEapServerName: Red Hat JBoss Enterprise Application Platform 7.3 -:javaVersion: Jakarta EE 10 -ifdef::EAPXPRelease[] -:javaVersion: Eclipse MicroProfile -endif::[] -:githubRepoBranch: master -:guidesBaseUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/ -:useEclipseUrl: {guidesBaseUrl}USE_JBDS.adoc#use_red_hat_jboss_developer_studio_or_eclipse_to_run_the_quickstarts -:useEclipseDeployJavaClientDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_containing_server_and_java_client_projects -:useEclipseDeployEARDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_ear_project -:useProductHomeDocUrl: {guidesBaseUrl}USE_OF_{jbossHomeName}.adoc#use_of_product_home_and_jboss_home_variables -:configureMavenDocUrl: {guidesBaseUrl}CONFIGURE_MAVEN_JBOSS_EAP.adoc#configure_maven_to_build_and_deploy_the_quickstarts -:arquillianTestsDocUrl: {guidesBaseUrl}RUN_ARQUILLIAN_TESTS.adoc#run_the_arquillian_tests -:addUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#create_users_required_by_the_quickstarts -:addApplicationUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_application_user -:addManagementUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_management_user -:startServerDocUrl: {guidesBaseUrl}START_JBOSS_EAP.adoc#start_the_jboss_eap_server -:configurePostgresDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_database_for_use_with_the_quickstarts -:configurePostgresDownloadDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#download_and_install_postgresql -:configurePostgresCreateUserDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#create_a_database_user -:configurePostgresAddModuleDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#add_the_postgres_module_to_the_jboss_eap_server -:configurePostgresDriverDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_driver_in_the_jboss_eap_server -:configureBytemanDownloadDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#download_and_configure_byteman -:configureBytemanDisableDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#disable_the_byteman_script -:configureBytemanClearDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#clear_the_transaction_object_store -:configureBytemanQuickstartDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts -:configureBytemanHaltDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#use_byteman_to_halt_the_application[ -:configureBytemanQuickstartsDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts - -:EESubsystemNamespace: urn:jboss:domain:ee:4.0 -:IiopOpenJdkSubsystemNamespace: urn:jboss:domain:iiop-openjdk:2.0 -:MailSubsystemNamespace: urn:jboss:domain:mail:3.0 -:SingletonSubsystemNamespace: urn:jboss:domain:singleton:1.0 -:TransactionsSubsystemNamespace: urn:jboss:domain:transactions:4.0 - -// LinkProductDocHome: https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/ -:LinkProductDocHome: https://access.redhat.com/documentation/en/jboss-enterprise-application-platform-continuous-delivery -:LinkConfigGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/configuration_guide/ -:LinkDevelopmentGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/development_guide/ -:LinkGettingStartedGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_guide/ -:LinkOpenShiftWelcome: https://docs.openshift.com/online/welcome/index.html -:LinkOpenShiftSignup: https://docs.openshift.com/online/getting_started/choose_a_plan.html -:OpenShiftTemplateName: JBoss EAP CD (no https) - -:ConfigBookName: Configuration Guide -:DevelopmentBookName: Development Guide -:GettingStartedBookName: Getting Started Guide - -:JBDSProductName: Red Hat CodeReady Studio -:JBDSVersion: 12.15 -:LinkJBDSInstall: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/installation_guide/ -:JBDSInstallBookName: Installation Guide -:LinkJBDSGettingStarted: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/getting_started_with_codeready_studio_tools/ -:JBDSGettingStartedBookName: Getting Started with CodeReady Studio Tools - -= thread-racing: A Jakarta EE thread racing web application -:author: Eduardo Martins -:level: Beginner -:technologies: Batch, CDI, EE Concurrency, JAX-RS, JMS, JPA, JSON, Web Sockets -:openshift: true - -[abstract] -A thread racing web application that demonstrates technologies introduced or updated in the latest Jakarta EE specification. - -:standalone-server-type: full -:archiveType: war -:uses-h2: - -== What is it? - -The `thread-racing` quickstart is a web application that demonstrates new and updated technologies introduced by the {javaVersion} specification through simple use cases. - -The web application allows the user to trigger a race between 4 threads and follow, in real time, the progress of each thread until the race ends. - -The race itself consists of multiple stages, each demonstrating the usage of a specific new or updated {javaVersion} technology: - -* Batch 2.1 -* EE Concurrency 3.0 -* JAX-RS 3.1 -* JMS 3.1 -* JSON 2.1 - -WebSockets 2.1 is one of the most relevant new technologies introduced by {javaVersion}. Instead of being used in a race stage, a WebSockets 2.1 ServerEndpoint provides the remote application interface. -A new race is run when a client establishes a session. That session is then used to update the client in real time, with respect to the race progress and results. The `src/main/java/org/jboss/as/quickstarts/threadracing/WebSocketRace.java` file is the WebSocket server endpoint class and is a good entry point when studying how the application code works. - -JPA 3.1 is also present in the application code. Specifically it is used to store race results in the default data source instance, which is also new to Jakarta EE. Further details are included in the `src/main/java/org/jboss/as/quickstarts/threadracing/results/RaceResults.java` class. - - -//************************************************* -// Product Release content only -//************************************************* - -ifndef::EAPCDRelease[] - -// Considerations for Use in a Production Environment -:leveloffset: +1 - -[[considerations_for_use_in_a_production_environment]] -= Considerations for Use in a Production Environment -//****************************************************************************** -// Include this template if your quickstart: -// * Uses the h2 database: Be sure to define the `uses-h2` attribute. -// * Uses an `*-ds.xml file`: Be sure to define the `uses-ds-xml` attribute. -// * Has performance or scalability concerns: Be sure to define the `uses-ds-xml` attribute. -//****************************************************************************** - -ifdef::uses-h2[] - -H2 Database:: This quickstart uses the H2 database included with {productNameFull} {productVersion}. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment. - -endif::uses-h2[] - -ifdef::uses-ds-xml[] - -Datasource Configuration File:: This quickstart uses a `*-ds.xml` datasource configuration file for convenience and ease of database configuration. These files are deprecated in {productName} and should not be used in a production environment. Instead, you should configure the datasource using the Management CLI or Management Console. Datasource configuration is documented in the {LinkConfigGuide}[__{ConfigBookName}__]. - -endif::uses-ds-xml[] - -ifdef::performance-scalability[] - -Performance and Scalability:: A Jakarta EE container is designed with robustness in mind, so you should carefully analyze the scalabiltiy, concurrency, and performance needs of your application before taking advantage of these techniques in your own applications. - -endif::performance-scalability[] - -:leveloffset!: -// System Requirements -:leveloffset: +1 - -[[system_requirements]] -= System Requirements -//****************************************************************************** -// Include this template to describe the standard system requirements for -// running the quickstarts. -// -// The Forge quickstarts define a `forge-from-scratch` attribute because they -// run entirely in CodeReady Studio and have different requirements . -//****************************************************************************** - -The application this project produces is designed to be run on {productNameFull} {productVersion} or later. - -All you need to build this project is {buildRequirements}. See link:{configureMavenDocUrl}[Configure Maven to Build and Deploy the Quickstarts] to make sure you are configured correctly for testing the quickstarts. - -:leveloffset!: -// Use of {jbossHomeName} -:leveloffset: +1 - -ifdef::requires-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -This quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifdef::optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -When deploying this quickstart to a managed domain, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When deploying this quickstart to multiple standalone servers, this quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifndef::requires-multiple-servers,optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName} and QUICKSTART_HOME Variables - -In the following instructions, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -:leveloffset!: - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Start the {productName} Standalone Server -:leveloffset: +2 - -[[start_the_eap_standalone_server]] -= Start the {productName} Standalone Server -//****************************************************************************** -// Include this template if your quickstart requires a normal start of a single -// standalone server. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// custom -// -// * For mobile applications, you can define the `mobileApp` variable in the -// `README.adoc` file to add `-b 0.0.0.0` to the command line. This allows -// external clients, such as phones, tablets, and desktops, to connect -// to the application through through your local network -// ::mobileApp: {artifactId}-service -// -//****************************************************************************** - -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -. Open a terminal and navigate to the root of the {productName} directory. -. Start the {productName} server with the {serverProfile} by typing the following command. -+ -ifdef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __JAEGER_REPORTER_LOG_SPANS=true JAEGER_SAMPLER_TYPE=const JAEGER_SAMPLER_PARAM=1__ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -ifndef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\standalone.bat` script. - -ifdef::mobileApp[] -+ -Adding `-b 0.0.0.0` to the above command allows external clients, such as phones, tablets, and desktops, to connect through your local network. For example: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} -b 0.0.0.0 ----- -endif::[] - -:leveloffset!: -// Build and Deploy the Quickstart -:leveloffset: +2 - -[[build_and_deploy_the_quickstart]] -= Build and Deploy the Quickstart -//****************************************************************************** -// Include this template if your quickstart does a normal deployment of a archive. -// -// * Define the `archiveType` variable in the quickstart README file. -// Supported values: -// :archiveType: ear -// :archiveType: war -// :archiveType: jar -// -// * To override the archive name, which defaults to the {artifactId), -// define the `archiveName` variable, for example: -// :archiveName: {artifactId}-service -// -// * To override the archive output directory, -// define the `archiveDir` variable, for example: -// :archiveDir: ear/target -// -// * To override the Maven command, define the `mavenCommand` variable, -// for example: -// :mavenCommand: clean install wildfly:deploy -//****************************************************************************** - -// The archive name defaults to the artifactId if not overridden -ifndef::archiveName[] -:archiveName: {artifactId} -endif::archiveName[] - -// The archive type defaults to war if not overridden -ifndef::archiveType[] -:archiveType: war -endif::archiveType[] - -// Define the archive file name as the concatenation of "archiveName" + "." + "archiveType+ -:archiveFileName: {archiveName}.{archiveType} - -// If they have not defined the target archive directory, make it the default for the archive type. -ifndef::archiveDir[] - -ifeval::["{archiveType}"=="ear"] -:archiveDir: {artifactId}/ear/target -endif::[] - -ifeval::["{archiveType}"=="war"] -:archiveDir: {artifactId}/target -endif::[] - -ifeval::["{archiveType}"=="jar"] -:archiveDir: {artifactId}/target -endif::[] - -endif::archiveDir[] - -ifndef::mavenCommand[] -ifeval::["{archiveType}"=="ear"] -:mavenCommand: clean install -endif::[] - -ifeval::["{archiveType}"=="war"] -:mavenCommand: clean package -endif::[] - -ifeval::["{archiveType}"=="jar"] -:mavenCommand: clean install -endif::[] - -endif::mavenCommand[] - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -ifdef::reactive-messaging[] -. Run this command to enable the MicroProfile Reactive Messaging functionality on the server -+ -[source,subs="attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=enable-reactive-messaging.cli ----- -endif::reactive-messaging[] -. Type the following command to build the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn {mavenCommand} ----- - -. Type the following command to deploy the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn wildfly:deploy ----- - -ifdef::rest-client-qs[] -This builds and deploys the `country-server` and `country-client` to the running instance of the server. - -You should see a message in the server log indicating that the archives deployed successfully. -endif::[] -ifndef::rest-client-qs[] -This deploys the `{archiveDir}/{archiveFileName}` to the running instance of the server. - -You should see a message in the server log indicating that the archive deployed successfully. -endif::[] - - -:leveloffset!: - -=== Access the application - -The application will be running at the following URL http://localhost:8080/{artifactId}/. - -To start a race press the `Insert Coin` button. The page displays the names of the threads as they join the race. It then tracks the progress of each thread through the Batch, EE Concurrency, JAX-RS, JMS, and JSON stages of the race. Finally, it displays the official race results and championship standings. - -// Testing with Arquillian -:leveloffset: +2 - -[[run_the_arquillian_integration_tests_with_server_distribution]] -= Run the Arquillian Integration Tests -//****************************************************************************** -// Include this template if your quickstart provides standard Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -Follow these steps to run the integration tests. - -. Make sure you start the {productName} server, as previously described. - -. Make sure you build and deploy the quickstart, as previously described. - -. Type the following command to run the `verify` goal with the `arq-remote` profile activated. -+ -[source,options="nowrap"] ----- -$ mvn verify -Parq-remote ----- - -[NOTE] -==== -You may also use the environment variable `SERVER_HOST` or the system property `server.host` to define the target host of the tests. -==== - -:leveloffset!: -// Undeploy the Quickstart -:leveloffset: +2 - -[[undeploy_the_quickstart]] -= Undeploy the Quickstart - -//******************************************************************************* -// Include this template if your quickstart does a normal undeployment of an archive. -//******************************************************************************* -When you are finished testing the quickstart, follow these steps to undeploy the archive. - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -. Type this command to undeploy the archive: -+ -[source,options="nowrap"] ----- -$ mvn wildfly:undeploy ----- - -:leveloffset!: - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -:leveloffset: +1 - -[[build_and_run_the_quickstart_on_openshift]] -= Building and running the quickstart application with OpenShift -// The openshift profile -:leveloffset: +1 - -[[build-the-quickstart-for-openshift]] -== Build the {productName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -On OpenShift, the S2I build with Apache Maven will use an `openshift` profile used to provision a {productName} server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named `openshift` when building the quickstart: - -[source,subs="attributes+",options="nowrap"] ----- -$ mvn clean package -Popenshift ----- - -The provisioned {productName} server for OpenShift, with the quickstart deployed, can then be found in the `target/server` directory, and its usage is similar to a standard server distribution. -ifndef::ProductRelease,EAPXPRelease[] -You may note that unlike the `provisioned-server` profile it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the WildFly Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.wildfly:wildfly-galleon-pack:${version.server} - - - org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp} - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -[NOTE] -==== -Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`. -==== - -:leveloffset: 1 -// Getting Started with Helm -:leveloffset: +1 - -[[getting_started_with_helm]] -= Getting Started with {xpaasproduct-shortname} and Helm Charts - -This section contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} using Helm Charts. - -[[prerequisites_helm_openshift]] -== Prerequisites - -* You must be logged in OpenShift and have an `oc` client to connect to OpenShift -* https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. - -Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}. - -ifndef::ProductRelease,EAPXPRelease[] -[source,options="nowrap"] ----- -$ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ -"wildfly" has been added to your repositories -$ helm search repo wildfly -NAME CHART VERSION APP VERSION DESCRIPTION -wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift -wildfly/wildfly-common ... ... A library chart for WildFly-based applications ----- -endif::[] -ifdef::ProductRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP {productVersion} applications ----- -endif::[] -ifdef::EAPXPRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP XP {productVersion} applications ----- -endif::[] - -:leveloffset: 1 -//Prepare Helm for Quickstart Deployment -:leveloffset: +1 - -[[deploy_helm]] -== Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -Log in to your OpenShift instance using the `oc login` command. -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -Navigate to the root directory of this quickstart and run the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm install {artifactId} -f charts/helm.yaml {helmChartName} -NAME: {artifactId} -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17: - -[source,options="nowrap",subs="+attributes"] ----- -build: - uri: {githubRepoCodeUrl} - ref: {WildFlyQuickStartRepoTag} - contextDir: {artifactId} -deploy: - replicas: 1 ----- - -This will create a new deployment on OpenShift and deploy the application. - -If you want to see all the configuration elements to customize your deployment you can use the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let’s wait for the application to be built and deployed: -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment {artifactId} -w -NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE -{artifactId} 1 1 1 0 12s -... -{artifactId} 1 1 1 1 2m ----- - -Get the URL of the route to the deployment. - -[source,options="nowrap",subs="+attributes"] ----- -$ oc get route {artifactId} -o jsonpath="{.spec.host}" ----- -Access the application in your web browser using the displayed URL. - -[NOTE] -==== -The Maven profile named `openshift` is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the `/{artifactId}` path segment after `HOST:PORT`. -==== - -[[undeploy_helm]] -== Undeploy the {ProductShortName} Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts - - -[source,options="nowrap",subs="+attributes"] ----- -$ helm uninstall {artifactId} ----- - -:leveloffset: 1 -// Testing on Openshift -:leveloffset: +1 - -[[run_the_arquillian_integration_tests_with_openshift]] -= Run the Arquillian Integration Tests with OpenShift -//****************************************************************************** -// Include this template if your quickstart provides Openshift Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -[NOTE] -==== -The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin. -==== - -Run the integration tests using the following command to run the `verify` goal with the `arq-remote` profile activated and the proper URL: -[source,options="nowrap",subs="+attributes"] ----- -$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route {artifactId} --template='{{ .spec.host }}') ----- - -[NOTE] -==== -The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from. -==== - -:leveloffset: 1 - -:leveloffset!: diff --git a/thread-racing/README.html b/thread-racing/README.html deleted file mode 100644 index 95c8e1d6e0..0000000000 --- a/thread-racing/README.html +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - -thread-racing: A Jakarta EE thread racing web application - - - - - -
-
-
-
-
-A thread racing web application that demonstrates technologies introduced or updated in the latest Jakarta EE specification. -
-
-
-
-
-

What is it?

-
-
-

The thread-racing quickstart is a web application that demonstrates new and updated technologies introduced by the Jakarta EE 10 specification through simple use cases.

-
-
-

The web application allows the user to trigger a race between 4 threads and follow, in real time, the progress of each thread until the race ends.

-
-
-

The race itself consists of multiple stages, each demonstrating the usage of a specific new or updated Jakarta EE 10 technology:

-
-
-
    -
  • -

    Batch 2.1

    -
  • -
  • -

    EE Concurrency 3.0

    -
  • -
  • -

    JAX-RS 3.1

    -
  • -
  • -

    JMS 3.1

    -
  • -
  • -

    JSON 2.1

    -
  • -
-
-
-

WebSockets 2.1 is one of the most relevant new technologies introduced by Jakarta EE 10. Instead of being used in a race stage, a WebSockets 2.1 ServerEndpoint provides the remote application interface. -A new race is run when a client establishes a session. That session is then used to update the client in real time, with respect to the race progress and results. The src/main/java/org/jboss/as/quickstarts/threadracing/WebSocketRace.java file is the WebSocket server endpoint class and is a good entry point when studying how the application code works.

-
-
-

JPA 3.1 is also present in the application code. Specifically it is used to store race results in the default data source instance, which is also new to Jakarta EE. Further details are included in the src/main/java/org/jboss/as/quickstarts/threadracing/results/RaceResults.java class.

-
-
-
-
-

Considerations for Use in a Production Environment

-
-
-
-
H2 Database
-
-

This quickstart uses the H2 database included with Red Hat JBoss Enterprise Application Platform 8.0. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment.

-
-
-
-
-
-
-

System Requirements

-
-
-

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 8.0 or later.

-
-
-

All you need to build this project is Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later. See Configure Maven to Build and Deploy the Quickstarts to make sure you are configured correctly for testing the quickstarts.

-
-
-
-
-

Use of the EAP_HOME and QUICKSTART_HOME Variables

-
-
-

In the following instructions, replace EAP_HOME with the actual path to your JBoss EAP installation. The installation path is described in detail here: Use of EAP_HOME and JBOSS_HOME Variables.

-
-
-

When you see the replaceable variable QUICKSTART_HOME, replace it with the path to the root directory of all of the quickstarts.

-
-
-
-
-

Building and running the quickstart application with a JBoss EAP server distribution

-
-
-

Start the JBoss EAP Standalone Server

-
-
    -
  1. -

    Open a terminal and navigate to the root of the JBoss EAP directory.

    -
  2. -
  3. -

    Start the JBoss EAP server with the full profile by typing the following command.

    -
    -
    -
    $ EAP_HOME/bin/standalone.sh -c standalone-full.xml
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\standalone.bat script. -
    -
    -
  4. -
-
-
-
-

Build and Deploy the Quickstart

-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type the following command to build the quickstart.

    -
    -
    -
    $ mvn clean package
    -
    -
    -
  6. -
  7. -

    Type the following command to deploy the quickstart.

    -
    -
    -
    $ mvn wildfly:deploy
    -
    -
    -
  8. -
-
-
-

This deploys the thread-racing/target/thread-racing.war to the running instance of the server.

-
-
-

You should see a message in the server log indicating that the archive deployed successfully.

-
-
-
-

Access the application

-
-

The application will be running at the following URL http://localhost:8080/thread-racing/.

-
-
-

To start a race press the Insert Coin button. The page displays the names of the threads as they join the race. It then tracks the progress of each thread through the Batch, EE Concurrency, JAX-RS, JMS, and JSON stages of the race. Finally, it displays the official race results and championship standings.

-
-
-
-

Run the Arquillian Integration Tests

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
-

Follow these steps to run the integration tests.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server, as previously described.

    -
  2. -
  3. -

    Make sure you build and deploy the quickstart, as previously described.

    -
  4. -
  5. -

    Type the following command to run the verify goal with the arq-remote profile activated.

    -
    -
    -
    $ mvn verify -Parq-remote
    -
    -
    -
  6. -
-
-
- - - - - -
-
Note
-
-
-

You may also use the environment variable SERVER_HOST or the system property server.host to define the target host of the tests.

-
-
-
-
-
-

Undeploy the Quickstart

-
-

When you are finished testing the quickstart, follow these steps to undeploy the archive.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type this command to undeploy the archive:

    -
    -
    -
    $ mvn wildfly:undeploy
    -
    -
    -
  6. -
-
-
-
-
-
-

Building and running the quickstart application with OpenShift

-
-
-

Build the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

On OpenShift, the S2I build with Apache Maven will use an openshift profile used to provision a JBoss EAP server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named openshift when building the quickstart:

-
-
-
-
$ mvn clean package -Popenshift
-
-
-
-

The provisioned JBoss EAP server for OpenShift, with the quickstart deployed, can then be found in the target/server directory, and its usage is similar to a standard server distribution. -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.

-
-
-

The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart pom.xml:

-
-
-
-
        <profile>
-            <id>openshift</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.jboss.eap.plugins</groupId>
-                        <artifactId>eap-maven-plugin</artifactId>
-                        <version>${version.eap.maven.plugin}</version>
-                        <configuration>
-                            <feature-packs>
-                                <feature-pack>
-                                    <location>org.jboss.eap:wildfly-ee-galleon-pack</location>
-                                </feature-pack>
-                                <feature-pack>
-                                    <location>org.jboss.eap.cloud:eap-cloud-galleon-pack</location>
-                                </feature-pack>
-                            </feature-packs>
-                            <layers>
-                                <layer>cloud-server</layer>
-                            </layers>
-                            <filename>ROOT.war</filename>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>package</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-
-
-
- - - - - -
-
Note
-
-
-

Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the /thread-racing path segment after HOST:PORT.

-
-
-
-
-
-

Getting Started with JBoss EAP for OpenShift and Helm Charts

-
-

This section contains the basic instructions to build and deploy this quickstart to JBoss EAP for OpenShift or JBoss EAP for OpenShift Online using Helm Charts.

-
-
-

Prerequisites

-
-
    -
  • -

    You must be logged in OpenShift and have an oc client to connect to OpenShift

    -
  • -
  • -

    Helm must be installed to deploy the backend on OpenShift.

    -
  • -
-
-
-

Once you have installed Helm, you need to add the repository that provides Helm Charts for JBoss EAP.

-
-
-
-
$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/
-"jboss-eap" has been added to your repositories
-$ helm search repo jboss-eap
-NAME                    CHART VERSION   APP VERSION     DESCRIPTION
-jboss-eap/eap8         ...             ...             A Helm chart to build and deploy EAP 8.0 applications
-
-
-
-
-

Deploy the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

Log in to your OpenShift instance using the oc login command. -The backend will be built and deployed on OpenShift with a Helm Chart for JBoss EAP.

-
-
-

Navigate to the root directory of this quickstart and run the following command:

-
-
-
-
$ helm install thread-racing -f charts/helm.yaml jboss-eap/eap8
-NAME: thread-racing
-...
-STATUS: deployed
-REVISION: 1
-
-
-
-

The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17:

-
-
-
-
build:
-  uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git
-  ref: 8.0.x
-  contextDir: thread-racing
-deploy:
-  replicas: 1
-
-
-
-

This will create a new deployment on OpenShift and deploy the application.

-
-
-

If you want to see all the configuration elements to customize your deployment you can use the following command:

-
-
-
-
$ helm show readme jboss-eap/eap8
-
-
-
-

Let’s wait for the application to be built and deployed:

-
-
-
-
$ oc get deployment thread-racing -w
-NAME         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
-thread-racing   1         1         1            0           12s
-...
-thread-racing   1         1         1            1           2m
-
-
-
-

Get the URL of the route to the deployment.

-
-
-
-
$ oc get route thread-racing -o jsonpath="{.spec.host}"
-
-
-
-

Access the application in your web browser using the displayed URL.

-
-
- - - - - -
-
Note
-
-
-

The Maven profile named openshift is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the /thread-racing path segment after HOST:PORT.

-
-
-
-
-
-

Undeploy the JBoss EAP Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts

-
-
-
$ helm uninstall thread-racing
-
-
-
-
-
-

Run the Arquillian Integration Tests with OpenShift

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
- - - - - -
-
Note
-
-
-

The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin.

-
-
-
-
-

Run the integration tests using the following command to run the verify goal with the arq-remote profile activated and the proper URL:

-
-
-
-
$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route thread-racing --template='{{ .spec.host }}')
-
-
-
- - - - - -
-
Note
-
-
-

The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from.

-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/thread-racing/charts/helm.yaml b/thread-racing/charts/helm.yaml deleted file mode 100644 index f60165ecbf..0000000000 --- a/thread-racing/charts/helm.yaml +++ /dev/null @@ -1,6 +0,0 @@ -build: - uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git - ref: 8.0.x - contextDir: thread-racing -deploy: - replicas: 1 \ No newline at end of file diff --git a/thread-racing/pom.xml b/thread-racing/pom.xml deleted file mode 100644 index 89c1fa8528..0000000000 --- a/thread-racing/pom.xml +++ /dev/null @@ -1,326 +0,0 @@ - - - - 4.0.0 - - org.jboss.eap.quickstarts - jboss-eap-quickstart-parent - - 6.0.0.redhat-00001 - - - - thread-racing - 8.0.0.GA - war - Quickstart: thread-racing - A web application that triggers a thread race to complete Jakarta EE related tasks - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - 8.0.0.GA-redhat-00009 - 1.0.0.Final-redhat-00014 - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - never - - default - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - never - - - true - never - - default - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - - - true - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - - - true - - - - - - - - - org.jboss.bom - jboss-eap-ee-with-tools - ${version.server.bom} - pom - import - - - - - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - - - jakarta.persistence - jakarta.persistence-api - provided - - - - - jakarta.annotation - jakarta.annotation-api - provided - - - - - jakarta.batch - jakarta.batch-api - provided - - - - - jakarta.ejb - jakarta.ejb-api - provided - - - - - jakarta.enterprise.concurrent - jakarta.enterprise.concurrent-api - provided - - - org.testng - testng - - - - - - - jakarta.jms - jakarta.jms-api - provided - - - - - jakarta.json - jakarta.json-api - provided - - - - - jakarta.websocket - jakarta.websocket-api - provided - - - jakarta.websocket - jakarta.websocket-client-api - provided - - - - - jakarta.ws.rs - jakarta.ws.rs-api - provided - - - org.jboss.resteasy - resteasy-client-api - jar - provided - - - - - org.junit.jupiter - junit-jupiter-api - 5.9.1 - test - - - org.junit.jupiter - junit-jupiter-params - 5.9.1 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.9.1 - test - - - - org.jboss.arquillian.junit5 - arquillian-junit5-container - test - - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet-jakarta - test - - - - - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - - org.jboss.eap.channels - eap-8.0 - - - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - ejb - batch-jberet - embedded-activemq - h2-default-datasource - - ROOT.war - - - - - package - - - - - - - - - arq-remote - - - org.wildfly.arquillian - wildfly-arquillian-container-remote - test - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} - - - **/RemoteThreadRacingIT - - - **/ProvisionedManagedThreadRacingIT - - - - - - integration-test - verify - - - - - - - - - diff --git a/thread-racing/scripts/embedded-broker.cli b/thread-racing/scripts/embedded-broker.cli deleted file mode 100644 index 265c11be65..0000000000 --- a/thread-racing/scripts/embedded-broker.cli +++ /dev/null @@ -1,14 +0,0 @@ -if (outcome == success) of /subsystem=messaging-activemq:read-resource - /subsystem=messaging-activemq/server=default:add(elytron-domain=ApplicationDomain) -end-if -if (outcome == success) of /subsystem=messaging-activemq/server=default:read-resource - /subsystem=messaging-activemq/server=default/in-vm-acceptor=in-vm:add(server-id=0, params=[buffer-pooling=false]) - /subsystem=messaging-activemq/server=default/in-vm-connector=in-vm:add(server-id=0, params=[buffer-pooling=false]) - /subsystem=messaging-activemq/server=default/pooled-connection-factory=activemq-ra:add(connectors=[in-vm], transaction=xa, entries=[java:/JmsXA,java:jboss/DefaultJMSConnectionFactory]) - /subsystem=messaging-activemq/server=default/jms-queue=DLQ:add(entries=[java:/jms/queue/DLQ]) - /subsystem=messaging-activemq/server=default/jms-queue=ExpiryQueue:add(entries=[java:/jms/queue/ExpiryQueue]) - /subsystem=messaging-activemq/server=default/address-setting=#:add(dead-letter-address=jms.queue.DLQ, expiry-address=jms.queue.ExpiryQueue) -end-if -if (outcome == success) of /subsystem=ee/service=default-bindings:read-resource - /subsystem=ee/service=default-bindings:write-attribute(name="jms-connection-factory", value="java:jboss/DefaultJMSConnectionFactory") -end-if \ No newline at end of file diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/EnvironmentProperties.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/EnvironmentProperties.java deleted file mode 100644 index 69c97c2768..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/EnvironmentProperties.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing; - -/** - * The name of each race's environment property. - * - * @author Eduardo Martins - */ -public interface EnvironmentProperties { - - /** - * the server/host name, e.g. localhost - */ - String SERVER_NAME = "SERVER_NAME"; - - /** - * the server port, e.g. 8080 - */ - String SERVER_PORT = "SERVER_PORT"; - - /** - * the app's root path, e.g. /thread-racing - */ - String ROOT_PATH = "ROOT_PATH"; -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/Race.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/Race.java deleted file mode 100644 index 4cabc533e1..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/Race.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing; - -import org.jboss.as.quickstarts.threadracing.results.ChampionshipStandings; -import org.jboss.as.quickstarts.threadracing.results.RaceResult; -import org.jboss.as.quickstarts.threadracing.results.RaceResults; - -import java.util.Map; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.CyclicBarrier; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * The awesome Jakarta EE thread race. It's the core of the app logic, but has no usage of Jakarta EE technologies, thus of limited interest to study. - * - * @author Eduardo Martins - */ -public class Race { - - /** - * a barrier used to sync racers for the race start - */ - private CyclicBarrier startBarrier; - - /** - * a count down latch used by the race to know when all racers finished/aborted - */ - private CountDownLatch endCountDownLatch; - - /** - * provides the positions to racer's who finish the race, the initial value is the first position, which increments on a racer finish - */ - private AtomicInteger donePosition; - - /** - * provides the position to racer's who abandon the race, the initial value is the last possible position, which decrements on a racer abort - */ - private AtomicInteger abortedPosition; - - /** - * the race result - */ - private RaceResult result; - - /** - * the race's environment - */ - private final Map environment; - - /** - * the race's broadcaster - */ - private final RaceBroadcaster broadcaster; - - /** - * the past race results - */ - private final RaceResults results; - - /** - * the racer #1 - */ - private final Racer racer1; - - /** - * the racer #2 - */ - private final Racer racer2; - - /** - * the racer #3 - */ - private final Racer racer3; - - /** - * the racer #4 - */ - private final Racer racer4; - - /** - * Creates a new race with the specified racers and environment. - * @param racer1 - * @param racer2 - * @param racer3 - * @param racer4 - * @param environment - * @param broadcaster the broadcaster that will be used to update fans about the race progress. - * @param results the race results - */ - public Race(Racer racer1, Racer racer2, Racer racer3, Racer racer4, Map environment, RaceBroadcaster broadcaster, RaceResults results) { - this.racer1 = racer1; - this.racer2 = racer2; - this.racer3 = racer3; - this.racer4 = racer4; - this.environment = environment; - this.broadcaster = broadcaster; - this.results = results; - } - - /** - * Starts the race. - * @throws Exception if there is an unexpected issue with the race, such as racers taking too long being ready to start, or not finishing the race in time. - */ - public synchronized void run() throws Exception { - reset(); - broadcaster.start(); - registerRacers(); - startEngines(); - startRace(); - awaitEnd(); - processResult(); - } - - /** - * Resets the race state. - */ - private void reset() { - startBarrier = new CyclicBarrier(5); - endCountDownLatch = new CountDownLatch(4); - donePosition = new AtomicInteger(1); - abortedPosition = new AtomicInteger(4); - result = new RaceResult(); - } - - /** - * Registers all racers. - */ - private void registerRacers() { - racer1.setRegistration(new Registration(racer1, 1)); - racer2.setRegistration(new Registration(racer2, 2)); - racer3.setRegistration(new Registration(racer3, 3)); - racer4.setRegistration(new Registration(racer4, 4)); - } - - /** - * Starts racer's engines. - */ - private void startEngines() { - broadcaster.startYourEngines(); - racer1.startEngine(); - racer2.startEngine(); - racer3.startEngine(); - racer4.startEngine(); - } - - /** - * Starts the race. Note that the race only starts when all racers are ready, i.e. all waiting at the start barrier, and for that to happen there is a 30 seconds timeout. - * @throws Exception if the race start has expired - */ - private void startRace() throws Exception { - broadcaster.readySetGo(); - startBarrier.await(30, TimeUnit.SECONDS); - } - - /** - * Awaits the race to finish. If the race is still in progress this method will block and wait for the race to end. The wait has a timeout of 90 seconds. - * @throws Exception if the race end has expired. - */ - private void awaitEnd() throws Exception { - endCountDownLatch.await(90, TimeUnit.SECONDS); - broadcaster.raceEnd(); - } - - /** - * Process the race result. - */ - private void processResult() { - results.add(result); - broadcaster.raceResult(result); - broadcaster.championshipStandings(new ChampionshipStandings().addAll(results).getEntryList()); - } - - /** - * The racer's registration. - */ - public class Registration { - - private final int number; - - /** - * the registration's racer - */ - private final Racer racer; - - /** - * - * @param racer - */ - private Registration(Racer racer, int number) { - this.number = number; - this.racer = racer; - broadcast("joins the race."); - } - - /** - * The racer is reader to start the race. - * @throws Exception - */ - public void ready() throws Exception { - startBarrier.await(30, TimeUnit.SECONDS); - } - - /** - * The racer has finished the race. - */ - public void done() { - int racerPosition = donePosition.getAndIncrement(); - broadcast("finished the race."); - result.setPosition(this, racerPosition); - endCountDownLatch.countDown(); - } - - /** - * The racer has aborted the race. - */ - public void aborted(Throwable t) { - int racerPosition = abortedPosition.getAndDecrement(); - t.printStackTrace(); - broadcast("aborted the race. Reason: " + (t != null ? t.getMessage() : "N/A)")); - result.setPosition(this, racerPosition); - endCountDownLatch.countDown(); - } - - /** - * Retrieves the race's environment. - * @return - */ - public Map getEnvironment() { - return environment; - } - - /** - * Retrieves the registered racer. - * @return - */ - public Racer getRacer() { - return racer; - } - - /** - * Retrieves the registration number. - * @return - */ - public int getNumber() { - return number; - } - - /** - * Broadcasts a msg with respect to a race event. - * @param msg - */ - public void broadcast(String msg) { - broadcaster.raceProgress(racer.getName() + ' ' + msg); - } - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/RaceBroadcaster.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/RaceBroadcaster.java deleted file mode 100644 index d910622c24..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/RaceBroadcaster.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing; - -import org.jboss.as.quickstarts.threadracing.results.ChampionshipStandings; -import org.jboss.as.quickstarts.threadracing.results.RaceResult; - -import java.util.List; - -/** - * The broadcaster provides the real time race progress updates, and the race result as well. - * - * @author Eduardo Martins - */ -public interface RaceBroadcaster { - - /** - * Starts the race's broadcast. - */ - void start(); - - /** - * Broadcasts the most famous words of car racing. - */ - void startYourEngines(); - - /** - * Broadcasts the race start. - */ - void readySetGo(); - - /** - * Broadcasts a race progress update. - * @param msg - */ - void raceProgress(String msg); - - /** - * Broadcasts the race's end. - */ - void raceEnd(); - - /** - * Broadcasts the race's result. - * @param result - */ - void raceResult(RaceResult result); - - /** - * Broadcasts the championship standings. - * @param entries - */ - void championshipStandings(List entries); - -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/Racer.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/Racer.java deleted file mode 100644 index 4667dd89cf..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/Racer.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing; - -import org.jboss.as.quickstarts.threadracing.stage.concurrency.EEConcurrencyRaceStage; -import org.jboss.as.quickstarts.threadracing.stage.batch.BatchRaceStage; -import org.jboss.as.quickstarts.threadracing.stage.jaxrs.JAXRSRaceStage; -import org.jboss.as.quickstarts.threadracing.stage.jms.JMSRaceStage; -import org.jboss.as.quickstarts.threadracing.stage.json.JSONRaceStage; - -import jakarta.annotation.Resource; -import jakarta.enterprise.concurrent.ManagedThreadFactory; -import jakarta.inject.Inject; -import java.util.UUID; - -/** - * A racer, a CDI bean injected with an instance of each race stage, which are also CDI beans. - * - * The race stages are run sequentially in a managed thread, provided by the container's EE Concurrency 1.0 {@link jakarta.enterprise.concurrent.ManagedThreadFactory} default instance, also injected, but through @Resource. - * - * The race's {@link org.jboss.as.quickstarts.threadracing.Race.Registration} is used to control the racer's start and finish/abort. - * - * @author Eduardo Martins - */ -public class Racer { - - /** - * JNDI injection of the default managed thread factory instance, introduced by EE Concurrency 1.0 (JSR 236), - * which apps may use to create threads running tasks with the invocation context present on the thread creation. - */ - @Resource - private ManagedThreadFactory managedThreadFactory; - - /** - * cdi injection of the Batch 1.0 race stage - */ - @Inject - private BatchRaceStage batchRaceStage; - - /** - * cdi injection of the EE Concurrency 1.0 race stage - */ - @Inject - private EEConcurrencyRaceStage eeConcurrencyRaceStage; - - /** - * cdi injection of the JAX-RS 2.0 race stage - */ - @Inject - private JAXRSRaceStage jaxrsRaceStageRen; - - /** - * cdi injection of the JMS 2.0 race stage - */ - @Inject - private JMSRaceStage jmsRaceStage; - - /** - * cdi injection of the JSON 1.0 race stage - */ - @Inject - private JSONRaceStage jsonRaceStageRen; - - /** - * the racer's registration , which the racer uses to "interact" with a race - */ - private Race.Registration registration; - - /** - * the racer's name - */ - private final String name; - - /** - * Mandatory bean's no args constructor, which creates a random racer's name. - */ - public Racer() { - this("Racer" + UUID.randomUUID()); - } - - /** - * Creates a racer with the specified name. - * @param name - */ - public Racer(String name) { - this.name = name; - } - - /** - * Retrieves the racer's name. - * @return - */ - public String getName() { - return name; - } - - /** - * Sets the race's registration, used by the racer to report race progress. - * @param registration - */ - public void setRegistration(Race.Registration registration) { - this.registration = registration; - } - - /** - * Starts the racer's engine a.k.a. as thread. The default {@link jakarta.enterprise.concurrent.ManagedThreadFactory} instance, provided by EE Concurrency 1.0, is used to create the racer's thread. - */ - public void startEngine() { - final Runnable raceTask = new Runnable() { - @Override - public void run() { - try { - // the racer is ready - registration.ready(); - // race on, run baby run - runRaceStages(); - // game over - registration.done(); - } catch (Throwable t) { - registration.aborted(t); - } - } - }; - managedThreadFactory.newThread(raceTask).start(); - } - - /** - * Execution of the race stages/tasks. - * @throws Exception - */ - private void runRaceStages() throws Exception { - batchRaceStage.run(registration); - registration.broadcast("completed the Batch 1.0 stage."); - eeConcurrencyRaceStage.run(registration); - registration.broadcast("completed the EE Concurrency 1.0 stage."); - jaxrsRaceStageRen.run(registration); - registration.broadcast("completed the JAX-RS 2.0 stage."); - jmsRaceStage.run(registration); - registration.broadcast("completed the JMS 2.0 stage."); - jsonRaceStageRen.run(registration); - registration.broadcast("completed the JSON 1.0 stage."); - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/WebSocketRace.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/WebSocketRace.java deleted file mode 100644 index d0e561a49e..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/WebSocketRace.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing; - -import org.jboss.as.quickstarts.threadracing.legends.JimmieThronson; -import org.jboss.as.quickstarts.threadracing.legends.MichaelThrumacher; -import org.jboss.as.quickstarts.threadracing.legends.SebastienThroeb; -import org.jboss.as.quickstarts.threadracing.legends.ValentinoThrossi; -import org.jboss.as.quickstarts.threadracing.results.RaceResults; - -import jakarta.inject.Inject; -import jakarta.websocket.HandshakeResponse; -import jakarta.websocket.OnOpen; -import jakarta.websocket.Session; -import jakarta.websocket.server.HandshakeRequest; -import jakarta.websocket.server.ServerEndpointConfig; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** - * The app's entry point, a Web Socket {@link jakarta.websocket.server.ServerEndpoint}, which runs a race for each client connection established. - * - * The server endpoint will update the client of the race progress and results, through text messages, and will close the session once the race ends. - * - * @author Eduardo Martins - */ -@jakarta.websocket.server.ServerEndpoint(value = WebSocketRace.PATH, configurator = WebSocketRace.ServerEndpointConfigurator.class) -public class WebSocketRace { - - public static final String PATH = "/race"; - - /** - * CDI injection of racer #1 - */ - @Inject - private JimmieThronson racer1; - - /** - * CDI injection of racer #2 - */ - @Inject - private MichaelThrumacher racer2; - - /** - * CDI injection of racer #3 - */ - @Inject - private SebastienThroeb racer3; - - /** - * CDI injection of racer #4 - */ - @Inject - private ValentinoThrossi racer4; - - /** - * CDI injection of all race results - */ - @Inject - private RaceResults raceResults; - - /** - * Session opened handler, creates and starts a race. - * @param session - */ - @OnOpen - public void onOpen(Session session) { - try { - new Race(racer1, racer2, racer3, racer4, buildRaceEnvironment(session), new WebSocketRaceBroadcaster(session), raceResults).run(); - } catch (Exception e) { - e.printStackTrace(); - } finally { - try { - session.close(); - } catch (IOException ignore) { - } - } - } - - /** - * Builds the race's environment, from the specified session. - * @param session - * @return - */ - private Map buildRaceEnvironment(Session session) { - final Map environment = new HashMap<>(); - final String host = (String) session.getUserProperties().get(ServerEndpointConfigurator.HOST_USER_PROP); - if (host != null) { - final String[] hostSplit = host.split(":"); - environment.put(EnvironmentProperties.SERVER_NAME, hostSplit[0]); - environment.put(EnvironmentProperties.SERVER_PORT, (hostSplit.length > 1 ? hostSplit[1] : "80")); - } - // extract the root path from the session's request uri, which starting with websockets 2.1 is an absolute uri - final String absoluteRequestURI = session.getRequestURI().toString(); - final String relativeRequestUri = absoluteRequestURI.substring(absoluteRequestURI.indexOf(host)+host.length()); - final String rootPath = relativeRequestUri.equals(PATH) ? "" : relativeRequestUri.substring(0, (relativeRequestUri.length() - PATH.length())); - environment.put(EnvironmentProperties.ROOT_PATH, rootPath); - return environment; - } - - /** - * This configurator will capture the environment properties, when handshaking a client. - */ - public static class ServerEndpointConfigurator extends ServerEndpointConfig.Configurator { - static final String HOST_USER_PROP = "Host"; - - @Override - public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) { - sec.getUserProperties().put(HOST_USER_PROP, request.getHeaders().get(HOST_USER_PROP).get(0)); - } - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/WebSocketRaceBroadcaster.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/WebSocketRaceBroadcaster.java deleted file mode 100644 index ad791ddc1e..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/WebSocketRaceBroadcaster.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing; - -import org.jboss.as.quickstarts.threadracing.results.ChampionshipStandings; -import org.jboss.as.quickstarts.threadracing.results.RaceResult; - -import jakarta.websocket.Session; -import java.io.IOException; -import java.util.List; - -/** - * A {@link org.jboss.as.quickstarts.threadracing.RaceBroadcaster} that sends html/text messages through a Web Socket {@link jakarta.websocket.Session}. - * - * @author Eduardo Martins - */ -public class WebSocketRaceBroadcaster implements RaceBroadcaster { - - /** - * the web socket's session where messages are sent. - */ - private final Session session; - - /** - * Creates a new web socket broadcaster - * @param session the session where race progress messages will be sent. - */ - public WebSocketRaceBroadcaster(Session session) { - this.session = session; - } - - /** - * Sends a message to the web socket client. - * @param message - */ - private void sendToClient(String message) { - try { - session.getBasicRemote().sendText(message); - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * Pauses the broadcast for the specified amount of milliseconds. - * @param millis - */ - private void pause(long millis) { - try { - Thread.sleep(millis); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - @Override - public void start() { - sendToClient("Wow, what a crowd today at Threadianopolis... "); - pause(2000); - sendToClient("There must be more than a GIGABYTE of thread racing fans going nuts.

"); - pause(3000); - } - - @Override - public void startYourEngines() { - pause(1000); - sendToClient("
Racers, "); - pause(2000); - sendToClient("start "); - pause(1000); - sendToClient("your "); - pause(1000); - sendToClient("THREADS.
"); - } - - @Override - public void readySetGo() { - pause(2000); - sendToClient("
Ready... "); - pause(2000); - sendToClient("Set... "); - pause(2000); - sendToClient("Go!

"); - } - - @Override - public void raceProgress(String msg) { - sendToClient(msg + "
"); - } - - @Override - public void raceEnd() { - sendToClient("
Please await() the official results "); - pause(2000); - sendToClient(":"); - pause(2000); - sendToClient("-"); - pause(2000); - sendToClient(")
"); - } - - @Override - public void raceResult(RaceResult result) { - StringBuilder sb = new StringBuilder(); - sb.append("

Official Race Results

"); - sb.append("
    "); - for (String racer : result.getSortedRacers()) { - sb.append("
  1. " + racer + "
  2. "); - } - sb.append("
"); - sendToClient(sb.toString()); - } - - @Override - public void championshipStandings(List entries) { - StringBuilder sb = new StringBuilder(); - sb.append("

Championship Standings

"); - sb.append("
    "); - for (ChampionshipStandings.Entry entry : entries) { - sb.append("
  1. " + entry.getName() + ", " + entry.getPoints() + " points
  2. "); - } - sb.append("
"); - sendToClient(sb.toString()); - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/JimmieThronson.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/JimmieThronson.java deleted file mode 100644 index 60ec6f2d3d..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/JimmieThronson.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.legends; - -import org.jboss.as.quickstarts.threadracing.Racer; - -/** - * A NASCAR legend. - * - * @author Eduardo Martins - */ -public class JimmieThronson extends Racer { - - public JimmieThronson() { - super("Jimmie Thronson"); - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/MichaelThrumacher.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/MichaelThrumacher.java deleted file mode 100644 index 600eac794f..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/MichaelThrumacher.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.legends; - -import org.jboss.as.quickstarts.threadracing.Racer; - -/** - * A F1 legend. - * - * @author Eduardo Martins - */ -public class MichaelThrumacher extends Racer { - - public MichaelThrumacher() { - super("Michael Thrumacher"); - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/SebastienThroeb.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/SebastienThroeb.java deleted file mode 100644 index f5a13f863b..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/SebastienThroeb.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.legends; - -import org.jboss.as.quickstarts.threadracing.Racer; - -/** - * A rally legend. - * - * @author Eduardo Martins - */ -public class SebastienThroeb extends Racer { - - public SebastienThroeb() { - super("Sebastien Throeb"); - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/ValentinoThrossi.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/ValentinoThrossi.java deleted file mode 100644 index 6aea820d30..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/ValentinoThrossi.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.legends; - -import org.jboss.as.quickstarts.threadracing.Racer; - -/** - * A MotoGP legend. - * - * @author Eduardo Martins - */ -public class ValentinoThrossi extends Racer { - - public ValentinoThrossi() { - super("Valentino Throssi"); - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/results/ChampionshipStandings.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/results/ChampionshipStandings.java deleted file mode 100644 index 328431b75a..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/results/ChampionshipStandings.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.results; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * The championship standings provides a sorted list of (racer's name, points) pairs, representing the how racers stand in the championship, the set of all races run. - * - * The first entry is the current championship leader. - * - * The Race position to championship points mapping is: - * 1st place -> 4 points - * 2nd place -> 3 points - * 3rd place -> 2 points - * 4th place -> 1 points - * - * @author Eduardo Martins - */ -public class ChampionshipStandings { - - /** - * the mapping racer's name --> racer's sum of points obtained in all added race results. - */ - private final Map racerPointsTotals = new HashMap<>(); - - /** - * Adds all race results. - * @param raceResults - * @return - */ - public ChampionshipStandings addAll(RaceResults raceResults) { - for (RaceResult raceResult : raceResults.findAll()) { - add(raceResult); - } - return this; - } - - /** - * Adds a race result. - * @param raceResult - * @return - */ - public ChampionshipStandings add(RaceResult raceResult) { - processRacerResult(raceResult.getRacer1Name(), raceResult.getRacer1Position(), racerPointsTotals); - processRacerResult(raceResult.getRacer2Name(), raceResult.getRacer2Position(), racerPointsTotals); - processRacerResult(raceResult.getRacer3Name(), raceResult.getRacer3Position(), racerPointsTotals); - processRacerResult(raceResult.getRacer4Name(), raceResult.getRacer4Position(), racerPointsTotals); - return this; - } - - /** - * Updates the racer's totals with a race's position. - * @param racerName - * @param racerPosition - * @param racerPointsTotals - */ - private void processRacerResult(String racerName, int racerPosition, Map racerPointsTotals) { - final int racerPoints; - if (racerPosition == 1) { - racerPoints = 4; - } else if (racerPosition == 2) { - racerPoints = 3; - } else if (racerPosition == 3) { - racerPoints = 2; - } else { - racerPoints = 1; - } - final Integer racerPointsTotal = racerPointsTotals.get(racerName); - if (racerPointsTotal == null) { - racerPointsTotals.put(racerName, racerPoints); - } else { - racerPointsTotals.put(racerName, racerPoints + racerPointsTotal); - } - } - - /** - * Builds the championship standings list. The list is ordered by racer's points, being the first entry the racer currently with more points. Racers with same points will be sorted by name. - * @return - */ - public List getEntryList() { - final List entries = new ArrayList<>(); - for (Map.Entry racerPointsTotal : racerPointsTotals.entrySet()) { - final String racer = racerPointsTotal.getKey(); - final Integer points = racerPointsTotal.getValue(); - entries.add(new Entry(racer, points)); - } - Collections.sort(entries); - return entries; - } - - /** - * An entry of the championship standings. - */ - public static class Entry implements Comparable { - - private final String name; - private final Integer points; - - /** - * - * @param name - * @param points - */ - private Entry(String name, Integer points) { - this.name = name; - this.points = points; - } - - /** - * - * @return - */ - public String getName() { - return name; - } - - /** - * - * @return - */ - public int getPoints() { - return points; - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - Entry racer = (Entry) o; - if (!name.equals(racer.name)) - return false; - return true; - } - - @Override - public int hashCode() { - return name.hashCode(); - } - - @Override - public int compareTo(Entry o) { - int result = -this.points.compareTo(o.points); - if (result == 0) { - result = this.name.compareTo(o.name); - } - return result; - } - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/results/RaceResult.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/results/RaceResult.java deleted file mode 100644 index 82ee1d6c27..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/results/RaceResult.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.results; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.NamedQueries; -import jakarta.persistence.NamedQuery; -import jakarta.persistence.Table; - -import org.jboss.as.quickstarts.threadracing.Race; - -/** - * A race result, a JPA entity. - * - * @author Eduardo Martins - */ -@Entity -@Table(name = "THREAD_RACE_RESULTS") -@NamedQueries({ - @NamedQuery(name = "RaceResult.findAll", query = "SELECT e FROM RaceResult e") -}) -public class RaceResult implements Serializable { - - /** - * - */ - private static final long serialVersionUID = 1L; - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE) - private int id; - - @Column - private String racer1Name; - - @Column - private int racer1Position; - - @Column - private String racer2Name; - - @Column - private int racer2Position; - - @Column - private String racer3Name; - - @Column - private int racer3Position; - - @Column - private String racer4Name; - - @Column - private int racer4Position; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getRacer1Name() { - return racer1Name; - } - - public void setRacer1Name(String racer1Name) { - this.racer1Name = racer1Name; - } - - public int getRacer1Position() { - return racer1Position; - } - - public void setRacer1Position(int racer1Position) { - this.racer1Position = racer1Position; - } - - public String getRacer2Name() { - return racer2Name; - } - - public void setRacer2Name(String racer2Name) { - this.racer2Name = racer2Name; - } - - public int getRacer2Position() { - return racer2Position; - } - - public void setRacer2Position(int racer2Position) { - this.racer2Position = racer2Position; - } - - public String getRacer3Name() { - return racer3Name; - } - - public void setRacer3Name(String racer3Name) { - this.racer3Name = racer3Name; - } - - public int getRacer3Position() { - return racer3Position; - } - - public void setRacer3Position(int racer3Position) { - this.racer3Position = racer3Position; - } - - public String getRacer4Name() { - return racer4Name; - } - - public void setRacer4Name(String racer4Name) { - this.racer4Name = racer4Name; - } - - public int getRacer4Position() { - return racer4Position; - } - - public void setRacer4Position(int racer4Position) { - this.racer4Position = racer4Position; - } - - /** - * Sets the result for the provided registration. - * - * @param registration - * @param position - */ - public void setPosition(Race.Registration registration, int position) { - switch (registration.getNumber()) { - case 1: - setRacer1Name(registration.getRacer().getName()); - setRacer1Position(position); - break; - case 2: - setRacer2Name(registration.getRacer().getName()); - setRacer2Position(position); - break; - case 3: - setRacer3Name(registration.getRacer().getName()); - setRacer3Position(position); - break; - case 4: - setRacer4Name(registration.getRacer().getName()); - setRacer4Position(position); - break; - default: - throw new IllegalStateException("registration number must be 1-4"); - } - } - - /** - * Retrieves a list with racers ordered by race position. - * - * @return - */ - public List getSortedRacers() { - List result = new ArrayList<>(); - result.add(getRacerWithPosition(1)); - result.add(getRacerWithPosition(2)); - result.add(getRacerWithPosition(3)); - result.add(getRacerWithPosition(4)); - return result; - } - - /** - * Retrieves the racer with the specified position - * - * @param i - * @return - */ - public String getRacerWithPosition(int i) { - if (racer1Position == i) { - return racer1Name; - } else if (racer2Position == i) { - return racer2Name; - } else if (racer3Position == i) { - return racer3Name; - } else if (racer4Position == i) { - return racer4Name; - } else { - return null; - } - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/results/RaceResults.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/results/RaceResults.java deleted file mode 100644 index 48118d8e69..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/results/RaceResults.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.results; - -import jakarta.ejb.Stateless; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; -import java.util.List; - -/** - * A stateless EJB used to manage the storage of race results, through JPA. - * - * The JPA PU deployed with the app (see src/main/resources/META-INF/persistence.xml) is used to persist race's results, and has the particularity of not declaring the datasource it targets, and in such case the Jakarta EE 7 introduced default datasource is used. - * @author Eduardo Martins - */ -@Stateless -public class RaceResults { - - /** - * the injected JPA entity manager, which may be used to interact with race result's PU - */ - @PersistenceContext - private EntityManager em; - - /** - * Adds a race result. - * @param e - */ - public void add(RaceResult e) { - em.persist(e); - } - - /** - * Finds all race results. - * @return - */ - public List findAll() { - return em.createNamedQuery("RaceResult.findAll", RaceResult.class).getResultList(); - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/RaceStage.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/RaceStage.java deleted file mode 100644 index f455378650..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/RaceStage.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.stage; - -import org.jboss.as.quickstarts.threadracing.Race; - -/** - * - * A stage of a {@link org.jboss.as.quickstarts.threadracing.Race}, which are run by {@link org.jboss.as.quickstarts.threadracing.Racer}s. - * - * @author Eduardo Martins - */ -public interface RaceStage { - - /** - * Runs the stage. - * @param registration the racer's race registration - * @throws Exception - */ - void run(Race.Registration registration) throws Exception; -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStage.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStage.java deleted file mode 100644 index 6fd094cd97..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStage.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.stage.batch; - -import org.jboss.as.quickstarts.threadracing.Race; -import org.jboss.as.quickstarts.threadracing.stage.RaceStage; - -import jakarta.batch.operations.JobOperator; -import jakarta.batch.runtime.BatchRuntime; -import jakarta.batch.runtime.BatchStatus; -import jakarta.batch.runtime.JobExecution; -import java.util.Properties; - -/** - * The Batch 1.0 race stage, which starts a job execution and waits for it to complete. - * - * Apps deploy Batch jobs by packaging the related XML descriptors in META-INF/batch-jobs. The name of these Batch jobs, which is needed to start their execution, is the name of the XML file, without the ".xml". - * This app deploys a Batch job named "race", so the XML descriptor file is named "race.xml" and put in "src/main/resources/META-INF/batch-jobs" directory of the project. - * - * - * @author Eduardo Martins - */ -public class BatchRaceStage implements RaceStage { - - @Override - public void run(Race.Registration registration) throws Exception { - // retrieve the job operator - JobOperator jobOperator = BatchRuntime.getJobOperator(); - // start the race.xml job - Long executionId = jobOperator.start("race", new Properties()); - // would be nice if the job start would provide a Future object wrt the job execution, perhaps something for next spec revision - // just check every 1ms if the job status is completed - JobExecution jobExecution = jobOperator.getJobExecution(executionId); - while (jobExecution.getBatchStatus() != BatchStatus.COMPLETED) { - Thread.sleep(1); - } - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStageItemProcessor.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStageItemProcessor.java deleted file mode 100644 index 5beab250ce..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStageItemProcessor.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.stage.batch; - -import jakarta.batch.api.chunk.ItemProcessor; -import jakarta.inject.Named; - -/** - * The batch component that processes/filters read items, one by one. - * @author Eduardo Martins - */ -@Named -public class BatchRaceStageItemProcessor implements ItemProcessor { - - @Override - public Object processItem(Object item) { - // TODO this app must have one, but here you process a read item, in case the item should be discarded just return null - return item; - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStageItemReader.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStageItemReader.java deleted file mode 100644 index f2bb058f2f..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStageItemReader.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.stage.batch; - -import jakarta.batch.api.chunk.AbstractItemReader; -import jakarta.inject.Named; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -/** - * The race batch job component that reads items for chunk processing. - * - * @author Eduardo Martins - */ -@Named -public class BatchRaceStageItemReader extends AbstractItemReader { - - /** - * random temperature simulator - */ - private static final Random random = new Random(); - - /** - * the items to read iterator - */ - private Iterator items; - - /** - * This method is implemented when the ItemReader requires any open time processing. - * @param checkpoint - * @throws Exception - */ - @Override - public void open(Serializable checkpoint) throws Exception { - // retrieve the items to read, let's just simulate something, a list containing a random number of objects - final List list = new ArrayList(); - for (int i = 0; i < random.nextInt(50); i++) { - list.add(new Object()); - } - items = list.iterator(); - } - - /** - * The method that reads 1 item to be processed. - * @return - */ - @Override - public Object readItem() { - return items.hasNext() ? items.next() : null; - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStageItemWriter.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStageItemWriter.java deleted file mode 100644 index 54c7273ed7..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStageItemWriter.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.stage.batch; - -import jakarta.batch.api.chunk.AbstractItemWriter; -import jakarta.inject.Named; -import java.util.List; - -/** - * The race batch job component that writes a chunk of processed items. - * @author Eduardo Martins - */ -@Named -public class BatchRaceStageItemWriter extends AbstractItemWriter { - - @Override - public void writeItems(List list) { - // simulate a item write op, sleep 10ms for each item to write - try { - Thread.sleep(10 * list.size()); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/concurrency/EEConcurrencyRaceStage.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/concurrency/EEConcurrencyRaceStage.java deleted file mode 100644 index 7dc8bd89f2..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/concurrency/EEConcurrencyRaceStage.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.stage.concurrency; - -import org.jboss.as.quickstarts.threadracing.Race; -import org.jboss.as.quickstarts.threadracing.stage.RaceStage; - -import jakarta.annotation.Resource; -import jakarta.enterprise.concurrent.ManagedExecutorService; -import jakarta.enterprise.concurrent.ManagedScheduledExecutorService; -import javax.naming.InitialContext; -import java.util.concurrent.TimeUnit; - -/** - * The EE Concurrency 1.0 race shows how to retrieve and use the EE Concurrency 1.0 {@link jakarta.enterprise.concurrent.ManagedExecutorService} and {@link jakarta.enterprise.concurrent.ManagedScheduledExecutorService} default instances. - * - * @author Eduardo Martins - */ -public class EEConcurrencyRaceStage implements RaceStage { - - /** - * Injecting the managed executor service's default instance is that simple. - */ - @Resource - private ManagedExecutorService executorService; - - @Override - public void run(Race.Registration registration) throws Exception { - // the task to submit (to the managed executor service) - final Runnable runnableToSubmit = new Runnable() { - @Override - public void run() { - // this task will run in a different thread, but it will be executed with the app invocation context available when the task was submitted, which means class loading, JNDI lookups, or even security roles, will work as expected - try { - // as an example, let's lookup the managed scheduled executor service's default instance, from the standard JNDI name, scoped to the web app - final ManagedScheduledExecutorService scheduledExecutorService = InitialContext.doLookup("java:comp/DefaultManagedScheduledExecutorService"); - // schedule a task and wait for its execution - final Runnable runnableToSchedule = new Runnable() { - @Override - public void run() { - // TODO all apps have at least one - } - }; - scheduledExecutorService.schedule(runnableToSchedule, 100, TimeUnit.MILLISECONDS).get(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - }; - // submit the task and wait for its execution - executorService.submit(runnableToSubmit).get(); - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jaxrs/BoxApplication.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jaxrs/BoxApplication.java deleted file mode 100644 index edda4dc0f0..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jaxrs/BoxApplication.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.stage.jaxrs; - -import jakarta.ws.rs.ApplicationPath; -import jakarta.ws.rs.core.Application; - -/** - * A class extending {@link jakarta.ws.rs.core.Application} is the portable way to define JAX-RS 2.0 REST Services, and the {@link jakarta.ws.rs.ApplicationPath} defines the common path of such services. - * @author Eduardo Martins - */ -@ApplicationPath(BoxApplication.PATH) -public class BoxApplication extends Application { - - /** - * the jaxrs app path - */ - public static final String PATH = "box"; - -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jaxrs/BoxService.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jaxrs/BoxService.java deleted file mode 100644 index a75e498d2a..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jaxrs/BoxService.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.stage.jaxrs; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.PathParam; -import jakarta.ws.rs.core.Response; -import java.util.Random; - -/** - * A REST service which racers may use to do a pit stop. - * - * The {@link jakarta.ws.rs.Path} annotation defines the path relative to the {@link org.jboss.as.quickstarts.threadracing.stage.jaxrs.BoxApplication} path. A value of "/" means the service will use the parent path. - * - * @author Eduardo Martins - */ -@Path("/") -public class BoxService { - - private static final Random random = new Random(); - - /** - * A method to handle GET requests on pitStop path (relative to the one defined at class level). - * - * The path may include segments that will match any value, {racer} is an example of such path param. The actual param value may be provided as a method param, by annotation the method param with {@link jakarta.ws.rs.PathParam}, as done in this method signature. - * @param racer - * @return - */ - @GET - @Path("pitStop/{racer}") - public Response pitStop(@PathParam("racer") String racer) { - // a pit stop simulation, a random 1-5ms thread sleep - try { - Thread.sleep(random.nextInt(5)); - } catch (InterruptedException e) { - e.printStackTrace(); - } - // the response may include payload, such as JSON data, here we just return the basic "OK" response. - return Response.ok().build(); - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jaxrs/JAXRSRaceStage.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jaxrs/JAXRSRaceStage.java deleted file mode 100644 index 16ad179232..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jaxrs/JAXRSRaceStage.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.stage.jaxrs; - -import org.jboss.as.quickstarts.threadracing.EnvironmentProperties; -import org.jboss.as.quickstarts.threadracing.Race; -import org.jboss.as.quickstarts.threadracing.stage.RaceStage; - -import jakarta.ws.rs.client.Client; -import jakarta.ws.rs.client.ClientBuilder; -import jakarta.ws.rs.client.WebTarget; -import jakarta.ws.rs.core.Response; -import java.util.Map; -import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; - -/** - * The JAX-RS 2.0 race stage implements the race's boxes, which a racer uses to do a pit stop. - * - * @author Eduardo Martins - */ -public class JAXRSRaceStage implements RaceStage { - - @Override - public void run(Race.Registration registration) throws Exception { - // build the REST service uri from race's environment - final Map environment = registration.getEnvironment(); - final String pitStopURI = new StringBuilder("http://") - .append(environment.get(EnvironmentProperties.SERVER_NAME)) - .append(':') - .append(environment.get(EnvironmentProperties.SERVER_PORT)) - .append(environment.get(EnvironmentProperties.ROOT_PATH)) - .append('/') - .append(BoxApplication.PATH) - .append("/pitStop") - .toString(); - // create and setup the new standard JAX-RS client (and its web target) - final Client client = ((ResteasyClientBuilder) ClientBuilder.newBuilder()) - .build(); - try { - final WebTarget target = client.target(pitStopURI); - // get current time - long now = System.currentTimeMillis(); - // box box box, i.e. send a request to the Box rest service, with the racers name provided as param 'racer' - final Response response = target.path("{racer}").resolveTemplate("racer", registration.getRacer().getName()).request().get(); - if (response.getStatus() != 200) { - throw new IllegalStateException("PIT STOP failure trouble " + response.getStatus()); - } else { - // broadcast a msg indicating the duration of the pit stop operation - registration.broadcast("PIT STOP in " + (System.currentTimeMillis() - now) + "ms"); - } - } finally { - client.close(); - } - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jms/JMSRaceStage.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jms/JMSRaceStage.java deleted file mode 100644 index 2e95e5fe2e..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jms/JMSRaceStage.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.stage.jms; - -import org.jboss.as.quickstarts.threadracing.Race; -import org.jboss.as.quickstarts.threadracing.stage.RaceStage; - -import jakarta.annotation.Resource; -import jakarta.jms.ConnectionFactory; -import jakarta.jms.JMSConsumer; -import jakarta.jms.JMSContext; -import jakarta.jms.Queue; -import jakarta.jms.TemporaryQueue; -import java.util.UUID; - -/** - * The JMS race stage is a JMS client which sends a request containing a text message, and waits for a response with same text, using the request/response trough a temporary queue pattern. - * - * @author Eduardo Martins - */ -public class JMSRaceStage implements RaceStage { - - /** - * injection of JMS message listener's queue, through JNDI lookup - */ - @Resource(lookup = JMSRaceStageMessageListener.REQUEST_QUEUE) - private Queue requestQueue; - @Resource(lookup = "java:comp/DefaultJMSConnectionFactory") - private ConnectionFactory cf; - - @Override - public void run(Race.Registration registration) throws Exception { - try (JMSContext jmsContext = cf.createContext()) { - // create response tmp queue - final TemporaryQueue responseQueue = jmsContext.createTemporaryQueue(); - // send request - final String request = UUID.randomUUID().toString(); - jmsContext.createProducer() - .setJMSReplyTo(responseQueue) - .send(requestQueue, request); - // receive response - try (JMSConsumer consumer = jmsContext.createConsumer(responseQueue)) { - String response = consumer.receiveBody(String.class); - if (response == null) { - registration.aborted(new IllegalStateException("Message processing timed out")); - } else if (!response.equals(request)) { - registration.aborted(new IllegalStateException("Response content does not match the request. Response: " + response + ", request: " + request)); - } - } - } - } -} - diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jms/JMSRaceStageMessageListener.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jms/JMSRaceStageMessageListener.java deleted file mode 100644 index f5ab624a3a..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jms/JMSRaceStageMessageListener.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.stage.jms; - -import jakarta.ejb.ActivationConfigProperty; -import jakarta.ejb.MessageDriven; -import jakarta.inject.Inject; -import jakarta.jms.JMSContext; -import jakarta.jms.JMSDestinationDefinition; -import jakarta.jms.JMSException; -import jakarta.jms.Message; -import jakarta.jms.MessageListener; -import jakarta.jms.TextMessage; - -/** - * The JMS race stage {@link jakarta.jms.MessageListener}, which simply returns back the received message's text. - * - * This class, being a container managed class, creates a JMS destination through annotation {@link jakarta.jms.JMSDestinationDefinition}. - * - * @author Eduardo Martins - */ -@JMSDestinationDefinition(name = JMSRaceStageMessageListener.REQUEST_QUEUE, - interfaceName = "jakarta.jms.Queue", - destinationName = "JMSThreadRacingQueue") -@MessageDriven(activationConfig = { - @ActivationConfigProperty(propertyName = "destinationLookup", - propertyValue = JMSRaceStageMessageListener.REQUEST_QUEUE), - @ActivationConfigProperty(propertyName = "destinationType", - propertyValue = "jakarta.jms.Queue"), - } -) -public class JMSRaceStageMessageListener implements MessageListener { - - public static final String REQUEST_QUEUE = "java:global/threadRacing/stages/jms/requestQueue"; - - @Inject - private JMSContext jmsContext; - - @Override - public void onMessage(Message message) { - // just echo the msg - try { - jmsContext.createProducer().send(message.getJMSReplyTo(), ((TextMessage) message).getText()); - } catch (JMSException e) { - e.printStackTrace(); - } - } -} diff --git a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/json/JSONRaceStage.java b/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/json/JSONRaceStage.java deleted file mode 100644 index 97900a515d..0000000000 --- a/thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/json/JSONRaceStage.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing.stage.json; - -import org.jboss.as.quickstarts.threadracing.Race; -import org.jboss.as.quickstarts.threadracing.stage.RaceStage; - -import jakarta.json.Json; -import jakarta.json.JsonObject; -import jakarta.json.JsonReader; -import jakarta.json.JsonWriter; -import java.io.StringReader; -import java.io.StringWriter; - -/** - * The JSON 1.0 race stage shows how work with the new API for common use cases: building of a JSON object, writing a JSON object to a string/stream, and reading a JSON object from a string/stream. - * - * @author Eduardo Martins - */ -public class JSONRaceStage implements RaceStage { - - @Override - public void run(Race.Registration registration) throws Exception { - // 1. build an object with nested structure - JsonObject jsonObject = Json.createObjectBuilder() - // simple pairs - .add("firstName", "John") - .add("lastName", "Smith") - .add("age", 25) - // nested object - .add("address", Json.createObjectBuilder() - .add("streetAddress", "21 2nd Street") - .add("city", "New York") - .add("state", "NY") - .add("postalCode", "10021")) - // nested object array - .add("phoneNumber", Json.createArrayBuilder() - .add(Json.createObjectBuilder() - .add("type", "home") - .add("number", "212 555-1234")) - .add(Json.createObjectBuilder() - .add("type", "fax") - .add("number", "646 555-4567"))) - .build(); - // 2. write the object to a string - StringWriter stringWriter = new StringWriter(); - try (JsonWriter writer = Json.createWriter(stringWriter)) { - writer.write(jsonObject); - } - String toString = stringWriter.toString(); - // 3. read object from the string - JsonObject fromString = null; - try (JsonReader jsonReader = Json.createReader(new StringReader(toString))) { - fromString = jsonReader.readObject(); - } - // 4. sanity check :) - if (!jsonObject.equals(fromString)) { - throw new IllegalStateException("json object read from string does not equal the one built"); - } - } -} diff --git a/thread-racing/src/main/resources/META-INF/batch-jobs/race.xml b/thread-racing/src/main/resources/META-INF/batch-jobs/race.xml deleted file mode 100644 index 477c6e6ebc..0000000000 --- a/thread-racing/src/main/resources/META-INF/batch-jobs/race.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - diff --git a/thread-racing/src/main/resources/META-INF/batch-jobs/race.xsd b/thread-racing/src/main/resources/META-INF/batch-jobs/race.xsd deleted file mode 100644 index fc3513f4bb..0000000000 --- a/thread-racing/src/main/resources/META-INF/batch-jobs/race.xsd +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/thread-racing/src/main/resources/META-INF/persistence.xml b/thread-racing/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index ff43ef9b02..0000000000 --- a/thread-racing/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - diff --git a/thread-racing/src/main/webapp/WEB-INF/beans.xml b/thread-racing/src/main/webapp/WEB-INF/beans.xml deleted file mode 100644 index d3ddf148e7..0000000000 --- a/thread-racing/src/main/webapp/WEB-INF/beans.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/thread-racing/src/main/webapp/index.html b/thread-racing/src/main/webapp/index.html deleted file mode 100644 index a6a6f9d31f..0000000000 --- a/thread-racing/src/main/webapp/index.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - -Jakarta EE Thread Racing - - - - -
-

Jakarta EE Thread Racing

-

The GREATEST open source racing application ever developed, all for FREE, including TV live broadcast.

-

A race where 4 threads run() for glory, completing different stages, each sponsored by a new or updated Jakarta EE technology!

- - - -
-
-
- - diff --git a/thread-racing/src/test/java/org/jboss/as/quickstarts/threadracing/EchoListener.java b/thread-racing/src/test/java/org/jboss/as/quickstarts/threadracing/EchoListener.java deleted file mode 100644 index e1b8139ebc..0000000000 --- a/thread-racing/src/test/java/org/jboss/as/quickstarts/threadracing/EchoListener.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.jboss.as.quickstarts.threadracing; - - -/* - * Copyright 2022 Red Hat, Inc. - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -import java.net.http.WebSocket; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -public class EchoListener implements WebSocket.Listener { - - private final RemoteThreadRacingIT test; - - public EchoListener(RemoteThreadRacingIT test) { - this.test = test; - } - - private static final Logger logger = Logger.getLogger(EchoListener.class.getName()); - private boolean connected = false; - private StringBuilder buffer = new StringBuilder(); - private String message = null; - CompletableFuture accumulatedMessage = new CompletableFuture<>(); - - @Override - public void onOpen(WebSocket webSocket) { - logger.info("CONNECTED"); - connected = true; - WebSocket.Listener.super.onOpen(webSocket); - } - - @Override - public CompletionStage onText(WebSocket webSocket, CharSequence data, boolean last) { - logger.info("Receiving Message -->"); - logger.info(String.format("onText received a data: %s", data)); - buffer.append(data); - webSocket.request(1); - if (last) { - if (buffer.toString() != null && !buffer.toString().equals(message)) { - message = buffer.toString(); - accumulatedMessage.complete(buffer.toString()); - buffer = new StringBuilder(); - CompletionStage cf = accumulatedMessage.thenAccept(RemoteThreadRacingIT::addMessage); - accumulatedMessage = new CompletableFuture<>(); - return cf; - } - } - return accumulatedMessage; - } - - public String getMessage() { - return message; - } - - @Override - public void onError(WebSocket webSocket, Throwable error) { - logger.log(Level.SEVERE, "Error!" + webSocket.toString(), error); - WebSocket.Listener.super.onError(webSocket, error); - } - - @Override - public CompletionStage onClose(WebSocket webSocket, int statusCode, String reason) { - logger.info("CLOSING"); - connected = false; - logger.info(String.format("Closed with status %d, and reason: %s", statusCode, reason)); - CompletableFuture.completedFuture(reason).thenAccept(s -> test.stop()); - return WebSocket.Listener.super.onClose(webSocket, statusCode, reason); - } - - public boolean isConnected() { - return connected; - } -} diff --git a/thread-racing/src/test/java/org/jboss/as/quickstarts/threadracing/ProvisionedManagedThreadRacingIT.java b/thread-racing/src/test/java/org/jboss/as/quickstarts/threadracing/ProvisionedManagedThreadRacingIT.java deleted file mode 100644 index eff33569cb..0000000000 --- a/thread-racing/src/test/java/org/jboss/as/quickstarts/threadracing/ProvisionedManagedThreadRacingIT.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing; - -import java.net.URI; -import java.net.URISyntaxException; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit5.ArquillianExtension; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; - -@RunAsClient -@ExtendWith(ArquillianExtension.class) -public class ProvisionedManagedThreadRacingIT extends RemoteThreadRacingIT { - - @Override - protected URI getWebSocketEndpoint() { - String host = getServerHost(); - if (host == null) { - host = "ws://localhost:8080"; - } - try { - return new URI(host + "/race"); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } - - @Test - public void testRace() throws Exception { - race(); - } - -} diff --git a/thread-racing/src/test/java/org/jboss/as/quickstarts/threadracing/RemoteThreadRacingIT.java b/thread-racing/src/test/java/org/jboss/as/quickstarts/threadracing/RemoteThreadRacingIT.java deleted file mode 100644 index 062e293759..0000000000 --- a/thread-racing/src/test/java/org/jboss/as/quickstarts/threadracing/RemoteThreadRacingIT.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.threadracing; - -import java.io.IOException; - -import java.net.URI; -import java.net.URISyntaxException; -import java.net.http.HttpClient; -import java.net.http.WebSocket; -import java.util.LinkedHashSet; -import java.util.Set; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - - -public class RemoteThreadRacingIT { - - private static final Set messages = new LinkedHashSet<>(); - private volatile boolean notFinished = true; - - protected URI getWebSocketEndpoint() { - String host = getServerHost(); - if (host == null) { - host = "ws://localhost:8080/thread-racing"; - } - try { - return new URI(host + "/race"); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } - - protected static String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host"); - } - if (host != null) { - host = host.replaceFirst("http", "ws"); - } - return host; - } - - @Test - public void testRace() throws Exception { - race(); - } - - public void race() throws IOException, InterruptedException { - System.out.println("Endpoint " + getWebSocketEndpoint()); - EchoListener listener = new EchoListener(this); - WebSocket webSocket = HttpClient.newHttpClient() - .newWebSocketBuilder() - .buildAsync(getWebSocketEndpoint(), listener) - .join(); - Assertions.assertTrue(listener.isConnected(), "Connection should be opened"); - while (notFinished) { - webSocket.request(1); - } - webSocket.sendClose(WebSocket.NORMAL_CLOSURE, "Done"); - webSocket.request(1); - Assertions.assertTrue(webSocket.isOutputClosed(), "Connection should be closed"); - Assertions.assertFalse(listener.isConnected(), "Connection should be closed"); - webSocket.abort(); - Assertions.assertTrue(webSocket.isInputClosed(), "Connection should be closed"); - String[] result = messages.toArray(new String[0]); - Assertions.assertEquals("
Please await() the official results ", result[messages.size() - 6]); - } - - public void stop() { - notFinished = false; - } - - public static void addMessage(String message) { - messages.add(message); - } - -} diff --git a/thread-racing/src/test/resources/arquillian.xml b/thread-racing/src/test/resources/arquillian.xml deleted file mode 100644 index 31d4c3cc43..0000000000 --- a/thread-racing/src/test/resources/arquillian.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - diff --git a/todo-backend/README-source.adoc b/todo-backend/README-source.adoc deleted file mode 100644 index 36d5a7963b..0000000000 --- a/todo-backend/README-source.adoc +++ /dev/null @@ -1,696 +0,0 @@ -include::../shared-doc/attributes.adoc[] - -= todo-backend: quickstart for backend deployment on OpenShift -:toc: left -:icons: font -:idprefix: -:idseparator: - -:keywords: openshift,galleon,helm -:level: Intermediate -:technologies: JPA, JAX-RS, OpenShift, Galleon -:openshift: true - -[abstract] -The `todo-backend` quickstart demonstrates how to implement a backend that exposes a HTTP API with JAX-RS -to manage a list of ToDo which are persisted in a database with JPA. - -ifndef::ProductRelease[] -This quickstart shows how to setup a local deployment of this backend as well as a deployment on OpenShift to connect -to a PostgreSQL database also hosted on OpenShift. -endif::[] -ifdef::ProductRelease[] -This quickstart shows how to deploy a {productName} application on OpenShift that connects -to a PostgreSQL database also hosted on OpenShift. -endif::[] - - -== What is it? - -The `todo-backend` quickstart demonstrates how to implement a backend that exposes a HTTP API with `JAX-RS` -to manage a list of ToDo which are persisted in a database with `JPA`. - -* The backend exposes a HTTP API to manage a list of todos that complies with the specs defined at https://todobackend.com/specs/index.html[todobackend.com]. -* It requires a connection to a PostgreSQL database to persist the todos. -ifndef::ProductRelease[] -* It uses the Bootable Jar for local and cloud deployment -endif::[] -* It can be build with {productName} S2I images for cloud deployment -ifndef::ProductRelease,EAPXPRelease[] -* It is deployed on OpenShift using the https://docs.wildfly.org/wildfly-charts/[Helm Chart for {productName}]. -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -* It is deployed on OpenShift using the https://jbossas.github.io/eap-charts//[Helm Chart for {productName}]. -endif::[] - -// System Requirements -include::../shared-doc/system-requirements.adoc[leveloffset=+1] - -== Architecture - -ifndef::ProductRelease,EAPXPRelease[] - -=== Architecture with Bootable Jar - -This backend is built and deployed as Bootable Jar that provisions the {productName} application server and all the feature packs it needs for its features. -The layers are defined in the `pom.xml` file in the `` section of the `org.wildfly.plugins:wildfly-jar-maven-plugin` plugin: - -[source,xml] ----- - - cloud-server - postgresql-datasource - ----- - -The `cloud-server` layer provides everything needed to run the backend on OpenShift. This also includes access to -Jakarta EE APIs such as CDI, JAX-RS, JPA, etc. These two layers comes from the {productName} feature pack provided by the Bootable Jar plugin: - -[source,xml] ----- - - wildfly@maven(org.jboss.universe:community-universe)#${version.server.bootable-jar} - ----- - -The `postgresql-datasource` layer provides a JDBC driver and DataSource to connect to a PostgreSQL database. It is not provided -by the {productName} feature pack but by an extra feature pack: - -[source,xml] ----- - - org.wildfly - wildfly-datasources-galleon-pack - ${version.eap-datasources-galleon-pack} - ----- - -The Git repository for this feature pack is hosted at https://github.com/wildfly-extras/wildfly-datasources-galleon-pack. -It provides JDBC drivers and datasources for different databases but for this quickstart, we will only need the `postgresql-datasource`. -endif::[] - -ifdef::EAPXPRelease[] - -=== Architecture with Bootable Jar - -This backend is built and deployed as Bootable Jar that provisions the {productName} application server and all the feature packs it needs for its features. -The layers are defined in the `pom.xml` file in the `` section of the `org.wildfly.plugins:wildfly-jar-maven-plugin` plugin: - -[source,xml] ----- - - cloud-server - postgresql-datasource - ----- - -The `cloud-server` layer provides everything needed to run the backend on OpenShift. This also includes access to -Jakarta EE APIs such as CDI, JAX-RS, JPA, etc. These two layers comes from the {productName} feature pack provided by the Bootable Jar plugin: - -[source,xml] ----- - - org.jboss.eap:wildfly-galleon-pack:${version.server.bootable-jar} - ----- - -The `postgresql-datasource` layer provides a JDBC driver and DataSource to connect to a PostgreSQL database. It is not provided -by the {productName} feature pack but by an extra feature pack: - -[source,xml] ----- - - org.jboss.eap - eap-datasources-galleon-pack - ${version.eap-datasources-galleon-pack} - ----- - -The Git repository for this feature pack is hosted at https://github.com/jbossas/eap-datasources-galleon-pack. -It provides JDBC drivers and datasources for different databases but for this quickstart, we will only need the `postgresql-datasource`. -endif::[] - -=== Architecture with S2I - -This backend is built using {productName} S2I Builder and Runtime images. - -ifndef::ProductRelease,EAPXPRelease[] -When the image is built, `org.wildfly.plugins:wildfly-maven-plugin` plugin provisions the {productName} application server and all the feature packs it needs for its features. -The layers are defined in the `pom.xml` file in the `` section of the `org.wildfly.plugins:wildfly-maven-plugin` plugin: - -[source,xml] ----- - - cloud-server - postgresql-datasource - ----- -endif::[] - -ifdef::ProductRelease[] -When the image is built, `org.jboss.eap.plugins:eap-maven-plugin` plugin provisions the {productName} application server and all the feature packs it needs for its features. -The layers are defined in the `pom.xml` file in the `` section of the `org.jboss.eap.plugins:eap-maven-plugin` plugin: - -[source,xml] ----- - - cloud-server - postgresql-datasource - ----- -endif::[] - -ifdef::EAPXPRelease[] -When the image is built, it provisions the {productName} application server and all the feature packs it needs for its features: - -[source,yaml] ----- -build: - s2i: - galleonLayers: - - cloud-server - - postgresql-datasource ----- -endif::[] - -The `cloud-server` layer provides everything needed to run the backend on OpenShift. This also includes access to -Jakarta EE APIs such as CDI, JAX-RS, JPA, etc. These two layers comes from the {productName} feature pack provided in the -{productName} S2I builder image. - -ifndef::ProductRelease,EAPXPRelease[] -The `postgresql-datasource` layer provides a JDBC driver and DataSource to connect to a PostgreSQL database. It is also provided by -`org.wildfly:wildfly-datasources-galleon-pack` which is included in the WildFly S2I image. - -The Git repository for this feature pack is hosted at https://github.com/wildfly-extras/wildfly-datasources-galleon-pack. -It provides JDBC drivers and datasources for different databases but for this quickstart, we will only need the `postgresql-datasource`. -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -The `postgresql-datasource` layer provides a JDBC driver and DataSource to connect to a PostgreSQL database. It is also provided by -the `org.jboss.eap:eap-datasources-galleon-pack` feature pack. - -The Git repository for this feature pack is hosted at https://github.com/jbossas/eap-datasources-galleon-pack. -It provides JDBC drivers and datasources for different databases but for this quickstart, we will only need the `postgresql-datasource`. -endif::[] - - -=== Connection to the PostgreSQL database - -ifndef::ProductRelease,EAPXPRelease[] -As mentioned, the JDBC drivers and datasource configuration that the backend uses to connect to the PostgreSQL database -is provided by the `org.wildfly:wildfly-datasources-galleon-pack` feature pack. -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -As mentioned, the JDBC drivers and datasource configuration that the backend uses to connect to the PostgreSQL database -is provided by the `org.jboss.eap:eap-datasources-galleon-pack` feature pack. -endif::[] - -By default, it exposes a single datasource. -In the backend, the name of this datasource is `ToDos` and is specified in the `persistence.xml` to configure JPA: - -[source,xml] ----- - - java:jboss/datasources/ToDos - ----- - -At runtime, we only need a few environment variables to establish the connection from {productName} to the external PostgreSQL database: - -* `POSTGRESQL_DATABASE` - the name of the database (that will be called `todos`) -* `POSTGRESQL_SERVICE_HOST` - the host to connect to the database -* `POSTGRESQL_SERVICE_PORT` - The port to connect to the database -* `POSTGRESQL_USER` & `POSTGRESQL_PASSWORD` - the credentials to connect to the database -* `POSTGRESQL_DATASOURCE` - The name of the datasources (as mentioned above, it will be `ToDos`) - -=== Filters for Cross-Origin Resource Sharing (CORS) - -The Web frontend for this quickstart uses JavaScript calls to query the backend's HTTP API. -We must enable Cross-Origin Resource Sharing (CORS) filters in the `undertow` subsystem of {productName} to allow -these HTTP requests to succeed. - -ifndef::ProductRelease[] -==== Configuration with Bootable Jar - -As we use Bootable Jar to build the application, we provide a CLI script that contains all the commands to create and configure the CORS filters in Undertow. This script is located in the `src/scripts/cors_filters.cli`. -endif::[] - -ifdef::ProductRelease[] -==== Configuration with {productName} S2I - -As we use S2I to provision the server and build the application, we provide a CLI script that contains all the commands to create and configure the CORS filters in Undertow. This script is located in the `src/scripts/cors_filters.cli`. -endif::[] - -This script is executed at build time and will provide the following HTTP headers to enabled CORS: - -* `Access-Control-Allow-Origin: *` -* `Access-Control-Allow-Methods: GET, POST, OPTION, PUT, DELETE, PATCH` -* `Access-Control-Allow-Headers: accept, authorization, content-type, x-requested-with` -* `Access-Control-Allow-Credentials: true` -* `Access-Control-Max-Age: 1` - -By default, the backend accepts requests from any origin (`*`). This is only simplicity. It is possible to restrict -the allowed origin using the environment variable `CORS_ORIGIN` at runtime. - -ifndef::ProductRelease[] -== Run the Backend Locally as a Bootable Jar - -=== Package the Backend as a Bootable Jar - -The backend is packaged as a Bootable Jar and configured to be deployable on OpenShift with the Maven Profile `bootable-jar-openshift`: - -[source,options="nowrap"] ----- -$ mvn clean package -P bootable-jar-openshift ----- - -=== Run a Local PostgreSQL Database - -Before running the backend locally, we need to have a local PostgreSQL database that we can connect to. -We use the `postgresql` docker image to create one: - -[source,options="nowrap"] ----- -$ docker run --name todo-backend-db \ - -e POSTGRES_USER=todos \ - -e POSTGRES_PASSWORD=mysecretpassword \ - -p 5432:5432 \ - postgres ----- - -This will create a database named `todos` that we can connect to on `localhost:5432` with the credentials `todos / mysecretpassword`. - -=== Run the Bootable Jar Application - -With the PostgreSQL database running, we can start the backend by passing the required environment variables to connect to the database: - -[source,options="nowrap"] ----- -$ POSTGRESQL_DATABASE=todos \ - POSTGRESQL_SERVICE_HOST=localhost \ - POSTGRESQL_SERVICE_PORT=5432 \ - POSTGRESQL_USER=todos \ - POSTGRESQL_PASSWORD=mysecretpassword \ - POSTGRESQL_DATASOURCE=ToDos \ - java -jar target/todo-backend-bootable.jar -... -14:41:58,111 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "todo-backend.war" (runtime-name : "ROOT.war") -... ----- - -The backend is running, and we can use the HTTP API to manage a list of todos: - -[source,options="nowrap"] ----- -# get a list of todos -$ curl http://localhost:8080 -[] - -# create a todo with the title "This is my first todo item!" -$ curl -X POST -H "Content-Type: application/json" -d '{"title": "This is my first todo item!"}' http://localhost:8080/ -{"completed":false,"id":1,"order":0,"title":"This is my first todo item!","url":"https://localhost:8080/1"}% - -# get a list of todos with the one that was just created -$ curl http://localhost:8080 -[{"completed":false,"id":1,"order":0,"title":"This is my first todo item!","url":"https://localhost:8080/1"}] ----- - -== Run the Backend Locally - -=== Package the Backend - -The backend is packaged and deployed on a provisioned server: - -[source,options="nowrap"] ----- -$ mvn clean package -Pprovisioned-server ----- - -[NOTE] -==== -To execute the integration tests require *a running PostgreSQL server*. + -If you have already started the PostgreSQL server and want to run the tests you need to execute the following command: - -[source,options="nowrap"] ----- -$ mvn clean verify -Pprovisioned-server ----- -==== - -=== Run a Local PostgreSQL Database - -Before running the backend locally, we need to have a local PostgreSQL database that we can connect to. -We use the `postgresql` docker image to create one: - -[source,options="nowrap"] ----- -$ docker run --name todo-backend-db \ - -e POSTGRES_USER=todos \ - -e POSTGRES_PASSWORD=mysecretpassword \ - -p 5432:5432 \ - postgres ----- - -This will create a database named `todos` that we can connect to on `localhost:5432` with the credentials `todos / mysecretpassword`. - -=== Run the Application - -With the PostgreSQL database running, we can start the backend by passing the required environment variables to connect to the database: - -[source,options="nowrap"] ----- -$ JBOSS_HOME=./target/server \ - POSTGRESQL_DATABASE=todos \ - POSTGRESQL_SERVICE_HOST=localhost \ - POSTGRESQL_SERVICE_PORT=5432 \ - POSTGRESQL_USER=todos \ - POSTGRESQL_PASSWORD=mysecretpassword \ - POSTGRESQL_DATASOURCE=ToDos \ - ./target/server/bin/standalone.sh -... -14:41:58,111 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "todo-backend.war" (runtime-name : "todo-backend.war") -... ----- - -The backend is running, and we can use the HTTP API to manage a list of todos: - -[source,options="nowrap"] ----- -# get a list of todos -$ curl http://localhost:8080/todo-backend -[] - -# create a todo with the title "This is my first todo item!" -$ curl -X POST -H "Content-Type: application/json" -d '{"title": "This is my first todo item!"}' http://localhost:8080/todo-backend -{"completed":false,"id":1,"order":0,"title":"This is my first todo item!","url":"https://localhost:8080/todo-backend/1"}% - -# get a list of todos with the one that was just created -$ curl http://localhost:8080/todo-backend -[{"completed":false,"id":1,"order":0,"title":"This is my first todo item!","url":"https://localhost:8080/todo-backend/1"}] ----- - -// Run the Arquillian Tests -include::../shared-doc/run-arquillian-functional-tests-remote.adoc[leveloffset=+1] - -[NOTE] -==== -You may also execute those tests against a running bootable jar application, but you will need to add `-Dserver.host=http://localhost:8080` to the command. -==== -endif::[] - -== Run the Backend on OpenShift - -include::../shared-doc/build-the-quickstart-for-openshift.adoc[leveloffset=+1] - -=== Prerequisites - -* You must be logged in OpenShift and have an `oc` client to connect to OpenShift -* https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. - -Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}: - -ifndef::ProductRelease,EAPXPRelease[] -[source,options="nowrap"] ----- -$ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ -"wildfly" has been added to your repositories -$ helm search repo wildfly -NAME CHART VERSION APP VERSION DESCRIPTION -wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift -wildfly/wildfly-common ... ... A library chart for WildFly-based applications ----- -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -[source,options="nowrap",subs="+attributes"]] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy {productVersion} applications ----- -endif::[] - -ifndef::ProductRelease[] -=== Build and Deploy the Backend on OpenShift with Bootable Jar -endif::[] - -==== Deploy a PostgreSQL Database on OpenShift - -[source,options="nowrap"] ----- -$ oc new-app postgresql-ephemeral \ - -p DATABASE_SERVICE_NAME=todo-backend-db \ - -p POSTGRESQL_DATABASE=todos ----- - -This will create a PostgreSQL database named `todos` on OpenShift that can be accessed on the port `5432` on the service `todo-backend-db`. -We don't need to copy the credentials to connect to the database as we will retrieve them later using the `todo-backend-db` secret that was created -when the database is deployed. - -ifndef::ProductRelease,EAPXPRelease[] -==== Build and Deploy the Backend on OpenShift with Bootable Jar using the Helm Chart - -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -[source,options="nowrap",subs="+attributes"] ----- -$ helm install todo-backend --set build.ref={WildFlyQuickStartRepoTag} -f https://raw.githubusercontent.com/wildfly/wildfly-charts/main/examples/todo-backend/todo-backend-bootable-jar.yaml {helmChartName} -NAME: todo-backend -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using Bootable Jar: - -[source,options="nowrap"] ----- -build: - uri: https://github.com/wildfly/quickstart.git - mode: bootable-jar ----- -endif::[] - -ifdef::EAPXPRelease[] -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -[source,options="nowrap",subs="+attributes"] ----- -$ helm install todo-backend --set build.ref={EAPQuickstartRepoTag} -f https://raw.githubusercontent.com/jbossas/eap-charts/main/examples/eap-xp3/todo-backend/todo-backend-bootable-jar.yaml {helmChartName} -NAME: todo-backend -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using Bootable Jar: - -[source,options="nowrap"] ----- -build: - uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git - mode: bootable-jar ----- -endif::[] - -ifndef::ProductRelease[] - -This will create a new deployment on OpenShift and deploy the application. - -If you want to see all the configuration elements to customize your deployment you can use the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let’s wait for the application to be built and deployed: -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment {artifactId} -w -NAME READY UP-TO-DATE AVAILABLE AGE -{artifactId} 0/1 1 0 31s -... -{artifactId} 1/1 1 1 4m31s ----- - -endif::[] - -ifndef::ProductRelease[] -=== Build and Deploy the Backend on OpenShift with {productName} S2I -endif::[] - -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -ifdef::EAPXPRelease[] -==== Deploy a PostgreSQL Database on OpenShift - -[source,options="nowrap"] ----- -$ oc new-app postgresql-ephemeral \ - -p DATABASE_SERVICE_NAME=todo-backend-db \ - -p POSTGRESQL_DATABASE=todos ----- - -This will create a PostgreSQL database named `todos` on OpenShift that can be accessed on the port `5432` on the service `todo-backend-db`. -We don't need to copy the credentials to connect to the database as we will retrieve them later using the `todo-backend-db` secret that was created -when the database is deployed. -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -Add the bitnami repository which provides an helm chart for PostgreSQL: -[source,options="nowrap"] ----- -$ helm repo add bitnami https://charts.bitnami.com/bitnami -"bitnami" has been added to your repositories ----- - -Install the full application (database + backend). - -[source,options="nowrap",subs="+attributes"] ----- -$ helm dependency update todo-backend-chart/ -$ helm install todo-backend todo-backend-chart/ -NAME: todo-backend -... -STATUS: deployed -REVISION: 1 ----- -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I and install it with the database: - -[source,options="nowrap"] ----- -dependencies: - - name: postgresql - repository: https://charts.bitnami.com/bitnami - version: ... - - name: wildfly - repository: http://docs.wildfly.org/wildfly-charts/ - version: ... ----- - -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -Any configuration specified by this chart is described in its README that is displayed in OpenShift Dev console -or using the command: - -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let's wait for the application to be built and deployed: - -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment todo-backend -w -NAME READY UP-TO-DATE AVAILABLE AGE -{artifactId} 0/1 1 0 31s -... -{artifactId} 1/1 1 1 4m31s ----- - -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] - -//Prepare Helm for Quickstart Deployment -include::../shared-doc/helm-deploy-project.adoc[leveloffset=+1] - -endif::[] - -=== Environment variables for PostgreSQL - -The Helm Chart also contains the environment variables required to connect to the PostgreSQL database. - -ifndef::ProductRelease[] -In local deployment the credentials were passed directly as the values of the environment variables. -endif::[] - -For OpenShift, we rely on secrets so that the credentials are never copied outside OpenShift: - -[source,options="nowrap"] ----- -deploy: - env: - - name: POSTGRESQL_PASSWORD - valueFrom: - secretKeyRef: - key: database-password - name: todo-backend-db ----- - -When the application is deployed, the value for the `POSTGRESQL_PASSWORD` will be taken from the key `database-password` -in the secret `todo-backend-db`. - -// Testing on Openshift -include::../shared-doc/run-arquillian-integration-tests-with-openshift.adoc[leveloffset=+2] - -=== Use the todobackend Web Frontend - -Once the backend is deployed on OpenShift, it can be accessed from the route `todo-backend`. -Let's find the host that we can use to connect to this backend: - -[source,options="nowrap"] ----- -$ oc get route todo-backend -o jsonpath="{.spec.host}" -todo-backend-jmesnil1-dev.apps.sandbox.x8i5.p1.openshiftapps.com ----- - -This value will be different for every installation of the backend. - -[WARNING] -==== -Make sure to prepend the host with `https://` to be able to connect to the backend from the ToDo Backend Specs or Client. -The host must also be publicly accessible. -==== - -We can verify that this application is properly working as a ToDo Backend by running its https://todobackend.com/specs/index.html[specs] on it. - - -Once all tests passed, we can use the https://todobackend.com/client/index.html[todobackend client] to have a Web application connected to the backend. - -[NOTE] -==== -https://todobackend.com/[todobackend.com] is an external service used to showcase this quickstart. -It might not always be functional but does not impact the availability of this backend. -==== - -=== Clean Up - -==== Remove the Backend - -The backend can be deleted from OpenShift by running the command: - -[source,options="nowrap"] ----- -$ helm uninstall todo-backend -release "todo-backend" uninstalled ----- - -==== Remove the Database - -The PostresSQL database can be deleted from OpenShift by running the commands: - -[source,options="nowrap"] ----- -$ oc delete all -l template=postgresql-ephemeral-template -replicationcontroller "todo-backend-db-1" deleted -service "todo-backend-db" deleted -deploymentconfig.apps.openshift.io "todo-backend-db" deleted -$ oc delete secret todo-backend-db -secret "todo-backend-db" deleted ----- - -== Conclusion - -This quickstart shows how the datasource feature pack provided by {productName} simplifies the deployment -of a {productName} Jakarta EE backend on OpenShift to connect to an external database and exposes an HTTP API. - -ifndef::ProductRelease[] -The use of a Bootable Jar deployment makes it seamless to move from a local deployment for development to a -deployment on OpenShift. -endif::[] \ No newline at end of file diff --git a/todo-backend/README.adoc b/todo-backend/README.adoc deleted file mode 100644 index 84acdbfd5c..0000000000 --- a/todo-backend/README.adoc +++ /dev/null @@ -1,1118 +0,0 @@ -ifdef::env-github[] -:artifactId: todo-backend -endif::[] - -//*********************************************************************************** -// Enable the following flag to build README.html files for JBoss EAP product builds. -// Comment it out for WildFly builds. -//*********************************************************************************** -:ProductRelease: - -//*********************************************************************************** -// Enable the following flag to build README.html files for EAP XP product builds. -// Comment it out for WildFly or JBoss EAP product builds. -//*********************************************************************************** -//:EAPXPRelease: - -// This is a universal name for all releases -:ProductShortName: JBoss EAP -// Product names and links are dependent on whether it is a product release (CD or JBoss) -// or the WildFly project. -// The "DocInfo*" attributes are used to build the book links to the product documentation - -ifdef::ProductRelease[] -// JBoss EAP release -:productName: JBoss EAP -:productNameFull: Red Hat JBoss Enterprise Application Platform -:productVersion: 8.0 -:DocInfoProductNumber: {productVersion} -:WildFlyQuickStartRepoTag: 8.0.x -:productImageVersion: 8.0.0 -:helmChartName: jboss-eap/eap8 -endif::[] - -ifdef::EAPXPRelease[] -// JBoss EAP XP release -:productName: JBoss EAP XP -:productNameFull: Red Hat JBoss Enterprise Application Platform expansion pack -:productVersion: 3.0 -:DocInfoProductNumber: 7.4 -:WildFlyQuickStartRepoTag: XP_3.0.0.GA -:productImageVersion: 3.0 -:helmChartName: jboss-eap/eap-xp3 -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -:githubRepoUrl: https://github.com/jboss-developer/jboss-eap-quickstarts/ -:githubRepoCodeUrl: https://github.com/jboss-developer/jboss-eap-quickstarts.git -:jbossHomeName: EAP_HOME -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:quickstartDownloadName: {productNameFull} {productVersion} Quickstarts -:quickstartDownloadUrl: https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=appplatform&downloadType=distributions -:helmRepoName: jboss-eap -:helmRepoUrl: https://jbossas.github.io/eap-charts/ -// END ifdef::ProductRelease,EAPXPRelease[] -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -// WildFly project -:productName: WildFly -:productNameFull: WildFly Application Server -:ProductShortName: {productName} -:jbossHomeName: WILDFLY_HOME -:productVersion: 28 -:productImageVersion: 28.0 -:githubRepoUrl: https://github.com/wildfly/quickstart/ -:githubRepoCodeUrl: https://github.com/wildfly/quickstart.git -:WildFlyQuickStartRepoTag: 28.0.1.Final -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -// Do not update the following until after the 7.4 docs are published! -:DocInfoProductNumber: 7.4 -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:helmRepoName: wildfly -:helmRepoUrl: http://docs.wildfly.org/wildfly-charts/ -:helmChartName: wildfly/wildfly -// END ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -endif::[] - -:source: {githubRepoUrl} - -// Values for Openshift S2i sections attributes -:CDProductName: {productNameFull} for OpenShift -:CDProductShortName: {ProductShortName} for OpenShift -:CDProductTitle: {CDProductName} -:CDProductNameSentence: Openshift release for {ProductShortName} -:CDProductAcronym: {CDProductShortName} -:CDProductVersion: {productVersion} -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {EapForOpenshiftBookName} Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {xpaasproduct} Online -:xpaasproduct-shortname: {CDProductShortName} -:xpaasproductOpenShiftOnline-shortname: {xpaasproduct-shortname} Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: Getting Started with {ProductShortName} for OpenShift Container Platform -:EapForOpenshiftOnlineBookName: Getting Started with {ProductShortName} for OpenShift Online -:OpenShiftOnlinePlatformName: Red Hat OpenShift Container Platform -:OpenShiftOnlineName: Red Hat OpenShift Online -:ImagePrefixVersion: eap80 -:ImageandTemplateImportBaseURL: https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift - -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepo: https://github.com/jboss-developer/jboss-eap-quickstarts -:EAPQuickStartRepoRef: 8.0.x -:EAPQuickStartRepoTag: EAP_8.0.0.GA -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_container_platform/ -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_online/ - -ifdef::EAPXPRelease[] -// Attributes for XP releases -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {productNameFull} for OpenShift Online -:xpaasproduct-shortname: {ProductShortName} for OpenShift -:xpaasproductOpenShiftOnline-shortname: {ProductShortName} for OpenShift Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:ImagePrefixVersion: eap-xp3 -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepoRef: xp-3.0.x -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -endif::[] - -ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -:ImageandTemplateImportURL: https://raw.githubusercontent.com/wildfly/wildfly-s2i/v{productVersion}.0/ -endif::[] - -//************************* -// Other values -//************************* -:buildRequirements: Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later -:jbdsEapServerName: Red Hat JBoss Enterprise Application Platform 7.3 -:javaVersion: Jakarta EE 10 -ifdef::EAPXPRelease[] -:javaVersion: Eclipse MicroProfile -endif::[] -:githubRepoBranch: master -:guidesBaseUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/ -:useEclipseUrl: {guidesBaseUrl}USE_JBDS.adoc#use_red_hat_jboss_developer_studio_or_eclipse_to_run_the_quickstarts -:useEclipseDeployJavaClientDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_containing_server_and_java_client_projects -:useEclipseDeployEARDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_ear_project -:useProductHomeDocUrl: {guidesBaseUrl}USE_OF_{jbossHomeName}.adoc#use_of_product_home_and_jboss_home_variables -:configureMavenDocUrl: {guidesBaseUrl}CONFIGURE_MAVEN_JBOSS_EAP.adoc#configure_maven_to_build_and_deploy_the_quickstarts -:arquillianTestsDocUrl: {guidesBaseUrl}RUN_ARQUILLIAN_TESTS.adoc#run_the_arquillian_tests -:addUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#create_users_required_by_the_quickstarts -:addApplicationUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_application_user -:addManagementUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_management_user -:startServerDocUrl: {guidesBaseUrl}START_JBOSS_EAP.adoc#start_the_jboss_eap_server -:configurePostgresDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_database_for_use_with_the_quickstarts -:configurePostgresDownloadDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#download_and_install_postgresql -:configurePostgresCreateUserDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#create_a_database_user -:configurePostgresAddModuleDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#add_the_postgres_module_to_the_jboss_eap_server -:configurePostgresDriverDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_driver_in_the_jboss_eap_server -:configureBytemanDownloadDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#download_and_configure_byteman -:configureBytemanDisableDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#disable_the_byteman_script -:configureBytemanClearDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#clear_the_transaction_object_store -:configureBytemanQuickstartDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts -:configureBytemanHaltDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#use_byteman_to_halt_the_application[ -:configureBytemanQuickstartsDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts - -:EESubsystemNamespace: urn:jboss:domain:ee:4.0 -:IiopOpenJdkSubsystemNamespace: urn:jboss:domain:iiop-openjdk:2.0 -:MailSubsystemNamespace: urn:jboss:domain:mail:3.0 -:SingletonSubsystemNamespace: urn:jboss:domain:singleton:1.0 -:TransactionsSubsystemNamespace: urn:jboss:domain:transactions:4.0 - -// LinkProductDocHome: https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/ -:LinkProductDocHome: https://access.redhat.com/documentation/en/jboss-enterprise-application-platform-continuous-delivery -:LinkConfigGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/configuration_guide/ -:LinkDevelopmentGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/development_guide/ -:LinkGettingStartedGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_guide/ -:LinkOpenShiftWelcome: https://docs.openshift.com/online/welcome/index.html -:LinkOpenShiftSignup: https://docs.openshift.com/online/getting_started/choose_a_plan.html -:OpenShiftTemplateName: JBoss EAP CD (no https) - -:ConfigBookName: Configuration Guide -:DevelopmentBookName: Development Guide -:GettingStartedBookName: Getting Started Guide - -:JBDSProductName: Red Hat CodeReady Studio -:JBDSVersion: 12.15 -:LinkJBDSInstall: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/installation_guide/ -:JBDSInstallBookName: Installation Guide -:LinkJBDSGettingStarted: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/getting_started_with_codeready_studio_tools/ -:JBDSGettingStartedBookName: Getting Started with CodeReady Studio Tools - -= todo-backend: quickstart for backend deployment on OpenShift -:toc: left -:icons: font -:idprefix: -:idseparator: - -:keywords: openshift,galleon,helm -:level: Intermediate -:technologies: JPA, JAX-RS, OpenShift, Galleon -:openshift: true - -[abstract] -The `todo-backend` quickstart demonstrates how to implement a backend that exposes a HTTP API with JAX-RS -to manage a list of ToDo which are persisted in a database with JPA. - -ifndef::ProductRelease[] -This quickstart shows how to setup a local deployment of this backend as well as a deployment on OpenShift to connect -to a PostgreSQL database also hosted on OpenShift. -endif::[] -ifdef::ProductRelease[] -This quickstart shows how to deploy a {productName} application on OpenShift that connects -to a PostgreSQL database also hosted on OpenShift. -endif::[] - - -== What is it? - -The `todo-backend` quickstart demonstrates how to implement a backend that exposes a HTTP API with `JAX-RS` -to manage a list of ToDo which are persisted in a database with `JPA`. - -* The backend exposes a HTTP API to manage a list of todos that complies with the specs defined at https://todobackend.com/specs/index.html[todobackend.com]. -* It requires a connection to a PostgreSQL database to persist the todos. -ifndef::ProductRelease[] -* It uses the Bootable Jar for local and cloud deployment -endif::[] -* It can be build with {productName} S2I images for cloud deployment -ifndef::ProductRelease,EAPXPRelease[] -* It is deployed on OpenShift using the https://docs.wildfly.org/wildfly-charts/[Helm Chart for {productName}]. -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -* It is deployed on OpenShift using the https://jbossas.github.io/eap-charts//[Helm Chart for {productName}]. -endif::[] - -// System Requirements -:leveloffset: +1 - -[[system_requirements]] -= System Requirements -//****************************************************************************** -// Include this template to describe the standard system requirements for -// running the quickstarts. -// -// The Forge quickstarts define a `forge-from-scratch` attribute because they -// run entirely in CodeReady Studio and have different requirements . -//****************************************************************************** - -The application this project produces is designed to be run on {productNameFull} {productVersion} or later. - -All you need to build this project is {buildRequirements}. See link:{configureMavenDocUrl}[Configure Maven to Build and Deploy the Quickstarts] to make sure you are configured correctly for testing the quickstarts. - -:leveloffset!: - -== Architecture - -ifndef::ProductRelease,EAPXPRelease[] - -=== Architecture with Bootable Jar - -This backend is built and deployed as Bootable Jar that provisions the {productName} application server and all the feature packs it needs for its features. -The layers are defined in the `pom.xml` file in the `` section of the `org.wildfly.plugins:wildfly-jar-maven-plugin` plugin: - -[source,xml] ----- - - cloud-server - postgresql-datasource - ----- - -The `cloud-server` layer provides everything needed to run the backend on OpenShift. This also includes access to -Jakarta EE APIs such as CDI, JAX-RS, JPA, etc. These two layers comes from the {productName} feature pack provided by the Bootable Jar plugin: - -[source,xml] ----- - - wildfly@maven(org.jboss.universe:community-universe)#${version.server.bootable-jar} - ----- - -The `postgresql-datasource` layer provides a JDBC driver and DataSource to connect to a PostgreSQL database. It is not provided -by the {productName} feature pack but by an extra feature pack: - -[source,xml] ----- - - org.wildfly - wildfly-datasources-galleon-pack - ${version.eap-datasources-galleon-pack} - ----- - -The Git repository for this feature pack is hosted at https://github.com/wildfly-extras/wildfly-datasources-galleon-pack. -It provides JDBC drivers and datasources for different databases but for this quickstart, we will only need the `postgresql-datasource`. -endif::[] - -ifdef::EAPXPRelease[] - -=== Architecture with Bootable Jar - -This backend is built and deployed as Bootable Jar that provisions the {productName} application server and all the feature packs it needs for its features. -The layers are defined in the `pom.xml` file in the `` section of the `org.wildfly.plugins:wildfly-jar-maven-plugin` plugin: - -[source,xml] ----- - - cloud-server - postgresql-datasource - ----- - -The `cloud-server` layer provides everything needed to run the backend on OpenShift. This also includes access to -Jakarta EE APIs such as CDI, JAX-RS, JPA, etc. These two layers comes from the {productName} feature pack provided by the Bootable Jar plugin: - -[source,xml] ----- - - org.jboss.eap:wildfly-galleon-pack:${version.server.bootable-jar} - ----- - -The `postgresql-datasource` layer provides a JDBC driver and DataSource to connect to a PostgreSQL database. It is not provided -by the {productName} feature pack but by an extra feature pack: - -[source,xml] ----- - - org.jboss.eap - eap-datasources-galleon-pack - ${version.eap-datasources-galleon-pack} - ----- - -The Git repository for this feature pack is hosted at https://github.com/jbossas/eap-datasources-galleon-pack. -It provides JDBC drivers and datasources for different databases but for this quickstart, we will only need the `postgresql-datasource`. -endif::[] - -=== Architecture with S2I - -This backend is built using {productName} S2I Builder and Runtime images. - -ifndef::ProductRelease,EAPXPRelease[] -When the image is built, `org.wildfly.plugins:wildfly-maven-plugin` plugin provisions the {productName} application server and all the feature packs it needs for its features. -The layers are defined in the `pom.xml` file in the `` section of the `org.wildfly.plugins:wildfly-maven-plugin` plugin: - -[source,xml] ----- - - cloud-server - postgresql-datasource - ----- -endif::[] - -ifdef::ProductRelease[] -When the image is built, `org.jboss.eap.plugins:eap-maven-plugin` plugin provisions the {productName} application server and all the feature packs it needs for its features. -The layers are defined in the `pom.xml` file in the `` section of the `org.jboss.eap.plugins:eap-maven-plugin` plugin: - -[source,xml] ----- - - cloud-server - postgresql-datasource - ----- -endif::[] - -ifdef::EAPXPRelease[] -When the image is built, it provisions the {productName} application server and all the feature packs it needs for its features: - -[source,yaml] ----- -build: - s2i: - galleonLayers: - - cloud-server - - postgresql-datasource ----- -endif::[] - -The `cloud-server` layer provides everything needed to run the backend on OpenShift. This also includes access to -Jakarta EE APIs such as CDI, JAX-RS, JPA, etc. These two layers comes from the {productName} feature pack provided in the -{productName} S2I builder image. - -ifndef::ProductRelease,EAPXPRelease[] -The `postgresql-datasource` layer provides a JDBC driver and DataSource to connect to a PostgreSQL database. It is also provided by -`org.wildfly:wildfly-datasources-galleon-pack` which is included in the WildFly S2I image. - -The Git repository for this feature pack is hosted at https://github.com/wildfly-extras/wildfly-datasources-galleon-pack. -It provides JDBC drivers and datasources for different databases but for this quickstart, we will only need the `postgresql-datasource`. -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -The `postgresql-datasource` layer provides a JDBC driver and DataSource to connect to a PostgreSQL database. It is also provided by -the `org.jboss.eap:eap-datasources-galleon-pack` feature pack. - -The Git repository for this feature pack is hosted at https://github.com/jbossas/eap-datasources-galleon-pack. -It provides JDBC drivers and datasources for different databases but for this quickstart, we will only need the `postgresql-datasource`. -endif::[] - - -=== Connection to the PostgreSQL database - -ifndef::ProductRelease,EAPXPRelease[] -As mentioned, the JDBC drivers and datasource configuration that the backend uses to connect to the PostgreSQL database -is provided by the `org.wildfly:wildfly-datasources-galleon-pack` feature pack. -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -As mentioned, the JDBC drivers and datasource configuration that the backend uses to connect to the PostgreSQL database -is provided by the `org.jboss.eap:eap-datasources-galleon-pack` feature pack. -endif::[] - -By default, it exposes a single datasource. -In the backend, the name of this datasource is `ToDos` and is specified in the `persistence.xml` to configure JPA: - -[source,xml] ----- - - java:jboss/datasources/ToDos - ----- - -At runtime, we only need a few environment variables to establish the connection from {productName} to the external PostgreSQL database: - -* `POSTGRESQL_DATABASE` - the name of the database (that will be called `todos`) -* `POSTGRESQL_SERVICE_HOST` - the host to connect to the database -* `POSTGRESQL_SERVICE_PORT` - The port to connect to the database -* `POSTGRESQL_USER` & `POSTGRESQL_PASSWORD` - the credentials to connect to the database -* `POSTGRESQL_DATASOURCE` - The name of the datasources (as mentioned above, it will be `ToDos`) - -=== Filters for Cross-Origin Resource Sharing (CORS) - -The Web frontend for this quickstart uses JavaScript calls to query the backend's HTTP API. -We must enable Cross-Origin Resource Sharing (CORS) filters in the `undertow` subsystem of {productName} to allow -these HTTP requests to succeed. - -ifndef::ProductRelease[] -==== Configuration with Bootable Jar - -As we use Bootable Jar to build the application, we provide a CLI script that contains all the commands to create and configure the CORS filters in Undertow. This script is located in the `src/scripts/cors_filters.cli`. -endif::[] - -ifdef::ProductRelease[] -==== Configuration with {productName} S2I - -As we use S2I to provision the server and build the application, we provide a CLI script that contains all the commands to create and configure the CORS filters in Undertow. This script is located in the `src/scripts/cors_filters.cli`. -endif::[] - -This script is executed at build time and will provide the following HTTP headers to enabled CORS: - -* `Access-Control-Allow-Origin: *` -* `Access-Control-Allow-Methods: GET, POST, OPTION, PUT, DELETE, PATCH` -* `Access-Control-Allow-Headers: accept, authorization, content-type, x-requested-with` -* `Access-Control-Allow-Credentials: true` -* `Access-Control-Max-Age: 1` - -By default, the backend accepts requests from any origin (`*`). This is only simplicity. It is possible to restrict -the allowed origin using the environment variable `CORS_ORIGIN` at runtime. - -ifndef::ProductRelease[] -== Run the Backend Locally as a Bootable Jar - -=== Package the Backend as a Bootable Jar - -The backend is packaged as a Bootable Jar and configured to be deployable on OpenShift with the Maven Profile `bootable-jar-openshift`: - -[source,options="nowrap"] ----- -$ mvn clean package -P bootable-jar-openshift ----- - -=== Run a Local PostgreSQL Database - -Before running the backend locally, we need to have a local PostgreSQL database that we can connect to. -We use the `postgresql` docker image to create one: - -[source,options="nowrap"] ----- -$ docker run --name todo-backend-db \ - -e POSTGRES_USER=todos \ - -e POSTGRES_PASSWORD=mysecretpassword \ - -p 5432:5432 \ - postgres ----- - -This will create a database named `todos` that we can connect to on `localhost:5432` with the credentials `todos / mysecretpassword`. - -=== Run the Bootable Jar Application - -With the PostgreSQL database running, we can start the backend by passing the required environment variables to connect to the database: - -[source,options="nowrap"] ----- -$ POSTGRESQL_DATABASE=todos \ - POSTGRESQL_SERVICE_HOST=localhost \ - POSTGRESQL_SERVICE_PORT=5432 \ - POSTGRESQL_USER=todos \ - POSTGRESQL_PASSWORD=mysecretpassword \ - POSTGRESQL_DATASOURCE=ToDos \ - java -jar target/todo-backend-bootable.jar -... -14:41:58,111 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "todo-backend.war" (runtime-name : "ROOT.war") -... ----- - -The backend is running, and we can use the HTTP API to manage a list of todos: - -[source,options="nowrap"] ----- -# get a list of todos -$ curl http://localhost:8080 -[] - -# create a todo with the title "This is my first todo item!" -$ curl -X POST -H "Content-Type: application/json" -d '{"title": "This is my first todo item!"}' http://localhost:8080/ -{"completed":false,"id":1,"order":0,"title":"This is my first todo item!","url":"https://localhost:8080/1"}% - -# get a list of todos with the one that was just created -$ curl http://localhost:8080 -[{"completed":false,"id":1,"order":0,"title":"This is my first todo item!","url":"https://localhost:8080/1"}] ----- - -== Run the Backend Locally - -=== Package the Backend - -The backend is packaged and deployed on a provisioned server: - -[source,options="nowrap"] ----- -$ mvn clean package -Pprovisioned-server ----- - -[NOTE] -==== -To execute the integration tests require *a running PostgreSQL server*. + -If you have already started the PostgreSQL server and want to run the tests you need to execute the following command: - -[source,options="nowrap"] ----- -$ mvn clean verify -Pprovisioned-server ----- -==== - -=== Run a Local PostgreSQL Database - -Before running the backend locally, we need to have a local PostgreSQL database that we can connect to. -We use the `postgresql` docker image to create one: - -[source,options="nowrap"] ----- -$ docker run --name todo-backend-db \ - -e POSTGRES_USER=todos \ - -e POSTGRES_PASSWORD=mysecretpassword \ - -p 5432:5432 \ - postgres ----- - -This will create a database named `todos` that we can connect to on `localhost:5432` with the credentials `todos / mysecretpassword`. - -=== Run the Application - -With the PostgreSQL database running, we can start the backend by passing the required environment variables to connect to the database: - -[source,options="nowrap"] ----- -$ JBOSS_HOME=./target/server \ - POSTGRESQL_DATABASE=todos \ - POSTGRESQL_SERVICE_HOST=localhost \ - POSTGRESQL_SERVICE_PORT=5432 \ - POSTGRESQL_USER=todos \ - POSTGRESQL_PASSWORD=mysecretpassword \ - POSTGRESQL_DATASOURCE=ToDos \ - ./target/server/bin/standalone.sh -... -14:41:58,111 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "todo-backend.war" (runtime-name : "todo-backend.war") -... ----- - -The backend is running, and we can use the HTTP API to manage a list of todos: - -[source,options="nowrap"] ----- -# get a list of todos -$ curl http://localhost:8080/todo-backend -[] - -# create a todo with the title "This is my first todo item!" -$ curl -X POST -H "Content-Type: application/json" -d '{"title": "This is my first todo item!"}' http://localhost:8080/todo-backend -{"completed":false,"id":1,"order":0,"title":"This is my first todo item!","url":"https://localhost:8080/todo-backend/1"}% - -# get a list of todos with the one that was just created -$ curl http://localhost:8080/todo-backend -[{"completed":false,"id":1,"order":0,"title":"This is my first todo item!","url":"https://localhost:8080/todo-backend/1"}] ----- - -// Run the Arquillian Tests -include::../shared-doc/run-arquillian-functional-tests-remote.adoc[leveloffset=+1] - -[NOTE] -==== -You may also execute those tests against a running bootable jar application, but you will need to add `-Dserver.host=http://localhost:8080` to the command. -==== -endif::[] - -== Run the Backend on OpenShift - -:leveloffset: +1 - -[[build-the-quickstart-for-openshift]] -== Build the {productName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -On OpenShift, the S2I build with Apache Maven will use an `openshift` profile used to provision a {productName} server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named `openshift` when building the quickstart: - -[source,subs="attributes+",options="nowrap"] ----- -$ mvn clean package -Popenshift ----- - -The provisioned {productName} server for OpenShift, with the quickstart deployed, can then be found in the `target/server` directory, and its usage is similar to a standard server distribution. -ifndef::ProductRelease,EAPXPRelease[] -You may note that unlike the `provisioned-server` profile it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the WildFly Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.wildfly:wildfly-galleon-pack:${version.server} - - - org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp} - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -[NOTE] -==== -Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`. -==== - -:leveloffset!: - -=== Prerequisites - -* You must be logged in OpenShift and have an `oc` client to connect to OpenShift -* https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. - -Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}: - -ifndef::ProductRelease,EAPXPRelease[] -[source,options="nowrap"] ----- -$ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ -"wildfly" has been added to your repositories -$ helm search repo wildfly -NAME CHART VERSION APP VERSION DESCRIPTION -wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift -wildfly/wildfly-common ... ... A library chart for WildFly-based applications ----- -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -[source,options="nowrap",subs="+attributes"]] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy {productVersion} applications ----- -endif::[] - -ifndef::ProductRelease[] -=== Build and Deploy the Backend on OpenShift with Bootable Jar -endif::[] - -==== Deploy a PostgreSQL Database on OpenShift - -[source,options="nowrap"] ----- -$ oc new-app postgresql-ephemeral \ - -p DATABASE_SERVICE_NAME=todo-backend-db \ - -p POSTGRESQL_DATABASE=todos ----- - -This will create a PostgreSQL database named `todos` on OpenShift that can be accessed on the port `5432` on the service `todo-backend-db`. -We don't need to copy the credentials to connect to the database as we will retrieve them later using the `todo-backend-db` secret that was created -when the database is deployed. - -ifndef::ProductRelease,EAPXPRelease[] -==== Build and Deploy the Backend on OpenShift with Bootable Jar using the Helm Chart - -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -[source,options="nowrap",subs="+attributes"] ----- -$ helm install todo-backend --set build.ref={WildFlyQuickStartRepoTag} -f https://raw.githubusercontent.com/wildfly/wildfly-charts/main/examples/todo-backend/todo-backend-bootable-jar.yaml {helmChartName} -NAME: todo-backend -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using Bootable Jar: - -[source,options="nowrap"] ----- -build: - uri: https://github.com/wildfly/quickstart.git - mode: bootable-jar ----- -endif::[] - -ifdef::EAPXPRelease[] -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -[source,options="nowrap",subs="+attributes"] ----- -$ helm install todo-backend --set build.ref={EAPQuickstartRepoTag} -f https://raw.githubusercontent.com/jbossas/eap-charts/main/examples/eap-xp3/todo-backend/todo-backend-bootable-jar.yaml {helmChartName} -NAME: todo-backend -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using Bootable Jar: - -[source,options="nowrap"] ----- -build: - uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git - mode: bootable-jar ----- -endif::[] - -ifndef::ProductRelease[] - -This will create a new deployment on OpenShift and deploy the application. - -If you want to see all the configuration elements to customize your deployment you can use the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let’s wait for the application to be built and deployed: -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment {artifactId} -w -NAME READY UP-TO-DATE AVAILABLE AGE -{artifactId} 0/1 1 0 31s -... -{artifactId} 1/1 1 1 4m31s ----- - -endif::[] - -ifndef::ProductRelease[] -=== Build and Deploy the Backend on OpenShift with {productName} S2I -endif::[] - -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -ifdef::EAPXPRelease[] -==== Deploy a PostgreSQL Database on OpenShift - -[source,options="nowrap"] ----- -$ oc new-app postgresql-ephemeral \ - -p DATABASE_SERVICE_NAME=todo-backend-db \ - -p POSTGRESQL_DATABASE=todos ----- - -This will create a PostgreSQL database named `todos` on OpenShift that can be accessed on the port `5432` on the service `todo-backend-db`. -We don't need to copy the credentials to connect to the database as we will retrieve them later using the `todo-backend-db` secret that was created -when the database is deployed. -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -Add the bitnami repository which provides an helm chart for PostgreSQL: -[source,options="nowrap"] ----- -$ helm repo add bitnami https://charts.bitnami.com/bitnami -"bitnami" has been added to your repositories ----- - -Install the full application (database + backend). - -[source,options="nowrap",subs="+attributes"] ----- -$ helm dependency update todo-backend-chart/ -$ helm install todo-backend todo-backend-chart/ -NAME: todo-backend -... -STATUS: deployed -REVISION: 1 ----- -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I and install it with the database: - -[source,options="nowrap"] ----- -dependencies: - - name: postgresql - repository: https://charts.bitnami.com/bitnami - version: ... - - name: wildfly - repository: http://docs.wildfly.org/wildfly-charts/ - version: ... ----- - -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -Any configuration specified by this chart is described in its README that is displayed in OpenShift Dev console -or using the command: - -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let's wait for the application to be built and deployed: - -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment todo-backend -w -NAME READY UP-TO-DATE AVAILABLE AGE -{artifactId} 0/1 1 0 31s -... -{artifactId} 1/1 1 1 4m31s ----- - -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] - -//Prepare Helm for Quickstart Deployment -:leveloffset: +1 - -[[deploy_helm]] -== Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -Log in to your OpenShift instance using the `oc login` command. -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -Navigate to the root directory of this quickstart and run the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm install {artifactId} -f charts/helm.yaml {helmChartName} -NAME: {artifactId} -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17: - -[source,options="nowrap",subs="+attributes"] ----- -build: - uri: {githubRepoCodeUrl} - ref: {WildFlyQuickStartRepoTag} - contextDir: {artifactId} -deploy: - replicas: 1 ----- - -This will create a new deployment on OpenShift and deploy the application. - -If you want to see all the configuration elements to customize your deployment you can use the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let’s wait for the application to be built and deployed: -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment {artifactId} -w -NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE -{artifactId} 1 1 1 0 12s -... -{artifactId} 1 1 1 1 2m ----- - -Get the URL of the route to the deployment. - -[source,options="nowrap",subs="+attributes"] ----- -$ oc get route {artifactId} -o jsonpath="{.spec.host}" ----- -Access the application in your web browser using the displayed URL. - -[NOTE] -==== -The Maven profile named `openshift` is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the `/{artifactId}` path segment after `HOST:PORT`. -==== - -[[undeploy_helm]] -== Undeploy the {ProductShortName} Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts - - -[source,options="nowrap",subs="+attributes"] ----- -$ helm uninstall {artifactId} ----- - -:leveloffset!: - -endif::[] - -=== Environment variables for PostgreSQL - -The Helm Chart also contains the environment variables required to connect to the PostgreSQL database. - -ifndef::ProductRelease[] -In local deployment the credentials were passed directly as the values of the environment variables. -endif::[] - -For OpenShift, we rely on secrets so that the credentials are never copied outside OpenShift: - -[source,options="nowrap"] ----- -deploy: - env: - - name: POSTGRESQL_PASSWORD - valueFrom: - secretKeyRef: - key: database-password - name: todo-backend-db ----- - -When the application is deployed, the value for the `POSTGRESQL_PASSWORD` will be taken from the key `database-password` -in the secret `todo-backend-db`. - -// Testing on Openshift -:leveloffset: +2 - -[[run_the_arquillian_integration_tests_with_openshift]] -= Run the Arquillian Integration Tests with OpenShift -//****************************************************************************** -// Include this template if your quickstart provides Openshift Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -[NOTE] -==== -The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin. -==== - -Run the integration tests using the following command to run the `verify` goal with the `arq-remote` profile activated and the proper URL: -[source,options="nowrap",subs="+attributes"] ----- -$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route {artifactId} --template='{{ .spec.host }}') ----- - -[NOTE] -==== -The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from. -==== - -:leveloffset!: - -=== Use the todobackend Web Frontend - -Once the backend is deployed on OpenShift, it can be accessed from the route `todo-backend`. -Let's find the host that we can use to connect to this backend: - -[source,options="nowrap"] ----- -$ oc get route todo-backend -o jsonpath="{.spec.host}" -todo-backend-jmesnil1-dev.apps.sandbox.x8i5.p1.openshiftapps.com ----- - -This value will be different for every installation of the backend. - -[WARNING] -==== -Make sure to prepend the host with `https://` to be able to connect to the backend from the ToDo Backend Specs or Client. -The host must also be publicly accessible. -==== - -We can verify that this application is properly working as a ToDo Backend by running its https://todobackend.com/specs/index.html[specs] on it. - - -Once all tests passed, we can use the https://todobackend.com/client/index.html[todobackend client] to have a Web application connected to the backend. - -[NOTE] -==== -https://todobackend.com/[todobackend.com] is an external service used to showcase this quickstart. -It might not always be functional but does not impact the availability of this backend. -==== - -=== Clean Up - -==== Remove the Backend - -The backend can be deleted from OpenShift by running the command: - -[source,options="nowrap"] ----- -$ helm uninstall todo-backend -release "todo-backend" uninstalled ----- - -==== Remove the Database - -The PostresSQL database can be deleted from OpenShift by running the commands: - -[source,options="nowrap"] ----- -$ oc delete all -l template=postgresql-ephemeral-template -replicationcontroller "todo-backend-db-1" deleted -service "todo-backend-db" deleted -deploymentconfig.apps.openshift.io "todo-backend-db" deleted -$ oc delete secret todo-backend-db -secret "todo-backend-db" deleted ----- - -== Conclusion - -This quickstart shows how the datasource feature pack provided by {productName} simplifies the deployment -of a {productName} Jakarta EE backend on OpenShift to connect to an external database and exposes an HTTP API. - -ifndef::ProductRelease[] -The use of a Bootable Jar deployment makes it seamless to move from a local deployment for development to a -deployment on OpenShift. -endif::[] diff --git a/todo-backend/README.html b/todo-backend/README.html deleted file mode 100644 index a5d43913dc..0000000000 --- a/todo-backend/README.html +++ /dev/null @@ -1,1010 +0,0 @@ - - - - - - - - -todo-backend: quickstart for backend deployment on OpenShift - - - - - - -
-
-
-
-
-The todo-backend quickstart demonstrates how to implement a backend that exposes a HTTP API with JAX-RS -to manage a list of ToDo which are persisted in a database with JPA. -
-
-
-

This quickstart shows how to deploy a JBoss EAP application on OpenShift that connects -to a PostgreSQL database also hosted on OpenShift.

-
-
-
-
-

What is it?

-
-
-

The todo-backend quickstart demonstrates how to implement a backend that exposes a HTTP API with JAX-RS -to manage a list of ToDo which are persisted in a database with JPA.

-
-
-
    -
  • -

    The backend exposes a HTTP API to manage a list of todos that complies with the specs defined at todobackend.com.

    -
  • -
  • -

    It requires a connection to a PostgreSQL database to persist the todos.

    -
  • -
  • -

    It can be build with JBoss EAP S2I images for cloud deployment

    -
  • -
  • -

    It is deployed on OpenShift using the Helm Chart for JBoss EAP.

    -
  • -
-
-
-
-
-

System Requirements

-
-
-

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 8.0 or later.

-
-
-

All you need to build this project is Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later. See Configure Maven to Build and Deploy the Quickstarts to make sure you are configured correctly for testing the quickstarts.

-
-
-
-
-

Architecture

-
-
-

Architecture with S2I

-
-

This backend is built using JBoss EAP S2I Builder and Runtime images.

-
-
-

When the image is built, org.jboss.eap.plugins:eap-maven-plugin plugin provisions the JBoss EAP application server and all the feature packs it needs for its features. -The layers are defined in the pom.xml file in the <configuration> section of the org.jboss.eap.plugins:eap-maven-plugin plugin:

-
-
-
-
<layers>
-  <layer>cloud-server</layer>
-  <layer>postgresql-datasource</layer>
-</layers>
-
-
-
-

The cloud-server layer provides everything needed to run the backend on OpenShift. This also includes access to -Jakarta EE APIs such as CDI, JAX-RS, JPA, etc. These two layers comes from the JBoss EAP feature pack provided in the -JBoss EAP S2I builder image.

-
-
-

The postgresql-datasource layer provides a JDBC driver and DataSource to connect to a PostgreSQL database. It is also provided by -the org.jboss.eap:eap-datasources-galleon-pack feature pack.

-
-
-

The Git repository for this feature pack is hosted at https://github.com/jbossas/eap-datasources-galleon-pack. -It provides JDBC drivers and datasources for different databases but for this quickstart, we will only need the postgresql-datasource.

-
-
-
-

Connection to the PostgreSQL database

-
-

As mentioned, the JDBC drivers and datasource configuration that the backend uses to connect to the PostgreSQL database -is provided by the org.jboss.eap:eap-datasources-galleon-pack feature pack.

-
-
-

By default, it exposes a single datasource. -In the backend, the name of this datasource is ToDos and is specified in the persistence.xml to configure JPA:

-
-
-
-
<persistence-unit name="primary">
-  <jta-data-source>java:jboss/datasources/ToDos</jta-data-source>
-</persistence-unit>
-
-
-
-

At runtime, we only need a few environment variables to establish the connection from JBoss EAP to the external PostgreSQL database:

-
-
-
    -
  • -

    POSTGRESQL_DATABASE - the name of the database (that will be called todos)

    -
  • -
  • -

    POSTGRESQL_SERVICE_HOST - the host to connect to the database

    -
  • -
  • -

    POSTGRESQL_SERVICE_PORT - The port to connect to the database

    -
  • -
  • -

    POSTGRESQL_USER & POSTGRESQL_PASSWORD - the credentials to connect to the database

    -
  • -
  • -

    POSTGRESQL_DATASOURCE - The name of the datasources (as mentioned above, it will be ToDos)

    -
  • -
-
-
-
-

Filters for Cross-Origin Resource Sharing (CORS)

-
-

The Web frontend for this quickstart uses JavaScript calls to query the backend’s HTTP API. -We must enable Cross-Origin Resource Sharing (CORS) filters in the undertow subsystem of JBoss EAP to allow -these HTTP requests to succeed.

-
-
-

Configuration with JBoss EAP S2I

-
-

As we use S2I to provision the server and build the application, we provide a CLI script that contains all the commands to create and configure the CORS filters in Undertow. This script is located in the src/scripts/cors_filters.cli.

-
-
-

This script is executed at build time and will provide the following HTTP headers to enabled CORS:

-
-
-
    -
  • -

    Access-Control-Allow-Origin: *

    -
  • -
  • -

    Access-Control-Allow-Methods: GET, POST, OPTION, PUT, DELETE, PATCH

    -
  • -
  • -

    Access-Control-Allow-Headers: accept, authorization, content-type, x-requested-with

    -
  • -
  • -

    Access-Control-Allow-Credentials: true

    -
  • -
  • -

    Access-Control-Max-Age: 1

    -
  • -
-
-
-

By default, the backend accepts requests from any origin (*). This is only simplicity. It is possible to restrict -the allowed origin using the environment variable CORS_ORIGIN at runtime.

-
-
-
-
-
-
-

Run the Backend on OpenShift

-
-
-

Build the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

On OpenShift, the S2I build with Apache Maven will use an openshift profile used to provision a JBoss EAP server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named openshift when building the quickstart:

-
-
-
-
$ mvn clean package -Popenshift
-
-
-
-

The provisioned JBoss EAP server for OpenShift, with the quickstart deployed, can then be found in the target/server directory, and its usage is similar to a standard server distribution. -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.

-
-
-

The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart pom.xml:

-
-
-
-
        <profile>
-            <id>openshift</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.jboss.eap.plugins</groupId>
-                        <artifactId>eap-maven-plugin</artifactId>
-                        <version>${version.eap.maven.plugin}</version>
-                        <configuration>
-                            <feature-packs>
-                                <feature-pack>
-                                    <location>org.jboss.eap:wildfly-ee-galleon-pack</location>
-                                </feature-pack>
-                                <feature-pack>
-                                    <location>org.jboss.eap.cloud:eap-cloud-galleon-pack</location>
-                                </feature-pack>
-                            </feature-packs>
-                            <layers>
-                                <layer>cloud-server</layer>
-                            </layers>
-                            <filename>ROOT.war</filename>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>package</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-
-
-
- - - - - -
- - -
-

Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the /todo-backend path segment after HOST:PORT.

-
-
-
-
-
-

Prerequisites

-
-
    -
  • -

    You must be logged in OpenShift and have an oc client to connect to OpenShift

    -
  • -
  • -

    Helm must be installed to deploy the backend on OpenShift.

    -
  • -
-
-
-

Once you have installed Helm, you need to add the repository that provides Helm Charts for JBoss EAP:

-
-
-
-
$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/
-"jboss-eap" has been added to your repositories
-$ helm search repo jboss-eap
-NAME                    CHART VERSION   APP VERSION     DESCRIPTION
-jboss-eap/eap8         ...             ...             A Helm chart to build and deploy 8.0 applications
-
-
-
-

Deploy a PostgreSQL Database on OpenShift

-
-
-
$ oc new-app postgresql-ephemeral \
-   -p DATABASE_SERVICE_NAME=todo-backend-db \
-   -p POSTGRESQL_DATABASE=todos
-
-
-
-

This will create a PostgreSQL database named todos on OpenShift that can be accessed on the port 5432 on the service todo-backend-db. -We don’t need to copy the credentials to connect to the database as we will retrieve them later using the todo-backend-db secret that was created -when the database is deployed.

-
-
-

The backend will be built and deployed on OpenShift with a Helm Chart for JBoss EAP.

-
-
-
-
-

Deploy the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

Log in to your OpenShift instance using the oc login command. -The backend will be built and deployed on OpenShift with a Helm Chart for JBoss EAP.

-
-
-

Navigate to the root directory of this quickstart and run the following command:

-
-
-
-
$ helm install todo-backend -f charts/helm.yaml jboss-eap/eap8
-NAME: todo-backend
-...
-STATUS: deployed
-REVISION: 1
-
-
-
-

The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17:

-
-
-
-
build:
-  uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git
-  ref: 8.0.x
-  contextDir: todo-backend
-deploy:
-  replicas: 1
-
-
-
-

This will create a new deployment on OpenShift and deploy the application.

-
-
-

If you want to see all the configuration elements to customize your deployment you can use the following command:

-
-
-
-
$ helm show readme jboss-eap/eap8
-
-
-
-

Let’s wait for the application to be built and deployed:

-
-
-
-
$ oc get deployment todo-backend -w
-NAME         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
-todo-backend   1         1         1            0           12s
-...
-todo-backend   1         1         1            1           2m
-
-
-
-

Get the URL of the route to the deployment.

-
-
-
-
$ oc get route todo-backend -o jsonpath="{.spec.host}"
-
-
-
-

Access the application in your web browser using the displayed URL.

-
-
- - - - - -
- - -
-

The Maven profile named openshift is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the /todo-backend path segment after HOST:PORT.

-
-
-
-
-
-

Undeploy the JBoss EAP Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts

-
-
-
$ helm uninstall todo-backend
-
-
-
-
-

Environment variables for PostgreSQL

-
-

The Helm Chart also contains the environment variables required to connect to the PostgreSQL database.

-
-
-

For OpenShift, we rely on secrets so that the credentials are never copied outside OpenShift:

-
-
-
-
deploy:
-  env:
-    - name: POSTGRESQL_PASSWORD
-      valueFrom:
-        secretKeyRef:
-          key: database-password
-          name: todo-backend-db
-
-
-
-

When the application is deployed, the value for the POSTGRESQL_PASSWORD will be taken from the key database-password -in the secret todo-backend-db.

-
-
-
-

Run the Arquillian Integration Tests with OpenShift

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
- - - - - -
- - -
-

The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin.

-
-
-
-
-

Run the integration tests using the following command to run the verify goal with the arq-remote profile activated and the proper URL:

-
-
-
-
$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route todo-backend --template='{{ .spec.host }}')
-
-
-
- - - - - -
- - -
-

The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from.

-
-
-
-
-
-

Use the todobackend Web Frontend

-
-

Once the backend is deployed on OpenShift, it can be accessed from the route todo-backend. -Let’s find the host that we can use to connect to this backend:

-
-
-
-
$ oc get route todo-backend -o jsonpath="{.spec.host}"
-todo-backend-jmesnil1-dev.apps.sandbox.x8i5.p1.openshiftapps.com
-
-
-
-

This value will be different for every installation of the backend.

-
-
- - - - - -
- - -
-

Make sure to prepend the host with https:// to be able to connect to the backend from the ToDo Backend Specs or Client. -The host must also be publicly accessible.

-
-
-
-
-

We can verify that this application is properly working as a ToDo Backend by running its specs on it.

-
-
-

Once all tests passed, we can use the todobackend client to have a Web application connected to the backend.

-
-
- - - - - -
- - -
-

todobackend.com is an external service used to showcase this quickstart. -It might not always be functional but does not impact the availability of this backend.

-
-
-
-
-
-

Clean Up

-
-

Remove the Backend

-
-

The backend can be deleted from OpenShift by running the command:

-
-
-
-
$ helm uninstall todo-backend
-release "todo-backend" uninstalled
-
-
-
-
-

Remove the Database

-
-

The PostresSQL database can be deleted from OpenShift by running the commands:

-
-
-
-
$ oc delete all -l template=postgresql-ephemeral-template
-replicationcontroller "todo-backend-db-1" deleted
-service "todo-backend-db" deleted
-deploymentconfig.apps.openshift.io "todo-backend-db" deleted
-$ oc delete secret todo-backend-db
-secret "todo-backend-db" deleted
-
-
-
-
-
-
-
-

Conclusion

-
-
-

This quickstart shows how the datasource feature pack provided by JBoss EAP simplifies the deployment -of a JBoss EAP Jakarta EE backend on OpenShift to connect to an external database and exposes an HTTP API.

-
-
-
-
- - - \ No newline at end of file diff --git a/todo-backend/charts/helm.yaml b/todo-backend/charts/helm.yaml deleted file mode 100644 index cfbcc5fa91..0000000000 --- a/todo-backend/charts/helm.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# This configuration file can be used to build and deploy the todo-backend -# quickstart on OpenShift with the Helm Chart for EAP. -build: - uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git - ref: 8.0.x - contextDir: todo-backend - env: - - name: POSTGRESQL_DRIVER_VERSION - value: '42.6.0' -deploy: - replicas: 1 - env: - # Env vars to connect to PostgreSQL DB - - name: POSTGRESQL_DATABASE - valueFrom: - secretKeyRef: - key: database-name - name: todo-backend-db - - name: POSTGRESQL_USER - valueFrom: - secretKeyRef: - key: database-user - name: todo-backend-db - - name: POSTGRESQL_PASSWORD - valueFrom: - secretKeyRef: - key: database-password - name: todo-backend-db - - name: POSTGRESQL_DATASOURCE - value: ToDos - - name: POSTGRESQL_SERVICE_HOST - value: todo-backend-db - - name: POSTGRESQL_SERVICE_PORT - value: "5432" diff --git a/todo-backend/pom.xml b/todo-backend/pom.xml deleted file mode 100644 index 66e4afe333..0000000000 --- a/todo-backend/pom.xml +++ /dev/null @@ -1,266 +0,0 @@ - - - - 4.0.0 - - org.jboss.eap.quickstarts - jboss-eap-quickstart-parent - - 6.0.0.redhat-00001 - - - - todo-backend - 8.0.0.GA - war - Quickstart: todo-backend - This project demonstrates how to implement a Todo-Backend application to manage ToDos - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - 8.0.0.GA-redhat-00009 - 1.0.0.Final-redhat-00014 - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - never - - default - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - never - - - true - never - - default - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - - - true - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - - - true - - - - - - - - - org.jboss.bom - jboss-eap-ee-with-tools - ${version.server.bom} - pom - import - - - - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - jakarta.persistence - jakarta.persistence-api - provided - - - jakarta.ejb - jakarta.ejb-api - provided - - - jakarta.ws.rs - jakarta.ws.rs-api - provided - - - org.jboss.resteasy - resteasy-jackson2-provider - provided - - - junit - junit - test - - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet-jakarta - test - - - org.jboss.resteasy - resteasy-client - test - - - org.jboss.logging - commons-logging-jboss-logging - test - - - - - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - - org.jboss.eap.channels - eap-8.0 - - - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap:eap-datasources-galleon-pack - - - - cloud-server - postgresql-datasource - - ROOT.war - - - - - - - false - - - - - - - package - - - - - - - - - - arq-remote - - - org.wildfly.arquillian - wildfly-arquillian-container-remote - test - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} - - - - integration-test - verify - - - - - - **/RemoteToDoIT - - - **/ProvisionedManagedToDoIT - - - - - - - - - diff --git a/todo-backend/src/main/java/org/wildfly/quickstarts/todos/Resources.java b/todo-backend/src/main/java/org/wildfly/quickstarts/todos/Resources.java deleted file mode 100644 index 94661a2a01..0000000000 --- a/todo-backend/src/main/java/org/wildfly/quickstarts/todos/Resources.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2020, Red Hat, Inc., and individual contributors - * as indicated by the @author tags. See the copyright.txt file in the - * distribution for a full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.wildfly.quickstarts.todos; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.Produces; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; -import jakarta.persistence.PersistenceContextType; - -@Stateful -@RequestScoped -public class Resources { - - @PersistenceContext(type = PersistenceContextType.EXTENDED) - private EntityManager em; - - @Produces - public EntityManager getEm() { - return em; - } -} \ No newline at end of file diff --git a/todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDo.java b/todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDo.java deleted file mode 100644 index 9c7c0b2ebf..0000000000 --- a/todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDo.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2020, Red Hat, Inc., and individual contributors - * as indicated by the @author tags. See the copyright.txt file in the - * distribution for a full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.wildfly.quickstarts.todos; - -import static java.util.Optional.ofNullable; -import static jakarta.persistence.GenerationType.IDENTITY; - -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Objects; - -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; -import jakarta.ws.rs.core.UriBuilder; - -@Entity -public class ToDo { - - @Id - @GeneratedValue(strategy = IDENTITY) - private Long id; - private String title; - private Boolean completed = false; - @Column(name = "\"order\"") - private int order; - private URL url; - - public ToDo() { - - } - - public ToDo(String title) { - this.title = title; - } - - public ToDo(Long id, String title, Boolean completed, int order, URL url) { - this.id = id; - this.title = title; - this.completed = completed; - this.order = order; - this.url = url; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public boolean isCompleted() { - return completed; - } - - public void setCompleted(Boolean completed) { - this.completed = completed; - } - - public Boolean getCompleted(){ - return this.completed == null ? false : this.completed; - } - - public int getOrder() { - return order; - } - - public void setOrder(int order) { - this.order = order; - } - - public URL getUrl() throws MalformedURLException, URISyntaxException { - if (this.id != null) { - return UriBuilder.fromUri(url.toURI()).scheme(url.getProtocol()).path(id.toString()).build().toURL(); - } - return this.url; - } - - public void setUrl(URL url) { - this.url = url; - } - - public void update(ToDo newTodo) { - this.title = ofNullable(newTodo.title).orElse(title); - this.completed = ofNullable(newTodo.completed).orElse(completed); - this.order = ofNullable(newTodo.order).orElse(order); - this.url = ofNullable(newTodo.url).orElse(url); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - ToDo toDo = (ToDo) o; - return id == toDo.id; - } - - @Override - public int hashCode() { - return Objects.hash(id); - } - - @Override - public String toString() { - return "ToDo{" + - "id=" + id + - ", title='" + title + '\'' + - ", completed=" + completed + - ", order=" + order + - ", url=" + url + - '}'; - } -} diff --git a/todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoBackendApplication.java b/todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoBackendApplication.java deleted file mode 100644 index 2da5913ad6..0000000000 --- a/todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoBackendApplication.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2020, Red Hat, Inc., and individual contributors - * as indicated by the @author tags. See the copyright.txt file in the - * distribution for a full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.wildfly.quickstarts.todos; - -import jakarta.ws.rs.ApplicationPath; -import jakarta.ws.rs.core.Application; - -@ApplicationPath("") -public class ToDoBackendApplication extends Application{ -} diff --git a/todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoController.java b/todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoController.java deleted file mode 100644 index 3a42a595bf..0000000000 --- a/todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoController.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2020, Red Hat, Inc., and individual contributors - * as indicated by the @author tags. See the copyright.txt file in the - * distribution for a full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.wildfly.quickstarts.todos; - -import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON; - -import java.net.MalformedURLException; -import java.util.List; -import java.util.Optional; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.transaction.Transactional; -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.DELETE; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.NotFoundException; -import jakarta.ws.rs.PATCH; -import jakarta.ws.rs.POST; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.PathParam; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.Context; -import jakarta.ws.rs.core.Response; -import jakarta.ws.rs.core.UriInfo; - -@Path("") -@RequestScoped -public class ToDoController { - - @Inject - private ToDoDAO todoDAO; - - @Context - private UriInfo uriInfo; - - @GET - @Produces(APPLICATION_JSON) - public List getAllTodos(){ - return todoDAO.findAll(); - } - - @GET - @Path("{id}") - @Produces(APPLICATION_JSON) - public ToDo getTodoFrom(@PathParam("id") long id) { - Optional todo = todoDAO.findById(id); - return todo.orElseThrow(() -> new NotFoundException("ToDo does not exist!")); - } - - @DELETE - @Transactional - public void deleteAllTodos(){ - todoDAO.findAll().forEach(todo -> todoDAO.remove(todo)); - } - - @DELETE - @Path("{id}") - @Transactional - public Response deleteTodoFrom(@PathParam("id") long id) { - Optional optional = todoDAO.findById(id); - ToDo todo = optional.orElseThrow(() -> new NotFoundException("ToDo does not exist!")); - todoDAO.remove(todo); - return Response.ok().build(); - } - - @POST - @Consumes(APPLICATION_JSON) - @Produces(APPLICATION_JSON) - @Transactional - public ToDo addTodo(ToDo todo) throws MalformedURLException { - todo.setUrl(uriInfo.getAbsolutePathBuilder().scheme("https").build().toURL()); - todoDAO.insert(todo); - return todo; - } - - @PATCH - @Path("{id}") - @Produces(APPLICATION_JSON) - @Consumes(APPLICATION_JSON) - @Transactional - public ToDo updateTodo(@PathParam("id") long id, ToDo update) { - return todoDAO.update(id, update).orElseThrow(() -> new NotFoundException("ToDo does not exist!")); - } -} \ No newline at end of file diff --git a/todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoDAO.java b/todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoDAO.java deleted file mode 100644 index c25b9ca8a9..0000000000 --- a/todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2020, Red Hat, Inc., and individual contributors - * as indicated by the @author tags. See the copyright.txt file in the - * distribution for a full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.wildfly.quickstarts.todos; - -import java.util.List; -import java.util.Optional; - -import jakarta.ejb.Local; - -@Local -public interface ToDoDAO { - - List findAll(); - - Optional findById(Long id); - - void remove(ToDo todo); - - void insert(ToDo todo); - - Optional update(Long id, ToDo todo); -} \ No newline at end of file diff --git a/todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoDAOImpl.java b/todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoDAOImpl.java deleted file mode 100644 index 87e2d45c03..0000000000 --- a/todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoDAOImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2020, Red Hat, Inc., and individual contributors - * as indicated by the @author tags. See the copyright.txt file in the - * distribution for a full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.wildfly.quickstarts.todos; - - -import java.util.List; -import java.util.Optional; - -import jakarta.ejb.Stateful; -import jakarta.inject.Inject; -import jakarta.persistence.EntityManager; -import jakarta.persistence.TypedQuery; - -@Stateful -public class ToDoDAOImpl implements ToDoDAO { - - @Inject - private EntityManager em; - - @Override - public List findAll() { - TypedQuery query = em.createQuery("SELECT t FROM ToDo t", ToDo.class); - return query.getResultList(); - } - - @Override - public Optional findById(Long id) { - ToDo toDo = em.find(ToDo.class, id); - return Optional.ofNullable(toDo); - } - - @Override - public void remove(ToDo todo) { - em.remove(todo); - } - - @Override - public void insert(ToDo todo) { - em.persist(todo); - } - - @Override - public Optional update(Long id, ToDo newTodo) { - Optional optional = findById(id); - if (optional.isPresent()) { - optional.get().update(newTodo); - return optional; - } - return Optional.empty(); - } -} diff --git a/todo-backend/src/main/resources/META-INF/persistence.xml b/todo-backend/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index dc0e611709..0000000000 --- a/todo-backend/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - java:jboss/datasources/ToDos - - - - - - - diff --git a/todo-backend/src/main/scripts/cors_filters.cli b/todo-backend/src/main/scripts/cors_filters.cli deleted file mode 100644 index 12b029fbba..0000000000 --- a/todo-backend/src/main/scripts/cors_filters.cli +++ /dev/null @@ -1,16 +0,0 @@ -echo Adding Undertow Filters for CORS -# Access-Control-Allow-Origin -/subsystem=undertow/server=default-server/host=default-host/filter-ref="Access-Control-Allow-Origin":add() -/subsystem=undertow/configuration=filter/response-header="Access-Control-Allow-Origin":add(header-name="Access-Control-Allow-Origin",header-value="${env.CORS_ORIGIN:*}") -# Access-Control-Allow-Methods -/subsystem=undertow/server=default-server/host=default-host/filter-ref="Access-Control-Allow-Methods":add() -/subsystem=undertow/configuration=filter/response-header="Access-Control-Allow-Methods":add(header-name="Access-Control-Allow-Methods",header-value="GET, POST, OPTION, PUT, DELETE, PATCH") -# Access-Control-Allow-Headers -/subsystem=undertow/server=default-server/host=default-host/filter-ref="Access-Control-Allow-Headers":add() -/subsystem=undertow/configuration=filter/response-header="Access-Control-Allow-Headers":add(header-name="Access-Control-Allow-Headers",header-value="accept, authorization, content-type, x-requested-with") -# Access-Control-Allow-Credentials -/subsystem=undertow/server=default-server/host=default-host/filter-ref="Access-Control-Allow-Credentials":add() -/subsystem=undertow/configuration=filter/response-header="Access-Control-Allow-Credentials":add(header-name="Access-Control-Allow-Credentials",header-value="true") -# Access-Control-Max-Age -/subsystem=undertow/server=default-server/host=default-host/filter-ref="Access-Control-Max-Age":add() -/subsystem=undertow/configuration=filter/response-header="Access-Control-Max-Age":add(header-name="Access-Control-Max-Age",header-value="1") \ No newline at end of file diff --git a/todo-backend/src/main/webapp/WEB-INF/beans.xml b/todo-backend/src/main/webapp/WEB-INF/beans.xml deleted file mode 100644 index d3ddf148e7..0000000000 --- a/todo-backend/src/main/webapp/WEB-INF/beans.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/todo-backend/src/test/java/org/wildfly/quickstarts/todos/AbstractToDoIT.java b/todo-backend/src/test/java/org/wildfly/quickstarts/todos/AbstractToDoIT.java deleted file mode 100644 index 76ed3dd64a..0000000000 --- a/todo-backend/src/test/java/org/wildfly/quickstarts/todos/AbstractToDoIT.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2022 Red Hat, Inc. - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wildfly.quickstarts.todos; - -import jakarta.ws.rs.client.ClientBuilder; -import jakarta.ws.rs.client.Entity; -import jakarta.ws.rs.client.WebTarget; -import jakarta.ws.rs.core.GenericType; -import jakarta.ws.rs.core.MediaType; -import java.net.URL; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -public abstract class AbstractToDoIT { - - abstract URL getRequestUrl(); - - public void internalCRUDTest() throws Exception { - WebTarget client = ((ResteasyClientBuilder) ClientBuilder.newBuilder()).setFollowRedirects(true).build().target(getRequestUrl().toURI()); - - GenericType> todosListType = new GenericType>() { - }; - List allTodos = client.request().get(todosListType); - assertEquals(0, allTodos.size()); - - ToDo toDo = new ToDo(); - toDo.setTitle("My First ToDo"); - toDo.setOrder(1); - ToDo persistedTodo = client.request().post(Entity.entity(toDo, MediaType.APPLICATION_JSON_TYPE), ToDo.class); - assertNotNull(persistedTodo.getId()); - - allTodos = client.request().get(todosListType); - assertEquals(1, allTodos.size()); - ToDo fetchedToDo = allTodos.get(0); - assertEquals(toDo.getTitle(), fetchedToDo.getTitle()); - - client.request().delete(); - - allTodos = client.request().get(todosListType); - assertEquals(0, allTodos.size()); - } -} diff --git a/todo-backend/src/test/java/org/wildfly/quickstarts/todos/ProvisionedManagedToDoIT.java b/todo-backend/src/test/java/org/wildfly/quickstarts/todos/ProvisionedManagedToDoIT.java deleted file mode 100644 index b0c48a7329..0000000000 --- a/todo-backend/src/test/java/org/wildfly/quickstarts/todos/ProvisionedManagedToDoIT.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2022 Red Hat, Inc. - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wildfly.quickstarts.todos; - -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -@RunWith(Arquillian.class) -@RunAsClient -public class ProvisionedManagedToDoIT extends AbstractToDoIT { - - private static final String REST_TARGET_URL = "http://localhost:8080/todo-backend"; - - private String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host"); - } - return host; - } - - @Override - URL getRequestUrl() { - String host = getServerHost(); - if (host == null) { - host = REST_TARGET_URL; - } - try { - return new URI(host).toURL(); - } catch (URISyntaxException | MalformedURLException ex) { - throw new RuntimeException(ex); - } - } - - @Test - public void testCRUD() throws Exception { - super.internalCRUDTest(); - } -} diff --git a/todo-backend/src/test/java/org/wildfly/quickstarts/todos/RemoteToDoIT.java b/todo-backend/src/test/java/org/wildfly/quickstarts/todos/RemoteToDoIT.java deleted file mode 100644 index b223cb78e7..0000000000 --- a/todo-backend/src/test/java/org/wildfly/quickstarts/todos/RemoteToDoIT.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2022 Red Hat, Inc. - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wildfly.quickstarts.todos; - -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import org.junit.Test; - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -public class RemoteToDoIT extends AbstractToDoIT { - - private static final String REST_TARGET_URL = "http://localhost:8080/todo-backend"; - - private String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host"); - } - return host; - } - - @Override - URL getRequestUrl() { - String host = getServerHost(); - if (host == null) { - host = REST_TARGET_URL; - } - try { - return new URI(host).toURL(); - } catch (URISyntaxException | MalformedURLException ex) { - throw new RuntimeException(ex); - } - } - - @Test - public void testCRUD() throws Exception { - super.internalCRUDTest(); - } -} diff --git a/todo-backend/src/test/resources/arquillian.xml b/todo-backend/src/test/resources/arquillian.xml deleted file mode 100644 index fdeb809fee..0000000000 --- a/todo-backend/src/test/resources/arquillian.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/websocket-hello/README-source.adoc b/websocket-hello/README-source.adoc deleted file mode 100644 index f7c32f6f33..0000000000 --- a/websocket-hello/README-source.adoc +++ /dev/null @@ -1,63 +0,0 @@ -include::../shared-doc/attributes.adoc[] - -= websocket-hello: A simple WebSocket application -:author: Sande Gilda, Emmanuel Hugonett -:level: Beginner -:technologies: WebSocket, CDI, JSF -:openshift: true - -[abstract] -The `websocket-hello` quickstart demonstrates how to create a simple WebSocket application. - -:standalone-server-type: default -:archiveType: war - -== What is it? - -The `websocket-hello` quickstart demonstrates how to create a simple WebSocket-enabled application in {productNameFull}. It consists of the following: - -* A JavaScript enabled WebSocket HTML client. -* A WebSocket server endpoint that uses annotations to interact with the WebSocket events. -* A `jboss-web.xml` file configured to enable WebSockets - -WebSockets are a requirement of the {javaVersion} specification and are implemented in {productName} {productVersion}. They are configured in the `undertow` subsystem of the server configuration file. This quickstart uses the WebSocket default settings, so it is not necessary to modify the server configuration to deploy and run this quickstart. - -NOTE: This quickstart demonstrates only a few of the basic functions. A fully functional application should provide better error handling and intercept and handle additional events. - -// System Requirements -include::../shared-doc/system-requirements.adoc[leveloffset=+1] -// Use of {jbossHomeName} -include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1] - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Start the {productName} Standalone Server -include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+2] -// Build and Deploy the Quickstart -include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+2] - -=== Access the Application - -The application will be running at the following URL: http://localhost:8080/{artifactId}/. - -. Click on the *Open Connection* button to create the WebSocket connection and display current status of `Open`. -. Type a name and click *Say Hello* to create and send the `Say hello to __NAME__` message. The message appears in the server log and a response is sent to the client. -. Click on the *Close Connection* button to close the WebSocket connection and display the current status of *Closed*. -. If you attempt to send another message after closing the connection, the following message appears on the page: -+ -[source,options="nowrap"] ----- -WebSocket connection is not established. Please click the Open Connection button. ----- - -// Testing with Arquillian -include::../shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc[leveloffset=+2] -// Undeploy the Quickstart -include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2] - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1] \ No newline at end of file diff --git a/websocket-hello/README.adoc b/websocket-hello/README.adoc deleted file mode 100644 index e9d0d44579..0000000000 --- a/websocket-hello/README.adoc +++ /dev/null @@ -1,847 +0,0 @@ -ifdef::env-github[] -:artifactId: websocket-hello -endif::[] - -//*********************************************************************************** -// Enable the following flag to build README.html files for JBoss EAP product builds. -// Comment it out for WildFly builds. -//*********************************************************************************** -:ProductRelease: - -//*********************************************************************************** -// Enable the following flag to build README.html files for EAP XP product builds. -// Comment it out for WildFly or JBoss EAP product builds. -//*********************************************************************************** -//:EAPXPRelease: - -// This is a universal name for all releases -:ProductShortName: JBoss EAP -// Product names and links are dependent on whether it is a product release (CD or JBoss) -// or the WildFly project. -// The "DocInfo*" attributes are used to build the book links to the product documentation - -ifdef::ProductRelease[] -// JBoss EAP release -:productName: JBoss EAP -:productNameFull: Red Hat JBoss Enterprise Application Platform -:productVersion: 8.0 -:DocInfoProductNumber: {productVersion} -:WildFlyQuickStartRepoTag: 8.0.x -:productImageVersion: 8.0.0 -:helmChartName: jboss-eap/eap8 -endif::[] - -ifdef::EAPXPRelease[] -// JBoss EAP XP release -:productName: JBoss EAP XP -:productNameFull: Red Hat JBoss Enterprise Application Platform expansion pack -:productVersion: 3.0 -:DocInfoProductNumber: 7.4 -:WildFlyQuickStartRepoTag: XP_3.0.0.GA -:productImageVersion: 3.0 -:helmChartName: jboss-eap/eap-xp3 -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -:githubRepoUrl: https://github.com/jboss-developer/jboss-eap-quickstarts/ -:githubRepoCodeUrl: https://github.com/jboss-developer/jboss-eap-quickstarts.git -:jbossHomeName: EAP_HOME -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:quickstartDownloadName: {productNameFull} {productVersion} Quickstarts -:quickstartDownloadUrl: https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=appplatform&downloadType=distributions -:helmRepoName: jboss-eap -:helmRepoUrl: https://jbossas.github.io/eap-charts/ -// END ifdef::ProductRelease,EAPXPRelease[] -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -// WildFly project -:productName: WildFly -:productNameFull: WildFly Application Server -:ProductShortName: {productName} -:jbossHomeName: WILDFLY_HOME -:productVersion: 28 -:productImageVersion: 28.0 -:githubRepoUrl: https://github.com/wildfly/quickstart/ -:githubRepoCodeUrl: https://github.com/wildfly/quickstart.git -:WildFlyQuickStartRepoTag: 28.0.1.Final -:DocInfoProductName: Red Hat JBoss Enterprise Application Platform -:DocInfoProductNameURL: red_hat_jboss_enterprise_application_platform -// Do not update the following until after the 7.4 docs are published! -:DocInfoProductNumber: 7.4 -:DocInfoPreviousProductName: jboss-enterprise-application-platform -:helmRepoName: wildfly -:helmRepoUrl: http://docs.wildfly.org/wildfly-charts/ -:helmChartName: wildfly/wildfly -// END ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -endif::[] - -:source: {githubRepoUrl} - -// Values for Openshift S2i sections attributes -:CDProductName: {productNameFull} for OpenShift -:CDProductShortName: {ProductShortName} for OpenShift -:CDProductTitle: {CDProductName} -:CDProductNameSentence: Openshift release for {ProductShortName} -:CDProductAcronym: {CDProductShortName} -:CDProductVersion: {productVersion} -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {EapForOpenshiftBookName} Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {xpaasproduct} Online -:xpaasproduct-shortname: {CDProductShortName} -:xpaasproductOpenShiftOnline-shortname: {xpaasproduct-shortname} Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: Getting Started with {ProductShortName} for OpenShift Container Platform -:EapForOpenshiftOnlineBookName: Getting Started with {ProductShortName} for OpenShift Online -:OpenShiftOnlinePlatformName: Red Hat OpenShift Container Platform -:OpenShiftOnlineName: Red Hat OpenShift Online -:ImagePrefixVersion: eap80 -:ImageandTemplateImportBaseURL: https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift - -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepo: https://github.com/jboss-developer/jboss-eap-quickstarts -:EAPQuickStartRepoRef: 8.0.x -:EAPQuickStartRepoTag: EAP_8.0.0.GA -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_container_platform/ -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_with_jboss_eap_for_openshift_online/ - -ifdef::EAPXPRelease[] -// Attributes for XP releases -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:xpaasproduct: {productNameFull} for OpenShift -:xpaasproductOpenShiftOnline: {productNameFull} for OpenShift Online -:xpaasproduct-shortname: {ProductShortName} for OpenShift -:xpaasproductOpenShiftOnline-shortname: {ProductShortName} for OpenShift Online -:ContainerRegistryName: Red Hat Container Registry -:EapForOpenshiftBookName: {productNameFull} for OpenShift -:EapForOpenshiftOnlineBookName: {productNameFull} for OpenShift Online -:ImagePrefixVersion: eap-xp3 -:ImageandTemplateImportURL: {ImageandTemplateImportBaseURL}/{ImagePrefixVersion}/ -:BuildImageStream: jboss-{ImagePrefixVersion}-openjdk11-openshift -:RuntimeImageStream: jboss-{ImagePrefixVersion}-openjdk11-runtime-openshift -// OpenShift repository and reference for quickstarts -:EAPQuickStartRepoRef: xp-3.0.x -// Links to the OpenShift documentation -:LinkOpenShiftGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -:LinkOpenShiftOnlineGuide: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/{DocInfoProductNumber}/html/using_eclipse_microprofile_in_jboss_eap/using-the-openshift-image-for-jboss-eap-xp_default -endif::[] - -ifndef::ProductRelease,EAPCDRelease,EAPXPRelease[] -:ImageandTemplateImportURL: https://raw.githubusercontent.com/wildfly/wildfly-s2i/v{productVersion}.0/ -endif::[] - -//************************* -// Other values -//************************* -:buildRequirements: Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later -:jbdsEapServerName: Red Hat JBoss Enterprise Application Platform 7.3 -:javaVersion: Jakarta EE 10 -ifdef::EAPXPRelease[] -:javaVersion: Eclipse MicroProfile -endif::[] -:githubRepoBranch: master -:guidesBaseUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/ -:useEclipseUrl: {guidesBaseUrl}USE_JBDS.adoc#use_red_hat_jboss_developer_studio_or_eclipse_to_run_the_quickstarts -:useEclipseDeployJavaClientDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_containing_server_and_java_client_projects -:useEclipseDeployEARDocUrl: {guidesBaseUrl}USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_ear_project -:useProductHomeDocUrl: {guidesBaseUrl}USE_OF_{jbossHomeName}.adoc#use_of_product_home_and_jboss_home_variables -:configureMavenDocUrl: {guidesBaseUrl}CONFIGURE_MAVEN_JBOSS_EAP.adoc#configure_maven_to_build_and_deploy_the_quickstarts -:arquillianTestsDocUrl: {guidesBaseUrl}RUN_ARQUILLIAN_TESTS.adoc#run_the_arquillian_tests -:addUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#create_users_required_by_the_quickstarts -:addApplicationUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_application_user -:addManagementUserDocUrl: {guidesBaseUrl}CREATE_USERS.adoc#add_an_management_user -:startServerDocUrl: {guidesBaseUrl}START_JBOSS_EAP.adoc#start_the_jboss_eap_server -:configurePostgresDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_database_for_use_with_the_quickstarts -:configurePostgresDownloadDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#download_and_install_postgresql -:configurePostgresCreateUserDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#create_a_database_user -:configurePostgresAddModuleDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#add_the_postgres_module_to_the_jboss_eap_server -:configurePostgresDriverDocUrl: {guidesBaseUrl}CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_driver_in_the_jboss_eap_server -:configureBytemanDownloadDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#download_and_configure_byteman -:configureBytemanDisableDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#disable_the_byteman_script -:configureBytemanClearDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#clear_the_transaction_object_store -:configureBytemanQuickstartDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts -:configureBytemanHaltDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#use_byteman_to_halt_the_application[ -:configureBytemanQuickstartsDocUrl: {guidesBaseUrl}CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts - -:EESubsystemNamespace: urn:jboss:domain:ee:4.0 -:IiopOpenJdkSubsystemNamespace: urn:jboss:domain:iiop-openjdk:2.0 -:MailSubsystemNamespace: urn:jboss:domain:mail:3.0 -:SingletonSubsystemNamespace: urn:jboss:domain:singleton:1.0 -:TransactionsSubsystemNamespace: urn:jboss:domain:transactions:4.0 - -// LinkProductDocHome: https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/ -:LinkProductDocHome: https://access.redhat.com/documentation/en/jboss-enterprise-application-platform-continuous-delivery -:LinkConfigGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/configuration_guide/ -:LinkDevelopmentGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/development_guide/ -:LinkGettingStartedGuide: https://access.redhat.com/documentation/en-us/{DocInfoProductNameURL}/{DocInfoProductNumber}/html-single/getting_started_guide/ -:LinkOpenShiftWelcome: https://docs.openshift.com/online/welcome/index.html -:LinkOpenShiftSignup: https://docs.openshift.com/online/getting_started/choose_a_plan.html -:OpenShiftTemplateName: JBoss EAP CD (no https) - -:ConfigBookName: Configuration Guide -:DevelopmentBookName: Development Guide -:GettingStartedBookName: Getting Started Guide - -:JBDSProductName: Red Hat CodeReady Studio -:JBDSVersion: 12.15 -:LinkJBDSInstall: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/installation_guide/ -:JBDSInstallBookName: Installation Guide -:LinkJBDSGettingStarted: https://access.redhat.com/documentation/en-us/red_hat_codeready_studio/{JBDSVersion}/html-single/getting_started_with_codeready_studio_tools/ -:JBDSGettingStartedBookName: Getting Started with CodeReady Studio Tools - -= websocket-hello: A simple WebSocket application -:author: Sande Gilda, Emmanuel Hugonett -:level: Beginner -:technologies: WebSocket, CDI, JSF -:openshift: true - -[abstract] -The `websocket-hello` quickstart demonstrates how to create a simple WebSocket application. - -:standalone-server-type: default -:archiveType: war - -== What is it? - -The `websocket-hello` quickstart demonstrates how to create a simple WebSocket-enabled application in {productNameFull}. It consists of the following: - -* A JavaScript enabled WebSocket HTML client. -* A WebSocket server endpoint that uses annotations to interact with the WebSocket events. -* A `jboss-web.xml` file configured to enable WebSockets - -WebSockets are a requirement of the {javaVersion} specification and are implemented in {productName} {productVersion}. They are configured in the `undertow` subsystem of the server configuration file. This quickstart uses the WebSocket default settings, so it is not necessary to modify the server configuration to deploy and run this quickstart. - -NOTE: This quickstart demonstrates only a few of the basic functions. A fully functional application should provide better error handling and intercept and handle additional events. - -// System Requirements -:leveloffset: +1 - -[[system_requirements]] -= System Requirements -//****************************************************************************** -// Include this template to describe the standard system requirements for -// running the quickstarts. -// -// The Forge quickstarts define a `forge-from-scratch` attribute because they -// run entirely in CodeReady Studio and have different requirements . -//****************************************************************************** - -The application this project produces is designed to be run on {productNameFull} {productVersion} or later. - -All you need to build this project is {buildRequirements}. See link:{configureMavenDocUrl}[Configure Maven to Build and Deploy the Quickstarts] to make sure you are configured correctly for testing the quickstarts. - -:leveloffset!: -// Use of {jbossHomeName} -:leveloffset: +1 - -ifdef::requires-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -This quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifdef::optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName}_1, {jbossHomeName}_2, and QUICKSTART_HOME Variables - -When deploying this quickstart to a managed domain, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When deploying this quickstart to multiple standalone servers, this quickstart requires that you clone your `__{jbossHomeName}__` installation directory and run two servers. In the following instructions, replace `__{jbossHomeName}_1__` with the path to your first {productName} server and replace `__{jbossHomeName}_2__` with the path to your second cloned {productName} server. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -ifndef::requires-multiple-servers,optional-domain-or-multiple-servers[] -[[use_of_jboss_home_name]] -= Use of the {jbossHomeName} and QUICKSTART_HOME Variables - -In the following instructions, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of __{jbossHomeName}__ and __JBOSS_HOME__ Variables]. - -When you see the replaceable variable __QUICKSTART_HOME__, replace it with the path to the root directory of all of the quickstarts. -endif::[] - -:leveloffset!: - -// build and run with standard server distribution -[[build_and_run_the_quickstart_with_server_dist]] -== Building and running the quickstart application with a {productName} server distribution -// Start the {productName} Standalone Server -:leveloffset: +2 - -[[start_the_eap_standalone_server]] -= Start the {productName} Standalone Server -//****************************************************************************** -// Include this template if your quickstart requires a normal start of a single -// standalone server. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// custom -// -// * For mobile applications, you can define the `mobileApp` variable in the -// `README.adoc` file to add `-b 0.0.0.0` to the command line. This allows -// external clients, such as phones, tablets, and desktops, to connect -// to the application through through your local network -// ::mobileApp: {artifactId}-service -// -//****************************************************************************** - -//****************************************************************************** -// This template sets attributes for the different standalone server profiles. -// -// You must define the `standalone-server-type`. Supported values are: -// default -// full -// full-ha -// ha -// microprofile -// custom -//****************************************************************************** - -// Standalone server with the default profile. -ifeval::["{standalone-server-type}"=="default"] -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::[] - -// Standalone server with the full profile. -ifeval::["{standalone-server-type}"=="full"] -:serverProfile: full profile -:configFileName: standalone/configuration/standalone-full.xml -:serverArguments: -c standalone-full.xml -endif::[] - -// Standalone server with the full HA profile. -ifeval::["{standalone-server-type}"=="full-ha"] -:serverProfile: full HA profile -:configFileName: standalone/configuration/standalone-full-ha.xml -:serverArguments: -c standalone-full-ha.xml -endif::[] - -// Start the standalone server with the HA profile. -ifeval::["{standalone-server-type}"=="ha"] -:serverProfile: HA profile -:configFileName: standalone/configuration/standalone-ha.xml -:serverArguments: -c standalone-ha.xml -endif::[] - -// Start the standalone server with the Eclipse MicroProfile profile. -ifeval::["{standalone-server-type}"=="microprofile"] -:serverProfile: MicroProfile profile -:configFileName: standalone/configuration/standalone-microprofile.xml -:serverArguments: -c standalone-microprofile.xml -endif::[] - -// Standalone server with the custom profile. -// NOTE: This profile requires that you define the `serverArguments` variable -// within the quickstart README.adoc file. For example: -// :serverArguments: --server-config=../../docs/examples/configs/standalone-xts.xml -ifeval::["{standalone-server-type}"=="custom"] -:serverProfile: custom profile -endif::[] - -// If there is no match, use the default profile. -ifndef::serverProfile[] -:standalone-server-type: default -:serverProfile: default profile -:configFileName: standalone/configuration/standalone.xml -:serverArguments: -endif::serverProfile[] - -. Open a terminal and navigate to the root of the {productName} directory. -. Start the {productName} server with the {serverProfile} by typing the following command. -+ -ifdef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __JAEGER_REPORTER_LOG_SPANS=true JAEGER_SAMPLER_TYPE=const JAEGER_SAMPLER_PARAM=1__ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -ifndef::uses-jaeger[] -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} ----- -endif::[] -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\standalone.bat` script. - -ifdef::mobileApp[] -+ -Adding `-b 0.0.0.0` to the above command allows external clients, such as phones, tablets, and desktops, to connect through your local network. For example: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/standalone.sh {serverArguments} -b 0.0.0.0 ----- -endif::[] - -:leveloffset!: -// Build and Deploy the Quickstart -:leveloffset: +2 - -[[build_and_deploy_the_quickstart]] -= Build and Deploy the Quickstart -//****************************************************************************** -// Include this template if your quickstart does a normal deployment of a archive. -// -// * Define the `archiveType` variable in the quickstart README file. -// Supported values: -// :archiveType: ear -// :archiveType: war -// :archiveType: jar -// -// * To override the archive name, which defaults to the {artifactId), -// define the `archiveName` variable, for example: -// :archiveName: {artifactId}-service -// -// * To override the archive output directory, -// define the `archiveDir` variable, for example: -// :archiveDir: ear/target -// -// * To override the Maven command, define the `mavenCommand` variable, -// for example: -// :mavenCommand: clean install wildfly:deploy -//****************************************************************************** - -// The archive name defaults to the artifactId if not overridden -ifndef::archiveName[] -:archiveName: {artifactId} -endif::archiveName[] - -// The archive type defaults to war if not overridden -ifndef::archiveType[] -:archiveType: war -endif::archiveType[] - -// Define the archive file name as the concatenation of "archiveName" + "." + "archiveType+ -:archiveFileName: {archiveName}.{archiveType} - -// If they have not defined the target archive directory, make it the default for the archive type. -ifndef::archiveDir[] - -ifeval::["{archiveType}"=="ear"] -:archiveDir: {artifactId}/ear/target -endif::[] - -ifeval::["{archiveType}"=="war"] -:archiveDir: {artifactId}/target -endif::[] - -ifeval::["{archiveType}"=="jar"] -:archiveDir: {artifactId}/target -endif::[] - -endif::archiveDir[] - -ifndef::mavenCommand[] -ifeval::["{archiveType}"=="ear"] -:mavenCommand: clean install -endif::[] - -ifeval::["{archiveType}"=="war"] -:mavenCommand: clean package -endif::[] - -ifeval::["{archiveType}"=="jar"] -:mavenCommand: clean install -endif::[] - -endif::mavenCommand[] - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -ifdef::reactive-messaging[] -. Run this command to enable the MicroProfile Reactive Messaging functionality on the server -+ -[source,subs="attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=enable-reactive-messaging.cli ----- -endif::reactive-messaging[] -. Type the following command to build the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn {mavenCommand} ----- - -. Type the following command to deploy the quickstart. -+ -[source,subs="attributes+",options="nowrap"] ----- -$ mvn wildfly:deploy ----- - -ifdef::rest-client-qs[] -This builds and deploys the `country-server` and `country-client` to the running instance of the server. - -You should see a message in the server log indicating that the archives deployed successfully. -endif::[] -ifndef::rest-client-qs[] -This deploys the `{archiveDir}/{archiveFileName}` to the running instance of the server. - -You should see a message in the server log indicating that the archive deployed successfully. -endif::[] - - -:leveloffset!: - -=== Access the Application - -The application will be running at the following URL: http://localhost:8080/{artifactId}/. - -. Click on the *Open Connection* button to create the WebSocket connection and display current status of `Open`. -. Type a name and click *Say Hello* to create and send the `Say hello to __NAME__` message. The message appears in the server log and a response is sent to the client. -. Click on the *Close Connection* button to close the WebSocket connection and display the current status of *Closed*. -. If you attempt to send another message after closing the connection, the following message appears on the page: -+ -[source,options="nowrap"] ----- -WebSocket connection is not established. Please click the Open Connection button. ----- - -// Testing with Arquillian -:leveloffset: +2 - -[[run_the_arquillian_integration_tests_with_server_distribution]] -= Run the Arquillian Integration Tests -//****************************************************************************** -// Include this template if your quickstart provides standard Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -Follow these steps to run the integration tests. - -. Make sure you start the {productName} server, as previously described. - -. Make sure you build and deploy the quickstart, as previously described. - -. Type the following command to run the `verify` goal with the `arq-remote` profile activated. -+ -[source,options="nowrap"] ----- -$ mvn verify -Parq-remote ----- - -[NOTE] -==== -You may also use the environment variable `SERVER_HOST` or the system property `server.host` to define the target host of the tests. -==== - -:leveloffset!: -// Undeploy the Quickstart -:leveloffset: +2 - -[[undeploy_the_quickstart]] -= Undeploy the Quickstart - -//******************************************************************************* -// Include this template if your quickstart does a normal undeployment of an archive. -//******************************************************************************* -When you are finished testing the quickstart, follow these steps to undeploy the archive. - -. Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. -. Open a terminal and navigate to the root directory of this quickstart. -. Type this command to undeploy the archive: -+ -[source,options="nowrap"] ----- -$ mvn wildfly:undeploy ----- - -:leveloffset!: - -// Build and run sections for other environments/builds -ifndef::ProductRelease,EAPXPRelease[] -include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] -endif::[] -:leveloffset: +1 - -[[build_and_run_the_quickstart_on_openshift]] -= Building and running the quickstart application with OpenShift -// The openshift profile -:leveloffset: +1 - -[[build-the-quickstart-for-openshift]] -== Build the {productName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -On OpenShift, the S2I build with Apache Maven will use an `openshift` profile used to provision a {productName} server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named `openshift` when building the quickstart: - -[source,subs="attributes+",options="nowrap"] ----- -$ mvn clean package -Popenshift ----- - -The provisioned {productName} server for OpenShift, with the quickstart deployed, can then be found in the `target/server` directory, and its usage is similar to a standard server distribution. -ifndef::ProductRelease,EAPXPRelease[] -You may note that unlike the `provisioned-server` profile it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] -ifdef::ProductRelease,EAPXPRelease[] -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment. -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the WildFly Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart `pom.xml`: -endif::[] - -ifndef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.wildfly:wildfly-galleon-pack:${version.server} - - - org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp} - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -ifdef::ProductRelease,EAPXPRelease[] -[source,xml,subs="attributes+"] ----- - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - ----- -endif::[] - -[NOTE] -==== -Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the `/{artifactId}` path segment after `HOST:PORT`. -==== - -:leveloffset: 1 -// Getting Started with Helm -:leveloffset: +1 - -[[getting_started_with_helm]] -= Getting Started with {xpaasproduct-shortname} and Helm Charts - -This section contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} using Helm Charts. - -[[prerequisites_helm_openshift]] -== Prerequisites - -* You must be logged in OpenShift and have an `oc` client to connect to OpenShift -* https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. - -Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}. - -ifndef::ProductRelease,EAPXPRelease[] -[source,options="nowrap"] ----- -$ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ -"wildfly" has been added to your repositories -$ helm search repo wildfly -NAME CHART VERSION APP VERSION DESCRIPTION -wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift -wildfly/wildfly-common ... ... A library chart for WildFly-based applications ----- -endif::[] -ifdef::ProductRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP {productVersion} applications ----- -endif::[] -ifdef::EAPXPRelease[] -[source,options="nowrap",subs="+attributes"] ----- -$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ -"jboss-eap" has been added to your repositories -$ helm search repo jboss-eap -NAME CHART VERSION APP VERSION DESCRIPTION -{helmChartName} ... ... A Helm chart to build and deploy EAP XP {productVersion} applications ----- -endif::[] - -:leveloffset: 1 -//Prepare Helm for Quickstart Deployment -:leveloffset: +1 - -[[deploy_helm]] -== Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts - -Log in to your OpenShift instance using the `oc login` command. -The backend will be built and deployed on OpenShift with a Helm Chart for {productName}. - -Navigate to the root directory of this quickstart and run the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm install {artifactId} -f charts/helm.yaml {helmChartName} -NAME: {artifactId} -... -STATUS: deployed -REVISION: 1 ----- - -The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17: - -[source,options="nowrap",subs="+attributes"] ----- -build: - uri: {githubRepoCodeUrl} - ref: {WildFlyQuickStartRepoTag} - contextDir: {artifactId} -deploy: - replicas: 1 ----- - -This will create a new deployment on OpenShift and deploy the application. - -If you want to see all the configuration elements to customize your deployment you can use the following command: -[source,options="nowrap",subs="+attributes"] ----- -$ helm show readme {helmChartName} ----- - -Let’s wait for the application to be built and deployed: -[source,options="nowrap",subs="+attributes"] ----- -$ oc get deployment {artifactId} -w -NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE -{artifactId} 1 1 1 0 12s -... -{artifactId} 1 1 1 1 2m ----- - -Get the URL of the route to the deployment. - -[source,options="nowrap",subs="+attributes"] ----- -$ oc get route {artifactId} -o jsonpath="{.spec.host}" ----- -Access the application in your web browser using the displayed URL. - -[NOTE] -==== -The Maven profile named `openshift` is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the `/{artifactId}` path segment after `HOST:PORT`. -==== - -[[undeploy_helm]] -== Undeploy the {ProductShortName} Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts - - -[source,options="nowrap",subs="+attributes"] ----- -$ helm uninstall {artifactId} ----- - -:leveloffset: 1 -// Testing on Openshift -:leveloffset: +1 - -[[run_the_arquillian_integration_tests_with_openshift]] -= Run the Arquillian Integration Tests with OpenShift -//****************************************************************************** -// Include this template if your quickstart provides Openshift Arquillian -// integration tests. -//****************************************************************************** - -This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. - -[NOTE] -==== -The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin. -==== - -Run the integration tests using the following command to run the `verify` goal with the `arq-remote` profile activated and the proper URL: -[source,options="nowrap",subs="+attributes"] ----- -$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route {artifactId} --template='{{ .spec.host }}') ----- - -[NOTE] -==== -The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from. -==== - -:leveloffset: 1 - -:leveloffset!: diff --git a/websocket-hello/README.html b/websocket-hello/README.html deleted file mode 100644 index ef5ec3aad7..0000000000 --- a/websocket-hello/README.html +++ /dev/null @@ -1,920 +0,0 @@ - - - - - - - - -websocket-hello: A simple WebSocket application - - - - - -
-
-
-
-
-The websocket-hello quickstart demonstrates how to create a simple WebSocket application. -
-
-
-
-
-

What is it?

-
-
-

The websocket-hello quickstart demonstrates how to create a simple WebSocket-enabled application in Red Hat JBoss Enterprise Application Platform. It consists of the following:

-
-
-
    -
  • -

    A JavaScript enabled WebSocket HTML client.

    -
  • -
  • -

    A WebSocket server endpoint that uses annotations to interact with the WebSocket events.

    -
  • -
  • -

    A jboss-web.xml file configured to enable WebSockets

    -
  • -
-
-
-

WebSockets are a requirement of the Jakarta EE 10 specification and are implemented in JBoss EAP 8.0. They are configured in the undertow subsystem of the server configuration file. This quickstart uses the WebSocket default settings, so it is not necessary to modify the server configuration to deploy and run this quickstart.

-
-
- - - - - -
-
Note
-
-This quickstart demonstrates only a few of the basic functions. A fully functional application should provide better error handling and intercept and handle additional events. -
-
-
-
-
-

System Requirements

-
-
-

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 8.0 or later.

-
-
-

All you need to build this project is Java 11.0 (Java SDK 11) or later and Maven 3.6.0 or later. See Configure Maven to Build and Deploy the Quickstarts to make sure you are configured correctly for testing the quickstarts.

-
-
-
-
-

Use of the EAP_HOME and QUICKSTART_HOME Variables

-
-
-

In the following instructions, replace EAP_HOME with the actual path to your JBoss EAP installation. The installation path is described in detail here: Use of EAP_HOME and JBOSS_HOME Variables.

-
-
-

When you see the replaceable variable QUICKSTART_HOME, replace it with the path to the root directory of all of the quickstarts.

-
-
-
-
-

Building and running the quickstart application with a JBoss EAP server distribution

-
-
-

Start the JBoss EAP Standalone Server

-
-
    -
  1. -

    Open a terminal and navigate to the root of the JBoss EAP directory.

    -
  2. -
  3. -

    Start the JBoss EAP server with the default profile by typing the following command.

    -
    -
    -
    $ EAP_HOME/bin/standalone.sh 
    -
    -
    -
    - - - - - -
    -
    Note
    -
    -For Windows, use the EAP_HOME\bin\standalone.bat script. -
    -
    -
  4. -
-
-
-
-

Build and Deploy the Quickstart

-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type the following command to build the quickstart.

    -
    -
    -
    $ mvn clean package
    -
    -
    -
  6. -
  7. -

    Type the following command to deploy the quickstart.

    -
    -
    -
    $ mvn wildfly:deploy
    -
    -
    -
  8. -
-
-
-

This deploys the websocket-hello/target/websocket-hello.war to the running instance of the server.

-
-
-

You should see a message in the server log indicating that the archive deployed successfully.

-
-
-
-

Access the Application

-
-

The application will be running at the following URL: http://localhost:8080/websocket-hello/.

-
-
-
    -
  1. -

    Click on the Open Connection button to create the WebSocket connection and display current status of Open.

    -
  2. -
  3. -

    Type a name and click Say Hello to create and send the Say hello to NAME message. The message appears in the server log and a response is sent to the client.

    -
  4. -
  5. -

    Click on the Close Connection button to close the WebSocket connection and display the current status of Closed.

    -
  6. -
  7. -

    If you attempt to send another message after closing the connection, the following message appears on the page:

    -
    -
    -
    WebSocket connection is not established. Please click the Open Connection button.
    -
    -
    -
  8. -
-
-
-
-

Run the Arquillian Integration Tests

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
-

Follow these steps to run the integration tests.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server, as previously described.

    -
  2. -
  3. -

    Make sure you build and deploy the quickstart, as previously described.

    -
  4. -
  5. -

    Type the following command to run the verify goal with the arq-remote profile activated.

    -
    -
    -
    $ mvn verify -Parq-remote
    -
    -
    -
  6. -
-
-
- - - - - -
-
Note
-
-
-

You may also use the environment variable SERVER_HOST or the system property server.host to define the target host of the tests.

-
-
-
-
-
-

Undeploy the Quickstart

-
-

When you are finished testing the quickstart, follow these steps to undeploy the archive.

-
-
-
    -
  1. -

    Make sure you start the JBoss EAP server as described above.

    -
  2. -
  3. -

    Open a terminal and navigate to the root directory of this quickstart.

    -
  4. -
  5. -

    Type this command to undeploy the archive:

    -
    -
    -
    $ mvn wildfly:undeploy
    -
    -
    -
  6. -
-
-
-
-
-
-

Building and running the quickstart application with OpenShift

-
-
-

Build the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

On OpenShift, the S2I build with Apache Maven will use an openshift profile used to provision a JBoss EAP server to deploy and run the quickstart in OpenShift environment. -You can activate the Maven profile named openshift when building the quickstart:

-
-
-
-
$ mvn clean package -Popenshift
-
-
-
-

The provisioned JBoss EAP server for OpenShift, with the quickstart deployed, can then be found in the target/server directory, and its usage is similar to a standard server distribution. -You may note that it uses the cloud feature pack which enables a configuration tuned for OpenShift environment.

-
-
-

The server provisioning functionality is provided by the EAP Maven Plugin, and you may find its configuration in the quickstart pom.xml:

-
-
-
-
        <profile>
-            <id>openshift</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.jboss.eap.plugins</groupId>
-                        <artifactId>eap-maven-plugin</artifactId>
-                        <version>${version.eap.maven.plugin}</version>
-                        <configuration>
-                            <feature-packs>
-                                <feature-pack>
-                                    <location>org.jboss.eap:wildfly-ee-galleon-pack</location>
-                                </feature-pack>
-                                <feature-pack>
-                                    <location>org.jboss.eap.cloud:eap-cloud-galleon-pack</location>
-                                </feature-pack>
-                            </feature-packs>
-                            <layers>
-                                <layer>cloud-server</layer>
-                            </layers>
-                            <filename>ROOT.war</filename>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>package</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-
-
-
- - - - - -
-
Note
-
-
-

Since the plugin configuration above deploys quickstart on root web context of the provisioned server, the URL to access the application should not have the /websocket-hello path segment after HOST:PORT.

-
-
-
-
-
-

Getting Started with JBoss EAP for OpenShift and Helm Charts

-
-

This section contains the basic instructions to build and deploy this quickstart to JBoss EAP for OpenShift or JBoss EAP for OpenShift Online using Helm Charts.

-
-
-

Prerequisites

-
-
    -
  • -

    You must be logged in OpenShift and have an oc client to connect to OpenShift

    -
  • -
  • -

    Helm must be installed to deploy the backend on OpenShift.

    -
  • -
-
-
-

Once you have installed Helm, you need to add the repository that provides Helm Charts for JBoss EAP.

-
-
-
-
$ helm repo add jboss-eap https://jbossas.github.io/eap-charts/
-"jboss-eap" has been added to your repositories
-$ helm search repo jboss-eap
-NAME                    CHART VERSION   APP VERSION     DESCRIPTION
-jboss-eap/eap8         ...             ...             A Helm chart to build and deploy EAP 8.0 applications
-
-
-
-
-

Deploy the JBoss EAP Source-to-Image (S2I) Quickstart to OpenShift with Helm Charts

-
-

Log in to your OpenShift instance using the oc login command. -The backend will be built and deployed on OpenShift with a Helm Chart for JBoss EAP.

-
-
-

Navigate to the root directory of this quickstart and run the following command:

-
-
-
-
$ helm install websocket-hello -f charts/helm.yaml jboss-eap/eap8
-NAME: websocket-hello
-...
-STATUS: deployed
-REVISION: 1
-
-
-
-

The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17:

-
-
-
-
build:
-  uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git
-  ref: 8.0.x
-  contextDir: websocket-hello
-deploy:
-  replicas: 1
-
-
-
-

This will create a new deployment on OpenShift and deploy the application.

-
-
-

If you want to see all the configuration elements to customize your deployment you can use the following command:

-
-
-
-
$ helm show readme jboss-eap/eap8
-
-
-
-

Let’s wait for the application to be built and deployed:

-
-
-
-
$ oc get deployment websocket-hello -w
-NAME         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
-websocket-hello   1         1         1            0           12s
-...
-websocket-hello   1         1         1            1           2m
-
-
-
-

Get the URL of the route to the deployment.

-
-
-
-
$ oc get route websocket-hello -o jsonpath="{.spec.host}"
-
-
-
-

Access the application in your web browser using the displayed URL.

-
-
- - - - - -
-
Note
-
-
-

The Maven profile named openshift is used by the Helm chart to provision the server with the quickstart deployed on the root web context, and thus the application should be accessed with the URL without the /websocket-hello path segment after HOST:PORT.

-
-
-
-
-
-

Undeploy the JBoss EAP Source-to-Image (S2I) Quickstart from OpenShift with Helm Charts

-
-
-
$ helm uninstall websocket-hello
-
-
-
-
-
-

Run the Arquillian Integration Tests with OpenShift

-
-

This quickstart includes Arquillian integration tests. They are located under the src/test/ directory. The integration tests verify that the quickstart runs correctly when deployed on the server.

-
-
- - - - - -
-
Note
-
-
-

The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin.

-
-
-
-
-

Run the integration tests using the following command to run the verify goal with the arq-remote profile activated and the proper URL:

-
-
-
-
$ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route websocket-hello --template='{{ .spec.host }}')
-
-
-
- - - - - -
-
Note
-
-
-

The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from.

-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/websocket-hello/charts/helm.yaml b/websocket-hello/charts/helm.yaml deleted file mode 100644 index 84867585ce..0000000000 --- a/websocket-hello/charts/helm.yaml +++ /dev/null @@ -1,6 +0,0 @@ -build: - uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git - ref: 8.0.x - contextDir: websocket-hello -deploy: - replicas: 2 \ No newline at end of file diff --git a/websocket-hello/pom.xml b/websocket-hello/pom.xml deleted file mode 100644 index c0dd8f2f67..0000000000 --- a/websocket-hello/pom.xml +++ /dev/null @@ -1,236 +0,0 @@ - - - - 4.0.0 - - org.jboss.eap.quickstarts - jboss-eap-quickstart-parent - - 6.0.0.redhat-00001 - - - - websocket-hello - 8.0.0.GA - war - Quickstart: websocket-hello - This project demonstrates a simple Hello WebSocket application - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - 8.0.0.GA-redhat-00009 - 1.0.0.Final-redhat-00014 - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - never - - default - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - never - - - true - never - - default - - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - - - true - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - - - true - - - - - - - - - org.jboss.bom - jboss-eap-ee-with-tools - ${version.server.bom} - pom - import - - - - - - - jakarta.websocket - jakarta.websocket-api - provided - - - jakarta.websocket - jakarta.websocket-client-api - provided - - - org.junit.jupiter - junit-jupiter-api - 5.9.1 - test - - - org.junit.jupiter - junit-jupiter-params - 5.9.1 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.9.1 - test - - - - org.jboss.arquillian.junit5 - arquillian-junit5-container - test - - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet-jakarta - test - - - - - - openshift - - - - org.jboss.eap.plugins - eap-maven-plugin - ${version.eap.maven.plugin} - - - - - org.jboss.eap.channels - eap-8.0 - - - - - - org.jboss.eap:wildfly-ee-galleon-pack - - - org.jboss.eap.cloud:eap-cloud-galleon-pack - - - - cloud-server - - ROOT.war - - - - - package - - - - - - - - - arq-remote - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} - - - **/RemoteWebSocketIT - - - **/ProvisionedManagedWebsocketIT - - - - - - integration-test - verify - - - - - - - - - diff --git a/websocket-hello/src/main/java/org/jboss/as/quickstarts/websocket_hello/HelloName.java b/websocket-hello/src/main/java/org/jboss/as/quickstarts/websocket_hello/HelloName.java deleted file mode 100644 index 6ac0f64af3..0000000000 --- a/websocket-hello/src/main/java/org/jboss/as/quickstarts/websocket_hello/HelloName.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.websocket_hello; - -import jakarta.websocket.CloseReason; -import jakarta.websocket.OnClose; -import jakarta.websocket.OnMessage; -import jakarta.websocket.OnOpen; -import jakarta.websocket.Session; -import jakarta.websocket.server.ServerEndpoint; - -@ServerEndpoint("/websocket/helloName") -public class HelloName { - - @OnMessage - public String sayHello(String name) { - System.out.println("Say hello to '" + name + "'"); - return ("Hello " + name + " from websocket endpoint"); - } - - @OnOpen - public void helloOnOpen(Session session) { - System.out.println("WebSocket opened: " + session.getId()); - } - - @OnClose - public void helloOnClose(CloseReason reason) { - System.out.println("WebSocket connection closed with CloseCode: " + reason.getCloseCode()); - } -} diff --git a/websocket-hello/src/main/webapp/index.html b/websocket-hello/src/main/webapp/index.html deleted file mode 100644 index 71121d23b6..0000000000 --- a/websocket-hello/src/main/webapp/index.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - WebSocket: Say Hello - - - - - -
-

Welcome to Red Hat JBoss Enterprise Application Platform!

-
This is a simple example of a WebSocket implementation.
-
-
-
- Connect or disconnect using websocket : - - -
-
-
-
- Type your name below, then click the `Say Hello` button : - - -
-
-
Current WebSocket Connection Status: Closed
-
- -
-
-
- - diff --git a/websocket-hello/src/main/webapp/resources/css/hello.css b/websocket-hello/src/main/webapp/resources/css/hello.css deleted file mode 100644 index df11e15091..0000000000 --- a/websocket-hello/src/main/webapp/resources/css/hello.css +++ /dev/null @@ -1,42 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* Core styles for the page */ -output.message { - color: blue; - font-style: italic; -} - -output.success { - color: green; - font-style: normal; -} - -output.error { - color: red; - font-weight: bold; - font-style: normal; -} - -div { - padding: 10px; -} - -fieldset { - border-radius:10px; - padding: 10px; -} - diff --git a/websocket-hello/src/test/java/org/jboss/as/quickstarts/websocket_hello/EchoListener.java b/websocket-hello/src/test/java/org/jboss/as/quickstarts/websocket_hello/EchoListener.java deleted file mode 100644 index be58e5684f..0000000000 --- a/websocket-hello/src/test/java/org/jboss/as/quickstarts/websocket_hello/EchoListener.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.jboss.as.quickstarts.websocket_hello; - - -/* - * Copyright 2022 Red Hat, Inc. - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -import java.net.http.WebSocket; -import java.util.concurrent.CompletionStage; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -public class EchoListener implements WebSocket.Listener { - - private static final Logger logger = Logger.getLogger(EchoListener.class.getName()); - private boolean connected = false; - private StringBuilder buffer = new StringBuilder(); - private String message = null; - - @Override - public void onOpen(WebSocket webSocket) { - logger.info("CONNECTED"); - connected = true; - WebSocket.Listener.super.onOpen(webSocket); - } - - @Override - public CompletionStage onText(WebSocket webSocket, CharSequence data, boolean last) { - logger.info("Receiving Message -->"); - logger.info(String.format("onText received a data: %s", data)); - buffer.append(data); - if(last) { - message = buffer.toString(); - buffer = new StringBuilder(); - } - return WebSocket.Listener.super.onText(webSocket, data, last); - } - - public String getMessage() { - return message; - } - - @Override - public void onError(WebSocket webSocket, Throwable error) { - logger.log(Level.SEVERE, "Error!" + webSocket.toString(), error); - WebSocket.Listener.super.onError(webSocket, error); - } - - @Override - public CompletionStage onClose(WebSocket webSocket, int statusCode, String reason) { - logger.info("CLOSING"); - connected = false; - logger.info(String.format("Closed with status %d, and reason: %s", statusCode, reason)); - return WebSocket.Listener.super.onClose(webSocket, statusCode, reason); - } - - public boolean isConnected() { - return connected; - } -} diff --git a/websocket-hello/src/test/java/org/jboss/as/quickstarts/websocket_hello/ProvisionedManagedWebsocketIT.java b/websocket-hello/src/test/java/org/jboss/as/quickstarts/websocket_hello/ProvisionedManagedWebsocketIT.java deleted file mode 100644 index 2e46618bc3..0000000000 --- a/websocket-hello/src/test/java/org/jboss/as/quickstarts/websocket_hello/ProvisionedManagedWebsocketIT.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2022 Red Hat, Inc. - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jboss.as.quickstarts.websocket_hello; - -import java.net.URI; -import java.net.URISyntaxException; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit5.ArquillianExtension; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -@ExtendWith(ArquillianExtension.class) -@RunAsClient -public class ProvisionedManagedWebsocketIT extends RemoteWebSocketIT { - - @Override - protected URI getWebSocketEndpoint() { - String host = getServerHost(); - if (host == null) { - host = "ws://localhost:8080"; - } - try { - return new URI(host + "/websocket/helloName"); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } - - @Test - public void testConnectOk() throws Exception { - testWebSocket(500); - } -} diff --git a/websocket-hello/src/test/java/org/jboss/as/quickstarts/websocket_hello/RemoteWebSocketIT.java b/websocket-hello/src/test/java/org/jboss/as/quickstarts/websocket_hello/RemoteWebSocketIT.java deleted file mode 100644 index 7252cb70cf..0000000000 --- a/websocket-hello/src/test/java/org/jboss/as/quickstarts/websocket_hello/RemoteWebSocketIT.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2022 Red Hat, Inc. - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jboss.as.quickstarts.websocket_hello; - -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.http.HttpClient; -import java.net.http.WebSocket; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -public class RemoteWebSocketIT { - - protected URI getWebSocketEndpoint() { - String host = getServerHost(); - if (host == null) { - host = "ws://localhost:8080/websocket-hello"; - } - try { - return new URI(host + "/websocket/helloName"); - } catch (URISyntaxException ex) { - throw new RuntimeException(ex); - } - } - - protected static String getServerHost() { - String host = System.getenv("SERVER_HOST"); - if (host == null) { - host = System.getProperty("server.host"); - } - if(host != null) { - host= host.replaceFirst("http", "ws"); - } - return host; - } - - @Test - public void testConnectOk() throws Exception { - testWebSocket(2000); - } - - public void testWebSocket(long wait) throws IOException, InterruptedException { - EchoListener listener = new EchoListener(); - WebSocket webSocket = HttpClient.newHttpClient() - .newWebSocketBuilder() - .buildAsync(getWebSocketEndpoint(), listener) - .join(); - Assertions.assertTrue(listener.isConnected(), "Connection should be opened"); - webSocket.sendText("Bart", true); - Thread.sleep(wait); - Assertions.assertEquals("Hello Bart from websocket endpoint", listener.getMessage()); - webSocket.sendClose(WebSocket.NORMAL_CLOSURE, "Done"); - Thread.sleep(wait); - Assertions.assertTrue(webSocket.isOutputClosed(), "Connection should be closed"); - Assertions.assertFalse(listener.isConnected(), "Connection should be closed"); - webSocket.abort(); - Assertions.assertTrue(webSocket.isInputClosed(), "Connection should be closed"); - } - -} diff --git a/websocket-hello/src/test/resources/arquillian.xml b/websocket-hello/src/test/resources/arquillian.xml deleted file mode 100644 index 31d4c3cc43..0000000000 --- a/websocket-hello/src/test/resources/arquillian.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - From d00e6cbf7ac912be6efb125fde929e7ea6d438c0 Mon Sep 17 00:00:00 2001 From: Factory Droid Date: Thu, 18 Jul 2024 23:21:43 -0700 Subject: [PATCH 2/4] Migration Plan for PRO-337 --- droid_migration/PRO-337_migration_plan.md | 210 ++++++++++++ droid_migration/PRO-337_setup_guide.md | 370 ++++++++++++++++++++++ 2 files changed, 580 insertions(+) create mode 100644 droid_migration/PRO-337_migration_plan.md create mode 100644 droid_migration/PRO-337_setup_guide.md diff --git a/droid_migration/PRO-337_migration_plan.md b/droid_migration/PRO-337_migration_plan.md new file mode 100644 index 0000000000..b2c060cc21 --- /dev/null +++ b/droid_migration/PRO-337_migration_plan.md @@ -0,0 +1,210 @@ + +# Migration Plan: JBoss 'kitchensink' to Spring Boot with Java 21 + +## Table of Contents +1. [Introduction](#introduction) +2. [Pre-Migration Analysis](#pre-migration-analysis) +3. [Migration Phases](#migration-phases) + 3.1. [Phase 1: Project Setup and Infrastructure](#phase-1-project-setup-and-infrastructure) + 3.2. [Phase 2: Core Application Migration](#phase-2-core-application-migration) + 3.3. [Phase 3: Database Migration](#phase-3-database-migration) + 3.4. [Phase 4: Testing and Quality Assurance](#phase-4-testing-and-quality-assurance) + 3.5. [Phase 5: Deployment and DevOps](#phase-5-deployment-and-devops) +4. [Risk Mitigation Strategies](#risk-mitigation-strategies) +5. [Conclusion](#conclusion) + +## 1. Introduction + +This document outlines a comprehensive plan to migrate the JBoss 'kitchensink' application from the Red Hat JBoss EAP Quickstarts repository to a Spring Boot application based on Java 21. The migration process is designed with scalability in mind, suitable for larger applications, and includes an optional phase for migrating to MongoDB. + +## 2. Pre-Migration Analysis + +### Current State of Artifacts + +#### Source Code Structure: +- `src/main/java/org/jboss/as/quickstarts/kitchensink/` + - `controller/`: Contains `MemberController.java` + - `data/`: Contains `MemberListProducer.java` and `MemberRepository.java` + - `model/`: Contains `Member.java` + - `rest/`: Contains `JaxRsActivator.java` and `MemberResourceRESTService.java` + - `service/`: Contains `MemberRegistration.java` + - `util/`: Contains `Resources.java` + +#### Configuration Files: +- `pom.xml`: Maven project configuration +- `src/main/resources/META-INF/persistence.xml`: JPA configuration +- `src/main/webapp/WEB-INF/beans.xml`: CDI configuration +- `src/main/webapp/WEB-INF/faces-config.xml`: JSF configuration + +#### Frontend: +- `src/main/webapp/`: Contains JSF views and resources + +#### Test Files: +- `src/test/java/org/jboss/as/quickstarts/kitchensink/test/`: Contains Arquillian tests + +### Technology Stack: +- Java EE 7 +- CDI (Contexts and Dependency Injection) +- JPA (Java Persistence API) +- EJB (Enterprise JavaBeans) +- JAX-RS (Java API for RESTful Web Services) +- Bean Validation +- JSF (JavaServer Faces) +- Arquillian for testing + +## 3. Migration Phases + +### 3.1 Phase 1: Project Setup and Infrastructure + +#### 3.1.1 Initialize Spring Boot Project +- Create a new Spring Boot project using Spring Initializr +- Configure project with necessary dependencies: + - Spring Web + - Spring Data JPA + - H2 Database (for initial development) + - Validation + - Lombok + +#### 3.1.2 Set Up Version Control +- Initialize Git repository +- Create `.gitignore` file for Spring Boot project +- Make initial commit with basic Spring Boot structure + +#### 3.1.3 Configure Build Tool +- Migrate from `pom.xml` to `build.gradle` (if using Gradle) +- Update dependencies and plugins + +#### 3.1.4 Set Up Development Environment +- Configure IDE for Spring Boot development +- Set up Java 21 JDK + +Estimated Time: 1 day +Acceleration Potential: High (70-80% faster with Project Droid and automated project setup tools) + +### 3.2 Phase 2: Core Application Migration + +#### 3.2.1 Migrate Domain Model +- Copy `Member.java` to `src/main/java/com/example/kitchensink/model/` +- Update JPA annotations to Spring Data JPA annotations +- Add Lombok annotations to reduce boilerplate code + +#### 3.2.2 Migrate Data Access Layer +- Create `MemberRepository` interface extending `JpaRepository` +- Implement custom queries using Spring Data JPA methods +- Remove `MemberListProducer.java` + +#### 3.2.3 Migrate Business Logic +- Create `MemberService` class in `src/main/java/com/example/kitchensink/service/` +- Migrate logic from `MemberRegistration.java` to `MemberService` +- Use Spring's `@Service` annotation and dependency injection + +#### 3.2.4 Migrate REST API +- Create `MemberController` class in `src/main/java/com/example/kitchensink/controller/` +- Implement REST endpoints using Spring Web annotations +- Migrate logic from `MemberResourceRESTService.java` to `MemberController` + +#### 3.2.5 Configure Application Properties +- Create `application.properties` or `application.yml` +- Configure datasource, JPA properties, and other necessary settings + +#### 3.2.6 Implement Exception Handling +- Create global exception handler using `@ControllerAdvice` +- Implement custom exception classes if necessary + +#### 3.2.7 Migrate Bean Validation +- Update validation annotations in the `Member` model +- Implement validation in the service layer + +Estimated Time: 3-4 days +Acceleration Potential: Medium (50-60% faster with Code Droid and automated code migration tools) + +### 3.3 Phase 3: Database Migration + +#### 3.3.1 Set Up MongoDB +- Add Spring Data MongoDB dependency +- Configure MongoDB connection in `application.properties` + +#### 3.3.2 Refactor Domain Model +- Update `Member` class to use MongoDB annotations +- Remove JPA-specific annotations + +#### 3.3.3 Update Repository Layer +- Modify `MemberRepository` to extend `MongoRepository` +- Refactor custom queries to use MongoDB query methods + +#### 3.3.4 Update Service Layer +- Refactor `MemberService` to work with MongoDB operations +- Update any JPA-specific logic to MongoDB equivalents + +#### 3.3.5 Data Migration +- Develop a script to migrate data from the relational database to MongoDB +- Test data migration in a staging environment + +Estimated Time: 2-3 days +Acceleration Potential: Medium (40-50% faster with database migration tools and scripts) + +### 3.4 Phase 4: Testing and Quality Assurance + +#### 3.4.1 Unit Testing +- Set up JUnit 5 and Mockito for unit testing +- Migrate existing unit tests from Arquillian to JUnit 5 +- Implement new unit tests for services and controllers + +#### 3.4.2 Integration Testing +- Set up Spring Boot Test for integration testing +- Implement integration tests for repository layer and REST API +- Use TestContainers for database integration tests + +#### 3.4.3 API Testing +- Implement API tests using REST Assured or similar tool +- Create test suites for different API scenarios + +#### 3.4.4 Performance Testing +- Set up JMeter or Gatling for performance testing +- Create performance test scenarios +- Establish performance benchmarks + +Estimated Time: 3-4 days +Acceleration Potential: Medium (50-60% faster with Test Droid and automated test generation tools) + +### 3.5 Phase 5: Deployment and DevOps + +#### 3.5.1 Containerization +- Create Dockerfile for the Spring Boot application +- Set up Docker Compose for local development + +#### 3.5.2 Kubernetes Configuration +- Create Kubernetes deployment YAML files +- Set up Kubernetes services and ingress + +#### 3.5.3 CI/CD Pipeline +- Set up GitHub Actions or Jenkins for CI/CD +- Configure build, test, and deployment jobs + +#### 3.5.4 Monitoring and Observability +- Implement Spring Boot Actuator for application metrics +- Set up Prometheus and Grafana for monitoring +- Implement distributed tracing with Zipkin or Jaeger + +#### 3.5.5 Production Deployment +- Set up staging and production environments +- Implement blue-green or canary deployment strategy + +Estimated Time: 3-4 days +Acceleration Potential: High (60-70% faster with DevOps Droid and infrastructure-as-code tools) + +## 4. Risk Mitigation Strategies + +1. **Incremental Migration**: Migrate one component at a time, ensuring each works before moving to the next. +2. **Comprehensive Testing**: Maintain high test coverage throughout the migration process. +3. **Feature Parity Validation**: Ensure all existing functionalities are preserved in the new system. +4. **Rollback Plan**: Maintain the ability to revert to the old system at each stage of the migration. +5. **Performance Monitoring**: Continuously monitor and compare performance metrics between old and new systems. +6. **Data Integrity Checks**: Implement thorough data validation during and after the MongoDB migration. +7. **Gradual Rollout**: Use feature flags to gradually introduce new components in production. + +## 5. Conclusion + +This migration plan outlines a structured approach to modernize the JBoss 'kitchensink' application to a Spring Boot application with Java 21, including an optional MongoDB migration. By following this plan and leveraging acceleration tools, the migration process can be significantly streamlined while maintaining code quality and minimizing risks. + +The estimated total time for this migration is 12-16 days, with potential for 50-60% acceleration using various AI-powered tools and automation techniques. This approach ensures a smooth transition from the legacy JBoss EAP application to a modern, cloud-ready Spring Boot application. diff --git a/droid_migration/PRO-337_setup_guide.md b/droid_migration/PRO-337_setup_guide.md new file mode 100644 index 0000000000..eaa9ca02e5 --- /dev/null +++ b/droid_migration/PRO-337_setup_guide.md @@ -0,0 +1,370 @@ + +# Setup Guide for JBoss 'kitchensink' to Spring Boot Migration + +## Table of Contents +1. [Prerequisites](#prerequisites) +2. [Project Structure](#project-structure) +3. [Development Environment Setup](#development-environment-setup) +4. [Spring Boot Project Initialization](#spring-boot-project-initialization) +5. [Version Control Setup](#version-control-setup) +6. [Build Tool Configuration](#build-tool-configuration) +7. [Database Setup](#database-setup) +8. [Testing Framework Setup](#testing-framework-setup) +9. [CI/CD and Deployment Setup](#cicd-and-deployment-setup) + +## 1. Prerequisites + +Ensure you have the following software installed: + +- Java Development Kit (JDK) 21 +- Git +- Gradle 7.x or Maven 3.x +- Docker and Docker Compose +- Kubernetes CLI (kubectl) +- Your preferred IDE (e.g., IntelliJ IDEA, Eclipse, VS Code) + +## 2. Project Structure + +We'll create a new directory for the Spring Boot project within the existing repository: + +``` +jboss-eap-quickstarts/ +├── kitchensink/ # Original JBoss project +└── kitchensink-spring-boot/ # New Spring Boot project +``` + +## 3. Development Environment Setup + +1. Install Java 21: + ``` + sudo apt-get update + sudo apt-get install openjdk-21-jdk + ``` + +2. Verify Java installation: + ``` + java -version + ``` + +3. Install your preferred IDE (e.g., IntelliJ IDEA, Eclipse, VS Code) + +4. Install Git: + ``` + sudo apt-get install git + ``` + +5. Install Gradle or Maven (if not already installed): + ``` + sudo apt-get install gradle + # or + sudo apt-get install maven + ``` + +6. Install Docker and Docker Compose: + ``` + sudo apt-get install docker.io docker-compose + ``` + +7. Install Kubernetes CLI: + ``` + sudo snap install kubectl --classic + ``` + +## 4. Spring Boot Project Initialization + +1. Navigate to the jboss-eap-quickstarts directory: + ``` + cd jboss-eap-quickstarts + ``` + +2. Create a new directory for the Spring Boot project: + ``` + mkdir kitchensink-spring-boot + cd kitchensink-spring-boot + ``` + +3. Use Spring Initializr to create a new Spring Boot project: + ``` + curl https://start.spring.io/starter.tgz -d dependencies=web,data-jpa,h2,validation,lombok -d type=gradle-project -d bootVersion=3.1.0 -d baseDir=. | tar -xzvf - + ``` + + This command creates a new Spring Boot project with the following dependencies: + - Spring Web + - Spring Data JPA + - H2 Database + - Validation + - Lombok + +## 5. Version Control Setup + +1. Initialize a new Git repository in the kitchensink-spring-boot directory: + ``` + git init + ``` + +2. Create a .gitignore file: + ``` + touch .gitignore + ``` + +3. Add the following content to .gitignore: + ``` + HELP.md + .gradle + build/ + !gradle/wrapper/gradle-wrapper.jar + !**/src/main/**/build/ + !**/src/test/**/build/ + + ### STS ### + .apt_generated + .classpath + .factorypath + .project + .settings + .springBeans + .sts4-cache + + ### IntelliJ IDEA ### + .idea + *.iws + *.iml + *.ipr + out/ + !**/src/main/**/out/ + !**/src/test/**/out/ + + ### NetBeans ### + /nbproject/private/ + /nbbuild/ + /dist/ + /nbdist/ + /.nb-gradle/ + + ### VS Code ### + .vscode/ + ``` + +4. Make the initial commit: + ``` + git add . + git commit -m "Initial Spring Boot project setup" + ``` + +## 6. Build Tool Configuration + +If using Gradle (default): + +1. Open `build.gradle` and ensure it contains the necessary dependencies: + + ```groovy + dependencies { + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' + compileOnly 'org.projectlombok:lombok' + runtimeOnly 'com.h2database:h2' + annotationProcessor 'org.projectlombok:lombok' + testImplementation 'org.springframework.boot:spring-boot-starter-test' + } + ``` + +If using Maven: + +1. Open `pom.xml` and ensure it contains the necessary dependencies: + + ```xml + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-validation + + + org.projectlombok + lombok + true + + + com.h2database + h2 + runtime + + + org.springframework.boot + spring-boot-starter-test + test + + + ``` + +## 7. Database Setup + +For initial development (H2 database): + +1. Open `src/main/resources/application.properties` and add: + + ``` + spring.datasource.url=jdbc:h2:mem:testdb + spring.datasource.driverClassName=org.h2.Driver + spring.datasource.username=sa + spring.datasource.password=password + spring.jpa.database-platform=org.hibernate.dialect.H2Dialect + spring.h2.console.enabled=true + ``` + +For MongoDB setup (optional): + +1. Add MongoDB dependency to `build.gradle` or `pom.xml`: + + Gradle: + ```groovy + implementation 'org.springframework.boot:spring-boot-starter-data-mongodb' + ``` + + Maven: + ```xml + + org.springframework.boot + spring-boot-starter-data-mongodb + + ``` + +2. Update `application.properties` for MongoDB: + + ``` + spring.data.mongodb.host=localhost + spring.data.mongodb.port=27017 + spring.data.mongodb.database=kitchensink + ``` + +## 8. Testing Framework Setup + +1. JUnit 5 and Mockito are included by default with Spring Boot Starter Test. + +2. Create a test directory structure: + ``` + mkdir -p src/test/java/com/example/kitchensink + ``` + +3. Create a sample test class to verify the setup: + ```java + package com.example.kitchensink; + + import org.junit.jupiter.api.Test; + import org.springframework.boot.test.context.SpringBootTest; + + @SpringBootTest + class KitchensinkApplicationTests { + + @Test + void contextLoads() { + } + + } + ``` + +## 9. CI/CD and Deployment Setup + +1. Create a Dockerfile in the project root: + ``` + touch Dockerfile + ``` + +2. Add the following content to the Dockerfile: + ```dockerfile + FROM openjdk:21-jdk-slim + VOLUME /tmp + ARG JAR_FILE=target/*.jar + COPY ${JAR_FILE} app.jar + ENTRYPOINT ["java","-jar","/app.jar"] + ``` + +3. Create a docker-compose.yml file: + ``` + touch docker-compose.yml + ``` + +4. Add the following content to docker-compose.yml: + ```yaml + version: '3' + services: + app: + build: . + ports: + - "8080:8080" + mongodb: + image: mongo:latest + ports: + - "27017:27017" + ``` + +5. For Kubernetes setup, create a deployment.yaml file: + ``` + touch deployment.yaml + ``` + +6. Add the following content to deployment.yaml: + ```yaml + apiVersion: apps/v1 + kind: Deployment + metadata: + name: kitchensink-app + spec: + replicas: 1 + selector: + matchLabels: + app: kitchensink + template: + metadata: + labels: + app: kitchensink + spec: + containers: + - name: kitchensink + image: your-docker-registry/kitchensink:latest + ports: + - containerPort: 8080 + ``` + +7. For CI/CD, create a .github/workflows directory and add a main.yml file: + ``` + mkdir -p .github/workflows + touch .github/workflows/main.yml + ``` + +8. Add the following content to main.yml for a basic GitHub Actions workflow: + ```yaml + name: CI/CD + + on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + + jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 21 + uses: actions/setup-java@v2 + with: + java-version: '21' + distribution: 'adopt' + - name: Build with Gradle + run: ./gradlew build + - name: Run tests + run: ./gradlew test + ``` + +This completes the setup guide for the JBoss 'kitchensink' to Spring Boot migration project. You now have a development environment ready for the migration process, with the necessary tools and configurations in place. From bcbff8b6316e15a53a4853fbde6c3c13eff15f3f Mon Sep 17 00:00:00 2001 From: Shivam Trivedi <52181001+shivamtrivedi@users.noreply.github.com> Date: Wed, 20 Aug 2025 13:00:45 -0700 Subject: [PATCH 3/4] Cleanup --- droid_migration/PRO-337_migration_plan.md | 210 ------------ droid_migration/PRO-337_setup_guide.md | 370 ---------------------- 2 files changed, 580 deletions(-) delete mode 100644 droid_migration/PRO-337_migration_plan.md delete mode 100644 droid_migration/PRO-337_setup_guide.md diff --git a/droid_migration/PRO-337_migration_plan.md b/droid_migration/PRO-337_migration_plan.md deleted file mode 100644 index b2c060cc21..0000000000 --- a/droid_migration/PRO-337_migration_plan.md +++ /dev/null @@ -1,210 +0,0 @@ - -# Migration Plan: JBoss 'kitchensink' to Spring Boot with Java 21 - -## Table of Contents -1. [Introduction](#introduction) -2. [Pre-Migration Analysis](#pre-migration-analysis) -3. [Migration Phases](#migration-phases) - 3.1. [Phase 1: Project Setup and Infrastructure](#phase-1-project-setup-and-infrastructure) - 3.2. [Phase 2: Core Application Migration](#phase-2-core-application-migration) - 3.3. [Phase 3: Database Migration](#phase-3-database-migration) - 3.4. [Phase 4: Testing and Quality Assurance](#phase-4-testing-and-quality-assurance) - 3.5. [Phase 5: Deployment and DevOps](#phase-5-deployment-and-devops) -4. [Risk Mitigation Strategies](#risk-mitigation-strategies) -5. [Conclusion](#conclusion) - -## 1. Introduction - -This document outlines a comprehensive plan to migrate the JBoss 'kitchensink' application from the Red Hat JBoss EAP Quickstarts repository to a Spring Boot application based on Java 21. The migration process is designed with scalability in mind, suitable for larger applications, and includes an optional phase for migrating to MongoDB. - -## 2. Pre-Migration Analysis - -### Current State of Artifacts - -#### Source Code Structure: -- `src/main/java/org/jboss/as/quickstarts/kitchensink/` - - `controller/`: Contains `MemberController.java` - - `data/`: Contains `MemberListProducer.java` and `MemberRepository.java` - - `model/`: Contains `Member.java` - - `rest/`: Contains `JaxRsActivator.java` and `MemberResourceRESTService.java` - - `service/`: Contains `MemberRegistration.java` - - `util/`: Contains `Resources.java` - -#### Configuration Files: -- `pom.xml`: Maven project configuration -- `src/main/resources/META-INF/persistence.xml`: JPA configuration -- `src/main/webapp/WEB-INF/beans.xml`: CDI configuration -- `src/main/webapp/WEB-INF/faces-config.xml`: JSF configuration - -#### Frontend: -- `src/main/webapp/`: Contains JSF views and resources - -#### Test Files: -- `src/test/java/org/jboss/as/quickstarts/kitchensink/test/`: Contains Arquillian tests - -### Technology Stack: -- Java EE 7 -- CDI (Contexts and Dependency Injection) -- JPA (Java Persistence API) -- EJB (Enterprise JavaBeans) -- JAX-RS (Java API for RESTful Web Services) -- Bean Validation -- JSF (JavaServer Faces) -- Arquillian for testing - -## 3. Migration Phases - -### 3.1 Phase 1: Project Setup and Infrastructure - -#### 3.1.1 Initialize Spring Boot Project -- Create a new Spring Boot project using Spring Initializr -- Configure project with necessary dependencies: - - Spring Web - - Spring Data JPA - - H2 Database (for initial development) - - Validation - - Lombok - -#### 3.1.2 Set Up Version Control -- Initialize Git repository -- Create `.gitignore` file for Spring Boot project -- Make initial commit with basic Spring Boot structure - -#### 3.1.3 Configure Build Tool -- Migrate from `pom.xml` to `build.gradle` (if using Gradle) -- Update dependencies and plugins - -#### 3.1.4 Set Up Development Environment -- Configure IDE for Spring Boot development -- Set up Java 21 JDK - -Estimated Time: 1 day -Acceleration Potential: High (70-80% faster with Project Droid and automated project setup tools) - -### 3.2 Phase 2: Core Application Migration - -#### 3.2.1 Migrate Domain Model -- Copy `Member.java` to `src/main/java/com/example/kitchensink/model/` -- Update JPA annotations to Spring Data JPA annotations -- Add Lombok annotations to reduce boilerplate code - -#### 3.2.2 Migrate Data Access Layer -- Create `MemberRepository` interface extending `JpaRepository` -- Implement custom queries using Spring Data JPA methods -- Remove `MemberListProducer.java` - -#### 3.2.3 Migrate Business Logic -- Create `MemberService` class in `src/main/java/com/example/kitchensink/service/` -- Migrate logic from `MemberRegistration.java` to `MemberService` -- Use Spring's `@Service` annotation and dependency injection - -#### 3.2.4 Migrate REST API -- Create `MemberController` class in `src/main/java/com/example/kitchensink/controller/` -- Implement REST endpoints using Spring Web annotations -- Migrate logic from `MemberResourceRESTService.java` to `MemberController` - -#### 3.2.5 Configure Application Properties -- Create `application.properties` or `application.yml` -- Configure datasource, JPA properties, and other necessary settings - -#### 3.2.6 Implement Exception Handling -- Create global exception handler using `@ControllerAdvice` -- Implement custom exception classes if necessary - -#### 3.2.7 Migrate Bean Validation -- Update validation annotations in the `Member` model -- Implement validation in the service layer - -Estimated Time: 3-4 days -Acceleration Potential: Medium (50-60% faster with Code Droid and automated code migration tools) - -### 3.3 Phase 3: Database Migration - -#### 3.3.1 Set Up MongoDB -- Add Spring Data MongoDB dependency -- Configure MongoDB connection in `application.properties` - -#### 3.3.2 Refactor Domain Model -- Update `Member` class to use MongoDB annotations -- Remove JPA-specific annotations - -#### 3.3.3 Update Repository Layer -- Modify `MemberRepository` to extend `MongoRepository` -- Refactor custom queries to use MongoDB query methods - -#### 3.3.4 Update Service Layer -- Refactor `MemberService` to work with MongoDB operations -- Update any JPA-specific logic to MongoDB equivalents - -#### 3.3.5 Data Migration -- Develop a script to migrate data from the relational database to MongoDB -- Test data migration in a staging environment - -Estimated Time: 2-3 days -Acceleration Potential: Medium (40-50% faster with database migration tools and scripts) - -### 3.4 Phase 4: Testing and Quality Assurance - -#### 3.4.1 Unit Testing -- Set up JUnit 5 and Mockito for unit testing -- Migrate existing unit tests from Arquillian to JUnit 5 -- Implement new unit tests for services and controllers - -#### 3.4.2 Integration Testing -- Set up Spring Boot Test for integration testing -- Implement integration tests for repository layer and REST API -- Use TestContainers for database integration tests - -#### 3.4.3 API Testing -- Implement API tests using REST Assured or similar tool -- Create test suites for different API scenarios - -#### 3.4.4 Performance Testing -- Set up JMeter or Gatling for performance testing -- Create performance test scenarios -- Establish performance benchmarks - -Estimated Time: 3-4 days -Acceleration Potential: Medium (50-60% faster with Test Droid and automated test generation tools) - -### 3.5 Phase 5: Deployment and DevOps - -#### 3.5.1 Containerization -- Create Dockerfile for the Spring Boot application -- Set up Docker Compose for local development - -#### 3.5.2 Kubernetes Configuration -- Create Kubernetes deployment YAML files -- Set up Kubernetes services and ingress - -#### 3.5.3 CI/CD Pipeline -- Set up GitHub Actions or Jenkins for CI/CD -- Configure build, test, and deployment jobs - -#### 3.5.4 Monitoring and Observability -- Implement Spring Boot Actuator for application metrics -- Set up Prometheus and Grafana for monitoring -- Implement distributed tracing with Zipkin or Jaeger - -#### 3.5.5 Production Deployment -- Set up staging and production environments -- Implement blue-green or canary deployment strategy - -Estimated Time: 3-4 days -Acceleration Potential: High (60-70% faster with DevOps Droid and infrastructure-as-code tools) - -## 4. Risk Mitigation Strategies - -1. **Incremental Migration**: Migrate one component at a time, ensuring each works before moving to the next. -2. **Comprehensive Testing**: Maintain high test coverage throughout the migration process. -3. **Feature Parity Validation**: Ensure all existing functionalities are preserved in the new system. -4. **Rollback Plan**: Maintain the ability to revert to the old system at each stage of the migration. -5. **Performance Monitoring**: Continuously monitor and compare performance metrics between old and new systems. -6. **Data Integrity Checks**: Implement thorough data validation during and after the MongoDB migration. -7. **Gradual Rollout**: Use feature flags to gradually introduce new components in production. - -## 5. Conclusion - -This migration plan outlines a structured approach to modernize the JBoss 'kitchensink' application to a Spring Boot application with Java 21, including an optional MongoDB migration. By following this plan and leveraging acceleration tools, the migration process can be significantly streamlined while maintaining code quality and minimizing risks. - -The estimated total time for this migration is 12-16 days, with potential for 50-60% acceleration using various AI-powered tools and automation techniques. This approach ensures a smooth transition from the legacy JBoss EAP application to a modern, cloud-ready Spring Boot application. diff --git a/droid_migration/PRO-337_setup_guide.md b/droid_migration/PRO-337_setup_guide.md deleted file mode 100644 index eaa9ca02e5..0000000000 --- a/droid_migration/PRO-337_setup_guide.md +++ /dev/null @@ -1,370 +0,0 @@ - -# Setup Guide for JBoss 'kitchensink' to Spring Boot Migration - -## Table of Contents -1. [Prerequisites](#prerequisites) -2. [Project Structure](#project-structure) -3. [Development Environment Setup](#development-environment-setup) -4. [Spring Boot Project Initialization](#spring-boot-project-initialization) -5. [Version Control Setup](#version-control-setup) -6. [Build Tool Configuration](#build-tool-configuration) -7. [Database Setup](#database-setup) -8. [Testing Framework Setup](#testing-framework-setup) -9. [CI/CD and Deployment Setup](#cicd-and-deployment-setup) - -## 1. Prerequisites - -Ensure you have the following software installed: - -- Java Development Kit (JDK) 21 -- Git -- Gradle 7.x or Maven 3.x -- Docker and Docker Compose -- Kubernetes CLI (kubectl) -- Your preferred IDE (e.g., IntelliJ IDEA, Eclipse, VS Code) - -## 2. Project Structure - -We'll create a new directory for the Spring Boot project within the existing repository: - -``` -jboss-eap-quickstarts/ -├── kitchensink/ # Original JBoss project -└── kitchensink-spring-boot/ # New Spring Boot project -``` - -## 3. Development Environment Setup - -1. Install Java 21: - ``` - sudo apt-get update - sudo apt-get install openjdk-21-jdk - ``` - -2. Verify Java installation: - ``` - java -version - ``` - -3. Install your preferred IDE (e.g., IntelliJ IDEA, Eclipse, VS Code) - -4. Install Git: - ``` - sudo apt-get install git - ``` - -5. Install Gradle or Maven (if not already installed): - ``` - sudo apt-get install gradle - # or - sudo apt-get install maven - ``` - -6. Install Docker and Docker Compose: - ``` - sudo apt-get install docker.io docker-compose - ``` - -7. Install Kubernetes CLI: - ``` - sudo snap install kubectl --classic - ``` - -## 4. Spring Boot Project Initialization - -1. Navigate to the jboss-eap-quickstarts directory: - ``` - cd jboss-eap-quickstarts - ``` - -2. Create a new directory for the Spring Boot project: - ``` - mkdir kitchensink-spring-boot - cd kitchensink-spring-boot - ``` - -3. Use Spring Initializr to create a new Spring Boot project: - ``` - curl https://start.spring.io/starter.tgz -d dependencies=web,data-jpa,h2,validation,lombok -d type=gradle-project -d bootVersion=3.1.0 -d baseDir=. | tar -xzvf - - ``` - - This command creates a new Spring Boot project with the following dependencies: - - Spring Web - - Spring Data JPA - - H2 Database - - Validation - - Lombok - -## 5. Version Control Setup - -1. Initialize a new Git repository in the kitchensink-spring-boot directory: - ``` - git init - ``` - -2. Create a .gitignore file: - ``` - touch .gitignore - ``` - -3. Add the following content to .gitignore: - ``` - HELP.md - .gradle - build/ - !gradle/wrapper/gradle-wrapper.jar - !**/src/main/**/build/ - !**/src/test/**/build/ - - ### STS ### - .apt_generated - .classpath - .factorypath - .project - .settings - .springBeans - .sts4-cache - - ### IntelliJ IDEA ### - .idea - *.iws - *.iml - *.ipr - out/ - !**/src/main/**/out/ - !**/src/test/**/out/ - - ### NetBeans ### - /nbproject/private/ - /nbbuild/ - /dist/ - /nbdist/ - /.nb-gradle/ - - ### VS Code ### - .vscode/ - ``` - -4. Make the initial commit: - ``` - git add . - git commit -m "Initial Spring Boot project setup" - ``` - -## 6. Build Tool Configuration - -If using Gradle (default): - -1. Open `build.gradle` and ensure it contains the necessary dependencies: - - ```groovy - dependencies { - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-validation' - compileOnly 'org.projectlombok:lombok' - runtimeOnly 'com.h2database:h2' - annotationProcessor 'org.projectlombok:lombok' - testImplementation 'org.springframework.boot:spring-boot-starter-test' - } - ``` - -If using Maven: - -1. Open `pom.xml` and ensure it contains the necessary dependencies: - - ```xml - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-validation - - - org.projectlombok - lombok - true - - - com.h2database - h2 - runtime - - - org.springframework.boot - spring-boot-starter-test - test - - - ``` - -## 7. Database Setup - -For initial development (H2 database): - -1. Open `src/main/resources/application.properties` and add: - - ``` - spring.datasource.url=jdbc:h2:mem:testdb - spring.datasource.driverClassName=org.h2.Driver - spring.datasource.username=sa - spring.datasource.password=password - spring.jpa.database-platform=org.hibernate.dialect.H2Dialect - spring.h2.console.enabled=true - ``` - -For MongoDB setup (optional): - -1. Add MongoDB dependency to `build.gradle` or `pom.xml`: - - Gradle: - ```groovy - implementation 'org.springframework.boot:spring-boot-starter-data-mongodb' - ``` - - Maven: - ```xml - - org.springframework.boot - spring-boot-starter-data-mongodb - - ``` - -2. Update `application.properties` for MongoDB: - - ``` - spring.data.mongodb.host=localhost - spring.data.mongodb.port=27017 - spring.data.mongodb.database=kitchensink - ``` - -## 8. Testing Framework Setup - -1. JUnit 5 and Mockito are included by default with Spring Boot Starter Test. - -2. Create a test directory structure: - ``` - mkdir -p src/test/java/com/example/kitchensink - ``` - -3. Create a sample test class to verify the setup: - ```java - package com.example.kitchensink; - - import org.junit.jupiter.api.Test; - import org.springframework.boot.test.context.SpringBootTest; - - @SpringBootTest - class KitchensinkApplicationTests { - - @Test - void contextLoads() { - } - - } - ``` - -## 9. CI/CD and Deployment Setup - -1. Create a Dockerfile in the project root: - ``` - touch Dockerfile - ``` - -2. Add the following content to the Dockerfile: - ```dockerfile - FROM openjdk:21-jdk-slim - VOLUME /tmp - ARG JAR_FILE=target/*.jar - COPY ${JAR_FILE} app.jar - ENTRYPOINT ["java","-jar","/app.jar"] - ``` - -3. Create a docker-compose.yml file: - ``` - touch docker-compose.yml - ``` - -4. Add the following content to docker-compose.yml: - ```yaml - version: '3' - services: - app: - build: . - ports: - - "8080:8080" - mongodb: - image: mongo:latest - ports: - - "27017:27017" - ``` - -5. For Kubernetes setup, create a deployment.yaml file: - ``` - touch deployment.yaml - ``` - -6. Add the following content to deployment.yaml: - ```yaml - apiVersion: apps/v1 - kind: Deployment - metadata: - name: kitchensink-app - spec: - replicas: 1 - selector: - matchLabels: - app: kitchensink - template: - metadata: - labels: - app: kitchensink - spec: - containers: - - name: kitchensink - image: your-docker-registry/kitchensink:latest - ports: - - containerPort: 8080 - ``` - -7. For CI/CD, create a .github/workflows directory and add a main.yml file: - ``` - mkdir -p .github/workflows - touch .github/workflows/main.yml - ``` - -8. Add the following content to main.yml for a basic GitHub Actions workflow: - ```yaml - name: CI/CD - - on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - - jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 21 - uses: actions/setup-java@v2 - with: - java-version: '21' - distribution: 'adopt' - - name: Build with Gradle - run: ./gradlew build - - name: Run tests - run: ./gradlew test - ``` - -This completes the setup guide for the JBoss 'kitchensink' to Spring Boot migration project. You now have a development environment ready for the migration process, with the necessary tools and configurations in place. From 57b16ab6f46bca492770d855664f30d0e15ff8dc Mon Sep 17 00:00:00 2001 From: Shivam Trivedi <52181001+shivamtrivedi@users.noreply.github.com> Date: Thu, 2 Oct 2025 09:43:42 -0700 Subject: [PATCH 4/4] Add Spring Boot kitchensink application with migrated core components Migrate domain model, data access (Spring Data JPA), services, REST API, validation, exception handling, and configuration to Spring Boot while preserving functionality and endpoints. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- spring-boot-kitchensink/pom.xml | 56 +++++++++++++++++ .../SpringBootKitchensinkApplication.java | 11 ++++ .../kitchensink/data/MemberRepository.java | 13 ++++ .../quickstarts/kitchensink/model/Member.java | 41 +++++++++++++ .../rest/GlobalExceptionHandler.java | 32 ++++++++++ .../rest/MemberResourceController.java | 60 +++++++++++++++++++ .../service/MemberRegistration.java | 21 +++++++ .../src/main/resources/application.properties | 13 ++++ .../src/main/resources/import.sql | 2 + 9 files changed, 249 insertions(+) create mode 100644 spring-boot-kitchensink/pom.xml create mode 100644 spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/SpringBootKitchensinkApplication.java create mode 100644 spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/data/MemberRepository.java create mode 100644 spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/model/Member.java create mode 100644 spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/GlobalExceptionHandler.java create mode 100644 spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceController.java create mode 100644 spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/service/MemberRegistration.java create mode 100644 spring-boot-kitchensink/src/main/resources/application.properties create mode 100644 spring-boot-kitchensink/src/main/resources/import.sql diff --git a/spring-boot-kitchensink/pom.xml b/spring-boot-kitchensink/pom.xml new file mode 100644 index 0000000000..b6bca0e72e --- /dev/null +++ b/spring-boot-kitchensink/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 3.3.3 + + + + org.jboss.as.quickstarts + spring-boot-kitchensink + 0.0.1-SNAPSHOT + spring-boot-kitchensink + Spring Boot version of kitchensink + + 17 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-validation + + + com.h2database + h2 + runtime + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/SpringBootKitchensinkApplication.java b/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/SpringBootKitchensinkApplication.java new file mode 100644 index 0000000000..33e685d8fd --- /dev/null +++ b/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/SpringBootKitchensinkApplication.java @@ -0,0 +1,11 @@ +package org.jboss.as.quickstarts.kitchensink; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringBootKitchensinkApplication { + public static void main(String[] args) { + SpringApplication.run(SpringBootKitchensinkApplication.class, args); + } +} diff --git a/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/data/MemberRepository.java b/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/data/MemberRepository.java new file mode 100644 index 0000000000..36999996b3 --- /dev/null +++ b/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/data/MemberRepository.java @@ -0,0 +1,13 @@ +package org.jboss.as.quickstarts.kitchensink.data; + +import java.util.List; +import java.util.Optional; + +import org.jboss.as.quickstarts.kitchensink.model.Member; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface MemberRepository extends JpaRepository { + Optional findByEmail(String email); + boolean existsByEmail(String email); + List findAllByOrderByNameAsc(); +} diff --git a/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/model/Member.java b/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/model/Member.java new file mode 100644 index 0000000000..339a8a080d --- /dev/null +++ b/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/model/Member.java @@ -0,0 +1,41 @@ +package org.jboss.as.quickstarts.kitchensink.model; + +import java.io.Serializable; + +import jakarta.persistence.*; +import jakarta.validation.constraints.*; + +@SuppressWarnings("serial") +@Entity +@Table(uniqueConstraints = @UniqueConstraint(columnNames = "email")) +public class Member implements Serializable { + + @Id + @GeneratedValue + private Long id; + + @NotNull + @Size(min = 1, max = 25) + @Pattern(regexp = "[^0-9]*", message = "Must not contain numbers") + private String name; + + @NotNull + @NotEmpty + @Email + private String email; + + @NotNull + @Size(min = 10, max = 12) + @Digits(fraction = 0, integer = 12) + @Column(name = "phone_number") + private String phoneNumber; + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + public String getName() { return name; } + public void setName(String name) { this.name = name; } + public String getEmail() { return email; } + public void setEmail(String email) { this.email = email; } + public String getPhoneNumber() { return phoneNumber; } + public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } +} diff --git a/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/GlobalExceptionHandler.java b/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/GlobalExceptionHandler.java new file mode 100644 index 0000000000..66df0ab910 --- /dev/null +++ b/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/GlobalExceptionHandler.java @@ -0,0 +1,32 @@ +package org.jboss.as.quickstarts.kitchensink.rest; + +import java.util.HashMap; +import java.util.Map; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; + +@ControllerAdvice +public class GlobalExceptionHandler { + + @ExceptionHandler(MethodArgumentNotValidException.class) + public ResponseEntity> handleValidation(MethodArgumentNotValidException ex) { + Map errors = new HashMap<>(); + ex.getBindingResult().getFieldErrors().forEach(err -> errors.put(err.getField(), err.getDefaultMessage())); + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(errors); + } + + @ExceptionHandler(ConstraintViolationException.class) + public ResponseEntity> handleConstraintViolation(ConstraintViolationException ex) { + Map errors = new HashMap<>(); + for (ConstraintViolation v : ex.getConstraintViolations()) { + errors.put(v.getPropertyPath().toString(), v.getMessage()); + } + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(errors); + } +} diff --git a/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceController.java b/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceController.java new file mode 100644 index 0000000000..5acbbb32e1 --- /dev/null +++ b/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceController.java @@ -0,0 +1,60 @@ +package org.jboss.as.quickstarts.kitchensink.rest; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import jakarta.validation.Valid; + +import org.jboss.as.quickstarts.kitchensink.data.MemberRepository; +import org.jboss.as.quickstarts.kitchensink.model.Member; +import org.jboss.as.quickstarts.kitchensink.service.MemberRegistration; +import org.springframework.dao.DataIntegrityViolationException; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/rest/members") +public class MemberResourceController { + + private final MemberRepository repository; + private final MemberRegistration registration; + + public MemberResourceController(MemberRepository repository, MemberRegistration registration) { + this.repository = repository; + this.registration = registration; + } + + @GetMapping(produces = "application/json") + public List listAllMembers() { + return repository.findAllByOrderByNameAsc(); + } + + @GetMapping(value = "/{id}", produces = "application/json") + public ResponseEntity lookupMemberById(@PathVariable("id") long id) { + return repository.findById(id) + .map(ResponseEntity::ok) + .orElseGet(() -> ResponseEntity.notFound().build()); + } + + @PostMapping(consumes = "application/json", produces = "application/json") + public ResponseEntity createMember(@Valid @RequestBody Member member) { + try { + if (repository.existsByEmail(member.getEmail())) { + Map responseObj = new HashMap<>(); + responseObj.put("email", "Email taken"); + return ResponseEntity.status(409).body(responseObj); + } + registration.register(member); + return ResponseEntity.ok().build(); + } catch (DataIntegrityViolationException ex) { + Map responseObj = new HashMap<>(); + responseObj.put("email", "Email taken"); + return ResponseEntity.status(409).body(responseObj); + } catch (Exception e) { + Map responseObj = new HashMap<>(); + responseObj.put("error", e.getMessage()); + return ResponseEntity.badRequest().body(responseObj); + } + } +} diff --git a/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/service/MemberRegistration.java b/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/service/MemberRegistration.java new file mode 100644 index 0000000000..43708a32b8 --- /dev/null +++ b/spring-boot-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/service/MemberRegistration.java @@ -0,0 +1,21 @@ +package org.jboss.as.quickstarts.kitchensink.service; + +import org.jboss.as.quickstarts.kitchensink.data.MemberRepository; +import org.jboss.as.quickstarts.kitchensink.model.Member; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +public class MemberRegistration { + + private final MemberRepository repository; + + public MemberRegistration(MemberRepository repository) { + this.repository = repository; + } + + @Transactional + public Member register(Member member) { + return repository.save(member); + } +} diff --git a/spring-boot-kitchensink/src/main/resources/application.properties b/spring-boot-kitchensink/src/main/resources/application.properties new file mode 100644 index 0000000000..cb4e2cbb7d --- /dev/null +++ b/spring-boot-kitchensink/src/main/resources/application.properties @@ -0,0 +1,13 @@ +spring.datasource.url=jdbc:h2:mem:kitchensink;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE +spring.datasource.driverClassName=org.h2.Driver +spring.datasource.username=sa +spring.datasource.password= + +spring.jpa.hibernate.ddl-auto=create-drop +spring.jpa.show-sql=false +spring.jpa.properties.hibernate.format_sql=false + +spring.h2.console.enabled=true +spring.h2.console.path=/h2-console + +server.port=8080 diff --git a/spring-boot-kitchensink/src/main/resources/import.sql b/spring-boot-kitchensink/src/main/resources/import.sql new file mode 100644 index 0000000000..fc2ea914ce --- /dev/null +++ b/spring-boot-kitchensink/src/main/resources/import.sql @@ -0,0 +1,2 @@ +-- Seed data for Spring Boot kitchensink +insert into Member (id, name, email, phone_number) values (0, 'John Smith', 'john.smith@mailinator.com', '2125551212');