├── .gitignore ├── ApacheCamelExamples ├── .vscode │ └── settings.json ├── ApacheCamelActiveMq │ ├── .gitignore │ ├── README.md │ ├── lombok.config │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── home │ │ │ │ └── ApacheCamelActiveMq │ │ │ │ ├── ApacheCamelActiveMqApplication.java │ │ │ │ └── router │ │ │ │ └── ApacheActiveMqRouter.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── log4j2.properties │ │ └── test │ │ └── resources │ │ └── docker │ │ ├── activemq.xml │ │ └── docker-compose.yml ├── ApacheCamelCSV │ ├── .gitignore │ ├── Changelog.md │ ├── README.md │ ├── lombok.config │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── home │ │ │ │ └── example │ │ │ │ ├── CamelApplication.java │ │ │ │ ├── pojo │ │ │ │ └── Book.java │ │ │ │ └── router │ │ │ │ └── CSVRouteBuilder.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── log4j2.properties │ │ └── test │ │ └── resources │ │ ├── samples │ │ └── books.csv │ │ └── wiremock │ │ ├── __files │ │ ├── bundle.xml │ │ └── metadata.json │ │ ├── mappings │ │ ├── fhir_get.json │ │ └── fhir_post.json │ │ └── run.sh ├── ApacheCamelConsulExample │ ├── ApacheCamelConsul │ │ ├── .gitignore │ │ ├── README.md │ │ ├── lombok.config │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── home │ │ │ │ └── ApacheCamelConsul │ │ │ │ ├── ApacheCamelConsulExampleApplication.java │ │ │ │ ├── pojo │ │ │ │ └── Book.java │ │ │ │ └── router │ │ │ │ └── BookServiceRouter.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── log4j2.properties │ ├── ApacheCamelMock │ │ ├── .gitignore │ │ ├── README.md │ │ ├── lombok.config │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── home │ │ │ │ │ └── ApacheCamelMock │ │ │ │ │ ├── ApacheCamelMockApplication.java │ │ │ │ │ ├── pojo │ │ │ │ │ └── Book.java │ │ │ │ │ └── router │ │ │ │ │ └── BookMockRouter.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ └── log4j2.properties │ │ │ └── test │ │ │ └── resources │ │ │ └── docker │ │ │ ├── configs │ │ │ └── mysql │ │ │ │ ├── conf.d │ │ │ │ └── custom.cnf │ │ │ │ └── scripts │ │ │ │ └── book.sql │ │ │ └── docker-compose.yml │ ├── docker-compose-basic │ │ └── docker-compose.yml │ └── docker-compose │ │ └── docker-compose.yml ├── ApacheCamelEureka │ ├── ApacheCamelEurekaClient │ │ ├── .gitignore │ │ ├── lombok.config │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── home │ │ │ │ └── ApacheCamelEureka │ │ │ │ ├── ApacheCamelEurekaApplication.java │ │ │ │ └── router │ │ │ │ └── MockRouter.java │ │ │ └── resources │ │ │ └── application.properties │ ├── SpringEurekaClient │ │ ├── .gitignore │ │ ├── lombok.config │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── demo │ │ │ │ └── springeurekaclient │ │ │ │ ├── SpringEurekaClientApplication.java │ │ │ │ └── controller │ │ │ │ └── EurekaClientRestController.java │ │ │ └── resources │ │ │ └── application.yml │ └── SpringEurekaServer │ │ ├── .gitignore │ │ ├── lombok.config │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── home │ │ │ └── SpringEurekaServer │ │ │ └── EurekaServerApplication.java │ │ └── resources │ │ └── application.properties ├── ApacheCamelHystrix │ ├── .gitignore │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── home │ │ │ │ └── ApacheCamelHystrixExample │ │ │ │ ├── ApacheCamelHystrixExampleApplication.java │ │ │ │ └── router │ │ │ │ └── BookHystrixRouter.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── log4j2.properties │ │ └── test │ │ └── resources │ │ ├── docker │ │ ├── configs │ │ │ └── mysql │ │ │ │ ├── conf.d │ │ │ │ └── custom.cnf │ │ │ │ └── scripts │ │ │ │ └── book.sql │ │ └── docker-compose.yml │ │ └── wiremock │ │ ├── __files │ │ └── book.json │ │ ├── mappings │ │ └── getBook.json │ │ ├── run.sh │ │ └── wiremock-jre8-standalone-2.28.0.jar ├── ApacheCamelMicrometer │ ├── README.md │ ├── lombok.config │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── home │ │ │ │ └── ApacheCamelMicrometer │ │ │ │ ├── ApacheCamelMicrometerApplication.java │ │ │ │ └── router │ │ │ │ └── MockRouter.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── resources │ │ └── docker │ │ ├── config │ │ └── prometheus.yml │ │ └── docker-compose.yml ├── ApacheCamelQuarkus │ ├── Dockerfile │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── home │ │ │ │ └── ApacheCamelQuarkus │ │ │ │ └── router │ │ │ │ └── BookRouter.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── log4j2.properties │ │ └── test │ │ └── resources │ │ └── docker │ │ ├── configs │ │ └── mysql │ │ │ ├── conf.d │ │ │ └── custom.cnf │ │ │ └── scripts │ │ │ └── book.sql │ │ ├── docker-compose-standalone.yml │ │ └── docker-compose.yml ├── ApacheCamelRestELK │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── lombok.config │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── home │ │ │ │ └── ApacheCamelRestExample │ │ │ │ ├── ApacheCamelRestExampleApplication.java │ │ │ │ ├── pojo │ │ │ │ └── Book.java │ │ │ │ └── router │ │ │ │ ├── BookCaffeineRouter.java │ │ │ │ ├── BookJPARouter.java │ │ │ │ └── BookSQLRouter.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ │ └── test │ │ └── resources │ │ └── docker-elk │ │ ├── .env │ │ ├── config │ │ ├── kibana.yml │ │ ├── logstash.yml │ │ └── mysql │ │ │ ├── conf.d │ │ │ └── custom.cnf │ │ │ └── scripts │ │ │ └── book.sql │ │ ├── docker-compose.yml │ │ ├── lib │ │ └── mysql-connector-java-5.1.38.jar │ │ └── logstash │ │ └── pipeline │ │ └── logstash.conf ├── ApacheCamelRestExample │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── lombok.config │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── home │ │ │ │ └── ApacheCamelRestExample │ │ │ │ ├── ApacheCamelRestExampleApplication.java │ │ │ │ ├── pojo │ │ │ │ └── Book.java │ │ │ │ └── router │ │ │ │ ├── BookCaffeineRouter.java │ │ │ │ ├── BookJPARouter.java │ │ │ │ ├── BookMicrometerRouter.java │ │ │ │ └── BookSQLRouter.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── log4j2.properties │ │ └── test │ │ └── resources │ │ └── docker │ │ ├── configs │ │ └── mysql │ │ │ ├── conf.d │ │ │ └── custom.cnf │ │ │ └── scripts │ │ │ └── book.sql │ │ └── docker-compose.yml ├── ApacheCamelRibbon │ ├── ApacheCamelRest │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── lombok.config │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── home │ │ │ │ └── ApacheCamelRestExample │ │ │ │ ├── ApacheCamelRestExampleApplication.java │ │ │ │ ├── pojo │ │ │ │ └── Book.java │ │ │ │ └── router │ │ │ │ └── BookMockRouter.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── log4j2.properties │ ├── ApacheCamelRest2 │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── lombok.config │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── home │ │ │ │ └── ApacheCamelRestExample │ │ │ │ ├── ApacheCamelRestExampleApplication2.java │ │ │ │ ├── pojo │ │ │ │ └── Book.java │ │ │ │ └── router │ │ │ │ └── BookMockRouter.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── log4j2.properties │ ├── ApacheCamelRibbon │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── lombok.config │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── home │ │ │ │ └── ApacheCamelRestExample │ │ │ │ ├── ApacheCamelRibbonExampleApplication.java │ │ │ │ ├── ping │ │ │ │ └── ActuatorHealthPing.java │ │ │ │ ├── pojo │ │ │ │ └── Book.java │ │ │ │ └── router │ │ │ │ └── BookRibbonRouter.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── log4j2.properties │ └── SpringEurekaServer │ │ ├── .gitignore │ │ ├── lombok.config │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── home │ │ │ └── SpringEurekaServer │ │ │ └── EurekaServerApplication.java │ │ └── resources │ │ └── application.properties ├── ApacheCamelServiceDiscoveryRibbon │ ├── ApacheCamelRest │ │ ├── .gitignore │ │ ├── README.md │ │ ├── lombok.config │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── home │ │ │ │ │ └── ApacheCamelRestExample │ │ │ │ │ ├── ApacheCamelRestExampleApplication.java │ │ │ │ │ ├── pojo │ │ │ │ │ └── Book.java │ │ │ │ │ └── router │ │ │ │ │ └── BookMockRouter.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ └── log4j2.properties │ │ │ └── test │ │ │ └── java │ │ │ └── es │ │ │ └── home │ │ │ └── example │ │ │ └── router │ │ │ ├── BookMockRouteTest.java │ │ │ └── MockTest.java │ ├── ApacheCamelRest2 │ │ ├── .gitignore │ │ ├── README.md │ │ ├── lombok.config │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── home │ │ │ │ └── ApacheCamelRestExample │ │ │ │ ├── ApacheCamelRestExampleApplication2.java │ │ │ │ ├── pojo │ │ │ │ └── Book.java │ │ │ │ └── router │ │ │ │ └── BookMockRouter.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── log4j2.properties │ └── ApacheCamelRibbon │ │ ├── .gitignore │ │ ├── README.md │ │ ├── lombok.config │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── home │ │ │ └── ApacheCamelRestExample │ │ │ ├── ApacheCamelRibbonExampleApplication.java │ │ │ ├── pojo │ │ │ ├── ActuatorHealthPing.java │ │ │ └── Book.java │ │ │ └── router │ │ │ └── BookRibbonRouter.java │ │ └── resources │ │ ├── application.properties │ │ └── log4j2.properties ├── ApacheCamelTest │ ├── .gitignore │ ├── README.md │ ├── lombok.config │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── home │ │ │ │ └── apachecamel │ │ │ │ ├── ApacheCamelTestApplication.java │ │ │ │ └── router │ │ │ │ ├── ApacheActiveMqRouter.java │ │ │ │ └── ApacheMySQLRouter.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── log4j2.properties │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── home │ │ │ └── apachecamel │ │ │ └── router │ │ │ ├── ApacheActiveMqRouterTest.java │ │ │ ├── ApacheMySQLRouterTest.java │ │ │ └── TestcontainersConf.java │ │ └── resources │ │ └── scripts │ │ └── init_mysql.sql └── ApacheCamelZipkin │ ├── .gitignore │ ├── README.md │ ├── lombok.config │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── home │ │ │ └── ApacheCamelZipkin │ │ │ ├── ApacheCamelZipKinApplication.java │ │ │ ├── pojo │ │ │ └── Book.java │ │ │ └── router │ │ │ └── BookMockRouter.java │ └── resources │ │ └── application.properties │ └── test │ └── resources │ └── docker │ ├── config │ └── prometheus.yml │ └── docker-compose.yml ├── ConsulExample ├── SparkMicroservices │ ├── .gitignore │ ├── Dockerfile │ ├── lombok.config │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── es │ │ └── home │ │ └── example │ │ └── sparkexample │ │ ├── bean │ │ └── Msg.java │ │ └── microservice │ │ └── HelloWorld.java └── docker-compose │ ├── data │ └── portainer │ │ └── config.json │ └── docker-compose.yml ├── ExampleJasypt ├── BasicJasyptExample │ ├── .gitignore │ ├── README.md │ ├── lombok.config │ ├── pom.xml │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── es │ │ │ │ │ └── home │ │ │ │ │ └── example │ │ │ │ │ └── encrypt │ │ │ │ │ ├── GetSupportedPaswords.java │ │ │ │ │ └── helper │ │ │ │ │ └── EncryptorHelper.java │ │ │ └── resources │ │ │ │ ├── configuration.properties │ │ │ │ └── log4j2.properties │ │ └── test │ │ │ └── java │ │ │ └── es │ │ │ └── home │ │ │ └── example │ │ │ └── encrypt │ │ │ ├── TestEncryption.java │ │ │ ├── TestEncryptorHelper.java │ │ │ └── helper │ │ │ └── EncryptorHelperTest.java │ └── target │ │ ├── classes │ │ └── es │ │ │ └── home │ │ │ └── example │ │ │ └── encrypt │ │ │ └── GetSupportedPaswords.class │ │ └── test-classes │ │ └── es │ │ └── home │ │ └── example │ │ └── encrypt │ │ ├── TestEncryption.class │ │ └── helper │ │ └── EncryptorHelperTest.class └── SpringJasyptExample │ ├── .gitignore │ ├── README.md │ ├── lombok.config │ ├── pom.xml │ ├── src │ ├── main │ │ ├── java │ │ │ └── es │ │ │ │ └── home │ │ │ │ └── example │ │ │ │ └── encrypt │ │ │ │ ├── Aplicacion.java │ │ │ │ └── service │ │ │ │ ├── AppPropertyService.java │ │ │ │ ├── ConfigurationPropService.java │ │ │ │ └── PropertyService.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── configuration.properties │ │ │ └── log4j2.properties │ └── test │ │ └── java │ │ └── es │ │ └── home │ │ └── example │ │ └── encrypt │ │ ├── AppPropertyServiceTest.java │ │ ├── ConfigurationPropServiceTest.java │ │ └── PropertyServiceTest.java │ └── target │ ├── classes │ ├── application.properties │ ├── configuration.properties │ └── log4j2.properties │ ├── maven-status │ └── maven-compiler-plugin │ │ ├── compile │ │ └── default-compile │ │ │ ├── createdFiles.lst │ │ │ └── inputFiles.lst │ │ └── testCompile │ │ └── default-testCompile │ │ ├── createdFiles.lst │ │ └── inputFiles.lst │ ├── surefire-reports │ ├── TEST-es.home.example.encrypt.AppPropertyServiceTest.xml │ ├── TEST-es.home.example.encrypt.ConfigurationPropServiceTest.xml │ ├── TEST-es.home.example.encrypt.PropertyServiceTest.xml │ ├── es.home.example.encrypt.AppPropertyServiceTest.txt │ ├── es.home.example.encrypt.ConfigurationPropServiceTest.txt │ └── es.home.example.encrypt.PropertyServiceTest.txt │ └── test-classes │ └── es │ └── home │ └── example │ └── encrypt │ ├── AppPropertyServiceTest.class │ ├── ConfigurationPropServiceTest.class │ └── PropertyServiceTest.class ├── ExampleJaxRS ├── .gitignore ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── es │ │ │ └── home │ │ │ └── ws │ │ │ └── example │ │ │ ├── dao │ │ │ ├── UserDao.java │ │ │ └── impl │ │ │ │ ├── AbstractDao.java │ │ │ │ └── UserDaoImpl.java │ │ │ ├── model │ │ │ ├── User.java │ │ │ └── ws │ │ │ │ └── UserXml.java │ │ │ └── service │ │ │ ├── WebServiceSample.java │ │ │ └── impl │ │ │ └── WebServiceSampleImpl.java │ ├── resources │ │ └── META-INF │ │ │ └── persistence.xml │ └── webapp │ │ └── WEB-INF │ │ └── web.xml │ └── test │ └── resources │ └── docker │ ├── configs │ └── mysql │ │ ├── conf.d │ │ └── custom.cnf │ │ └── scripts │ │ └── users.sql │ └── docker-compose.yml ├── ExampleWS ├── .gitignore ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── es │ │ │ └── home │ │ │ └── ws │ │ │ └── example │ │ │ ├── WebServiceSample.java │ │ │ ├── dao │ │ │ ├── UserDao.java │ │ │ └── impl │ │ │ │ ├── AbstractDao.java │ │ │ │ └── UserDaoImpl.java │ │ │ ├── impl │ │ │ └── WebServiceSampleImpl.java │ │ │ └── model │ │ │ ├── User.java │ │ │ └── ws │ │ │ ├── Saludo.java │ │ │ └── UserXml.java │ ├── resources │ │ ├── META-INF │ │ │ └── persistence.xml │ │ └── log4j.properties │ └── webapp │ │ └── WEB-INF │ │ ├── sun-jaxws.xml │ │ └── web.xml │ └── test │ └── java │ └── es │ └── home │ └── ws │ └── dao │ └── test │ └── UserDaoTest.java ├── ExampleWSClient ├── .gitignore ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── es │ │ │ └── home │ │ │ ├── example │ │ │ └── client │ │ │ │ └── WebServiceClient.java │ │ │ └── ws │ │ │ └── example │ │ │ ├── Book.java │ │ │ ├── Despide.java │ │ │ ├── DespideResponse.java │ │ │ ├── GetUsers.java │ │ │ ├── GetUsersResponse.java │ │ │ ├── ObjectFactory.java │ │ │ ├── Saluda.java │ │ │ ├── SaludaResponse.java │ │ │ ├── Saludo.java │ │ │ ├── UserXml.java │ │ │ └── impl │ │ │ ├── WebServiceSample.java │ │ │ └── WebServiceSampleImplService.java │ └── resources │ │ └── META-INF │ │ └── wsdl │ │ └── webservice-sample.wsdl │ └── test │ └── java │ └── es │ └── home │ └── example │ └── test │ └── client │ ├── AutoValueTest.java │ └── WebServiceClientTest.java ├── FOPExample ├── .gitignore ├── ChangeLog.md ├── README.md ├── build.gradle └── src │ ├── main │ ├── java │ │ └── es │ │ │ └── home │ │ │ └── example │ │ │ └── fop │ │ │ ├── FoExample.java │ │ │ └── FoXSLTAndSourceExample.java │ └── resources │ │ ├── xml │ │ └── foXSLTAndSourceExample.xml │ │ └── xsl │ │ ├── foExample.xsl │ │ └── foXSLTAndSourceExample.xsl │ └── test │ └── java │ └── test │ └── es │ └── home │ └── example │ └── fop │ ├── FoExampleTest.java │ └── FoXSLTAndSourceExampleTest.java ├── FeignExample ├── .gitignore ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── es │ │ │ └── home │ │ │ └── example │ │ │ └── feignexample │ │ │ ├── client │ │ │ └── BookClient.java │ │ │ ├── customize │ │ │ ├── CustomErrorDecode.java │ │ │ ├── CustomException.java │ │ │ └── CustomTokenGeneratorInterceptor.java │ │ │ └── pojo │ │ │ ├── Book.java │ │ │ └── Token.java │ └── resources │ │ └── config.properties │ └── test │ ├── java │ ├── es │ │ └── home │ │ │ └── example │ │ │ └── feignexample │ │ │ └── client │ │ │ ├── FeignInterceptor.java │ │ │ ├── FeignRetryableTest.java │ │ │ ├── FeignRibbon.java │ │ │ ├── FeignRibbonTest.java │ │ │ └── FeignTest.java │ └── log4j.properties │ └── resources │ └── wiremock │ └── __files │ ├── book1.json │ ├── book3_update.json │ └── books.json ├── FlywayExample ├── .gitignore ├── ChangeLog.md ├── README.md ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src │ ├── main │ └── resources │ │ └── db │ │ └── migration │ │ ├── V1__script_CREATE_BOOK.sql │ │ ├── V2__script_ALTER_BOOK.sql │ │ └── V3__script_INSERT_BOOK.sql │ └── test │ └── resources │ └── rundocker.sh ├── GraviteeExample ├── README.md ├── apis │ ├── book_keyless-v1.json │ ├── book_keyless-v1_apiKey.json │ └── book_keyless-v1_limited.json └── docker │ ├── configs │ └── mysql │ │ ├── conf.d │ │ └── custom.cnf │ │ └── scripts │ │ └── book.sql │ └── docker-compose.yml ├── HazelcastExample └── RestEasyService │ ├── .gitignore │ ├── Readme.md │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── home │ │ │ └── example │ │ │ └── resteasy │ │ │ ├── Configuration.java │ │ │ ├── bean │ │ │ └── Info.java │ │ │ ├── hazelcast │ │ │ └── HazelcastHelper.java │ │ │ ├── listener │ │ │ └── HazelcastStartupListener.java │ │ │ └── service │ │ │ └── InfoServiceImple.java │ └── resources │ │ ├── hazelcast.xml │ │ └── log4j2.properties │ └── test │ └── resources │ ├── docker-compose.yml │ └── lib │ └── hazelcast-all-4.2.2.jar ├── HttpClientFluentExample ├── ChangeLog.md ├── README.md ├── build.gradle └── src │ ├── main │ └── java │ │ └── es │ │ └── home │ │ └── example │ │ ├── api │ │ └── BookClient.java │ │ └── pojo │ │ └── Book.java │ └── test │ └── resources │ └── test │ └── es │ └── home │ └── example │ └── api │ └── TestBookClient.java ├── JavaExamples └── MapStructExample │ ├── .gitignore │ ├── README.md │ ├── lombok.config │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── com │ │ └── example │ │ └── mapstruct │ │ ├── converter │ │ └── BookConverter.java │ │ ├── dto │ │ ├── BookDto.java │ │ ├── BookResumeDto.java │ │ └── SagaDto.java │ │ └── pojo │ │ ├── Book.java │ │ └── Saga.java │ └── test │ └── java │ └── com │ └── example │ └── mapstruct │ └── converter │ └── BookConverterTest.java ├── JerseyExample ├── .gitignore ├── ChangeLog.md ├── README.md ├── build.gradle └── src │ ├── main │ ├── java │ │ └── es │ │ │ └── home │ │ │ └── example │ │ │ ├── api │ │ │ ├── BookApi.java │ │ │ ├── BookWS.java │ │ │ └── client │ │ │ │ └── BookApiClient.java │ │ │ └── pojo │ │ │ ├── Book.java │ │ │ └── Library.java │ └── webapp │ │ └── WEB-INF │ │ └── web.xml │ └── test │ └── resources │ ├── JerseyExample.postman_collection.json │ ├── book-schema.json │ └── test │ └── es │ └── home │ └── example │ └── api │ ├── client │ └── BookApiClientTest.java │ └── rest │ └── assured │ └── WebServiceTest.java ├── MSF4JExample ├── .gitignore ├── ChangeLog.md ├── README.md ├── dependency-reduced-pom.xml ├── pom.xml └── src │ └── main │ ├── java │ └── es │ │ └── home │ │ └── example │ │ ├── config │ │ └── Application.java │ │ ├── dao │ │ ├── AbstractRepository.java │ │ ├── BookDao.java │ │ ├── UserDao.java │ │ └── impl │ │ │ ├── AbstractRepositoryImpl.java │ │ │ ├── BookDaoImpl.java │ │ │ └── UserDaoImpl.java │ │ ├── exception │ │ └── ServiceExceptionMapper.java │ │ ├── interceptor │ │ └── UsernamePasswordSecurityInterceptor.java │ │ ├── pojo │ │ ├── Book.java │ │ ├── GenericEntity.java │ │ └── User.java │ │ ├── service │ │ ├── BookService.java │ │ ├── OAuthValidatorService.java │ │ └── impl │ │ │ ├── BookServiceImpl.java │ │ │ └── OAuthValidatorServiceImpl.java │ │ └── websocket │ │ └── GroupChatWebsocket.java │ └── resources │ ├── META-INF │ └── persistence.xml │ ├── metrics.yaml │ └── script │ └── data.sql ├── MailSenderExample ├── ChangeLog.md ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── home │ │ └── sample │ │ └── mailsender │ │ └── util │ │ ├── InputStreamDataSource.java │ │ └── MailSenderUtil.java │ └── resources │ └── content │ ├── html │ └── basic.html │ └── images │ └── header-wallpaper.jpg ├── QuarkusExamples ├── ms-k8s-config │ ├── .dockerignore │ ├── .gitignore │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── docker │ │ │ ├── Dockerfile.jvm │ │ │ ├── Dockerfile.legacy-jar │ │ │ ├── Dockerfile.native │ │ │ └── Dockerfile.native-micro │ │ ├── java │ │ │ └── com │ │ │ │ └── home │ │ │ │ └── example │ │ │ │ ├── entity │ │ │ │ └── Book.java │ │ │ │ ├── repository │ │ │ │ └── BookRepository.java │ │ │ │ └── resource │ │ │ │ └── BookResource.java │ │ └── resources │ │ │ ├── V1__init_database.sql │ │ │ ├── application.properties │ │ │ └── db │ │ │ ├── ddl.sql │ │ │ ├── init.sql │ │ │ └── migration │ │ │ └── V1__init_database.sql │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── home │ │ │ └── example │ │ │ └── BookResourceTest.java │ │ └── resources │ │ ├── V1__init_database.sql │ │ ├── db │ │ ├── ddl.sql │ │ ├── init.sql │ │ └── migration │ │ │ └── V1__init_database.sql │ │ ├── docker │ │ ├── config │ │ │ └── init.sql │ │ └── docker-compose.yml │ │ └── kube │ │ ├── config │ │ └── scripts │ │ │ └── init.sql │ │ ├── kind-config.yaml │ │ ├── ms-k8s-config.yaml │ │ └── ms-k8s.yaml ├── ms-k8s │ ├── .dockerignore │ ├── .gitignore │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── docker │ │ │ ├── Dockerfile.jvm │ │ │ ├── Dockerfile.legacy-jar │ │ │ ├── Dockerfile.native │ │ │ └── Dockerfile.native-micro │ │ ├── java │ │ │ └── com │ │ │ │ └── home │ │ │ │ └── example │ │ │ │ ├── entity │ │ │ │ └── Book.java │ │ │ │ ├── repository │ │ │ │ └── BookRepository.java │ │ │ │ └── resource │ │ │ │ └── BookResource.java │ │ └── resources │ │ │ ├── V1__init_database.sql │ │ │ ├── application.properties │ │ │ └── db │ │ │ ├── ddl.sql │ │ │ ├── init.sql │ │ │ └── migration │ │ │ └── V1__init_database.sql │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── home │ │ │ └── example │ │ │ └── BookResourceTest.java │ │ └── resources │ │ ├── V1__init_database.sql │ │ ├── db │ │ ├── ddl.sql │ │ ├── init.sql │ │ └── migration │ │ │ └── V1__init_database.sql │ │ ├── docker │ │ ├── config │ │ │ └── init.sql │ │ └── docker-compose.yml │ │ └── kube │ │ ├── config │ │ └── scripts │ │ │ └── init.sql │ │ ├── kind-config.yaml │ │ ├── ms-k8s-mariadb-standalone.yaml │ │ ├── ms-k8s-mariadb.yaml │ │ └── ms-k8s.yaml └── ms-with-panache │ ├── .dockerignore │ ├── .gitignore │ ├── README.md │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── docker │ │ ├── Dockerfile.jvm │ │ ├── Dockerfile.legacy-jar │ │ ├── Dockerfile.native │ │ └── Dockerfile.native-micro │ ├── java │ │ └── com │ │ │ └── home │ │ │ └── example │ │ │ ├── GreetingResource.java │ │ │ ├── GreetingService.java │ │ │ ├── entity │ │ │ ├── BoardGame.java │ │ │ ├── Book.java │ │ │ └── Movie.java │ │ │ ├── mapper │ │ │ ├── BoardGameMapper.java │ │ │ └── BookMapper.java │ │ │ ├── pojo │ │ │ └── Success.java │ │ │ ├── repository │ │ │ └── BookRepository.java │ │ │ ├── rest │ │ │ ├── BoardGameResource.java │ │ │ ├── BookResource.java │ │ │ └── WiremockResource.java │ │ │ └── service │ │ │ └── ExternalService.java │ └── resources │ │ ├── META-INF │ │ ├── ddl.sql │ │ ├── drop.sql │ │ ├── import-dev.sql │ │ └── resources │ │ │ └── index.html │ │ └── application.properties │ └── test │ ├── java │ └── com │ │ └── home │ │ └── example │ │ ├── GreetingResourceIT.java │ │ ├── GreetingResourceTest.java │ │ ├── entity │ │ └── BoardGameTest.java │ │ ├── repository │ │ ├── BookRepositoryTest.java │ │ ├── InjectBookRepositoryTest.java │ │ └── MockBookRepository.java │ │ ├── rest │ │ ├── BookResourceTest.java │ │ ├── MockBoardGameTest.java │ │ ├── SpyBookResourceTest.java │ │ ├── WiremockResourceBasicTest.java │ │ ├── WiremockResourceInjectTest.java │ │ └── WiremockResourceTest.java │ │ └── test │ │ ├── WiremockResourceConfigurable.java │ │ ├── WiremockTestAnnotation.java │ │ └── WiremockTestResource.java │ └── resources │ └── docker │ ├── config │ └── mysql │ │ ├── conf.d │ │ └── custom.cnf │ │ └── scripts │ │ └── book.sql │ └── docker-compose.yml ├── README.md ├── RESTEasyExample ├── README.md ├── RestEasyService │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── home │ │ │ └── example │ │ │ └── resteasy │ │ │ ├── bean │ │ │ └── Book.java │ │ │ ├── configuration │ │ │ └── LibraryApplication.java │ │ │ └── service │ │ │ ├── BookService.java │ │ │ └── BookServiceImpl.java │ │ └── webapp │ │ └── WEB-INF │ │ └── web.xml └── resteasyclient │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── com │ │ └── home │ │ └── example │ │ └── resteasy │ │ ├── bean │ │ └── Book.java │ │ ├── client │ │ └── BookClient.java │ │ └── service │ │ └── BookService.java │ └── test │ └── java │ └── com │ └── home │ └── example │ └── resteasy │ └── client │ └── BookClientTest.java ├── SparkExample ├── README.md ├── pom.xml └── src │ └── main │ └── java │ └── es │ └── home │ └── example │ └── spark │ ├── Application.java │ ├── pojo │ └── Book.java │ └── transformer │ └── JsonTransformer.java ├── SpringExamples ├── ExampleSpringBootREST │ ├── .gitignore │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── es │ │ │ │ └── home │ │ │ │ └── example │ │ │ │ └── knowledge │ │ │ │ ├── Aplicacion.java │ │ │ │ ├── entity │ │ │ │ ├── Book.java │ │ │ │ └── GenericEntity.java │ │ │ │ ├── pojo │ │ │ │ └── Saludo.java │ │ │ │ ├── repository │ │ │ │ ├── BookDao.java │ │ │ │ └── GenericDao.java │ │ │ │ └── rest │ │ │ │ ├── controller │ │ │ │ ├── BookRestController.java │ │ │ │ └── SaludoRestController.java │ │ │ │ └── template │ │ │ │ └── BookRestClient.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── script │ │ │ └── data.sql │ │ │ └── swagger │ │ │ ├── swagger.json │ │ │ └── swagger.yaml │ │ └── test │ │ └── java │ │ └── es │ │ └── home │ │ └── example │ │ └── knowledge │ │ └── test │ │ └── rest │ │ └── template │ │ └── BookRestClientTest.java ├── ExampleSpringSecurity │ ├── .gitignore │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── es │ │ │ │ └── home │ │ │ │ └── example │ │ │ │ ├── config │ │ │ │ ├── Application.java │ │ │ │ ├── MvcConfig.java │ │ │ │ └── security │ │ │ │ │ ├── AuthenticationProviderConfig.java │ │ │ │ │ └── WebSecurityConfig.java │ │ │ │ └── controller │ │ │ │ └── InicioController.java │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── log4j.properties │ │ └── webapp │ │ │ └── WEB-INF │ │ │ └── jsp │ │ │ ├── 403.jsp │ │ │ ├── error.jsp │ │ │ ├── hello.jsp │ │ │ ├── home.jsp │ │ │ └── login.jsp │ │ └── test │ │ ├── java │ │ └── es │ │ │ └── home │ │ │ └── example │ │ │ └── EncryptPasswordTest.java │ │ └── resources │ │ └── schema.sql ├── Spring2Datasources │ ├── .gitignore │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── es │ │ │ │ └── home │ │ │ │ └── example │ │ │ │ └── knowledge │ │ │ │ ├── Aplicacion.java │ │ │ │ ├── conf │ │ │ │ ├── PersistenceDevConfiguration.java │ │ │ │ ├── PersistencePreConfiguration.java │ │ │ │ └── PersistenceProConfiguration.java │ │ │ │ ├── dev │ │ │ │ └── repository │ │ │ │ │ └── DevBookDao.java │ │ │ │ ├── entity │ │ │ │ └── Book.java │ │ │ │ ├── pre │ │ │ │ └── repository │ │ │ │ │ └── PreBookDao.java │ │ │ │ ├── pro │ │ │ │ └── repository │ │ │ │ │ └── ProBookDao.java │ │ │ │ └── rest │ │ │ │ └── controller │ │ │ │ └── BookRestController.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── persistence-multiple-db.properties │ │ │ ├── script │ │ │ └── data.sql │ │ │ └── swagger │ │ │ ├── swagger.json │ │ │ └── swagger.yaml │ │ └── test │ │ └── resources │ │ └── docker │ │ ├── configs │ │ └── mysql │ │ │ ├── conf.d │ │ │ └── custom.cnf │ │ │ ├── dev-scripts │ │ │ └── dev-books.sql │ │ │ ├── pre-scripts │ │ │ └── pre-books.sql │ │ │ └── pro-scripts │ │ │ └── pro-books.sql │ │ └── docker-compose.yml ├── SpringBoot2OauthWso2Is │ ├── Changelog.md │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── es │ │ │ └── home │ │ │ └── example │ │ │ └── sbowi │ │ │ ├── Application.java │ │ │ ├── SecurityConfig.java │ │ │ ├── WebConfig.java │ │ │ └── extractor │ │ │ └── WSO2IsPrincipalExtractor.java │ │ └── resources │ │ ├── application.yml │ │ └── templates │ │ ├── index.html │ │ └── profile.html ├── SpringBootActivemqReader │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── home │ │ │ │ └── example │ │ │ │ └── activemqreader │ │ │ │ ├── ActivemqReaderApplication.java │ │ │ │ ├── client │ │ │ │ └── SpringConsumer.java │ │ │ │ └── config │ │ │ │ ├── JmsConfig.java │ │ │ │ └── JmsErrorHandler.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── chakray │ │ └── intdev │ │ └── activemqreader │ │ └── ActivemqReaderApplicationTests.java ├── SpringBootAdminExample │ ├── README.md │ ├── SpringEurekaServer │ │ ├── .gitignore │ │ ├── lombok.config │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── home │ │ │ │ └── SpringEurekaServer │ │ │ │ └── EurekaServerApplication.java │ │ │ └── resources │ │ │ └── application.properties │ ├── spring-boot-admin-client │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── baeldung │ │ │ │ └── springbootadminclient │ │ │ │ ├── SpringBootAdminClientApplication.java │ │ │ │ ├── controller │ │ │ │ └── BookController.java │ │ │ │ └── pojo │ │ │ │ └── Book.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ ├── spring-boot-admin-eureka-client │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── springbootadmin │ │ │ │ └── eurekaclient │ │ │ │ ├── SpringBootAdminEurekaClientApp.java │ │ │ │ ├── controller │ │ │ │ └── BookController.java │ │ │ │ └── pojo │ │ │ │ └── Book.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── log4j.properties │ ├── spring-boot-admin-eureka-server │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── springbootadminserver │ │ │ │ ├── SpringBootAdminEurekaServerApp.java │ │ │ │ └── config │ │ │ │ └── SecuritySecureConfig.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ └── spring-boot-admin-server │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── springbootadminserver │ │ │ ├── SpringBootAdminServerApplication.java │ │ │ └── config │ │ │ └── SecuritySecureConfig.java │ │ └── resources │ │ ├── application.properties │ │ └── logback.xml ├── SpringJWTAuthentication │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── es │ │ │ │ └── home │ │ │ │ └── example │ │ │ │ └── app │ │ │ │ ├── SpringJWTAuthApp.java │ │ │ │ ├── config │ │ │ │ └── SecurityConfig.java │ │ │ │ ├── controller │ │ │ │ ├── DummyController.java │ │ │ │ └── LoginController.java │ │ │ │ ├── filter │ │ │ │ ├── JWTUserDetailsImpl.java │ │ │ │ └── JwtTokenFilter.java │ │ │ │ ├── pojo │ │ │ │ ├── LoginRequest.java │ │ │ │ ├── LoginResponse.java │ │ │ │ └── Msg.java │ │ │ │ ├── service │ │ │ │ └── MockDetailsService.java │ │ │ │ └── util │ │ │ │ └── JwtTokenUtil.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── jwt-secret │ │ └── test │ │ └── resources │ │ └── JWTAuth.postman_collection.json └── SpringWebflux │ ├── .gitignore │ ├── SpringWebfluxClient │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── es │ │ │ └── home │ │ │ └── example │ │ │ └── app │ │ │ ├── SpringWebfluxClientApp.java │ │ │ ├── controller │ │ │ └── IncidenceController.java │ │ │ ├── pojo │ │ │ └── Incidence.java │ │ │ └── service │ │ │ └── IncidenceService.java │ │ └── resources │ │ ├── application.properties │ │ └── templates │ │ └── index.html │ └── SpringWebfluxServer │ ├── .gitignore │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── es │ │ └── home │ │ └── example │ │ └── app │ │ ├── SpringWebfluxServerApp.java │ │ ├── controller │ │ ├── IncidenceController.java │ │ └── IncidenceRestController.java │ │ └── pojo │ │ └── Incidence.java │ └── resources │ └── application.properties ├── Struts2Examples ├── .gitignore ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── home │ │ └── example │ │ └── struts2 │ │ ├── action │ │ ├── BookAction.java │ │ └── GridPageAction.java │ │ ├── filter │ │ └── Struts2Filter.java │ │ └── pojo │ │ └── Book.java │ ├── resources │ ├── global.properties │ ├── log4j2.xml │ ├── struts.properties │ └── struts.xml │ └── webapp │ └── pages │ └── books.jsp ├── TestingExample ├── DBJUnitTestExample │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── home │ │ │ └── example │ │ │ └── dbjunittest │ │ │ ├── dao │ │ │ ├── GenericDao.java │ │ │ └── impl │ │ │ │ ├── BookDaoImpl.java │ │ │ │ └── GenericDaoImpl.java │ │ │ └── entity │ │ │ └── Book.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── home │ │ │ └── example │ │ │ └── dbjunittest │ │ │ └── dao │ │ │ └── impl │ │ │ ├── BookDaoImplITTest.java │ │ │ └── GenericDaoImplUnitTest.java │ │ └── resources │ │ ├── META-INF │ │ └── persistence.xml │ │ ├── log4j2.properties │ │ └── schema-generator.sql ├── DatabaseRiderTestExample │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── home │ │ │ └── example │ │ │ └── dbjunittest │ │ │ ├── dao │ │ │ ├── GenericDao.java │ │ │ └── impl │ │ │ │ ├── BookDaoImpl.java │ │ │ │ └── GenericDaoImpl.java │ │ │ └── entity │ │ │ └── Book.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── home │ │ │ └── example │ │ │ └── dbjunittest │ │ │ └── dao │ │ │ └── impl │ │ │ ├── BookDaoImplBeforeAllTest.java │ │ │ ├── BookDaoImplBeforeEachTest.java │ │ │ ├── BookDaoImplConfigurationTest.java │ │ │ └── BookDaoImplExpectedDataSetTest.java │ │ └── resources │ │ ├── META-INF │ │ └── persistence.xml │ │ ├── book1.sql │ │ ├── datasets │ │ ├── books.yml │ │ ├── expectedBooks.yml │ │ ├── expectedBooksTranFalse.yml │ │ └── expectedRegExBooks.yml │ │ ├── log4j2.properties │ │ └── schema-generator.sql ├── JPAJNDIIntTestExample │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── home │ │ │ └── example │ │ │ └── jpajndiinttest │ │ │ ├── dao │ │ │ ├── GenericDao.java │ │ │ └── impl │ │ │ │ ├── BookDaoImpl.java │ │ │ │ └── GenericDaoImpl.java │ │ │ └── entity │ │ │ └── Book.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── home │ │ │ └── example │ │ │ └── jpajndiinttest │ │ │ └── dao │ │ │ └── impl │ │ │ ├── BookDaoImplIT.java │ │ │ └── MockTest.java │ │ └── resources │ │ ├── META-INF │ │ └── persistence.xml │ │ ├── jndi.properties │ │ ├── jndi │ │ └── jdbc.properties │ │ ├── log4j2.properties │ │ └── schema-generator.sql ├── PowerMockExample │ ├── .gitignore │ ├── ChangeLog.md │ ├── README.md │ ├── build.gradle │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ └── es │ │ │ └── home │ │ │ └── example │ │ │ └── testing │ │ │ ├── controller │ │ │ └── BookController.java │ │ │ ├── pojo │ │ │ └── Book.java │ │ │ └── ws │ │ │ ├── client │ │ │ └── BookWSClient.java │ │ │ └── helper │ │ │ └── BookWSHelper.java │ │ └── test │ │ └── java │ │ └── test │ │ └── es │ │ └── home │ │ └── example │ │ └── testing │ │ └── powermock │ │ ├── MockStatic.java │ │ └── WhiteboxExample.java ├── README.md └── TContainersJ4Example │ ├── pom.xml │ └── src │ └── test │ ├── java │ └── com │ │ └── example │ │ ├── MongoDBCustomTest.java │ │ └── TestContainerMongoDBTest.java │ └── resources │ └── log4j2.properties ├── WSO2Examples ├── ActiveMQExample │ ├── docker-compose │ │ ├── conf │ │ │ ├── deployment.toml │ │ │ └── log4j2.properties │ │ ├── docker-compose.yml │ │ └── lib │ │ │ ├── activemq-broker-5.14.0.jar │ │ │ ├── activemq-client-5.14.0.jar │ │ │ ├── activemq-openwire-legacy-5.14.0.jar │ │ │ ├── geronimo-j2ee-management_1.1_spec-1.0.1.jar │ │ │ ├── geronimo-jms_1.1_spec-1.1.1.jar │ │ │ └── hawtbuf-1.11.jar │ └── wso2-activemq-example │ │ ├── pom.xml │ │ ├── wso2-activemq-exampleCompositeExporter │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ └── security │ │ │ └── wso2carbon.jks │ │ └── wso2-activemq-exampleConfigs │ │ ├── artifact.xml │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── resources │ │ └── metadata │ │ │ ├── activemqExample_v1_book_api_metadata.yaml │ │ │ └── activemqExample_v1_book_api_swagger.yaml │ │ └── synapse-config │ │ ├── api │ │ └── activemqExample_v1_book_api.xml │ │ └── proxy-services │ │ └── activemqExample_v1_consumer_pr.xml ├── BasicExample │ ├── docker-compose │ │ ├── apps │ │ │ ├── Dockerfile │ │ │ └── wso2-basic-example_1.0.0.car │ │ ├── conf │ │ │ └── deployment.toml │ │ └── docker-compose.yml │ └── wso2-basic-example │ │ ├── pom.xml │ │ ├── wso2-basic-exampleCompositeExporter │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ └── security │ │ │ └── wso2carbon.jks │ │ └── wso2-basic-exampleConfigs │ │ ├── artifact.xml │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── resources │ │ └── metadata │ │ │ ├── basicExample_v1_book_api_metadata.yaml │ │ │ └── basicExample_v1_book_api_swagger.yaml │ │ └── synapse-config │ │ └── api │ │ └── basicExample_v1_book_api.xml ├── SecretExample │ ├── docker-compose │ │ ├── .env │ │ ├── apps │ │ │ └── wso2-secret-exampleCompositeExporter_1.0.0.car │ │ ├── conf │ │ │ ├── deployment.toml │ │ │ ├── docker-entrypoint.sh │ │ │ └── log4j2.properties │ │ └── docker-compose.yml │ └── wso2-secret-example │ │ ├── pom.xml │ │ ├── wso2-secret-exampleCompositeExporter │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ └── security │ │ │ └── wso2carbon.jks │ │ └── wso2-secret-exampleConfigs │ │ ├── artifact.xml │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── resources │ │ └── metadata │ │ │ ├── secretExample_v1_reader_api_metadata.yaml │ │ │ └── secretExample_v1_reader_api_swagger.yaml │ │ └── synapse-config │ │ └── api │ │ └── secretExample_v1_reader_api.xml └── custom-user-store-10 │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── es │ │ └── home │ │ └── example │ │ └── wso2is │ │ └── userstore │ │ ├── CustomUserStore10.java │ │ └── internal │ │ └── CustomUserStore10DSC.java │ └── test │ └── resources │ └── docker-compose-is │ ├── configs │ ├── IS511 │ │ └── deployment.toml │ ├── custom-user-store-10-1.0.0.jar │ ├── log4j2.properties │ └── scripts │ │ └── mysql.sql │ ├── docker-compose-511.yml │ └── docker-compose.yml ├── Wiremock ├── ChangeLog.md ├── README.md ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── home │ │ └── example │ │ └── wiremockhttps │ │ ├── helper │ │ └── HttpClientHelper.java │ │ └── pojo │ │ └── Token.java │ └── test │ ├── java │ └── com │ │ └── home │ │ └── example │ │ └── wiremockhttps │ │ └── main │ │ └── WiremockTest.java │ └── resources │ ├── log4j2.properties │ └── wiremock │ ├── __files │ └── tokenCredentialsResponse.json │ ├── identity.jks │ └── mappings │ └── token.json ├── weblogicWSExample ├── .gitignore ├── Readme.md ├── lombok.config ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── example │ │ └── weblogicWS │ │ ├── pojo │ │ └── Book.java │ │ ├── rest │ │ └── impl │ │ │ └── BookRestServiceImpl.java │ │ ├── soap │ │ └── impl │ │ │ └── BookServiceImpl.java │ │ └── ws │ │ └── BookService.java │ └── test │ └── resources │ └── dockerProperties │ └── domain.properties └── wordCounterWS ├── README.md ├── pom.xml └── src ├── main ├── java │ └── es │ │ └── home │ │ └── sample │ │ └── wordCounter │ │ ├── Application.java │ │ ├── controller │ │ ├── HistoryController.java │ │ └── TextController.java │ │ ├── entity │ │ ├── GenericEntity.java │ │ └── History.java │ │ ├── function │ │ └── HistoryFromTextResponse.java │ │ ├── pojo │ │ ├── ReadmeResponse.java │ │ └── TextResponse.java │ │ ├── repository │ │ ├── GenericDao.java │ │ └── HistoryRepository.java │ │ └── util │ │ ├── RestTemplateCaller.java │ │ └── WordCounter.java └── resources │ └── application.properties └── test ├── java └── test │ └── es │ └── home │ └── sample │ └── wordCounter │ ├── controller │ ├── HistoryControllerTest.java │ └── TextControllerTest.java │ └── util │ ├── RestTemplateCallerTest.java │ └── WordCounterTest.java └── resources └── BetVictorSample.postman_collection.json /.gitignore: -------------------------------------------------------------------------------- 1 | **/.settings/* 2 | **/.classpath 3 | **/.project 4 | **/target/* 5 | **/build/* 6 | **/bin/* 7 | **/data/portainer/* 8 | /.gradle/ 9 | 10 | ExampleJaxRS/.factorypath 11 | -------------------------------------------------------------------------------- /ApacheCamelExamples/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "java.project.referencedLibraries": [ 3 | "lib/**/*.jar", 4 | "/Users/deesebc/Library/Application Support/Code/User/globalStorage/redhat.vscode-camelk/java-dependencies-3.19.0/dependencies/*.jar" 5 | ] 6 | } -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelActiveMq/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelActiveMq/README.md: -------------------------------------------------------------------------------- 1 | # ApacheCamelActiveMq 2 | 3 | ## Info 4 | 5 | Project to explain how it works Apache Camel 2.25.1. A basic CRUD Example, with Mock, SQL and JPA. 6 | 7 | ## Links 8 | 9 | You can see an explanation in Spanish here: 10 | 11 | * ActiveMQ: https://DesarrolloJavaYYo.blogspot.com/ 12 | 13 | You can see an explanation in English here: 14 | 15 | * ActiveMQ: https://medium.com/@danielblancocuadrado/ 16 | 17 | ## Tags 18 | 19 | API, web services, integration, ESB, apache, camel, REST, CRUD, ActiveMQ -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelActiveMq/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelActiveMq/src/main/java/com/example/home/ApacheCamelActiveMq/ApacheCamelActiveMqApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelActiveMq; 2 | 3 | import javax.annotation.PostConstruct; 4 | import org.apache.camel.CamelContext; 5 | import org.apache.camel.component.activemq.ActiveMQComponent; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.SpringApplication; 8 | import org.springframework.boot.autoconfigure.SpringBootApplication; 9 | 10 | @SpringBootApplication 11 | public class ApacheCamelActiveMqApplication { 12 | 13 | public static void main(final String[] args) { 14 | SpringApplication.run(ApacheCamelActiveMqApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelActiveMq/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # the name of Camel 2 | #camel.springboot.name=Service1 3 | camel.springboot.main-run-controller=true 4 | 5 | #camel.component.servlet.mapping.context-path=/* 6 | #server.port=9090 7 | 8 | #camel.component.activemq.broker-url=tcp://localhost:61616 9 | camel.component.activemq.brokerUrl=tcp://localhost:61616 10 | 11 | activemq.privateQueue.password=P#s5W0rd 12 | 13 | #camel.component.activemq.test-connection-on-startup=true 14 | #camel.component.jms.connection-factory=org.apache.activemq.ActiveMQConnectionFactory 15 | 16 | #camel.activemq.brokerUrl=failover:(tcp://localhost:61616)?jms.prefetchPolicy.all=1&randomize=false -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelCSV/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /.apt_generated/ 3 | /.apt_generated_tests/ 4 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelCSV/Changelog.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | ## [1.0.0] - 2022-12-21 6 | 7 | ### Added 8 | 9 | * First version 10 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelCSV/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Apache Camel CSV 3 | 4 | A basic example of how to manage files and read CSV 5 | 6 | ## Configuration 7 | 8 | - Fuse Boom Version: 7.6.0.fuse-sb2-760028-redhat-00001 9 | 10 | ## Installation 11 | 12 | 13 | ## Test 14 | 15 | In *src/test/resources/samples* there is an example file. Put the file in the folder indicate in *dir.in* in application.properties. 16 | The FHIR can be mocked with the *src/test/resources/wiremock*. 17 | 18 | ## Links 19 | 20 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelCSV/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelCSV/src/main/java/com/home/example/CamelApplication.java: -------------------------------------------------------------------------------- 1 | package com.home.example; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class CamelApplication { 8 | public static void main(final String[] args) { 9 | SpringApplication.run(CamelApplication.class, args); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelCSV/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # the name of application 2 | camel.springboot.name=csvReader 3 | # the port 4 | #server.port=9090 5 | 6 | camel.springboot.main-run-controller=true 7 | 8 | 9 | dir.in=/Users/deesebc/git/deesebc/PostExamples/ApacheCamelExamples/ApacheCamelCSV/src/test/resources/samples 10 | dir.out=/Users/deesebc/git/deesebc/PostExamples/ApacheCamelExamples/ApacheCamelCSV/src/test/resources/out 11 | dir.inProgress=/Users/deesebc/git/deesebc/PostExamples/ApacheCamelExamples/ApacheCamelCSV/src/test/resources/progress -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelCSV/src/test/resources/samples/books.csv: -------------------------------------------------------------------------------- 1 | 1,Dune,Frank Herbert 2 | 2,The starts my destination,Alfred Bester 3 | 3,Ender's game,Orson S. Card -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelCSV/src/test/resources/wiremock/mappings/fhir_get.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": 3 | { 4 | "urlPath": "/metadata", 5 | "method": "GET" 6 | 7 | }, 8 | "response": 9 | { 10 | "status": 200, 11 | "headers": { 12 | "Content-Type": "application/json" 13 | }, 14 | "bodyFileName":"metadata.json" 15 | } 16 | } -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelCSV/src/test/resources/wiremock/mappings/fhir_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": 3 | { 4 | "urlPath": "/", 5 | "method": "POST" 6 | 7 | }, 8 | "response": 9 | { 10 | "status": 201, 11 | "headers": { 12 | "Content-Type": "application/xml" 13 | }, 14 | "bodyFileName":"bundle.xml" 15 | } 16 | } -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelCSV/src/test/resources/wiremock/run.sh: -------------------------------------------------------------------------------- 1 | java -jar wiremock-jre8-standalone-2.28.0.jar --port 57001 --verbose -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelConsulExample/ApacheCamelConsul/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelConsulExample/ApacheCamelConsul/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelConsulExample/ApacheCamelConsul/src/main/java/com/example/home/ApacheCamelConsul/ApacheCamelConsulExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelConsul; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ApacheCamelConsulExampleApplication { 8 | 9 | public static void main(final String[] args) { 10 | SpringApplication.run(ApacheCamelConsulExampleApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelConsulExample/ApacheCamelConsul/src/main/java/com/example/home/ApacheCamelConsul/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelConsul.pojo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import lombok.ToString; 9 | 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | @ToString 14 | public class Book { 15 | 16 | @JsonProperty 17 | private Integer id; 18 | @JsonProperty 19 | private String name; 20 | @JsonProperty 21 | private String author; 22 | } 23 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelConsulExample/ApacheCamelConsul/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=9091 2 | 3 | # the name of Camel 4 | camel.springboot.name=apacheCamelServiceCall 5 | 6 | # to reconfigure the camel servlet context-path mapping to use /api/* instead of /camel/* 7 | #Camel version < 3.10 8 | #camel.component.servlet.mapping.context-path=/api/* 9 | #Camel version > 3.10 10 | camel.servlet.mapping.context-path=/api/* 11 | 12 | # Camel Cloud 13 | camel.cloud.consul.enabled=true 14 | camel.cloud.consul.service-discovery.url=http://localhost:8500 -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelConsulExample/ApacheCamelMock/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelConsulExample/ApacheCamelMock/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelConsulExample/ApacheCamelMock/src/main/java/com/example/home/ApacheCamelMock/ApacheCamelMockApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelMock; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ApacheCamelMockApplication { 8 | 9 | public static void main(final String[] args) { 10 | SpringApplication.run(ApacheCamelMockApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelConsulExample/ApacheCamelMock/src/main/java/com/example/home/ApacheCamelMock/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelMock.pojo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import lombok.ToString; 9 | 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | @ToString 14 | public class Book { 15 | 16 | @JsonProperty 17 | private Integer id; 18 | @JsonProperty 19 | private String name; 20 | @JsonProperty 21 | private String author; 22 | } 23 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelConsulExample/ApacheCamelMock/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=9092 2 | 3 | # the name of Camel 4 | camel.springboot.name=apacheCamelMock 5 | 6 | # to reconfigure the camel servlet context-path mapping to use /api/* instead of /camel/* 7 | #Camel version < 3.10 8 | #camel.component.servlet.mapping.context-path=/api/* 9 | #Camel version > 3.10 10 | camel.servlet.mapping.context-path=/api/* 11 | 12 | # expose actuator endpoint via HTTP 13 | management.endpoints.web.exposure.include=info,health 14 | 15 | # Camel Cloud 16 | camel.cloud.consul.enabled=false 17 | #META TAG: service address 18 | camel.cloud.consul.service-host=localhost 19 | camel.cloud.consul.url=http://localhost:8500 20 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelConsulExample/ApacheCamelMock/src/test/resources/docker/configs/mysql/conf.d/custom.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | max_connections=1500 3 | max_allowed_packet=1024M 4 | # innodb_buffer_pool_size=1024M 5 | # wait_timeout=350 6 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelEureka/ApacheCamelEurekaClient/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelEureka/ApacheCamelEurekaClient/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelEureka/ApacheCamelEurekaClient/src/main/java/com/example/home/ApacheCamelEureka/ApacheCamelEurekaApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelEureka; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @SpringBootApplication 8 | @EnableDiscoveryClient 9 | public class ApacheCamelEurekaApplication { 10 | 11 | public static void main(final String[] args) { 12 | SpringApplication.run(ApacheCamelEurekaApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelEureka/ApacheCamelEurekaClient/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=app-camel-eureka-client 2 | 3 | spring.cloud.loadbalancer.ribbon.enabled=false 4 | 5 | eureka.client.serviceUrl.defaultZone = http://localhost:8761/eureka/ -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelEureka/SpringEurekaClient/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /bin/ 3 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelEureka/SpringEurekaClient/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelEureka/SpringEurekaClient/src/main/java/com/example/demo/springeurekaclient/SpringEurekaClientApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.springeurekaclient; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @EnableDiscoveryClient 8 | @SpringBootApplication 9 | public class SpringEurekaClientApplication { 10 | public static void main(final String[] args) { 11 | SpringApplication.run(SpringEurekaClientApplication.class, args); 12 | } 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelEureka/SpringEurekaClient/src/main/java/com/example/demo/springeurekaclient/controller/EurekaClientRestController.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.springeurekaclient.controller; 2 | 3 | import org.springframework.http.MediaType; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @RestController 8 | public class EurekaClientRestController { 9 | @GetMapping(value="/books", produces = MediaType.APPLICATION_JSON_VALUE) 10 | public String index() { 11 | return "[{\"id\":1,\"name\":\"Ender's game\",\"author\":\"Orson Scott Card\"},{\"id\":2,\"name\":\"Foundation\",\"author\":\"Isaac Asimov\"}]"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelEureka/SpringEurekaClient/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: discovery-client 4 | server: 5 | port: 8385 6 | eureka: 7 | client: 8 | serviceUrl: 9 | defaultZone: http://localhost:8761/eureka/ -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelEureka/SpringEurekaServer/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelEureka/SpringEurekaServer/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelEureka/SpringEurekaServer/src/main/java/com/example/home/SpringEurekaServer/EurekaServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.SpringEurekaServer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class EurekaServerApplication { 10 | 11 | public static void main(final String[] args) { 12 | SpringApplication.run(EurekaServerApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelEureka/SpringEurekaServer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8761 2 | 3 | eureka.client.register-with-eureka=false 4 | eureka.client.fetch-registry=false 5 | 6 | logging.level.com.netflix.eureka=OFF 7 | logging.level.com.netflix.discovery=OFF -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelHystrix/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelHystrix/README.md: -------------------------------------------------------------------------------- 1 | # Apache Camel Hystrix 2 | 3 | Demo of how it works Apache Camel with Hystrix 4 | 5 | ## Instructions 6 | 7 | 1. execute command: docker-compose up in src/test/resources/docker folder 8 | 2. execut command: sh run.sh in src/test/resources/wiremock folder 9 | 3. If you open the project with eclipse, run as Java Application the ApacheCamelHystrixExampleApplication.java class 10 | 11 | ## Explanation 12 | 13 | - You can read it in Spanish here: 14 | - You can read it in English here: -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelHystrix/src/main/java/com/example/home/ApacheCamelHystrixExample/ApacheCamelHystrixExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelHystrixExample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ApacheCamelHystrixExampleApplication { 8 | 9 | public static void main(final String[] args) { 10 | SpringApplication.run(ApacheCamelHystrixExampleApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelHystrix/src/test/resources/docker/configs/mysql/conf.d/custom.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | max_connections=1500 3 | max_allowed_packet=1024M 4 | # innodb_buffer_pool_size=1024M 5 | # wait_timeout=350 6 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelHystrix/src/test/resources/wiremock/__files/book.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 1, 4 | "NAME": "Ender Game", 5 | "AUTHOR": "Orson S. Card" 6 | }, 7 | { 8 | "ID": 2, 9 | "NAME": "The stars my destination", 10 | "AUTHOR": "Alfred Bester" 11 | }, 12 | { 13 | "ID": 3, 14 | "NAME": "Dune", 15 | "AUTHOR": "Frank Herbert" 16 | } 17 | ] -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelHystrix/src/test/resources/wiremock/mappings/getBook.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": 3 | { 4 | "urlPath": "/book", 5 | "method": "GET" 6 | 7 | }, 8 | "response": 9 | { 10 | "status": 200, 11 | "bodyFileName": "book.json", 12 | "headers": { 13 | "Content-Type": "application/json" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelHystrix/src/test/resources/wiremock/run.sh: -------------------------------------------------------------------------------- 1 | java -jar wiremock-jre8-standalone-2.28.0.jar --port 57001 --verbose -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelHystrix/src/test/resources/wiremock/wiremock-jre8-standalone-2.28.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/ApacheCamelExamples/ApacheCamelHystrix/src/test/resources/wiremock/wiremock-jre8-standalone-2.28.0.jar -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelMicrometer/README.md: -------------------------------------------------------------------------------- 1 | # ApacheCamelRestExample 2 | 3 | ## Info 4 | 5 | Project to explain how it works Apache Camel with Spring Actuator, Micrometer, Prometheus & Grafana. 6 | 7 | ## Links 8 | 9 | You can see an explanation in Spanish here: 10 | 11 | * Micrometer: 12 | 13 | You can see an explanation in English here: 14 | 15 | * Micrometer: 16 | 17 | 18 | ### Docker-Compose 19 | 20 | Run the following command in the /src/test/resources/docker folder 21 | 22 | ''' 23 | docker-compose up -d && docker-compose logs -f 24 | ''' 25 | 26 | 27 | ## Tags 28 | 29 | API, web services, integration, ESB, apache, camel, Prometheus, Grafana -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelMicrometer/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelMicrometer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #SPRING CONFIGURATION 2 | management.endpoints.web.exposure.include=prometheus 3 | 4 | #CAMEL CONFIGURATION 5 | #camel.component.metrics.metric-registry=prometheusMeterRegistry -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelMicrometer/src/test/resources/docker/config/prometheus.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: 'prometheus' 3 | scrape_interval: 1m 4 | static_configs: 5 | - targets: ['localhost:9090'] 6 | - job_name: 'camel-app' 7 | scrape_interval: 1m 8 | metrics_path: '/actuator/prometheus' 9 | static_configs: 10 | - targets: ['host.docker.internal:8080'] 11 | - job_name: 'grafana' 12 | scrape_interval: 1m 13 | metrics_path: '/metrics' 14 | static_configs: 15 | - targets: ['grafana:3000'] -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelMicrometer/src/test/resources/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | 3 | services: 4 | grafana: 5 | image: grafana/grafana:5.4.3 6 | ports: 7 | - 3000:3000 8 | volumes: 9 | - ./grafana:/var/lib/grafana 10 | environment: 11 | - GF_SECURITY_ADMIN_USER=admin 12 | - GF_SECURITY_ADMIN_PASSWORD=password 13 | networks: 14 | monitoring: 15 | aliases: 16 | - grafana 17 | prometheus: 18 | image: prom/prometheus:v2.6.1 19 | ports: 20 | - 9090:9090 21 | volumes: 22 | - ./config/prometheus.yml:/etc/prometheus/prometheus.yml 23 | - ./prometheus:/prometheus 24 | networks: 25 | monitoring: 26 | aliases: 27 | - prometheus 28 | networks: 29 | monitoring: -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelQuarkus/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM registry.access.redhat.com/ubi8/ubi-minimal 2 | WORKDIR /work/ 3 | COPY target/*-runner /work/application 4 | RUN chmod 775 /work 5 | EXPOSE 8099 6 | CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelQuarkus/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Quarkus 3 | # 4 | quarkus.banner.enabled = false 5 | quarkus.ssl.native=true 6 | # 7 | # Camel 8 | # 9 | camel.context.name = camel-quarkus 10 | 11 | # datasource configuration 12 | quarkus.datasource.db-kind=mysql 13 | quarkus.datasource.username=reader 14 | quarkus.datasource.password=password 15 | 16 | quarkus.datasource.jdbc.url=jdbc:mysql://localhost:3306/library?autoReconnect=true&useSSL=false -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelQuarkus/src/test/resources/docker/configs/mysql/conf.d/custom.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | max_connections=1500 3 | max_allowed_packet=1024M 4 | # innodb_buffer_pool_size=1024M 5 | # wait_timeout=350 6 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRestELK/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRestELK/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jdk-alpine 2 | 3 | ARG JAR_FILE 4 | COPY target/${JAR_FILE} app.jar 5 | ENTRYPOINT ["java","-jar","/app.jar"] -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRestELK/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRestELK/src/main/java/com/example/home/ApacheCamelRestExample/ApacheCamelRestExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelRestExample; 2 | 3 | import org.apache.camel.opentracing.starter.CamelOpenTracing; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | @CamelOpenTracing 9 | public class ApacheCamelRestExampleApplication { 10 | 11 | public static void main(final String[] args) { 12 | SpringApplication.run(ApacheCamelRestExampleApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRestELK/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | /home/dsblanco/Documentos/logs/apache_Camel_ELK.log 5 | 7 | >/home/dsblanco/Documentos/logs/apacheCamelELK.%d{yyyy-MM-dd}.log 8 | 7 9 | 10 | 11 | {"appname":"Apache Camel ELK"} 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRestELK/src/test/resources/docker-elk/.env: -------------------------------------------------------------------------------- 1 | ELK_VERSION=7.10.2 -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRestELK/src/test/resources/docker-elk/config/kibana.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## Default Kibana configuration from Kibana base image. 3 | ## https://github.com/elastic/kibana/blob/master/src/dev/build/tasks/os_packages/docker_generator/templates/kibana_yml.template.ts 4 | # 5 | server.name: kibana 6 | server.host: 0.0.0.0 7 | elasticsearch.hosts: [ "http://elasticsearch:9200" ] 8 | monitoring.ui.container.elasticsearch.enabled: true 9 | 10 | ## X-Pack security credentials 11 | # 12 | elasticsearch.username: elastic 13 | elasticsearch.password: changeme -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRestELK/src/test/resources/docker-elk/config/logstash.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## Default Logstash configuration from Logstash base image. 3 | ## https://github.com/elastic/logstash/blob/master/docker/data/logstash/config/logstash-full.yml 4 | # 5 | http.host: 0.0.0.0 6 | xpack.monitoring.elasticsearch.hosts: [ "http://elasticsearch:9200" ] 7 | 8 | ## X-Pack security credentials 9 | # 10 | xpack.monitoring.enabled: true 11 | xpack.monitoring.elasticsearch.username: elastic 12 | xpack.monitoring.elasticsearch.password: changeme -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRestELK/src/test/resources/docker-elk/config/mysql/conf.d/custom.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | max_connections=1500 3 | max_allowed_packet=1024M 4 | # innodb_buffer_pool_size=1024M 5 | # wait_timeout=350 6 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRestELK/src/test/resources/docker-elk/lib/mysql-connector-java-5.1.38.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/ApacheCamelExamples/ApacheCamelRestELK/src/test/resources/docker-elk/lib/mysql-connector-java-5.1.38.jar -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRestExample/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRestExample/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jdk-alpine 2 | 3 | ARG JAR_FILE 4 | COPY target/${JAR_FILE} app.jar 5 | ENTRYPOINT ["java","-jar","/app.jar"] -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRestExample/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRestExample/src/main/java/com/example/home/ApacheCamelRestExample/ApacheCamelRestExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelRestExample; 2 | 3 | import org.apache.camel.opentracing.starter.CamelOpenTracing; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | @CamelOpenTracing 9 | public class ApacheCamelRestExampleApplication { 10 | 11 | public static void main(final String[] args) { 12 | SpringApplication.run(ApacheCamelRestExampleApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRestExample/src/test/resources/docker/configs/mysql/conf.d/custom.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | max_connections=1500 3 | max_allowed_packet=1024M 4 | # innodb_buffer_pool_size=1024M 5 | # wait_timeout=350 6 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRest/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRest/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jdk-alpine 2 | 3 | ARG JAR_FILE 4 | COPY target/${JAR_FILE} app.jar 5 | ENTRYPOINT ["java","-jar","/app.jar"] -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRest/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRest/src/main/java/com/example/home/ApacheCamelRestExample/ApacheCamelRestExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelRestExample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ApacheCamelRestExampleApplication { 8 | public static void main(final String[] args) { 9 | SpringApplication.run(ApacheCamelRestExampleApplication.class, args); 10 | } 11 | } -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRest/src/main/java/com/example/home/ApacheCamelRestExample/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelRestExample.pojo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import lombok.ToString; 9 | 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | @ToString 14 | public class Book { 15 | 16 | @JsonProperty 17 | private Integer id; 18 | @JsonProperty 19 | private String name; 20 | @JsonProperty 21 | private String author; 22 | } 23 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRest2/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRest2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jdk-alpine 2 | 3 | ARG JAR_FILE 4 | COPY target/${JAR_FILE} app.jar 5 | ENTRYPOINT ["java","-jar","/app.jar"] -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRest2/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRest2/src/main/java/com/example/home/ApacheCamelRestExample/ApacheCamelRestExampleApplication2.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelRestExample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ApacheCamelRestExampleApplication2 { 8 | 9 | public static void main(final String[] args) { 10 | SpringApplication.run(ApacheCamelRestExampleApplication2.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRest2/src/main/java/com/example/home/ApacheCamelRestExample/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelRestExample.pojo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import lombok.ToString; 9 | 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | @ToString 14 | public class Book { 15 | 16 | @JsonProperty 17 | private Integer id; 18 | @JsonProperty 19 | private String name; 20 | @JsonProperty 21 | private String author; 22 | } 23 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRibbon/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRibbon/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jdk-alpine 2 | 3 | ARG JAR_FILE 4 | COPY target/${JAR_FILE} app.jar 5 | ENTRYPOINT ["java","-jar","/app.jar"] -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRibbon/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRibbon/src/main/java/com/example/home/ApacheCamelRestExample/ApacheCamelRibbonExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelRestExample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ApacheCamelRibbonExampleApplication { 8 | 9 | public static void main(final String[] args) { 10 | SpringApplication.run(ApacheCamelRibbonExampleApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRibbon/src/main/java/com/example/home/ApacheCamelRestExample/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelRestExample.pojo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import lombok.ToString; 9 | 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | @ToString 14 | public class Book { 15 | 16 | @JsonProperty 17 | private Integer id; 18 | @JsonProperty 19 | private String name; 20 | @JsonProperty 21 | private String author; 22 | } 23 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/ApacheCamelRibbon/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # the name of Camel 2 | camel.springboot.name=ServiceRibbon 3 | camel.springboot.main-run-controller=true 4 | 5 | camel.component.servlet.mapping.context-path=/* 6 | server.port=9092 7 | 8 | spring.application.name=app-camel-ribbon-client 9 | eureka.client.serviceUrl.defaultZone = http://localhost:8761/eureka/ 10 | #eureka.client.serviceUrl.defaultZone= http://${registry.host:localhost}:${registry.port:8761}/eureka/ 11 | eureka.client.healthcheck.enabled= true 12 | eureka.instance.leaseRenewalIntervalInSeconds= 1 13 | eureka.instance.leaseExpirationDurationInSeconds= 2 14 | 15 | server.ribbon.eureka.enabled=true 16 | camel.cloud.ribbon.properties[ServerListRefreshInterval] = 250 17 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/SpringEurekaServer/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/SpringEurekaServer/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/SpringEurekaServer/src/main/java/com/example/home/SpringEurekaServer/EurekaServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.SpringEurekaServer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class EurekaServerApplication { 10 | 11 | public static void main(final String[] args) { 12 | SpringApplication.run(EurekaServerApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelRibbon/SpringEurekaServer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name= ${springboot.app.name:eureka-serviceregistry} 2 | server.port = ${server-port:8761} 3 | eureka.instance.hostname= ${springboot.app.name:eureka-serviceregistry} 4 | eureka.client.registerWithEureka= false 5 | eureka.client.fetchRegistry= false 6 | eureka.client.serviceUrl.defaultZone: http://${registry.host:localhost}:${server.port}/eureka/ 7 | 8 | logging.level.com.netflix.eureka=OFF 9 | logging.level.com.netflix.discovery=OFF -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelServiceDiscoveryRibbon/ApacheCamelRest/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelServiceDiscoveryRibbon/ApacheCamelRest/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelServiceDiscoveryRibbon/ApacheCamelRest/src/main/java/com/example/home/ApacheCamelRestExample/ApacheCamelRestExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelRestExample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ApacheCamelRestExampleApplication { 8 | public static void main(final String[] args) { 9 | SpringApplication.run(ApacheCamelRestExampleApplication.class, args); 10 | } 11 | } -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelServiceDiscoveryRibbon/ApacheCamelRest/src/main/java/com/example/home/ApacheCamelRestExample/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelRestExample.pojo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import lombok.ToString; 9 | 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | @ToString 14 | public class Book { 15 | 16 | @JsonProperty 17 | private Integer id; 18 | @JsonProperty 19 | private String name; 20 | @JsonProperty 21 | private String author; 22 | } 23 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelServiceDiscoveryRibbon/ApacheCamelRest2/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelServiceDiscoveryRibbon/ApacheCamelRest2/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelServiceDiscoveryRibbon/ApacheCamelRest2/src/main/java/com/example/home/ApacheCamelRestExample/ApacheCamelRestExampleApplication2.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelRestExample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ApacheCamelRestExampleApplication2 { 8 | public static void main(final String[] args) { 9 | SpringApplication.run(ApacheCamelRestExampleApplication2.class, args); 10 | } 11 | } -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelServiceDiscoveryRibbon/ApacheCamelRest2/src/main/java/com/example/home/ApacheCamelRestExample/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelRestExample.pojo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import lombok.ToString; 9 | 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | @ToString 14 | public class Book { 15 | 16 | @JsonProperty 17 | private Integer id; 18 | @JsonProperty 19 | private String name; 20 | @JsonProperty 21 | private String author; 22 | } 23 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelServiceDiscoveryRibbon/ApacheCamelRibbon/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelServiceDiscoveryRibbon/ApacheCamelRibbon/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelServiceDiscoveryRibbon/ApacheCamelRibbon/src/main/java/com/example/home/ApacheCamelRestExample/ApacheCamelRibbonExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelRestExample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ApacheCamelRibbonExampleApplication { 8 | 9 | public static void main(final String[] args) { 10 | SpringApplication.run(ApacheCamelRibbonExampleApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelServiceDiscoveryRibbon/ApacheCamelRibbon/src/main/java/com/example/home/ApacheCamelRestExample/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelRestExample.pojo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import lombok.ToString; 9 | 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | @ToString 14 | public class Book { 15 | 16 | @JsonProperty 17 | private Integer id; 18 | @JsonProperty 19 | private String name; 20 | @JsonProperty 21 | private String author; 22 | } 23 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelTest/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelTest/README.md: -------------------------------------------------------------------------------- 1 | # ApacheCamelTest 2 | 3 | ## Info 4 | 5 | Project to explain how it works Testcontainers with Apache Camel. 6 | 7 | ## Links 8 | 9 | You can see an explanation in Spanish here: 10 | 11 | * ActiveMQ: https://DesarrolloJavaYYo.blogspot.com/ 12 | 13 | You can see an explanation in English here: 14 | 15 | * ActiveMQ: https://medium.com/@danielblancocuadrado/ 16 | 17 | ## Tags 18 | 19 | Integration, Apache Camel, ESB, Testing, JUnit5, Testcontainers, Spring boot -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelTest/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelTest/src/main/java/com/example/home/apachecamel/ApacheCamelTestApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.apachecamel; 2 | 3 | import javax.annotation.PostConstruct; 4 | import org.apache.camel.CamelContext; 5 | import org.apache.camel.component.activemq.ActiveMQComponent; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.SpringApplication; 8 | import org.springframework.boot.autoconfigure.SpringBootApplication; 9 | 10 | @SpringBootApplication 11 | public class ApacheCamelTestApplication { 12 | 13 | public static void main(final String[] args) { 14 | SpringApplication.run(ApacheCamelTestApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelTest/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # the name of Camel 2 | #camel.springboot.name=Service1 3 | camel.springboot.main-run-controller=true 4 | 5 | #custom property 6 | activemq.broker-url=tcp://localhost:62626 7 | 8 | #MySQL 9 | spring.datasource.url=jdbc:mysql://localhost:3306/library?createDatabaseIfNotExist=true&autoReconnect=true&useSSL=false 10 | spring.datasource.username=reader 11 | spring.datasource.password=password 12 | spring.datasource.platform=mysql 13 | spring.datasource.initialization-mode=always 14 | 15 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelTest/src/test/java/com/example/home/apachecamel/router/ApacheMySQLRouterTest.java: -------------------------------------------------------------------------------- 1 | package com.example.home.apachecamel.router; 2 | 3 | import org.apache.camel.ProducerTemplate; 4 | import org.junit.jupiter.api.Test; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | 7 | import lombok.extern.slf4j.Slf4j; 8 | 9 | @Slf4j 10 | public class ApacheMySQLRouterTest extends TestcontainersConf{ 11 | 12 | @Autowired 13 | ProducerTemplate producer; 14 | 15 | @Test 16 | public void getBookById() throws InterruptedException { 17 | log.info("getBookById - init"); 18 | producer.sendBodyAndHeader("direct:getBookById", null, "id", 1); 19 | Thread.sleep(5000); 20 | log.info("getBookById - end"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelZipkin/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelZipkin/README.md: -------------------------------------------------------------------------------- 1 | # ApacheCamel & Zipkin 2 | 3 | ## Info 4 | 5 | Project to explain how it works Apache Camel with Zipkin 6 | 7 | ## Links 8 | 9 | You can see an explanation in Spanish here: 10 | 11 | [https://desarrollojavayyo.blogspot.com/](https://desarrollojavayyo.blogspot.com/) 12 | 13 | 14 | You can see an explanation in English here: 15 | 16 | [https://medium.com/@danielblancocuadrado](https://medium.com/@danielblancocuadrado) 17 | 18 | 19 | ### Docker-Compose 20 | 21 | Run the following command in the /src/test/resources/docker folder 22 | 23 | ''' 24 | docker-compose up -d && docker-compose logs -f 25 | ''' 26 | 27 | 28 | ## Tags 29 | 30 | API, web services, integration, ESB, apache, camel, Zipkin -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelZipkin/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelZipkin/src/main/java/com/example/home/ApacheCamelZipkin/ApacheCamelZipKinApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelZipkin; 2 | 3 | import org.apache.camel.zipkin.starter.CamelZipkin; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | k 9 | public class ApacheCamelZipKinApplication { 10 | 11 | public static void main(final String[] args) { 12 | SpringApplication.run(ApacheCamelZipKinApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelZipkin/src/main/java/com/example/home/ApacheCamelZipkin/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package com.example.home.ApacheCamelZipkin.pojo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import lombok.ToString; 9 | 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | @ToString 14 | public class Book { 15 | 16 | @JsonProperty 17 | private Integer id; 18 | @JsonProperty 19 | private String name; 20 | @JsonProperty 21 | private String author; 22 | } 23 | -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelZipkin/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # the name of Camel 2 | camel.springboot.name=CamelZipkin 3 | camel.springboot.main-run-controller=true 4 | 5 | camel.component.servlet.mapping.context-path=/* 6 | server.port=9090 7 | 8 | 9 | #url to send data but needs serviceName header 10 | camel.zipkin.endpoint=http://localhost:9411/api/v2/spans 11 | 12 | camel.zipkin.service-name=camelZipkinMock 13 | camel.zipkin.server-service-mappings.mockClientGetAll=getAll 14 | camel.zipkin.server-service-mappings.mockGetById=getById -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelZipkin/src/test/resources/docker/config/prometheus.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: 'prometheus' 3 | scrape_interval: 1m 4 | static_configs: 5 | - targets: ['localhost:9090'] 6 | - job_name: 'camel-app' 7 | scrape_interval: 1m 8 | metrics_path: '/actuator/prometheus' 9 | static_configs: 10 | - targets: ['host.docker.internal:8080'] 11 | - job_name: 'grafana' 12 | scrape_interval: 1m 13 | metrics_path: '/metrics' 14 | static_configs: 15 | - targets: ['grafana:3000'] -------------------------------------------------------------------------------- /ApacheCamelExamples/ApacheCamelZipkin/src/test/resources/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | 3 | services: 4 | zipkin: 5 | image: openzipkin/zipkin 6 | ports: 7 | - 9411:9411 8 | networks: 9 | monitoring: 10 | aliases: 11 | - zipkin 12 | 13 | networks: 14 | monitoring: -------------------------------------------------------------------------------- /ConsulExample/SparkMicroservices/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /bin/ 3 | -------------------------------------------------------------------------------- /ConsulExample/SparkMicroservices/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM openjdk:8u151-jre 3 | 4 | WORKDIR /code 5 | 6 | COPY target/SparkExample-fat.jar /code 7 | 8 | CMD ["java", "-jar", "/code/SparkExample-fat.jar"] -------------------------------------------------------------------------------- /ConsulExample/SparkMicroservices/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ConsulExample/SparkMicroservices/src/main/java/es/home/example/sparkexample/bean/Msg.java: -------------------------------------------------------------------------------- 1 | package es.home.example.sparkexample.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class Msg { 9 | private String msg; 10 | } 11 | -------------------------------------------------------------------------------- /ConsulExample/SparkMicroservices/src/main/java/es/home/example/sparkexample/microservice/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package es.home.example.sparkexample.microservice; 2 | 3 | import static spark.Spark.get; 4 | import static spark.Spark.port; 5 | 6 | import com.google.gson.Gson; 7 | 8 | import es.home.example.sparkexample.bean.Msg; 9 | 10 | public class HelloWorld { 11 | public static void main(final String[] args) { 12 | port(8080); 13 | get("/hello", (req, res) -> { 14 | res.type("application/json"); 15 | return new Gson().toJson(new Msg("Hello World!")); 16 | }); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ConsulExample/docker-compose/data/portainer/config.json: -------------------------------------------------------------------------------- 1 | {"HttpHeaders":{"X-PortainerAgent-ManagerOperation":"1","X-PortainerAgent-PublicKey":"3059301306072a8648ce3d020106082a8648ce3d0301070342000406169667bad19d501c83eb18e178ebf56a6ab7b98169b0d42ffe9a9a26f6cf63f43a3658abb3050a16c81ef56b6efbcdc7cd8ac3d6dec231dbacb5fe43aaf4f2","X-PortainerAgent-Signature":"rD3irYmPWl3AIE/6uXKUhwoMjWC2yZxed1k93zW5CrfdQAEohVnlsYTS02pfTgItjwRwxbyF6bj29oAI7fBM7w"}} -------------------------------------------------------------------------------- /ExampleJasypt/BasicJasyptExample/.gitignore: -------------------------------------------------------------------------------- 1 | */target/** 2 | /target/ 3 | -------------------------------------------------------------------------------- /ExampleJasypt/BasicJasyptExample/README.md: -------------------------------------------------------------------------------- 1 | # BasicJasyptExample 2 | 3 | ## Info 4 | 5 | Project to explain how it works Jasypt in a standalone Java application 6 | 7 | ## Link 8 | 9 | * You can see an explanation in Spanish here: http://DesarrolloJavaYYo.blogspot.com 10 | * You can see an explanation in English here: https://danielblancocuadrado.medium.com/ 11 | 12 | ## Tags 13 | 14 | Jasypt, test, encryption, configuration, security -------------------------------------------------------------------------------- /ExampleJasypt/BasicJasyptExample/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ExampleJasypt/BasicJasyptExample/src/main/java/es/home/example/encrypt/GetSupportedPaswords.java: -------------------------------------------------------------------------------- 1 | package es.home.example.encrypt; 2 | 3 | import java.security.Provider; 4 | import java.security.Security; 5 | 6 | import lombok.extern.log4j.Log4j2; 7 | 8 | @Log4j2 9 | public class GetSupportedPaswords { 10 | 11 | public static void main(final String[] args) { 12 | for (Provider provider : Security.getProviders()) { 13 | log.info("Provider: " + provider.getName()); 14 | for (Provider.Service service : provider.getServices()) { 15 | log.info(" Algorithm: " + service.getAlgorithm()); 16 | } 17 | } 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ExampleJasypt/BasicJasyptExample/src/main/resources/configuration.properties: -------------------------------------------------------------------------------- 1 | datasource.usr=root 2 | datasource.pwd=ENC(xwg7loJbeovRKn4R710cjEKyTBfwQV/PNKgPHZdQoOQ1AQ9W/UwfjnhRyHUyuKdD) -------------------------------------------------------------------------------- /ExampleJasypt/BasicJasyptExample/src/main/resources/log4j2.properties: -------------------------------------------------------------------------------- 1 | status = error 2 | name = PropertiesConfig 3 | 4 | filters = threshold 5 | 6 | filter.threshold.type = ThresholdFilter 7 | filter.threshold.level = debug 8 | 9 | appenders = console 10 | 11 | appender.console.type = Console 12 | appender.console.name = STDOUT 13 | appender.console.layout.type = PatternLayout 14 | appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n 15 | 16 | rootLogger.level = debug 17 | rootLogger.appenderRefs = stdout 18 | rootLogger.appenderRef.stdout.ref = STDOUT -------------------------------------------------------------------------------- /ExampleJasypt/BasicJasyptExample/src/test/java/es/home/example/encrypt/helper/EncryptorHelperTest.java: -------------------------------------------------------------------------------- 1 | package es.home.example.encrypt.helper; 2 | 3 | import static org.hamcrest.CoreMatchers.equalTo; 4 | import static org.hamcrest.MatcherAssert.assertThat; 5 | 6 | import org.junit.jupiter.api.Test; 7 | 8 | public class EncryptorHelperTest { 9 | 10 | String root = "root"; 11 | 12 | @Test 13 | public void encripted() { 14 | assertThat(EncryptorHelper.getINSTANCE().getProperty("datasource.usr"), equalTo(root)); 15 | } 16 | 17 | @Test 18 | public void non_encripted() { 19 | assertThat(EncryptorHelper.getINSTANCE().getProperty("datasource.pwd"), equalTo(root)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ExampleJasypt/BasicJasyptExample/target/classes/es/home/example/encrypt/GetSupportedPaswords.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/ExampleJasypt/BasicJasyptExample/target/classes/es/home/example/encrypt/GetSupportedPaswords.class -------------------------------------------------------------------------------- /ExampleJasypt/BasicJasyptExample/target/test-classes/es/home/example/encrypt/TestEncryption.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/ExampleJasypt/BasicJasyptExample/target/test-classes/es/home/example/encrypt/TestEncryption.class -------------------------------------------------------------------------------- /ExampleJasypt/BasicJasyptExample/target/test-classes/es/home/example/encrypt/helper/EncryptorHelperTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/ExampleJasypt/BasicJasyptExample/target/test-classes/es/home/example/encrypt/helper/EncryptorHelperTest.class -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/.gitignore: -------------------------------------------------------------------------------- 1 | */target/** 2 | /target/ 3 | -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/README.md: -------------------------------------------------------------------------------- 1 | # SpringJasyptExample 2 | 3 | ## Info 4 | 5 | Project to explain how it works Jasypt with Spring boot 6 | 7 | ## Link 8 | 9 | * You can see an explanation in Spanish here: http://DesarrolloJavaYYo.blogspot.com 10 | * You can see an explanation in English here: https://danielblancocuadrado.medium.com/ 11 | 12 | ## Tags 13 | 14 | Jasypt, Spring, test, encryption, configuration, security -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/src/main/java/es/home/example/encrypt/Aplicacion.java: -------------------------------------------------------------------------------- 1 | package es.home.example.encrypt; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.annotation.ComponentScan; 6 | 7 | import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties; 8 | 9 | @SpringBootApplication 10 | @ComponentScan(basePackages = { "es.home.example.encrypt" }) 11 | @EnableEncryptableProperties 12 | public class Aplicacion { 13 | public static void main(final String[] args) { 14 | SpringApplication.run(Aplicacion.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/src/main/java/es/home/example/encrypt/service/AppPropertyService.java: -------------------------------------------------------------------------------- 1 | package es.home.example.encrypt.service; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.stereotype.Service; 5 | 6 | import lombok.Getter; 7 | 8 | @Service 9 | @Getter 10 | public class AppPropertyService { 11 | @Value("${spring.datasource.username}") 12 | private String usr; 13 | @Value("${spring.datasource.password}") 14 | private String pwd; 15 | } 16 | -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/src/main/java/es/home/example/encrypt/service/ConfigurationPropService.java: -------------------------------------------------------------------------------- 1 | package es.home.example.encrypt.service; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | import lombok.Data; 7 | 8 | @ConfigurationProperties(prefix = "datasource") 9 | @Configuration("configuration") 10 | @Data 11 | public class ConfigurationPropService { 12 | private String usr; 13 | private String pwd; 14 | } 15 | -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/src/main/java/es/home/example/encrypt/service/PropertyService.java: -------------------------------------------------------------------------------- 1 | package es.home.example.encrypt.service; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.context.annotation.PropertySource; 5 | import org.springframework.stereotype.Service; 6 | 7 | import lombok.Getter; 8 | 9 | @Service 10 | @Getter 11 | @PropertySource("classpath:configuration.properties") 12 | public class PropertyService { 13 | 14 | @Value("${datasource.usr}") 15 | private String usr; 16 | 17 | @Value("${datasource.pwd}") 18 | private String pwd; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | jasypt.encryptor.algorithm=PBEWithHmacSHA512AndAES_256 2 | jasypt.encryptor.iv-generator-classname=org.jasypt.iv.RandomIvGenerator 3 | 4 | spring.datasource.jdbc-url=jdbc:oracle:thin:@localhost:1521/XE 5 | spring.datasource.username=root 6 | spring.datasource.password=ENC(xwg7loJbeovRKn4R710cjEKyTBfwQV/PNKgPHZdQoOQ1AQ9W/UwfjnhRyHUyuKdD) 7 | spring.datasource.driver-class-name=oracle.jdbc.OracleDriver -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/src/main/resources/configuration.properties: -------------------------------------------------------------------------------- 1 | datasource.usr=root 2 | datasource.pwd=ENC(xwg7loJbeovRKn4R710cjEKyTBfwQV/PNKgPHZdQoOQ1AQ9W/UwfjnhRyHUyuKdD) -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/src/main/resources/log4j2.properties: -------------------------------------------------------------------------------- 1 | status = error 2 | name = PropertiesConfig 3 | 4 | filters = threshold 5 | 6 | filter.threshold.type = ThresholdFilter 7 | filter.threshold.level = debug 8 | 9 | appenders = console 10 | 11 | appender.console.type = Console 12 | appender.console.name = STDOUT 13 | appender.console.layout.type = PatternLayout 14 | appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n 15 | 16 | rootLogger.level = debug 17 | rootLogger.appenderRefs = stdout 18 | rootLogger.appenderRef.stdout.ref = STDOUT -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/src/test/java/es/home/example/encrypt/ConfigurationPropServiceTest.java: -------------------------------------------------------------------------------- 1 | package es.home.example.encrypt; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import org.junit.jupiter.api.Test; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | 9 | import es.home.example.encrypt.service.ConfigurationPropService; 10 | 11 | @SpringBootTest 12 | public class ConfigurationPropServiceTest { 13 | 14 | @Autowired 15 | ConfigurationPropService service; 16 | 17 | // Setting env JASYPT_ENCRYPTOR_PASSWORD=XXXX 18 | @Test 19 | public void testProps() { 20 | assertEquals(service.getUsr(), "root"); 21 | assertEquals(service.getPwd(), "root"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/src/test/java/es/home/example/encrypt/PropertyServiceTest.java: -------------------------------------------------------------------------------- 1 | package es.home.example.encrypt; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import org.junit.jupiter.api.Test; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | 9 | import es.home.example.encrypt.service.PropertyService; 10 | 11 | @SpringBootTest 12 | public class PropertyServiceTest { 13 | 14 | @Autowired 15 | PropertyService service; 16 | 17 | // executing in eclipse with argument: -Djasypt_encryptor_password=XXXX 18 | 19 | @Test 20 | public void testProps() { 21 | assertEquals(service.getUsr(), "root"); 22 | assertEquals(service.getPwd(), "root"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | jasypt.encryptor.algorithm=PBEWithHmacSHA512AndAES_256 2 | jasypt.encryptor.iv-generator-classname=org.jasypt.iv.RandomIvGenerator 3 | 4 | spring.datasource.jdbc-url=jdbc:oracle:thin:@localhost:1521/XE 5 | spring.datasource.username=root 6 | spring.datasource.password=ENC(xwg7loJbeovRKn4R710cjEKyTBfwQV/PNKgPHZdQoOQ1AQ9W/UwfjnhRyHUyuKdD) 7 | spring.datasource.driver-class-name=oracle.jdbc.OracleDriver -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/target/classes/configuration.properties: -------------------------------------------------------------------------------- 1 | datasource.usr=root 2 | datasource.pwd=ENC(xwg7loJbeovRKn4R710cjEKyTBfwQV/PNKgPHZdQoOQ1AQ9W/UwfjnhRyHUyuKdD) -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/target/classes/log4j2.properties: -------------------------------------------------------------------------------- 1 | status = error 2 | name = PropertiesConfig 3 | 4 | filters = threshold 5 | 6 | filter.threshold.type = ThresholdFilter 7 | filter.threshold.level = debug 8 | 9 | appenders = console 10 | 11 | appender.console.type = Console 12 | appender.console.name = STDOUT 13 | appender.console.layout.type = PatternLayout 14 | appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n 15 | 16 | rootLogger.level = debug 17 | rootLogger.appenderRefs = stdout 18 | rootLogger.appenderRef.stdout.ref = STDOUT -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst: -------------------------------------------------------------------------------- 1 | es/home/example/encrypt/service/PropertyService.class 2 | es/home/example/encrypt/service/AppPropertyService.class 3 | es/home/example/encrypt/service/ConfigurationPropService.class 4 | es/home/example/encrypt/Aplicacion.class 5 | -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst: -------------------------------------------------------------------------------- 1 | /home/dsblanco/Git/deesebc/PostExamples/ExampleJasypt/SpringJasyptExample/src/main/java/es/home/example/encrypt/Aplicacion.java 2 | /home/dsblanco/Git/deesebc/PostExamples/ExampleJasypt/SpringJasyptExample/src/main/java/es/home/example/encrypt/service/AppPropertyService.java 3 | /home/dsblanco/Git/deesebc/PostExamples/ExampleJasypt/SpringJasyptExample/src/main/java/es/home/example/encrypt/service/ConfigurationPropService.java 4 | /home/dsblanco/Git/deesebc/PostExamples/ExampleJasypt/SpringJasyptExample/src/main/java/es/home/example/encrypt/service/PropertyService.java 5 | -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst: -------------------------------------------------------------------------------- 1 | es/home/example/encrypt/PropertyServiceTest.class 2 | es/home/example/encrypt/AppPropertyServiceTest.class 3 | es/home/example/encrypt/ConfigurationPropServiceTest.class 4 | -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst: -------------------------------------------------------------------------------- 1 | /home/dsblanco/Git/deesebc/PostExamples/ExampleJasypt/SpringJasyptExample/src/test/java/es/home/example/encrypt/ConfigurationPropServiceTest.java 2 | /home/dsblanco/Git/deesebc/PostExamples/ExampleJasypt/SpringJasyptExample/src/test/java/es/home/example/encrypt/PropertyServiceTest.java 3 | /home/dsblanco/Git/deesebc/PostExamples/ExampleJasypt/SpringJasyptExample/src/test/java/es/home/example/encrypt/AppPropertyServiceTest.java 4 | -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/target/surefire-reports/es.home.example.encrypt.AppPropertyServiceTest.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: es.home.example.encrypt.AppPropertyServiceTest 3 | ------------------------------------------------------------------------------- 4 | Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.801 s - in es.home.example.encrypt.AppPropertyServiceTest 5 | -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/target/surefire-reports/es.home.example.encrypt.ConfigurationPropServiceTest.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: es.home.example.encrypt.ConfigurationPropServiceTest 3 | ------------------------------------------------------------------------------- 4 | Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 s - in es.home.example.encrypt.ConfigurationPropServiceTest 5 | -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/target/surefire-reports/es.home.example.encrypt.PropertyServiceTest.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: es.home.example.encrypt.PropertyServiceTest 3 | ------------------------------------------------------------------------------- 4 | Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 s - in es.home.example.encrypt.PropertyServiceTest 5 | -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/target/test-classes/es/home/example/encrypt/AppPropertyServiceTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/ExampleJasypt/SpringJasyptExample/target/test-classes/es/home/example/encrypt/AppPropertyServiceTest.class -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/target/test-classes/es/home/example/encrypt/ConfigurationPropServiceTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/ExampleJasypt/SpringJasyptExample/target/test-classes/es/home/example/encrypt/ConfigurationPropServiceTest.class -------------------------------------------------------------------------------- /ExampleJasypt/SpringJasyptExample/target/test-classes/es/home/example/encrypt/PropertyServiceTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/ExampleJasypt/SpringJasyptExample/target/test-classes/es/home/example/encrypt/PropertyServiceTest.class -------------------------------------------------------------------------------- /ExampleJaxRS/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /.apt_generated/ 3 | /.apt_generated_tests/ 4 | -------------------------------------------------------------------------------- /ExampleJaxRS/README.md: -------------------------------------------------------------------------------- 1 | # ExampleJaxRS 2 | 3 | ## Info 4 | 5 | Project to explain how it works Jersey JAX-RS with jersey-servlet:1.19 6 | 7 | ## Link 8 | 9 | You can see an explanation in Spanish here: http://DesarrolloJavaYYo.blogspot.com/2015/10/webservice-rest-jax-rs.html 10 | 11 | ## Tags 12 | 13 | Hibernate, Java EE, JAX-RS, JPA, microservicio, PoC, REST -------------------------------------------------------------------------------- /ExampleJaxRS/src/main/java/es/home/ws/example/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package es.home.ws.example.dao; 2 | 3 | import java.util.List; 4 | 5 | import es.home.ws.example.model.User; 6 | 7 | public interface UserDao { 8 | List getUsers(); 9 | } 10 | -------------------------------------------------------------------------------- /ExampleJaxRS/src/main/java/es/home/ws/example/dao/impl/UserDaoImpl.java: -------------------------------------------------------------------------------- 1 | package es.home.ws.example.dao.impl; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.EntityManager; 6 | import javax.persistence.Query; 7 | 8 | import es.home.ws.example.dao.UserDao; 9 | import es.home.ws.example.model.User; 10 | 11 | public class UserDaoImpl extends AbstractDao implements UserDao { 12 | 13 | @Override 14 | @SuppressWarnings("unchecked") 15 | public List getUsers() { 16 | EntityManager em = getEntityManager(); 17 | Query qry = em.createQuery("select p from User p"); 18 | qry.setMaxResults(100); 19 | return qry.getResultList(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ExampleJaxRS/src/main/java/es/home/ws/example/service/WebServiceSample.java: -------------------------------------------------------------------------------- 1 | package es.home.ws.example.service; 2 | 3 | import java.util.List; 4 | 5 | import es.home.ws.example.model.ws.UserXml; 6 | 7 | public interface WebServiceSample { 8 | 9 | List getPersonas(); 10 | } 11 | -------------------------------------------------------------------------------- /ExampleJaxRS/src/test/resources/docker/configs/mysql/conf.d/custom.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | max_connections=1500 3 | max_allowed_packet=1024M 4 | # innodb_buffer_pool_size=1024M 5 | # wait_timeout=350 6 | -------------------------------------------------------------------------------- /ExampleJaxRS/src/test/resources/docker/configs/mysql/scripts/users.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE almacen; 2 | GRANT ALL PRIVILEGES ON almacen.* TO 'administrator'@'%' IDENTIFIED BY 'password'; 3 | 4 | USE `almacen`; 5 | 6 | CREATE TABLE `users` ( 7 | `USER_ID` int(10) unsigned NOT NULL AUTO_INCREMENT, 8 | `USERNAME` varchar(45) DEFAULT NULL, 9 | `PASSWORD` varchar(100) DEFAULT NULL, 10 | `ENABLED` tinyint(1) NOT NULL DEFAULT '0', 11 | PRIMARY KEY (`USER_ID`) 12 | ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; 13 | 14 | -- user:admin password:admin 15 | insert into users (USER_ID, USERNAME, PASSWORD, ENABLED) values ('1', 'admin', '$2a$10$h.p9sfywxm02e0tU8Zlu2O5VEb6JFOUU6V5RhdVhxIvOeduMppMvS', '1'); 16 | 17 | -------------------------------------------------------------------------------- /ExampleJaxRS/src/test/resources/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2.4' 2 | networks: 3 | sandbox-net: 4 | ipam: 5 | driver: default 6 | config: 7 | - subnet: 172.28.0.0/16 8 | 9 | services: 10 | mysql: 11 | image: mysql:5.7.26 12 | mem_limit: 2G 13 | container_name: sandbox-mysql 14 | hostname: sandbox-mysql 15 | networks: 16 | sandbox-net: 17 | ipv4_address: 172.28.1.1 18 | environment: 19 | MYSQL_HOST: sandbox-mysql 20 | MYSQL_ROOT_PASSWORD: root 21 | ports: 22 | - 3306:3306 23 | volumes: 24 | - ./configs/mysql/conf.d/custom.cnf:/etc/mysql/conf.d/custom.cnf 25 | - ./configs/mysql/scripts:/docker-entrypoint-initdb.d -------------------------------------------------------------------------------- /ExampleWS/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /ExampleWS/README.md: -------------------------------------------------------------------------------- 1 | # ExampleWS 2 | 3 | ## Info 4 | 5 | Project to explain how it works JAX-WS with jaxws-rt:2.2.10 6 | 7 | ## Link 8 | 9 | You can see an explanation in Spanish here: http://DesarrolloJavaYYo.blogspot.com/2015/08/webservice-con-jax-ws-i.html 10 | 11 | ## Tags 12 | 13 | annotation, Java EE, JAX-WS, microservicio, PoC, web services -------------------------------------------------------------------------------- /ExampleWS/src/main/java/es/home/ws/example/WebServiceSample.java: -------------------------------------------------------------------------------- 1 | package es.home.ws.example; 2 | 3 | import java.util.List; 4 | 5 | import javax.jws.WebMethod; 6 | import javax.jws.WebService; 7 | 8 | import es.home.ws.example.model.ws.Saludo; 9 | import es.home.ws.example.model.ws.UserXml; 10 | 11 | @WebService 12 | public interface WebServiceSample { 13 | 14 | @WebMethod 15 | Saludo saluda(); 16 | 17 | @WebMethod 18 | String despide(); 19 | 20 | @WebMethod 21 | List getUsers(); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /ExampleWS/src/main/java/es/home/ws/example/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package es.home.ws.example.dao; 2 | 3 | import java.util.List; 4 | 5 | import es.home.ws.example.model.User; 6 | 7 | public interface UserDao { 8 | List getUsers(); 9 | } 10 | -------------------------------------------------------------------------------- /ExampleWS/src/main/java/es/home/ws/example/dao/impl/UserDaoImpl.java: -------------------------------------------------------------------------------- 1 | package es.home.ws.example.dao.impl; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.EntityManager; 6 | import javax.persistence.Query; 7 | 8 | import es.home.ws.example.dao.UserDao; 9 | import es.home.ws.example.model.User; 10 | 11 | public class UserDaoImpl extends AbstractDao implements UserDao { 12 | 13 | @Override 14 | @SuppressWarnings("unchecked") 15 | public List getUsers() { 16 | EntityManager em = getEntityManager(); 17 | Query qry = em.createQuery("select p from User p"); 18 | qry.setMaxResults(100); 19 | return qry.getResultList(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ExampleWS/src/main/java/es/home/ws/example/model/ws/Saludo.java: -------------------------------------------------------------------------------- 1 | package es.home.ws.example.model.ws; 2 | 3 | import javax.xml.bind.annotation.XmlElement; 4 | import javax.xml.bind.annotation.XmlRootElement; 5 | 6 | @XmlRootElement 7 | public class Saludo { 8 | 9 | private String saludo; 10 | private String nombre; 11 | 12 | @XmlElement 13 | public String getSaludo() { 14 | return saludo; 15 | } 16 | 17 | public void setSaludo(String saludo) { 18 | this.saludo = saludo; 19 | } 20 | 21 | @XmlElement 22 | public String getNombre() { 23 | return nombre; 24 | } 25 | 26 | public void setNombre(String nombre) { 27 | this.nombre = nombre; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ExampleWS/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=DEBUG, stdout 3 | 4 | # Direct log messages to stdout 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.Target=System.out 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n -------------------------------------------------------------------------------- /ExampleWS/src/main/webapp/WEB-INF/sun-jaxws.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | -------------------------------------------------------------------------------- /ExampleWSClient/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /.apt_generated/ 3 | /.apt_generated_tests/ 4 | -------------------------------------------------------------------------------- /ExampleWSClient/README.md: -------------------------------------------------------------------------------- 1 | # ExampleWS 2 | 3 | ## Info 4 | 5 | Project to explain how it works a web-client with JAX-WS and jaxws-rt:2.3.0 6 | 7 | ## Link 8 | 9 | You can see an explanation in Spanish here: http://DesarrolloJavaYYo.blogspot.com/ 10 | 11 | ## Tags 12 | 13 | JAX-WS, Java EE, WSDL, SOAP, web services, web service client, cliente, -------------------------------------------------------------------------------- /ExampleWSClient/src/main/java/es/home/example/client/WebServiceClient.java: -------------------------------------------------------------------------------- 1 | package es.home.example.client; 2 | 3 | import javax.xml.ws.WebServiceRef; 4 | 5 | import es.home.ws.example.Saludo; 6 | import es.home.ws.example.impl.WebServiceSample; 7 | import es.home.ws.example.impl.WebServiceSampleImplService; 8 | 9 | public class WebServiceClient { 10 | @WebServiceRef(wsdlLocation = "META-INF/wsdl/webservice-sample.wsdl") 11 | private static WebServiceSample service; 12 | 13 | public WebServiceClient() { 14 | service = new WebServiceSampleImplService().getWebServiceSampleImplPort(); 15 | } 16 | 17 | public String despide() { 18 | return service.despide(); 19 | } 20 | 21 | public Saludo saluda() { 22 | return service.saluda(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ExampleWSClient/src/main/java/es/home/ws/example/Book.java: -------------------------------------------------------------------------------- 1 | package es.home.ws.example; 2 | 3 | import com.google.auto.value.AutoValue; 4 | 5 | @AutoValue 6 | public abstract class Book { 7 | public static Book create(final String name, final String author, final Integer pages) { 8 | return new AutoValue_Book(name, author, pages); 9 | } 10 | 11 | public abstract String name(); 12 | 13 | public abstract String author(); 14 | 15 | public abstract Integer pages(); 16 | } 17 | -------------------------------------------------------------------------------- /ExampleWSClient/src/test/java/es/home/example/test/client/WebServiceClientTest.java: -------------------------------------------------------------------------------- 1 | package es.home.example.test.client; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | import static org.junit.Assert.assertNotNull; 5 | 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | 9 | import es.home.example.client.WebServiceClient; 10 | import es.home.ws.example.Saludo; 11 | 12 | public class WebServiceClientTest { 13 | WebServiceClient client; 14 | 15 | @Before 16 | public void configure() { 17 | client = new WebServiceClient(); 18 | } 19 | 20 | @Test 21 | public void metodo() { 22 | Saludo saluda = client.saluda(); 23 | assertNotNull(saluda); 24 | assertEquals("John", saluda.getNombre()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /FOPExample/.gitignore: -------------------------------------------------------------------------------- 1 | /.gradle/ 2 | /bin/ 3 | /.classpath 4 | /.project 5 | /.DS_Store 6 | /.settings/ 7 | -------------------------------------------------------------------------------- /FOPExample/ChangeLog.md: -------------------------------------------------------------------------------- 1 | #Changes 2 | 3 | ## 1.0.0-SNAPSHOT 4 | 5 | - Initial version. It contains a basic example of apache FOP -------------------------------------------------------------------------------- /FOPExample/README.md: -------------------------------------------------------------------------------- 1 | # FOPExample 2 | 3 | Project to explain how create a PDF in Java. We can do it with Apache FOP with org.apache.xmlgraphics.fop:2.3 4 | 5 | Web Page: https://xmlgraphics.apache.org/fop/ 6 | 7 | You can see an explanation in Spanish here: http://DesarrolloJavaYYo.blogspot.com -------------------------------------------------------------------------------- /FOPExample/src/main/resources/xml/foXSLTAndSourceExample.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | The Stars My Destination 4 | Alfred Bester 5 | 1957 6 | 19.99 7 | 8 | 9 | The Philosopher's Stone 10 | J K. Rowling 11 | 1997 12 | 29.99 13 | 14 | 15 | Mythago Wood 16 | Robert Holdstock 17 | 1984 18 | 9.99 19 | 20 | -------------------------------------------------------------------------------- /FeignExample/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /FeignExample/README.md: -------------------------------------------------------------------------------- 1 | # FeignExample 2 | 3 | ## Info 4 | 5 | Project to explain how it works a feign 6 | 7 | ## Link 8 | 9 | You can see an explanation in Spanish here: http://DesarrolloJavaYYo.blogspot.com/ 10 | 11 | ## Tags 12 | 13 | Java, Feign, web service client, cliente, -------------------------------------------------------------------------------- /FeignExample/src/main/java/es/home/example/feignexample/customize/CustomErrorDecode.java: -------------------------------------------------------------------------------- 1 | package es.home.example.feignexample.customize; 2 | 3 | import feign.Response; 4 | import feign.codec.ErrorDecoder; 5 | 6 | public class CustomErrorDecode implements ErrorDecoder { 7 | @Override 8 | public Exception decode(final String methodKey, final Response response) { 9 | if (response.status() > 399) { 10 | return new CustomException("Error detected in backend"); 11 | } else { 12 | return new Default().decode(methodKey, response); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /FeignExample/src/main/java/es/home/example/feignexample/customize/CustomException.java: -------------------------------------------------------------------------------- 1 | package es.home.example.feignexample.customize; 2 | 3 | public class CustomException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 2878833957128656805L; 9 | 10 | public CustomException(final String message) { 11 | super(message); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /FeignExample/src/main/java/es/home/example/feignexample/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package es.home.example.feignexample.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import lombok.ToString; 7 | 8 | @ToString 9 | @Data 10 | @NoArgsConstructor 11 | @AllArgsConstructor 12 | public class Book { 13 | 14 | private Integer id; 15 | private String title; 16 | private String author; 17 | 18 | } -------------------------------------------------------------------------------- /FeignExample/src/main/java/es/home/example/feignexample/pojo/Token.java: -------------------------------------------------------------------------------- 1 | package es.home.example.feignexample.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @AllArgsConstructor 8 | @Data 9 | @NoArgsConstructor 10 | public class Token { 11 | 12 | private String clientId; 13 | private String clientSecret; 14 | } 15 | -------------------------------------------------------------------------------- /FeignExample/src/main/resources/config.properties: -------------------------------------------------------------------------------- 1 | discovery-client.ribbon.listOfServers=localhost:57010,localhost:57011 -------------------------------------------------------------------------------- /FeignExample/src/test/java/log4j.properties: -------------------------------------------------------------------------------- 1 | # Set root logger level to DEBUG and its only appender to A1. 2 | log4j.rootLogger=DEBUG, A1 3 | 4 | # A1 is set to be a ConsoleAppender. 5 | log4j.appender.A1=org.apache.log4j.ConsoleAppender 6 | 7 | # A1 uses PatternLayout. 8 | log4j.appender.A1.layout=org.apache.log4j.PatternLayout 9 | log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n -------------------------------------------------------------------------------- /FeignExample/src/test/resources/wiremock/__files/book1.json: -------------------------------------------------------------------------------- 1 | { 2 | "id":1, 3 | "author":"Orson S. Card", 4 | "title":"Ender's game" 5 | } -------------------------------------------------------------------------------- /FeignExample/src/test/resources/wiremock/__files/book3_update.json: -------------------------------------------------------------------------------- 1 | {"id":3,"author":"Frank Herbert.","title":"Dune"} -------------------------------------------------------------------------------- /FeignExample/src/test/resources/wiremock/__files/books.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "id":1, 3 | "author":"Orson S. Card", 4 | "title":"Ender's game'" 5 | },{ 6 | "id":2, 7 | "author":"Alfred Bester", 8 | "title":"The Stars My Destination" 9 | },{ 10 | "id":3, 11 | "author":"Frank Herbert", 12 | "title":"Dune" 13 | }] -------------------------------------------------------------------------------- /FlywayExample/.gitignore: -------------------------------------------------------------------------------- 1 | /.gradle/ 2 | -------------------------------------------------------------------------------- /FlywayExample/ChangeLog.md: -------------------------------------------------------------------------------- 1 | #Changes 2 | 3 | ## 1.0.0-SNAPSHOT 4 | 5 | - Initial version. It contains an example of how to use flywaydb -------------------------------------------------------------------------------- /FlywayExample/README.md: -------------------------------------------------------------------------------- 1 | # FlywayExample 2 | 3 | Project to explain how it works Flyway. 4 | 5 | To run the example it must be necessary have docker installed and execute the following command: 6 | 7 | docker run -d --name flyway-example-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root mysql:5.6 8 | 9 | Later you can execute this command inside the root folder of the project: 10 | 11 | ./gradlew flywayMigrate -i 12 | 13 | You can see an explanation in Spanish here: http://DesarrolloJavaYYo.blogspot.com/2018/xxxxxx -------------------------------------------------------------------------------- /FlywayExample/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/FlywayExample/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /FlywayExample/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /FlywayExample/src/main/resources/db/migration/V1__script_CREATE_BOOK.sql: -------------------------------------------------------------------------------- 1 | create table flywayExample.BOOK ( 2 | ID int not null, 3 | NAME varchar(100) not null, 4 | AUTHOR varchar(100) not null 5 | ); -------------------------------------------------------------------------------- /FlywayExample/src/main/resources/db/migration/V2__script_ALTER_BOOK.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE flywayExample.BOOK 2 | ADD PAGES int not null; -------------------------------------------------------------------------------- /FlywayExample/src/main/resources/db/migration/V3__script_INSERT_BOOK.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO flywayExample.BOOK (ID, NAME, AUTHOR, PAGES) VALUES (1, 'The stars my destination','Alfred Bester',400); 2 | INSERT INTO flywayExample.BOOK (ID, NAME, AUTHOR, PAGES) VALUES (2, 'The Ender\'s game ','Orson Scott Card',400); -------------------------------------------------------------------------------- /FlywayExample/src/test/resources/rundocker.sh: -------------------------------------------------------------------------------- 1 | docker run -d --name flyway-example-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root mysql:5.6 -------------------------------------------------------------------------------- /GraviteeExample/README.md: -------------------------------------------------------------------------------- 1 | # PostExamples 2 | 3 | ## Instrucctions 4 | 5 | For the deesebc/apache-camel-jpa, you must run the following command in the ../ApacheCamelRestExample folder: 6 | 7 | ''' 8 | mvn clean package 9 | ''' 10 | 11 | To run the docker-compose you must run the following command in the docker folder: 12 | 13 | ''' 14 | docker-compose up 15 | ''' 16 | 17 | ## URLs 18 | 19 | - Portainer: http://localhost:9000/ 20 | - Management UI: http://localhost:8084/#!/management/apis 21 | - Gateway: http://localhost:8082/ 22 | 23 | You have more explanation in spanish here: 24 | 25 | You have more explanation in english here: -------------------------------------------------------------------------------- /GraviteeExample/docker/configs/mysql/conf.d/custom.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | max_connections=1500 3 | max_allowed_packet=1024M 4 | # innodb_buffer_pool_size=1024M 5 | # wait_timeout=350 6 | -------------------------------------------------------------------------------- /HazelcastExample/RestEasyService/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /HazelcastExample/RestEasyService/Readme.md: -------------------------------------------------------------------------------- 1 | # Hazelcast Example 2 | 3 | Example to see how it works Hazelcast 4 | 5 | ## Documentation 6 | 7 | In Spanish [here](http://desarrollojavayyo.blogspot.com/) 8 | In English [here](https://medium.com/@danielblancocuadrado) 9 | 10 | ## Docker Compose 11 | 12 | Run docker compose up in src/test/resources folder 13 | 14 | ## Testing 15 | 16 | Execute GET http://localhost:8080/RestEasyService/rest/info/property to see the value of the property 'property'. 17 | 18 | Execute POST http://localhost:8080/RestEasyService/rest/info/property/value to set the value for the property and obtain the previous value 19 | 20 | To call tomcat-server1 use localhost:8080 and for tomcat-server2 use localhost:8082 -------------------------------------------------------------------------------- /HazelcastExample/RestEasyService/src/main/java/com/home/example/resteasy/Configuration.java: -------------------------------------------------------------------------------- 1 | package com.home.example.resteasy; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | import javax.ws.rs.core.Application; 5 | 6 | @ApplicationPath("rest") 7 | public class Configuration extends Application { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /HazelcastExample/RestEasyService/src/main/java/com/home/example/resteasy/bean/Info.java: -------------------------------------------------------------------------------- 1 | package com.home.example.resteasy.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @NoArgsConstructor 9 | @AllArgsConstructor 10 | public class Info { 11 | 12 | private String machine; 13 | 14 | private String property; 15 | 16 | private String value; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /HazelcastExample/RestEasyService/src/main/java/com/home/example/resteasy/hazelcast/HazelcastHelper.java: -------------------------------------------------------------------------------- 1 | package com.home.example.resteasy.hazelcast; 2 | 3 | import com.hazelcast.core.HazelcastInstance; 4 | 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | public final class HazelcastHelper { 9 | 10 | @Getter 11 | private static HazelcastHelper INSTANCE = new HazelcastHelper(); 12 | 13 | @Setter 14 | @Getter 15 | public HazelcastInstance hz; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /HazelcastExample/RestEasyService/src/test/resources/lib/hazelcast-all-4.2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/HazelcastExample/RestEasyService/src/test/resources/lib/hazelcast-all-4.2.2.jar -------------------------------------------------------------------------------- /HttpClientFluentExample/ChangeLog.md: -------------------------------------------------------------------------------- 1 | #Changes 2 | 3 | ## 1.0.0-SNAPSHOT 4 | 5 | - Initial version. It contains samples HTTP Apache CLient 5 -------------------------------------------------------------------------------- /HttpClientFluentExample/README.md: -------------------------------------------------------------------------------- 1 | # JerseyExample 2 | 3 | Project to explain how it works Apache HttpClient Fluent with fluent-hc:4.5.8 4 | 5 | You can see an explanation in Spanish here: http://DesarrolloJavaYYo.blogspot.com/2018/07/jersey-iniciacion.html -------------------------------------------------------------------------------- /JavaExamples/MapStructExample/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /.apt_generated_tests/ 3 | -------------------------------------------------------------------------------- /JavaExamples/MapStructExample/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /JavaExamples/MapStructExample/src/main/java/com/example/mapstruct/dto/BookDto.java: -------------------------------------------------------------------------------- 1 | package com.example.mapstruct.dto; 2 | 3 | import java.util.Date; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class BookDto { 9 | 10 | private Integer id; 11 | private Date publicationDate; 12 | private String author; 13 | private String name; 14 | private SagaDto serie; 15 | } 16 | -------------------------------------------------------------------------------- /JavaExamples/MapStructExample/src/main/java/com/example/mapstruct/dto/BookResumeDto.java: -------------------------------------------------------------------------------- 1 | package com.example.mapstruct.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class BookResumeDto { 7 | 8 | private String sagaName; 9 | private String bookName; 10 | } 11 | -------------------------------------------------------------------------------- /JavaExamples/MapStructExample/src/main/java/com/example/mapstruct/dto/SagaDto.java: -------------------------------------------------------------------------------- 1 | package com.example.mapstruct.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class SagaDto { 7 | 8 | private String name; 9 | private Integer numberNovels; 10 | } 11 | -------------------------------------------------------------------------------- /JavaExamples/MapStructExample/src/main/java/com/example/mapstruct/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package com.example.mapstruct.pojo; 2 | 3 | import java.time.LocalDate; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class Book { 9 | 10 | private Integer id; 11 | private LocalDate publicationDate; 12 | private String author; 13 | private String name; 14 | private String isbn; 15 | private Saga saga; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /JavaExamples/MapStructExample/src/main/java/com/example/mapstruct/pojo/Saga.java: -------------------------------------------------------------------------------- 1 | package com.example.mapstruct.pojo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Saga { 7 | 8 | private Integer id; 9 | private String name; 10 | private Long numberNovels; 11 | } 12 | -------------------------------------------------------------------------------- /JerseyExample/.gitignore: -------------------------------------------------------------------------------- 1 | /.gradle/ 2 | /bin/ 3 | /.classpath 4 | /.project 5 | /.DS_Store 6 | /.settings/ 7 | /build/ 8 | -------------------------------------------------------------------------------- /JerseyExample/ChangeLog.md: -------------------------------------------------------------------------------- 1 | #Changes 2 | 3 | ## 1.0.0-SNAPSHOT 4 | 5 | - Initial version. It contains samples for @GET, @PUT, @POST and @DELETE 6 | 7 | ## 1.1.0-SNAPSHOT 8 | 9 | - We include rest-assured to test it -------------------------------------------------------------------------------- /JerseyExample/README.md: -------------------------------------------------------------------------------- 1 | # JerseyExample 2 | 3 | Project to explain how it works Jersey JAX-RS with jersey-container-servlet:2.25.1 4 | 5 | You can see an explanation in Spanish here: http://DesarrolloJavaYYo.blogspot.com/2018/07/jersey-iniciacion.html 6 | 7 | ## Testing 8 | 9 | We have include rest-assured 3.3.0 to learn and know how this library works -------------------------------------------------------------------------------- /JerseyExample/src/main/java/es/home/example/api/BookWS.java: -------------------------------------------------------------------------------- 1 | package es.home.example.api; 2 | 3 | import java.util.Collection; 4 | 5 | import javax.ws.rs.core.Response; 6 | 7 | import es.home.example.pojo.Book; 8 | import es.home.example.pojo.Library; 9 | 10 | public interface BookWS { 11 | Collection getAll(); 12 | 13 | Library getLibrary(); 14 | 15 | Book getOne(final Integer id); 16 | 17 | Response deleteOne(final Integer id); 18 | 19 | Response updateOne(final Integer id, final Book book); 20 | 21 | Response saveOne(final Book book); 22 | } 23 | -------------------------------------------------------------------------------- /JerseyExample/src/main/java/es/home/example/pojo/Library.java: -------------------------------------------------------------------------------- 1 | package es.home.example.pojo; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class Library { 7 | List library = new ArrayList<>(); 8 | 9 | public List getLibrary() { 10 | return library; 11 | } 12 | 13 | public void setLibrary(List library) { 14 | this.library = library; 15 | } 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /JerseyExample/src/test/resources/book-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "properties": { 5 | "id": { 6 | "type": "integer" 7 | }, 8 | "author": { 9 | "type": "string" 10 | }, 11 | "name": { 12 | "type": "string" 13 | } 14 | }, 15 | "required": [ 16 | "id", 17 | "author", 18 | "name" 19 | ] 20 | } -------------------------------------------------------------------------------- /MSF4JExample/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /.apt_generated_tests/ 3 | -------------------------------------------------------------------------------- /MSF4JExample/ChangeLog.md: -------------------------------------------------------------------------------- 1 | #Changes 2 | 3 | ### 1.7.0-SNAPSHOT 4 | - We include a websocket example 5 | 6 | ### 1.6.0-SNAPSHOT 7 | - We include OAuth2 authorization 8 | 9 | ### 1.5.0-SNAPSHOT 10 | - We include basic authorization 11 | 12 | ### 1.4.0-SNAPSHOT 13 | - We include the use of JPA with H2 14 | 15 | ### 1.3.0-SNAPSHOT 16 | - We include the use of metrics 17 | 18 | ### 1.2.0-SNAPSHOT 19 | - We include an exception mapper 20 | 21 | ## 1.1.0-SNAPSHOT 22 | - We include swagger support 23 | 24 | ## 1.0.0-SNAPSHOT 25 | - Initial version -------------------------------------------------------------------------------- /MSF4JExample/src/main/java/es/home/example/dao/AbstractRepository.java: -------------------------------------------------------------------------------- 1 | package es.home.example.dao; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | import es.home.example.pojo.GenericEntity; 7 | 8 | public interface AbstractRepository

, K> { 9 | 10 | void create(P p); 11 | 12 | P findById(K id); 13 | 14 | List

getResultList(); 15 | 16 | void remove(P t); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /MSF4JExample/src/main/java/es/home/example/dao/BookDao.java: -------------------------------------------------------------------------------- 1 | package es.home.example.dao; 2 | 3 | import es.home.example.pojo.Book; 4 | 5 | public interface BookDao extends AbstractRepository { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /MSF4JExample/src/main/java/es/home/example/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package es.home.example.dao; 2 | 3 | import es.home.example.pojo.User; 4 | 5 | public interface UserDao extends AbstractRepository { 6 | User findByNameAndPassword(final String name, final String password); 7 | } 8 | -------------------------------------------------------------------------------- /MSF4JExample/src/main/java/es/home/example/dao/impl/BookDaoImpl.java: -------------------------------------------------------------------------------- 1 | package es.home.example.dao.impl; 2 | 3 | import javax.persistence.EntityManagerFactory; 4 | 5 | import es.home.example.dao.BookDao; 6 | import es.home.example.pojo.Book; 7 | 8 | public class BookDaoImpl extends AbstractRepositoryImpl implements BookDao { 9 | 10 | public BookDaoImpl() { 11 | super(); 12 | } 13 | 14 | public BookDaoImpl(final EntityManagerFactory emf) { 15 | super(emf); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /MSF4JExample/src/main/java/es/home/example/service/BookService.java: -------------------------------------------------------------------------------- 1 | package es.home.example.service; 2 | 3 | import java.util.List; 4 | 5 | import org.wso2.msf4j.Request; 6 | 7 | import es.home.example.pojo.Book; 8 | 9 | public interface BookService { 10 | Book getBookById(final Integer id); 11 | 12 | List getList(Request request); 13 | 14 | } -------------------------------------------------------------------------------- /MSF4JExample/src/main/java/es/home/example/service/OAuthValidatorService.java: -------------------------------------------------------------------------------- 1 | package es.home.example.service; 2 | 3 | import java.io.IOException; 4 | import java.security.KeyManagementException; 5 | import java.security.KeyStoreException; 6 | import java.security.NoSuchAlgorithmException; 7 | 8 | import org.apache.http.auth.AuthenticationException; 9 | import org.apache.http.client.ClientProtocolException; 10 | import org.wso2.msf4j.Request; 11 | 12 | public interface OAuthValidatorService { 13 | 14 | String validate(Request request, String token) throws AuthenticationException, KeyManagementException, 15 | NoSuchAlgorithmException, KeyStoreException, ClientProtocolException, IOException; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /MSF4JExample/src/main/resources/script/data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO Book(id, title, author) VALUES (1, '1984', 'George Orwell'); 2 | INSERT INTO Book(id, title, author) VALUES (2, 'Fahrenheit 451', 'Ray Bradbury'); 3 | INSERT INTO Book(id, title, author) VALUES (3, 'Brave New World', 'Aldous Huxley'); 4 | INSERT INTO User(id, name, password) VALUES (1, 'username', 'cGFzc3dvcmQ='); -------------------------------------------------------------------------------- /MailSenderExample/ChangeLog.md: -------------------------------------------------------------------------------- 1 | #Changes 2 | 3 | ## 1.0.0-SNAPSHOT 4 | 5 | - Initial version. -------------------------------------------------------------------------------- /MailSenderExample/README.md: -------------------------------------------------------------------------------- 1 | # Mail Sender Sample 2 | 3 | Project to explain how to send mail with attachments and relative paths 4 | 5 | You can see an explanation in Spanish here: https://DesarrolloJavaYYo.blogspot.com/2020/04/java-mail-con-adjuntos-y-rutas-relativas.html -------------------------------------------------------------------------------- /MailSenderExample/src/main/resources/content/images/header-wallpaper.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/MailSenderExample/src/main/resources/content/images/header-wallpaper.jpg -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s-config/.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !target/*-runner 3 | !target/*-runner.jar 4 | !target/lib/* 5 | !target/quarkus-app/* -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s-config/.gitignore: -------------------------------------------------------------------------------- 1 | #Maven 2 | target/ 3 | pom.xml.tag 4 | pom.xml.releaseBackup 5 | pom.xml.versionsBackup 6 | release.properties 7 | .flattened-pom.xml 8 | 9 | # Eclipse 10 | .project 11 | .classpath 12 | .settings/ 13 | bin/ 14 | 15 | # IntelliJ 16 | .idea 17 | *.ipr 18 | *.iml 19 | *.iws 20 | 21 | # NetBeans 22 | nb-configuration.xml 23 | 24 | # Visual Studio Code 25 | .vscode 26 | .factorypath 27 | 28 | # OSX 29 | .DS_Store 30 | 31 | # Vim 32 | *.swp 33 | *.swo 34 | 35 | # patch 36 | *.orig 37 | *.rej 38 | 39 | # Local environment 40 | .env 41 | 42 | # Plugin directory 43 | /.quarkus/cli/plugins/ 44 | -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s-config/src/main/java/com/home/example/repository/BookRepository.java: -------------------------------------------------------------------------------- 1 | package com.home.example.repository; 2 | 3 | import com.home.example.entity.Book; 4 | 5 | import io.quarkus.hibernate.orm.panache.PanacheRepository; 6 | import jakarta.enterprise.context.ApplicationScoped; 7 | import jakarta.transaction.Transactional; 8 | 9 | //warning: class not interface 10 | @ApplicationScoped 11 | @Transactional 12 | public class BookRepository implements PanacheRepository { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s-config/src/main/resources/V1__init_database.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `BOOK` ( 2 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 3 | `NAME` varchar(45) DEFAULT NULL, 4 | `AUTHOR` varchar(45) DEFAULT NULL, 5 | PRIMARY KEY (`ID`) 6 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; 7 | 8 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 9 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 10 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 11 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s-config/src/main/resources/db/ddl.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE library; 2 | GRANT ALL PRIVILEGES ON library.* TO 'username-default'@'%' IDENTIFIED BY 'my_cool_secret'; 3 | 4 | USE `library`; 5 | 6 | CREATE TABLE `BOOK` ( 7 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 8 | `NAME` varchar(45) DEFAULT NULL, 9 | `AUTHOR` varchar(45) DEFAULT NULL, 10 | PRIMARY KEY (`ID`) 11 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s-config/src/main/resources/db/init.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 2 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 3 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 4 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s-config/src/main/resources/db/migration/V1__init_database.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `BOOK` ( 2 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 3 | `NAME` varchar(45) DEFAULT NULL, 4 | `AUTHOR` varchar(45) DEFAULT NULL, 5 | PRIMARY KEY (`ID`) 6 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; 7 | 8 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 9 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 10 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 11 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s-config/src/test/resources/V1__init_database.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `BOOK` ( 2 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 3 | `NAME` varchar(45) DEFAULT NULL, 4 | `AUTHOR` varchar(45) DEFAULT NULL, 5 | PRIMARY KEY (`ID`) 6 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; 7 | 8 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 9 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 10 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 11 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s-config/src/test/resources/db/ddl.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE library; 2 | GRANT ALL PRIVILEGES ON library.* TO 'username-default'@'%' IDENTIFIED BY 'my_cool_secret'; 3 | 4 | USE `library`; 5 | 6 | CREATE TABLE `BOOK` ( 7 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 8 | `NAME` varchar(45) DEFAULT NULL, 9 | `AUTHOR` varchar(45) DEFAULT NULL, 10 | PRIMARY KEY (`ID`) 11 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s-config/src/test/resources/db/init.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 2 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 3 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 4 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s-config/src/test/resources/db/migration/V1__init_database.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `BOOK` ( 2 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 3 | `NAME` varchar(45) DEFAULT NULL, 4 | `AUTHOR` varchar(45) DEFAULT NULL, 5 | PRIMARY KEY (`ID`) 6 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; 7 | 8 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 9 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 10 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 11 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s-config/src/test/resources/docker/config/init.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE library; 2 | GRANT ALL PRIVILEGES ON library.* TO 'username-default'@'%' IDENTIFIED BY 'my_cool_secret'; 3 | 4 | USE `library`; 5 | 6 | CREATE TABLE `BOOK` ( 7 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 8 | `NAME` varchar(45) DEFAULT NULL, 9 | `AUTHOR` varchar(45) DEFAULT NULL, 10 | PRIMARY KEY (`ID`) 11 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; 12 | 13 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 14 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 15 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 16 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s-config/src/test/resources/kube/config/scripts/init.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE library; 2 | GRANT ALL PRIVILEGES ON library.* TO 'username-default'@'%' IDENTIFIED BY 'my_cool_secret'; 3 | 4 | USE `library`; 5 | 6 | CREATE TABLE `BOOK` ( 7 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 8 | `NAME` varchar(45) DEFAULT NULL, 9 | `AUTHOR` varchar(45) DEFAULT NULL, 10 | PRIMARY KEY (`ID`) 11 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; 12 | 13 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 14 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 15 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 16 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s-config/src/test/resources/kube/kind-config.yaml: -------------------------------------------------------------------------------- 1 | # run: kind create cluster --config kind-config.yaml --name kind-basic 2 | # checkIp: docker container inspect kind-basic-control-plane --format '{{ .NetworkSettings.Networks.kind.IPAddress }}' 3 | # destroy: kind delete cluster --name kind-basic 4 | apiVersion: kind.x-k8s.io/v1alpha4 5 | kind: Cluster 6 | nodes: 7 | - role: control-plane 8 | extraPortMappings: 9 | - containerPort: 30000 10 | hostPort: 30000 11 | listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0" 12 | protocol: tcp # Optional, defaults to tcp 13 | - role: worker -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s/.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !target/*-runner 3 | !target/*-runner.jar 4 | !target/lib/* 5 | !target/quarkus-app/* -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s/.gitignore: -------------------------------------------------------------------------------- 1 | #Maven 2 | target/ 3 | pom.xml.tag 4 | pom.xml.releaseBackup 5 | pom.xml.versionsBackup 6 | release.properties 7 | .flattened-pom.xml 8 | 9 | # Eclipse 10 | .project 11 | .classpath 12 | .settings/ 13 | bin/ 14 | 15 | # IntelliJ 16 | .idea 17 | *.ipr 18 | *.iml 19 | *.iws 20 | 21 | # NetBeans 22 | nb-configuration.xml 23 | 24 | # Visual Studio Code 25 | .vscode 26 | .factorypath 27 | 28 | # OSX 29 | .DS_Store 30 | 31 | # Vim 32 | *.swp 33 | *.swo 34 | 35 | # patch 36 | *.orig 37 | *.rej 38 | 39 | # Local environment 40 | .env 41 | 42 | # Plugin directory 43 | /.quarkus/cli/plugins/ 44 | -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s/src/main/java/com/home/example/repository/BookRepository.java: -------------------------------------------------------------------------------- 1 | package com.home.example.repository; 2 | 3 | import com.home.example.entity.Book; 4 | 5 | import io.quarkus.hibernate.orm.panache.PanacheRepository; 6 | import jakarta.enterprise.context.ApplicationScoped; 7 | import jakarta.transaction.Transactional; 8 | 9 | //warning: class not interface 10 | @ApplicationScoped 11 | @Transactional 12 | public class BookRepository implements PanacheRepository { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s/src/main/resources/V1__init_database.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `BOOK` ( 2 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 3 | `NAME` varchar(45) DEFAULT NULL, 4 | `AUTHOR` varchar(45) DEFAULT NULL, 5 | PRIMARY KEY (`ID`) 6 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; 7 | 8 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 9 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 10 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 11 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s/src/main/resources/db/ddl.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE library; 2 | GRANT ALL PRIVILEGES ON library.* TO 'username-default'@'%' IDENTIFIED BY 'my_cool_secret'; 3 | 4 | USE `library`; 5 | 6 | CREATE TABLE `BOOK` ( 7 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 8 | `NAME` varchar(45) DEFAULT NULL, 9 | `AUTHOR` varchar(45) DEFAULT NULL, 10 | PRIMARY KEY (`ID`) 11 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s/src/main/resources/db/init.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 2 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 3 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 4 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s/src/main/resources/db/migration/V1__init_database.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `BOOK` ( 2 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 3 | `NAME` varchar(45) DEFAULT NULL, 4 | `AUTHOR` varchar(45) DEFAULT NULL, 5 | PRIMARY KEY (`ID`) 6 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; 7 | 8 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 9 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 10 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 11 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s/src/test/resources/V1__init_database.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `BOOK` ( 2 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 3 | `NAME` varchar(45) DEFAULT NULL, 4 | `AUTHOR` varchar(45) DEFAULT NULL, 5 | PRIMARY KEY (`ID`) 6 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; 7 | 8 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 9 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 10 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 11 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s/src/test/resources/db/ddl.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE library; 2 | GRANT ALL PRIVILEGES ON library.* TO 'username-default'@'%' IDENTIFIED BY 'my_cool_secret'; 3 | 4 | USE `library`; 5 | 6 | CREATE TABLE `BOOK` ( 7 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 8 | `NAME` varchar(45) DEFAULT NULL, 9 | `AUTHOR` varchar(45) DEFAULT NULL, 10 | PRIMARY KEY (`ID`) 11 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s/src/test/resources/db/init.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 2 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 3 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 4 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s/src/test/resources/db/migration/V1__init_database.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `BOOK` ( 2 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 3 | `NAME` varchar(45) DEFAULT NULL, 4 | `AUTHOR` varchar(45) DEFAULT NULL, 5 | PRIMARY KEY (`ID`) 6 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; 7 | 8 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 9 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 10 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 11 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s/src/test/resources/docker/config/init.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE library; 2 | GRANT ALL PRIVILEGES ON library.* TO 'username-default'@'%' IDENTIFIED BY 'my_cool_secret'; 3 | 4 | USE `library`; 5 | 6 | CREATE TABLE `BOOK` ( 7 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 8 | `NAME` varchar(45) DEFAULT NULL, 9 | `AUTHOR` varchar(45) DEFAULT NULL, 10 | PRIMARY KEY (`ID`) 11 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; 12 | 13 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 14 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 15 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 16 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s/src/test/resources/kube/config/scripts/init.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE library; 2 | GRANT ALL PRIVILEGES ON library.* TO 'username-default'@'%' IDENTIFIED BY 'my_cool_secret'; 3 | 4 | USE `library`; 5 | 6 | CREATE TABLE `BOOK` ( 7 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 8 | `NAME` varchar(45) DEFAULT NULL, 9 | `AUTHOR` varchar(45) DEFAULT NULL, 10 | PRIMARY KEY (`ID`) 11 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; 12 | 13 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Ender Game', 'Orson S. Card'); 14 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('The stars my destination', 'Alfred Bester'); 15 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); 16 | INSERT INTO BOOK (NAME, AUTHOR) VALUES('Dune', 'Frank Herbert'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-k8s/src/test/resources/kube/kind-config.yaml: -------------------------------------------------------------------------------- 1 | # run: kind create cluster --config kind-config.yaml --name kind-basic 2 | # checkIp: docker container inspect kind-basic-control-plane --format '{{ .NetworkSettings.Networks.kind.IPAddress }}' 3 | # destroy: kind delete cluster --name kind-basic 4 | apiVersion: kind.x-k8s.io/v1alpha4 5 | kind: Cluster 6 | nodes: 7 | - role: control-plane 8 | extraPortMappings: 9 | - containerPort: 30000 10 | hostPort: 30000 11 | listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0" 12 | protocol: tcp # Optional, defaults to tcp 13 | - role: worker -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !target/*-runner 3 | !target/*-runner.jar 4 | !target/lib/* 5 | !target/quarkus-app/* -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/.gitignore: -------------------------------------------------------------------------------- 1 | #Maven 2 | target/ 3 | pom.xml.tag 4 | pom.xml.releaseBackup 5 | pom.xml.versionsBackup 6 | release.properties 7 | .flattened-pom.xml 8 | 9 | # Eclipse 10 | .project 11 | .classpath 12 | .settings/ 13 | bin/ 14 | 15 | # IntelliJ 16 | .idea 17 | *.ipr 18 | *.iml 19 | *.iws 20 | 21 | # NetBeans 22 | nb-configuration.xml 23 | 24 | # Visual Studio Code 25 | .vscode 26 | .factorypath 27 | 28 | # OSX 29 | .DS_Store 30 | 31 | # Vim 32 | *.swp 33 | *.swo 34 | 35 | # patch 36 | *.orig 37 | *.rej 38 | 39 | # Local environment 40 | .env 41 | -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/src/main/java/com/home/example/GreetingResource.java: -------------------------------------------------------------------------------- 1 | package com.home.example; 2 | 3 | import jakarta.inject.Inject; 4 | import jakarta.ws.rs.GET; 5 | import jakarta.ws.rs.Path; 6 | import jakarta.ws.rs.Produces; 7 | import jakarta.ws.rs.core.MediaType; 8 | 9 | @Path("greeting") 10 | public class GreetingResource { 11 | 12 | @Inject 13 | GreetingService greetingService; 14 | 15 | // public GreetingResource(GreetingService greetingService) { 16 | // this.greetingService = greetingService; 17 | // } 18 | 19 | @GET 20 | @Produces("text/plain") 21 | public String greet() { 22 | return greetingService.greet(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/src/main/java/com/home/example/GreetingService.java: -------------------------------------------------------------------------------- 1 | package com.home.example; 2 | 3 | import jakarta.enterprise.context.ApplicationScoped; 4 | 5 | @ApplicationScoped 6 | public class GreetingService { 7 | public String greet(){ 8 | return "hello"; 9 | } 10 | } -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/src/main/java/com/home/example/entity/BoardGame.java: -------------------------------------------------------------------------------- 1 | package com.home.example.entity; 2 | 3 | import io.quarkus.hibernate.orm.panache.PanacheEntity; 4 | import jakarta.persistence.Entity; 5 | import jakarta.persistence.Table; 6 | 7 | @Entity 8 | @Table(name = "BOARDGAME") 9 | public class BoardGame extends PanacheEntity { 10 | 11 | //warning with PanacheEntity we dont need getter/setter or Id 12 | public String designer; 13 | public String name; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/src/main/java/com/home/example/mapper/BoardGameMapper.java: -------------------------------------------------------------------------------- 1 | package com.home.example.mapper; 2 | 3 | import org.mapstruct.Mapper; 4 | import org.mapstruct.MappingTarget; 5 | 6 | import com.home.example.entity.BoardGame; 7 | 8 | import jakarta.enterprise.context.ApplicationScoped; 9 | 10 | @ApplicationScoped 11 | //warning: we need componentModel.CDI to use @Inject 12 | @Mapper(componentModel = "CDI") 13 | public interface BoardGameMapper { 14 | void update(@MappingTarget BoardGame entity, BoardGame updateEntity); 15 | } 16 | -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/src/main/java/com/home/example/mapper/BookMapper.java: -------------------------------------------------------------------------------- 1 | package com.home.example.mapper; 2 | 3 | import org.mapstruct.Mapper; 4 | import org.mapstruct.MappingTarget; 5 | 6 | import com.home.example.entity.Book; 7 | 8 | import jakarta.enterprise.context.ApplicationScoped; 9 | 10 | @ApplicationScoped 11 | //warning: we need componentModel.CDI to use @Inject 12 | @Mapper(componentModel = "CDI") 13 | public interface BookMapper { 14 | void update(@MappingTarget Book entity, Book updateEntity); 15 | } 16 | -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/src/main/java/com/home/example/pojo/Success.java: -------------------------------------------------------------------------------- 1 | package com.home.example.pojo; 2 | 3 | public class Success { 4 | 5 | public Success(String success) { 6 | this.success = success; 7 | } 8 | 9 | private String success; 10 | 11 | public String getSuccess() { 12 | return success; 13 | } 14 | 15 | public void setSuccess(String success) { 16 | this.success = success; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/src/main/java/com/home/example/repository/BookRepository.java: -------------------------------------------------------------------------------- 1 | package com.home.example.repository; 2 | 3 | import com.home.example.entity.Book; 4 | 5 | import io.quarkus.hibernate.orm.panache.PanacheRepository; 6 | import jakarta.enterprise.context.ApplicationScoped; 7 | import jakarta.transaction.Transactional; 8 | 9 | //warning: class not interface 10 | @ApplicationScoped 11 | @Transactional 12 | public class BookRepository implements PanacheRepository{ 13 | 14 | } 15 | -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/src/main/java/com/home/example/service/ExternalService.java: -------------------------------------------------------------------------------- 1 | package com.home.example.service; 2 | 3 | import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; 4 | 5 | import com.home.example.entity.Movie; 6 | 7 | import jakarta.ws.rs.GET; 8 | import jakarta.ws.rs.Path; 9 | import jakarta.ws.rs.PathParam; 10 | import jakarta.ws.rs.Produces; 11 | import jakarta.ws.rs.core.MediaType; 12 | 13 | @Path("/imdb") 14 | @RegisterRestClient 15 | @Produces(MediaType.APPLICATION_JSON) 16 | public interface ExternalService { 17 | 18 | @GET 19 | @Path("/film/{id}") 20 | @Produces(MediaType.APPLICATION_JSON) 21 | Movie getMovieById(@PathParam("id") Long id); 22 | } -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/src/main/resources/META-INF/ddl.sql: -------------------------------------------------------------------------------- 1 | USE `library`; 2 | 3 | -- 4 | -- Table structure for table `BOARDGAME` 5 | -- 6 | 7 | DROP TABLE IF EXISTS `BOARDGAME`; 8 | /*!40101 SET @saved_cs_client = @@character_set_client */; 9 | /*!40101 SET character_set_client = utf8 */; 10 | CREATE TABLE `BOARDGAME` ( 11 | `ID` bigint(20) NOT NULL AUTO_INCREMENT, 12 | `NAME` varchar(45) DEFAULT NULL, 13 | `DESIGNER` varchar(45) DEFAULT NULL, 14 | PRIMARY KEY (`ID`) 15 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/src/main/resources/META-INF/drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `BOARDGAME`; -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/src/main/resources/META-INF/import-dev.sql: -------------------------------------------------------------------------------- 1 | -- USE `library`; 2 | 3 | INSERT INTO BOARDGAME (ID, NAME, DESIGNER) VALUES(1, 'Terraforming Mars ', 'Jacob Fryxelius'); 4 | INSERT INTO BOARDGAME (ID, NAME, DESIGNER) VALUES(2, 'Dune: Imperium', 'Paul Dennen'); 5 | INSERT INTO BOARDGAME (ID, NAME, DESIGNER) VALUES(3, 'Scythe', 'Jamey Stegmaier'); -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/src/test/java/com/home/example/GreetingResourceIT.java: -------------------------------------------------------------------------------- 1 | package com.home.example; 2 | 3 | import io.quarkus.test.junit.QuarkusIntegrationTest; 4 | 5 | @QuarkusIntegrationTest 6 | public class GreetingResourceIT extends GreetingResourceTest { 7 | // Execute the same tests but in packaged mode. 8 | } 9 | -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/src/test/java/com/home/example/repository/MockBookRepository.java: -------------------------------------------------------------------------------- 1 | package com.home.example.repository; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import com.home.example.entity.Book; 7 | 8 | import io.quarkus.test.Mock; 9 | import jakarta.enterprise.context.ApplicationScoped; 10 | 11 | // @ApplicationScoped 12 | // @Mock 13 | //Incompatible with integration tests (BookResourceTest), will use always this mock 14 | //old approach : https://es.quarkus.io/blog/mocking/ 15 | public class MockBookRepository extends BookRepository{ 16 | 17 | @Override 18 | public List listAll(){ 19 | List list = new ArrayList<>(); 20 | return list; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/src/test/java/com/home/example/test/WiremockTestAnnotation.java: -------------------------------------------------------------------------------- 1 | package com.home.example.test; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | import io.quarkus.test.common.QuarkusTestResource; 9 | 10 | 11 | @QuarkusTestResource(value = WiremockResourceConfigurable.class, restrictToAnnotatedClass = true) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Target(ElementType.TYPE) 14 | public @interface WiremockTestAnnotation { 15 | String port() default "57005"; 16 | } 17 | -------------------------------------------------------------------------------- /QuarkusExamples/ms-with-panache/src/test/resources/docker/config/mysql/conf.d/custom.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | max_connections=1500 3 | max_allowed_packet=1024M 4 | # innodb_buffer_pool_size=1024M 5 | # wait_timeout=350 6 | -------------------------------------------------------------------------------- /RESTEasyExample/README.md: -------------------------------------------------------------------------------- 1 | # RESTEasyExample 2 | 3 | ## Info 4 | 5 | This project contains a Web Service and a client made with RESTEasy Framework. 6 | 7 | ## Web Service 8 | 9 | You can generate the application running the command: mvn clean package, and deploy it the war file in a servlet container like tomcat or jetty or on a application server like WildFly. 10 | 11 | ## Client 12 | 13 | If you have the Web Service running you can also run the tests. 14 | 15 | ## Doc 16 | 17 | You can see an explanation in Spanish here: https://DesarrolloJavaYYo.blogspot.com/ 18 | You can see an explanation in English here: https://danielblancocuadrado.medium.com/ -------------------------------------------------------------------------------- /RESTEasyExample/RestEasyService/src/main/java/com/home/example/resteasy/bean/Book.java: -------------------------------------------------------------------------------- 1 | package com.home.example.resteasy.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class Book { 9 | private int id; 10 | private String name; 11 | private String author; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /RESTEasyExample/RestEasyService/src/main/java/com/home/example/resteasy/configuration/LibraryApplication.java: -------------------------------------------------------------------------------- 1 | package com.home.example.resteasy.configuration; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | import javax.ws.rs.core.Application; 5 | 6 | @ApplicationPath("/library") 7 | public class LibraryApplication extends Application { 8 | // private Set singletons = new HashSet(); 9 | // 10 | // public LibraryApplication() { 11 | // singletons.add(new BookService()); 12 | // } 13 | // 14 | // @Override 15 | // public Set getSingletons() { 16 | // return singletons; 17 | // } 18 | } -------------------------------------------------------------------------------- /RESTEasyExample/RestEasyService/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /RESTEasyExample/resteasyclient/src/main/java/com/home/example/resteasy/bean/Book.java: -------------------------------------------------------------------------------- 1 | package com.home.example.resteasy.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class Book { 11 | private int id; 12 | private String name; 13 | private String author; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /SparkExample/README.md: -------------------------------------------------------------------------------- 1 | # SparkExample 2 | 3 | Project to explain how we can create micro services with Spark 2.9.0 4 | 5 | You can see an explanation in Spanish here: http://DesarrolloJavaYYo.blogspot.com 6 | 7 | ## Versions 8 | 9 | * Version 1.0.0: How to do a micro service with Spark. Link: http://DesarrolloJavaYYo.blogspot.com/2017/08/web-services-con-spring-boot-nivel.html 10 | 11 | 12 | ## Run 13 | 14 | You must run the 'Aplicacion' class as a Java application, you can do it inside eclipse. -------------------------------------------------------------------------------- /SparkExample/src/main/java/es/home/example/spark/pojo/Book.java: -------------------------------------------------------------------------------- 1 | /* 2 | */ 3 | package es.home.example.spark.pojo; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | 10 | @NoArgsConstructor 11 | @AllArgsConstructor 12 | public class Book { 13 | @Getter 14 | @Setter 15 | private Integer id; 16 | @Getter 17 | @Setter 18 | private String author; 19 | @Getter 20 | @Setter 21 | private String name; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /SparkExample/src/main/java/es/home/example/spark/transformer/JsonTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | */ 3 | package es.home.example.spark.transformer; 4 | 5 | import com.google.gson.Gson; 6 | 7 | import spark.ResponseTransformer; 8 | 9 | public class JsonTransformer implements ResponseTransformer { 10 | 11 | private Gson gson = new Gson(); 12 | 13 | @Override 14 | public String render(final Object model) { 15 | return gson.toJson(model); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringBootREST/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /.apt_generated_tests/ 3 | -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringBootREST/src/main/java/es/home/example/knowledge/Aplicacion.java: -------------------------------------------------------------------------------- 1 | package es.home.example.knowledge; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.annotation.ComponentScan; 6 | 7 | @SpringBootApplication 8 | @ComponentScan(basePackages = { "es.home.example.knowledge" }) 9 | public class Aplicacion { 10 | 11 | public static void main(final String[] args) { 12 | SpringApplication.run(Aplicacion.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringBootREST/src/main/java/es/home/example/knowledge/pojo/Saludo.java: -------------------------------------------------------------------------------- 1 | package es.home.example.knowledge.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | import lombok.NoArgsConstructor; 6 | import lombok.Setter; 7 | 8 | @NoArgsConstructor 9 | @AllArgsConstructor 10 | public class Saludo { 11 | private @Getter @Setter String saludo; 12 | private @Setter @Getter String nombre; 13 | } 14 | -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringBootREST/src/main/java/es/home/example/knowledge/repository/BookDao.java: -------------------------------------------------------------------------------- 1 | package es.home.example.knowledge.repository; 2 | 3 | import es.home.example.knowledge.entity.Book; 4 | 5 | public interface BookDao extends GenericDao { 6 | } -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringBootREST/src/main/java/es/home/example/knowledge/repository/GenericDao.java: -------------------------------------------------------------------------------- 1 | package es.home.example.knowledge.repository; 2 | 3 | import java.io.Serializable; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 7 | import org.springframework.data.repository.NoRepositoryBean; 8 | 9 | import es.home.example.knowledge.entity.GenericEntity; 10 | 11 | @NoRepositoryBean 12 | public interface GenericDao, K extends Serializable> 13 | extends JpaRepository, JpaSpecificationExecutor { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringBootREST/src/main/java/es/home/example/knowledge/rest/controller/SaludoRestController.java: -------------------------------------------------------------------------------- 1 | package es.home.example.knowledge.rest.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RequestParam; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import es.home.example.knowledge.pojo.Saludo; 8 | import lombok.extern.log4j.Log4j2; 9 | 10 | @Log4j2 11 | @RestController 12 | public class SaludoRestController { 13 | @GetMapping("/saludo") 14 | public Saludo Saludo(@RequestParam(value = "nombre", defaultValue = "World") final String nombre) { 15 | log.info("Saludo - init"); 16 | return new Saludo("Hola", nombre); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringBootREST/src/main/java/es/home/example/knowledge/rest/template/BookRestClient.java: -------------------------------------------------------------------------------- 1 | package es.home.example.knowledge.rest.template; 2 | 3 | import org.springframework.stereotype.Service; 4 | import org.springframework.web.client.RestTemplate; 5 | 6 | import es.home.example.knowledge.entity.Book; 7 | 8 | @Service 9 | public class BookRestClient { 10 | public static final String REST_SERVICE_URI = "http://localhost:8085"; 11 | public Book getBook(final Integer id) { 12 | RestTemplate restTemplate = new RestTemplate(); 13 | return restTemplate.getForObject(REST_SERVICE_URI + "/book/" + id, Book.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringBootREST/src/main/resources/script/data.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM Book; 2 | INSERT INTO Book(id, title, author) VALUES (1, '1984', 'George Orwell'); 3 | INSERT INTO Book(id, title, author) VALUES (2, 'Fahrenheit 451', 'Ray Bradbury'); 4 | INSERT INTO Book(id, title, author) VALUES (3, 'Brave New World', 'Aldous Huxley'); -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringSecurity/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringSecurity/README.md: -------------------------------------------------------------------------------- 1 | # ExampleSpringSecurity 2 | 3 | ## Info 4 | 5 | Project to explain how it works spring security with spring-boot:1.4.0.RELEASE 6 | 7 | ## Link 8 | 9 | You can see an explanation in Spanish here: http://DesarrolloJavaYYo.blogspot.com/2016/08/spring-boot-security-nivel-basico.html 10 | 11 | ## Tags 12 | 13 | jdbc, MYSQL, spring boot, spring security -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringSecurity/src/main/java/es/home/example/config/Application.java: -------------------------------------------------------------------------------- 1 | package es.home.example.config; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.annotation.ComponentScan; 6 | 7 | @SpringBootApplication 8 | @ComponentScan(basePackages = "es.home.example") 9 | public class Application { 10 | public static void main(final String[] args) throws Throwable { 11 | SpringApplication.run(Application.class, args); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringSecurity/src/main/java/es/home/example/controller/InicioController.java: -------------------------------------------------------------------------------- 1 | package es.home.example.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.ResponseBody; 6 | 7 | @Controller 8 | public class InicioController { 9 | 10 | @RequestMapping("/") 11 | @ResponseBody 12 | String home() { 13 | return "HolaMundo"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringSecurity/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/SpringExamples/ExampleSpringSecurity/src/main/resources/application.properties -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringSecurity/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=WARN,stdout 2 | log4j.logger.es.home.example=DEBUG 3 | 4 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 5 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.stdout.layout.ConversionPattern=%p\t%d{ISO8601}\t%r\t%c\t[%t]\t%m%n -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringSecurity/src/main/webapp/WEB-INF/jsp/403.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | 3 | pageEncoding="UTF-8"%> 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Access Denied - ProgrammingFree 12 | 13 | 14 | 15 | 16 | 17 |

Error 18 | 19 |

20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringSecurity/src/main/webapp/WEB-INF/jsp/error.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | 3 | pageEncoding="UTF-8"%> 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | error 12 | 13 | 14 | 15 | 16 | 17 |

error 18 | 19 |

20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringSecurity/src/main/webapp/WEB-INF/jsp/hello.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 2 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | 5 | 6 | 7 | Hello World! 8 | 9 | 10 |

Hello

11 |
12 | 13 | 14 |
15 | 16 | -------------------------------------------------------------------------------- /SpringExamples/ExampleSpringSecurity/src/main/webapp/WEB-INF/jsp/home.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 2 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | 5 | 6 | 7 | Spring Security Example - ProgrammingFree 8 | 9 | 10 |

Welcome!

11 | 12 |

Click here to see a greeting.

13 | 14 | -------------------------------------------------------------------------------- /SpringExamples/Spring2Datasources/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /.apt_generated_tests/ 3 | -------------------------------------------------------------------------------- /SpringExamples/Spring2Datasources/README.md: -------------------------------------------------------------------------------- 1 | # Spring2Datasources 2 | 3 | Project to explain how we can create a Spring Boot REST service with two datasources 4 | 5 | You can see an explanation in Spanish here: http://DesarrolloJavaYYo.blogspot.com](http://DesarrolloJavaYYo.blogspot.com) 6 | 7 | You can see an explanation in English here: [https://medium.com/@danielblancocuadrado](https://medium.com/@danielblancocuadrado) 8 | 9 | ## Run 10 | 11 | You must run the 'Aplicacion' class as a Java application, you can do it inside eclipse. 12 | 13 | ## References 14 | 15 | - https://www.baeldung.com/spring-data-jpa-multiple-databases 16 | - https://springframework.guru/how-to-configure-multiple-data-sources-in-a-spring-boot-application/ -------------------------------------------------------------------------------- /SpringExamples/Spring2Datasources/src/main/java/es/home/example/knowledge/Aplicacion.java: -------------------------------------------------------------------------------- 1 | package es.home.example.knowledge; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.annotation.ComponentScan; 6 | 7 | @SpringBootApplication 8 | @ComponentScan(basePackages = { "es.home.example.knowledge" }) 9 | public class Aplicacion { 10 | 11 | public static void main(final String[] args) { 12 | SpringApplication.run(Aplicacion.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SpringExamples/Spring2Datasources/src/main/java/es/home/example/knowledge/dev/repository/DevBookDao.java: -------------------------------------------------------------------------------- 1 | package es.home.example.knowledge.dev.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import es.home.example.knowledge.entity.Book; 6 | 7 | public interface DevBookDao extends JpaRepository { 8 | } -------------------------------------------------------------------------------- /SpringExamples/Spring2Datasources/src/main/java/es/home/example/knowledge/pre/repository/PreBookDao.java: -------------------------------------------------------------------------------- 1 | package es.home.example.knowledge.pre.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import es.home.example.knowledge.entity.Book; 6 | 7 | public interface PreBookDao extends JpaRepository { 8 | } -------------------------------------------------------------------------------- /SpringExamples/Spring2Datasources/src/main/java/es/home/example/knowledge/pro/repository/ProBookDao.java: -------------------------------------------------------------------------------- 1 | package es.home.example.knowledge.pro.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import es.home.example.knowledge.entity.Book; 6 | 7 | public interface ProBookDao extends JpaRepository { 8 | } -------------------------------------------------------------------------------- /SpringExamples/Spring2Datasources/src/main/resources/persistence-multiple-db.properties: -------------------------------------------------------------------------------- 1 | 2 | app.datasource.dev.jdbcUrl=jdbc:mysql://localhost:3304/library?createDatabaseIfNotExist=true&autoReconnect=true&useSSL=false 3 | app.datasource.dev.username=reader 4 | app.datasource.dev.password=password 5 | app.datasource.dev.driverClassName=com.mysql.cj.jdbc.Driver 6 | app.datasource.dev.schema=library 7 | 8 | # hibernate.X 9 | hibernate.dialect=org.hibernate.dialect.MySQLDialect 10 | hibernate.show_sql=true 11 | hibernate.hbm2ddl.auto=none 12 | hibernate.cache.use_second_level_cache=false 13 | hibernate.cache.use_query_cache=false -------------------------------------------------------------------------------- /SpringExamples/Spring2Datasources/src/main/resources/script/data.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM BOOK; 2 | INSERT INTO BOOK (id, name, author) VALUES (1, '1984', 'George Orwell'); 3 | INSERT INTO BOOK (id, name, author) VALUES (2, 'Fahrenheit 451', 'Ray Bradbury'); 4 | INSERT INTO BOOK (id, name, author) VALUES (3, 'Brave New World', 'Aldous Huxley'); 5 | 6 | --INSERT INTO library.book (id, name, author) VALUES (1, '1984', 'George Orwell'); 7 | --INSERT INTO library.book (id, name, author) VALUES (2, 'Fahrenheit 451', 'Ray Bradbury'); 8 | --INSERT INTO library.book (id, name, author) VALUES (3, 'Brave New World', 'Aldous Huxley'); -------------------------------------------------------------------------------- /SpringExamples/Spring2Datasources/src/test/resources/docker/configs/mysql/conf.d/custom.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | max_connections=1500 3 | max_allowed_packet=1024M 4 | # innodb_buffer_pool_size=1024M 5 | # wait_timeout=350 6 | -------------------------------------------------------------------------------- /SpringExamples/SpringBoot2OauthWso2Is/Changelog.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | ## [1.0.0] - 2019-10-16 5 | ### Added 6 | 7 | - First Version -------------------------------------------------------------------------------- /SpringExamples/SpringBoot2OauthWso2Is/README.md: -------------------------------------------------------------------------------- 1 | # SpringBoot2OauthWSO2IS 2 | 3 | ## Info 4 | 5 | Project to explain how to do a SSO in a Spring Boot 2 project with WSO2 Identity Server as authenticated server 6 | 7 | ## Link 8 | 9 | You can see an explanation in here: XXXXX 10 | 11 | ## Tags 12 | 13 | Spring Boot 2, WSO2 IS, SSO, OAuth2 -------------------------------------------------------------------------------- /SpringExamples/SpringBoot2OauthWso2Is/src/main/java/es/home/example/sbowi/extractor/WSO2IsPrincipalExtractor.java: -------------------------------------------------------------------------------- 1 | package es.home.example.sbowi.extractor; 2 | 3 | import java.util.Map; 4 | 5 | import org.springframework.boot.autoconfigure.security.oauth2.resource.PrincipalExtractor; 6 | 7 | public class WSO2IsPrincipalExtractor implements PrincipalExtractor { 8 | 9 | @Override 10 | public Object extractPrincipal(final Map map) { 11 | return map.get("sub"); 12 | } 13 | } -------------------------------------------------------------------------------- /SpringExamples/SpringBoot2OauthWso2Is/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8082 3 | servlet: 4 | context-path: /sbowi 5 | session: 6 | cookie: 7 | name: UISESSION 8 | security: 9 | basic: 10 | enabled: false 11 | oauth2: 12 | client: 13 | clientId: lwN1Aa2pKgnt5rX78JtZGQFiJtoa 14 | clientSecret: n9RZfVrN8zJsfEq53bYt5f8eZNka 15 | scope: openid 16 | accessTokenUri: https://localhost:9443/oauth2/token 17 | userAuthorizationUri: https://localhost:9443/oauth2/authorize 18 | tokenName: code 19 | authenticationScheme: header 20 | resource: 21 | userInfoUri: https://localhost:9443/oauth2/userinfo 22 | spring: 23 | thymeleaf: 24 | cache: false -------------------------------------------------------------------------------- /SpringExamples/SpringBoot2OauthWso2Is/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Spring Boot 2 Oauth WOS2 IS SSO 6 | 8 | 9 | 10 | 11 |
12 |
13 |

Index Page

14 | Login and access to your profile 15 |
16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /SpringExamples/SpringBoot2OauthWso2Is/src/main/resources/templates/profile.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Spring Boot 2 Oauth WOS2 IS SSO 8 | 10 | 11 | 12 | 13 |
14 |
15 |

Profile Page

16 |
17 | Welcome John Doe !! 18 |
19 |
20 |
21 | 22 | -------------------------------------------------------------------------------- /SpringExamples/SpringBootActivemqReader/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /SpringExamples/SpringBootActivemqReader/src/main/java/com/home/example/activemqreader/config/JmsErrorHandler.java: -------------------------------------------------------------------------------- 1 | package com.home.example.activemqreader.config; 2 | 3 | 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.stereotype.Component; 7 | import org.springframework.util.ErrorHandler; 8 | 9 | @Component 10 | public class JmsErrorHandler implements ErrorHandler { 11 | 12 | private static Logger LOGGER = LoggerFactory.getLogger(JmsErrorHandler.class); 13 | 14 | public JmsErrorHandler() { 15 | LOGGER.info("Creating error handler"); 16 | } 17 | 18 | @Override 19 | public void handleError(Throwable t) { 20 | LOGGER.error("An error occurred during processing of the JMS message", t); 21 | } 22 | } -------------------------------------------------------------------------------- /SpringExamples/SpringBootActivemqReader/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | 3 | activemq.broker-url=tcp://localhost:61616 4 | activemq.user= 5 | activemq.password= 6 | activemq.queue-name=Consumer.SPRING.VirtualTopic.testingQ -------------------------------------------------------------------------------- /SpringExamples/SpringBootActivemqReader/src/test/java/com/chakray/intdev/activemqreader/ActivemqReaderApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.home.example.activemqreader; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ActivemqReaderApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/SpringEurekaServer/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/SpringEurekaServer/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/SpringEurekaServer/src/main/java/com/example/home/SpringEurekaServer/EurekaServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.home.SpringEurekaServer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class EurekaServerApplication { 10 | 11 | public static void main(final String[] args) { 12 | SpringApplication.run(EurekaServerApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/SpringEurekaServer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8761 2 | 3 | eureka.client.register-with-eureka=false 4 | eureka.client.fetch-registry=false 5 | 6 | logging.level.com.netflix.eureka=OFF 7 | logging.level.com.netflix.discovery=OFF -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/spring-boot-admin-client/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | 12 | ### IntelliJ IDEA ### 13 | .idea 14 | *.iws 15 | *.iml 16 | *.ipr 17 | 18 | ### NetBeans ### 19 | nbproject/private/ 20 | build/ 21 | nbbuild/ 22 | dist/ 23 | nbdist/ 24 | .nb-gradle/ -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/spring-boot-admin-client/src/main/java/com/baeldung/springbootadminclient/SpringBootAdminClientApplication.java: -------------------------------------------------------------------------------- 1 | package com.baeldung.springbootadminclient; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootAdminClientApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootAdminClientApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/spring-boot-admin-client/src/main/java/com/baeldung/springbootadminclient/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package com.baeldung.springbootadminclient.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import lombok.ToString; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | @NoArgsConstructor 11 | @ToString 12 | public class Book { 13 | 14 | private Integer id; 15 | private String name; 16 | private String author; 17 | } 18 | -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/spring-boot-admin-client/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8081 2 | 3 | spring.application.name=spring-boot-admin-client 4 | 5 | management.endpoints.web.exposure.include=* 6 | management.endpoint.metrics.enabled=true 7 | management.endpoint.health.show-details=always 8 | 9 | #dsblanco-Latitude-5500 10 | spring.boot.admin.client.url=http://localhost:8080 11 | 12 | spring.jmx.enabled=true 13 | spring.main.lazy-initialization=true 14 | 15 | #These two are needed so that the client can register at the protected server api 16 | spring.boot.admin.client.username=admin 17 | spring.boot.admin.client.password=admin -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/spring-boot-admin-client/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %date [%thread] %-5level %logger{25} - %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/spring-boot-admin-eureka-client/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | 12 | ### IntelliJ IDEA ### 13 | .idea 14 | *.iws 15 | *.iml 16 | *.ipr 17 | 18 | ### NetBeans ### 19 | nbproject/private/ 20 | build/ 21 | nbbuild/ 22 | dist/ 23 | nbdist/ 24 | .nb-gradle/ -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/spring-boot-admin-eureka-client/src/main/java/com/example/springbootadmin/eurekaclient/SpringBootAdminEurekaClientApp.java: -------------------------------------------------------------------------------- 1 | package com.example.springbootadmin.eurekaclient; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootAdminEurekaClientApp { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootAdminEurekaClientApp.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/spring-boot-admin-eureka-client/src/main/java/com/example/springbootadmin/eurekaclient/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package com.example.springbootadmin.eurekaclient.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import lombok.ToString; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | @NoArgsConstructor 11 | @ToString 12 | public class Book { 13 | 14 | private Integer id; 15 | private String name; 16 | private String author; 17 | } 18 | -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/spring-boot-admin-eureka-server/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | 12 | ### IntelliJ IDEA ### 13 | .idea 14 | *.iws 15 | *.iml 16 | *.ipr 17 | 18 | ### NetBeans ### 19 | nbproject/private/ 20 | build/ 21 | nbbuild/ 22 | dist/ 23 | nbdist/ 24 | .nb-gradle/ -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/spring-boot-admin-eureka-server/src/main/java/com/example/springbootadminserver/SpringBootAdminEurekaServerApp.java: -------------------------------------------------------------------------------- 1 | package com.example.springbootadminserver; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | import de.codecentric.boot.admin.server.config.EnableAdminServer; 8 | 9 | @EnableAdminServer 10 | @EnableAutoConfiguration 11 | @SpringBootApplication 12 | public class SpringBootAdminEurekaServerApp { 13 | 14 | public static void main(final String[] args) { 15 | SpringApplication.run(SpringBootAdminEurekaServerApp.class, args); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/spring-boot-admin-eureka-server/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %date [%thread] %-5level %logger{25} - %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/spring-boot-admin-server/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | 12 | ### IntelliJ IDEA ### 13 | .idea 14 | *.iws 15 | *.iml 16 | *.ipr 17 | 18 | ### NetBeans ### 19 | nbproject/private/ 20 | build/ 21 | nbbuild/ 22 | dist/ 23 | nbdist/ 24 | .nb-gradle/ -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/spring-boot-admin-server/src/main/java/com/example/springbootadminserver/SpringBootAdminServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.springbootadminserver; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | import de.codecentric.boot.admin.server.config.EnableAdminServer; 8 | 9 | @EnableAdminServer 10 | @EnableAutoConfiguration 11 | @SpringBootApplication 12 | public class SpringBootAdminServerApplication { 13 | 14 | public static void main(final String[] args) { 15 | SpringApplication.run(SpringBootAdminServerApplication.class, args); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /SpringExamples/SpringBootAdminExample/spring-boot-admin-server/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %date [%thread] %-5level %logger{25} - %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SpringExamples/SpringJWTAuthentication/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /SpringExamples/SpringJWTAuthentication/src/main/java/es/home/example/app/SpringJWTAuthApp.java: -------------------------------------------------------------------------------- 1 | package es.home.example.app; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 6 | 7 | @SpringBootApplication 8 | public class SpringJWTAuthApp extends SpringBootServletInitializer { 9 | 10 | public static void main(final String[] args) { 11 | SpringApplication.run(SpringJWTAuthApp.class, args); 12 | } 13 | } -------------------------------------------------------------------------------- /SpringExamples/SpringJWTAuthentication/src/main/java/es/home/example/app/controller/DummyController.java: -------------------------------------------------------------------------------- 1 | package es.home.example.app.controller; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | import es.home.example.app.pojo.Msg; 9 | 10 | @RestController 11 | public class DummyController { 12 | @GetMapping("/hello") 13 | public ResponseEntity msg() { 14 | return new ResponseEntity<>(new Msg("World"), HttpStatus.OK); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SpringExamples/SpringJWTAuthentication/src/main/java/es/home/example/app/pojo/LoginRequest.java: -------------------------------------------------------------------------------- 1 | package es.home.example.app.pojo; 2 | 3 | import java.io.Serializable; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class LoginRequest implements Serializable { 9 | 10 | private static final long serialVersionUID = 1L; 11 | 12 | private String userName; 13 | private String password; 14 | } 15 | -------------------------------------------------------------------------------- /SpringExamples/SpringJWTAuthentication/src/main/java/es/home/example/app/pojo/LoginResponse.java: -------------------------------------------------------------------------------- 1 | package es.home.example.app.pojo; 2 | 3 | import java.io.Serializable; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | public class LoginResponse implements Serializable { 11 | 12 | private static final long serialVersionUID = 8080620636512014033L; 13 | private final String jwttoken; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /SpringExamples/SpringJWTAuthentication/src/main/java/es/home/example/app/pojo/Msg.java: -------------------------------------------------------------------------------- 1 | package es.home.example.app.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class Msg { 9 | 10 | private String msg; 11 | } 12 | -------------------------------------------------------------------------------- /SpringExamples/SpringJWTAuthentication/src/main/java/es/home/example/app/service/MockDetailsService.java: -------------------------------------------------------------------------------- 1 | package es.home.example.app.service; 2 | 3 | import java.util.Arrays; 4 | 5 | import org.springframework.security.core.userdetails.UserDetails; 6 | import org.springframework.security.core.userdetails.UserDetailsService; 7 | import org.springframework.stereotype.Service; 8 | 9 | import es.home.example.app.filter.JWTUserDetailsImpl; 10 | 11 | @Service 12 | public class MockDetailsService implements UserDetailsService { 13 | 14 | @Override 15 | public UserDetails loadUserByUsername(final String username) { 16 | return JWTUserDetailsImpl.build(1L, "userName", Arrays.asList("user", "admin")); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SpringExamples/SpringJWTAuthentication/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | 3 | jwt.api.issuer=company 4 | jwt.api.jwtExpiration=3600 -------------------------------------------------------------------------------- /SpringExamples/SpringWebflux/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /SpringExamples/SpringWebflux/SpringWebfluxClient/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /SpringExamples/SpringWebflux/SpringWebfluxClient/src/main/java/es/home/example/app/SpringWebfluxClientApp.java: -------------------------------------------------------------------------------- 1 | package es.home.example.app; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 6 | 7 | @SpringBootApplication 8 | public class SpringWebfluxClientApp extends SpringBootServletInitializer { 9 | 10 | public static void main(final String[] args) { 11 | SpringApplication.run(SpringWebfluxClientApp.class, args); 12 | } 13 | } -------------------------------------------------------------------------------- /SpringExamples/SpringWebflux/SpringWebfluxClient/src/main/java/es/home/example/app/pojo/Incidence.java: -------------------------------------------------------------------------------- 1 | package es.home.example.app.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class Incidence { 11 | 12 | private String server; 13 | private String env; 14 | private String level; 15 | private String info; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /SpringExamples/SpringWebflux/SpringWebfluxClient/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 -------------------------------------------------------------------------------- /SpringExamples/SpringWebflux/SpringWebfluxServer/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /SpringExamples/SpringWebflux/SpringWebfluxServer/src/main/java/es/home/example/app/SpringWebfluxServerApp.java: -------------------------------------------------------------------------------- 1 | package es.home.example.app; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 6 | 7 | @SpringBootApplication 8 | public class SpringWebfluxServerApp extends SpringBootServletInitializer { 9 | 10 | public static void main(final String[] args) { 11 | SpringApplication.run(SpringWebfluxServerApp.class, args); 12 | } 13 | } -------------------------------------------------------------------------------- /SpringExamples/SpringWebflux/SpringWebfluxServer/src/main/java/es/home/example/app/pojo/Incidence.java: -------------------------------------------------------------------------------- 1 | package es.home.example.app.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class Incidence { 9 | 10 | private String env; 11 | private String server; 12 | private String level; 13 | private String info; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /SpringExamples/SpringWebflux/SpringWebfluxServer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8085 -------------------------------------------------------------------------------- /Struts2Examples/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /Struts2Examples/src/main/java/com/home/example/struts2/filter/Struts2Filter.java: -------------------------------------------------------------------------------- 1 | package com.home.example.struts2.filter; 2 | 3 | import javax.servlet.annotation.WebFilter; 4 | 5 | import org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter; 6 | 7 | @WebFilter("/*") 8 | public class Struts2Filter extends StrutsPrepareAndExecuteFilter { 9 | } 10 | -------------------------------------------------------------------------------- /Struts2Examples/src/main/java/com/home/example/struts2/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package com.home.example.struts2.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import lombok.ToString; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | @NoArgsConstructor 11 | @ToString 12 | public class Book { 13 | 14 | private Integer id; 15 | 16 | private String author; 17 | 18 | private String name; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Struts2Examples/src/main/resources/global.properties: -------------------------------------------------------------------------------- 1 | global.book.author=Autor 2 | global.book.name=Nombre -------------------------------------------------------------------------------- /Struts2Examples/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Struts2Examples/src/main/resources/struts.properties: -------------------------------------------------------------------------------- 1 | struts.devMode=true -------------------------------------------------------------------------------- /Struts2Examples/src/main/resources/struts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /TestingExample/DBJUnitTestExample/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /TestingExample/DBJUnitTestExample/src/main/java/com/home/example/dbjunittest/dao/GenericDao.java: -------------------------------------------------------------------------------- 1 | package com.home.example.dbjunittest.dao; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.EntityManager; 6 | 7 | public interface GenericDao { 8 | 9 | List findAll(); 10 | 11 | E getByField(String field, String value); 12 | 13 | E getById(K key); 14 | 15 | EntityManager getEntityManager(); 16 | 17 | } -------------------------------------------------------------------------------- /TestingExample/DBJUnitTestExample/src/main/java/com/home/example/dbjunittest/dao/impl/BookDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.home.example.dbjunittest.dao.impl; 2 | 3 | import javax.ejb.Stateless; 4 | import javax.persistence.EntityManager; 5 | import javax.persistence.PersistenceContext; 6 | 7 | import com.home.example.dbjunittest.entity.Book; 8 | 9 | @Stateless 10 | public class BookDaoImpl extends GenericDaoImpl { 11 | @PersistenceContext(unitName = "persistence-unit") 12 | protected EntityManager em; 13 | 14 | @Override 15 | public EntityManager getEntityManager() { 16 | return em; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /TestingExample/DBJUnitTestExample/src/test/resources/schema-generator.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE BOOK ( 2 | ID INTEGER IDENTITY NOT NULL, 3 | AUTHOR VARCHAR, 4 | NAME VARCHAR, 5 | PRIMARY KEY (ID) 6 | ); 7 | 8 | INSERT INTO BOOK (ID, AUTHOR, NAME) VALUES (1, 'Orson S. Card', 'Ender Game'); -------------------------------------------------------------------------------- /TestingExample/DatabaseRiderTestExample/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /TestingExample/DatabaseRiderTestExample/src/main/java/com/home/example/dbjunittest/dao/GenericDao.java: -------------------------------------------------------------------------------- 1 | package com.home.example.dbjunittest.dao; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.EntityManager; 6 | 7 | public interface GenericDao { 8 | 9 | E create(E entity); 10 | 11 | List findAll(); 12 | 13 | E getByField(String field, String value); 14 | 15 | E getById(K key); 16 | 17 | EntityManager getEntityManager(); 18 | 19 | } -------------------------------------------------------------------------------- /TestingExample/DatabaseRiderTestExample/src/main/java/com/home/example/dbjunittest/dao/impl/BookDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.home.example.dbjunittest.dao.impl; 2 | 3 | import javax.ejb.Stateless; 4 | import javax.persistence.EntityManager; 5 | import javax.persistence.PersistenceContext; 6 | 7 | import com.home.example.dbjunittest.entity.Book; 8 | 9 | @Stateless 10 | public class BookDaoImpl extends GenericDaoImpl { 11 | @PersistenceContext(unitName = "persistence-unit") 12 | protected EntityManager em; 13 | 14 | @Override 15 | public EntityManager getEntityManager() { 16 | return em; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /TestingExample/DatabaseRiderTestExample/src/test/resources/book1.sql: -------------------------------------------------------------------------------- 1 | 2 | INSERT INTO BOOK (ID, AUTHOR, NAME) VALUES (1, 'Orson S. Card', 'Ender Game'); -------------------------------------------------------------------------------- /TestingExample/DatabaseRiderTestExample/src/test/resources/datasets/books.yml: -------------------------------------------------------------------------------- 1 | book: 2 | - id: 1 3 | name: "Ender's game" 4 | author: "Orson S. Card" 5 | - id: 2 6 | name: "The starts my destination" 7 | author: "Alfred Bester" 8 | - id: 3 9 | name: "Dune" 10 | author: "Frank Herbert" -------------------------------------------------------------------------------- /TestingExample/DatabaseRiderTestExample/src/test/resources/datasets/expectedBooks.yml: -------------------------------------------------------------------------------- 1 | book: 2 | - id: 11 3 | name: "Ender's game" 4 | author: "Orson S. Card" 5 | - id: 22 6 | name: "The starts my destination" 7 | author: "Alfred Bester" 8 | - id: 3 9 | name: "Dune" 10 | author: "Frank Herbert" 11 | - id: 33 12 | name: "Foundation" 13 | author: "Isaac Asimov" -------------------------------------------------------------------------------- /TestingExample/DatabaseRiderTestExample/src/test/resources/datasets/expectedBooksTranFalse.yml: -------------------------------------------------------------------------------- 1 | book: 2 | - id: 11 3 | name: "Ender's game" 4 | author: "Orson S. Card" 5 | - id: 22 6 | name: "The starts my destination" 7 | author: "Alfred Bester" 8 | - id: 3 9 | name: "Dune" 10 | author: "Frank Herbert" -------------------------------------------------------------------------------- /TestingExample/DatabaseRiderTestExample/src/test/resources/datasets/expectedRegExBooks.yml: -------------------------------------------------------------------------------- 1 | book: 2 | - id: "regex:\\d+" 3 | name: regex:^Ender's.* 4 | author: "Orson S. Card" 5 | - id: 2 6 | name: regex:.*starts.* 7 | author: Alfred Bester 8 | - id: 3 9 | name: Dune 10 | author: Frank Herbert 11 | - id: 5 12 | name: regex:.*tion$ 13 | author: Isaac Asimov -------------------------------------------------------------------------------- /TestingExample/DatabaseRiderTestExample/src/test/resources/schema-generator.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO BOOK (ID, AUTHOR, NAME) VALUES (1, 'Orson S. Card', 'Ender Game'); -------------------------------------------------------------------------------- /TestingExample/JPAJNDIIntTestExample/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /TestingExample/JPAJNDIIntTestExample/src/main/java/com/home/example/jpajndiinttest/dao/GenericDao.java: -------------------------------------------------------------------------------- 1 | package com.home.example.jpajndiinttest.dao; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.EntityManager; 6 | 7 | public interface GenericDao { 8 | 9 | List findAll(); 10 | 11 | E getByField(String field, String value); 12 | 13 | E getById(K key); 14 | 15 | EntityManager getEntityManager(); 16 | 17 | } -------------------------------------------------------------------------------- /TestingExample/JPAJNDIIntTestExample/src/main/java/com/home/example/jpajndiinttest/dao/impl/BookDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.home.example.jpajndiinttest.dao.impl; 2 | 3 | import javax.ejb.Stateless; 4 | import javax.persistence.EntityManager; 5 | import javax.persistence.PersistenceContext; 6 | 7 | import com.home.example.jpajndiinttest.entity.Book; 8 | 9 | @Stateless 10 | public class BookDaoImpl extends GenericDaoImpl { 11 | 12 | @PersistenceContext(unitName = "persistence-unit") 13 | protected EntityManager em; 14 | 15 | @Override 16 | public EntityManager getEntityManager() { 17 | return em; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /TestingExample/JPAJNDIIntTestExample/src/test/java/com/home/example/jpajndiinttest/dao/impl/MockTest.java: -------------------------------------------------------------------------------- 1 | package com.home.example.jpajndiinttest.dao.impl; 2 | 3 | import static org.hamcrest.CoreMatchers.equalTo; 4 | import static org.hamcrest.MatcherAssert.assertThat; 5 | 6 | import org.junit.jupiter.api.Test; 7 | 8 | //you can see how this class it's execute with maven-surefire-plugin 9 | public class MockTest { 10 | 11 | @Test 12 | public void metodo() { 13 | assertThat(1, equalTo(1)); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /TestingExample/JPAJNDIIntTestExample/src/test/resources/jndi.properties: -------------------------------------------------------------------------------- 1 | java.naming.factory.initial=org.osjava.sj.SimpleContextFactory 2 | org.osjava.sj.jndi.shared=true 3 | org.osjava.sj.delimiter=. 4 | jndi.syntax.separator=/ 5 | org.osjava.sj.space=java:comp/env 6 | org.osjava.sj.root=src/test/resources/jndi -------------------------------------------------------------------------------- /TestingExample/JPAJNDIIntTestExample/src/test/resources/jndi/jdbc.properties: -------------------------------------------------------------------------------- 1 | myds.type=javax.sql.DataSource 2 | myds.driver=org.h2.Driver 3 | myds.url=jdbc:h2:mem:test:sample;DB_CLOSE_ON_EXIT=FALSE;INIT=RUNSCRIPT FROM 'classpath:schema-generator.sql'; 4 | myds.user=sa 5 | myds.password=password -------------------------------------------------------------------------------- /TestingExample/JPAJNDIIntTestExample/src/test/resources/schema-generator.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE BOOK ( 2 | ID INTEGER IDENTITY NOT NULL, 3 | AUTHOR VARCHAR, 4 | NAME VARCHAR, 5 | PRIMARY KEY (ID) 6 | ); 7 | 8 | INSERT INTO BOOK (ID, AUTHOR, NAME) VALUES (1, 'Orson S. Card', 'Ender Game'); -------------------------------------------------------------------------------- /TestingExample/PowerMockExample/.gitignore: -------------------------------------------------------------------------------- 1 | /.gradle/ 2 | -------------------------------------------------------------------------------- /TestingExample/PowerMockExample/ChangeLog.md: -------------------------------------------------------------------------------- 1 | #Changes 2 | 3 | ## 1.0.0-SNAPSHOT 4 | 5 | - Initial version -------------------------------------------------------------------------------- /TestingExample/PowerMockExample/README.md: -------------------------------------------------------------------------------- 1 | # TestingExample 2 | 3 | ## Info 4 | 5 | Project to explain how mocks static with PowerMock version: 1.7.4 6 | 7 | ## Execution 8 | 9 | Execute the JUnit tests 10 | 11 | ## Tags 12 | 13 | Java, JUnit, Mockito, PowerMock, Test -------------------------------------------------------------------------------- /TestingExample/PowerMockExample/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java-library' 2 | apply plugin: 'eclipse' 3 | 4 | repositories { 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | testCompile group: 'org.powermock', name: 'powermock-api-mockito2', version: '1.7.4' 10 | testCompile group: 'org.powermock', name: 'powermock-module-junit4', version: '1.7.4' 11 | testCompile group: 'org.powermock', name: 'powermock-reflect', version: '1.7.4' 12 | 13 | } 14 | 15 | -------------------------------------------------------------------------------- /TestingExample/PowerMockExample/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was generated by the Gradle 'init' task. 3 | * 4 | * The settings file is used to specify which projects to include in your build. 5 | * In a single project build this file can be empty or even removed. 6 | * 7 | * Detailed information about configuring a multi-project build in Gradle can be found 8 | * in the user guide at https://docs.gradle.org/4.3/userguide/multi_project_builds.html 9 | */ 10 | 11 | /* 12 | // To declare projects as part of a multi-project build use the 'include' method 13 | include 'shared' 14 | include 'api' 15 | include 'services:webservice' 16 | */ 17 | 18 | rootProject.name = 'TestingExample' 19 | -------------------------------------------------------------------------------- /TestingExample/PowerMockExample/src/main/java/es/home/example/testing/controller/BookController.java: -------------------------------------------------------------------------------- 1 | package es.home.example.testing.controller; 2 | 3 | import es.home.example.testing.pojo.Book; 4 | import es.home.example.testing.ws.client.BookWSClient; 5 | import es.home.example.testing.ws.helper.BookWSHelper; 6 | 7 | public class BookController { 8 | private static BookWSClient client = new BookWSClient(); 9 | 10 | public Book getBookByStaticAttribute(final Integer id) { 11 | return client.getBook(id); 12 | } 13 | 14 | public Book getBookByStaticClass(final Integer id) { 15 | return BookWSHelper.getBook(id); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /TestingExample/PowerMockExample/src/main/java/es/home/example/testing/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package es.home.example.testing.pojo; 2 | 3 | public class Book { 4 | 5 | private String name; 6 | private String author; 7 | 8 | public Book(final String name, final String author) { 9 | super(); 10 | this.name = name; 11 | this.author = author; 12 | } 13 | 14 | public String getAuthor() { 15 | return author; 16 | } 17 | 18 | public String getName() { 19 | return name; 20 | } 21 | 22 | public void setAuthor(final String author) { 23 | this.author = author; 24 | } 25 | 26 | public void setName(final String name) { 27 | this.name = name; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /TestingExample/PowerMockExample/src/main/java/es/home/example/testing/ws/client/BookWSClient.java: -------------------------------------------------------------------------------- 1 | package es.home.example.testing.ws.client; 2 | 3 | import es.home.example.testing.pojo.Book; 4 | 5 | public class BookWSClient { 6 | 7 | public Book getBook(final Integer id) { 8 | return null; 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /TestingExample/PowerMockExample/src/main/java/es/home/example/testing/ws/helper/BookWSHelper.java: -------------------------------------------------------------------------------- 1 | package es.home.example.testing.ws.helper; 2 | 3 | import es.home.example.testing.pojo.Book; 4 | 5 | public final class BookWSHelper { 6 | 7 | public static Book getBook(final Integer id) { 8 | return null; 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /TestingExample/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/TestingExample/README.md -------------------------------------------------------------------------------- /TestingExample/TContainersJ4Example/src/test/resources/log4j2.properties: -------------------------------------------------------------------------------- 1 | name=PropertiesConfig 2 | 3 | appenders = apConsole 4 | 5 | appender.apConsole.type = Console 6 | appender.apConsole.name = STDOUT 7 | appender.apConsole.layout.type = PatternLayout 8 | appender.apConsole.layout.pattern = [%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} - %c{1} [%t] %msg%n 9 | 10 | loggers=lConsole 11 | logger.lConsole.name=com.example 12 | logger.lConsole.level = debug 13 | logger.lConsole.appenderRefs = apConsole 14 | 15 | rootLogger.level = info 16 | rootLogger.appenderRefs = stdout 17 | rootLogger.appenderRef.stdout.ref = STDOUT -------------------------------------------------------------------------------- /WSO2Examples/ActiveMQExample/docker-compose/lib/activemq-broker-5.14.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/WSO2Examples/ActiveMQExample/docker-compose/lib/activemq-broker-5.14.0.jar -------------------------------------------------------------------------------- /WSO2Examples/ActiveMQExample/docker-compose/lib/activemq-client-5.14.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/WSO2Examples/ActiveMQExample/docker-compose/lib/activemq-client-5.14.0.jar -------------------------------------------------------------------------------- /WSO2Examples/ActiveMQExample/docker-compose/lib/activemq-openwire-legacy-5.14.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/WSO2Examples/ActiveMQExample/docker-compose/lib/activemq-openwire-legacy-5.14.0.jar -------------------------------------------------------------------------------- /WSO2Examples/ActiveMQExample/docker-compose/lib/geronimo-j2ee-management_1.1_spec-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/WSO2Examples/ActiveMQExample/docker-compose/lib/geronimo-j2ee-management_1.1_spec-1.0.1.jar -------------------------------------------------------------------------------- /WSO2Examples/ActiveMQExample/docker-compose/lib/geronimo-jms_1.1_spec-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/WSO2Examples/ActiveMQExample/docker-compose/lib/geronimo-jms_1.1_spec-1.1.1.jar -------------------------------------------------------------------------------- /WSO2Examples/ActiveMQExample/docker-compose/lib/hawtbuf-1.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/WSO2Examples/ActiveMQExample/docker-compose/lib/hawtbuf-1.11.jar -------------------------------------------------------------------------------- /WSO2Examples/ActiveMQExample/wso2-activemq-example/wso2-activemq-exampleCompositeExporter/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /WSO2Examples/ActiveMQExample/wso2-activemq-example/wso2-activemq-exampleCompositeExporter/src/main/resources/security/wso2carbon.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/WSO2Examples/ActiveMQExample/wso2-activemq-example/wso2-activemq-exampleCompositeExporter/src/main/resources/security/wso2carbon.jks -------------------------------------------------------------------------------- /WSO2Examples/ActiveMQExample/wso2-activemq-example/wso2-activemq-exampleConfigs/src/main/resources/metadata/activemqExample_v1_book_api_metadata.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | key: "activemqExample_v1_book_api-1.0.0" 3 | name : "activemqExample_v1_book_api" 4 | displayName : "activemqExample_v1_book_api" 5 | description: "Sample API" 6 | version: "1.0.0" 7 | serviceUrl: "https://{MI_HOST}:{MI_PORT}/book" 8 | definitionType: "OAS3" 9 | securityType: "BASIC" 10 | mutualSSLEnabled: false 11 | -------------------------------------------------------------------------------- /WSO2Examples/BasicExample/docker-compose/apps/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM wso2/wso2mi:4.0.0 2 | COPY wso2-basic-example_1.0.0.car /home/wso2carbon/wso2mi-4.0.0/repository/deployment/server/carbonapps/ -------------------------------------------------------------------------------- /WSO2Examples/BasicExample/docker-compose/apps/wso2-basic-example_1.0.0.car: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/WSO2Examples/BasicExample/docker-compose/apps/wso2-basic-example_1.0.0.car -------------------------------------------------------------------------------- /WSO2Examples/BasicExample/wso2-basic-example/wso2-basic-exampleCompositeExporter/src/main/resources/security/wso2carbon.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/WSO2Examples/BasicExample/wso2-basic-example/wso2-basic-exampleCompositeExporter/src/main/resources/security/wso2carbon.jks -------------------------------------------------------------------------------- /WSO2Examples/BasicExample/wso2-basic-example/wso2-basic-exampleConfigs/src/main/resources/metadata/basicExample_v1_book_api_metadata.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | key: "basicExample_v1_book_api-1.0.0" 3 | name : "basicExample_v1_book_api" 4 | displayName : "basicExample_v1_book_api" 5 | description: "Sample API" 6 | version: "1.0.0" 7 | serviceUrl: "https://{MI_HOST}:{MI_PORT}/book" 8 | definitionType: "OAS3" 9 | securityType: "BASIC" 10 | mutualSSLEnabled: false 11 | -------------------------------------------------------------------------------- /WSO2Examples/SecretExample/docker-compose/.env: -------------------------------------------------------------------------------- 1 | ENV_SECRET=vUEEmGLNfq0SIPLi+zsEzPDR5hFJPuxN/6/1MtdNdmUxGcJrvLJrjDfS25Pw877N7V/HrFnaAmHVrG8TYVRpAaC+6CJ+oc+ITpqAm+ku2/F/H6iOAPHsrfkAXz+l5cjLGOKiW544K+Ycw5gUcqUkCpEBC8WPO2FF8n+wkmTRK1jGdwSj//tjU+pai+xk4eBKy/ILof6WjCwHvOSUd80FoFAQ09qxep1s2P8gp0Xe3ygRsmbQsMnbbdsxvYHPYYzwtrnOGnPziGDRv7lz9A49ROyFmSk1jmlWRd9xUNWFm0QStx0d2igjADSg22SEcnWJiHowhpIIVxMOi8YgYHHlZg== 2 | SYS_SECRET=k9rbQrS7VvpRdd9Bah0OVgHq0gix4wG5yKA+aXcqmbw3bEs2BIrvEOqHpxd28owwR41ghML1hzNDDQcJ+KmFI+S8NT4scCNIbhrqxovWZJ/35ugnLFxO56GyWX0k5plE3aHTO7OiCO9LC3tBjFXGxcGjedAYCvFsCyZJCptUQDkrUlD2CekfTetJAdyNbs+zrizR3ewoqYtklE0a4askomdHwIfd1lggDVZykqCkNer+2iUlZ6JvM23ARgcBfz/X4U9S7SX3A+nEByEPNeShh9ymtHcOXZKngrA1Z5o11xS90H7cXHOMBfof3CP+MUHx80M+tV5MQMs1TWDBbzt3vQ== -------------------------------------------------------------------------------- /WSO2Examples/SecretExample/docker-compose/apps/wso2-secret-exampleCompositeExporter_1.0.0.car: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/WSO2Examples/SecretExample/docker-compose/apps/wso2-secret-exampleCompositeExporter_1.0.0.car -------------------------------------------------------------------------------- /WSO2Examples/SecretExample/wso2-secret-example/wso2-secret-exampleCompositeExporter/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /WSO2Examples/SecretExample/wso2-secret-example/wso2-secret-exampleCompositeExporter/src/main/resources/security/wso2carbon.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/WSO2Examples/SecretExample/wso2-secret-example/wso2-secret-exampleCompositeExporter/src/main/resources/security/wso2carbon.jks -------------------------------------------------------------------------------- /WSO2Examples/SecretExample/wso2-secret-example/wso2-secret-exampleConfigs/src/main/resources/metadata/secretExample_v1_reader_api_metadata.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | key: "secretExample_v1_reader_api-1.0.0" 3 | name : "secretExample_v1_reader_api" 4 | displayName : "secretExample_v1_reader_api" 5 | description: "Sample API" 6 | version: "1.0.0" 7 | serviceUrl: "https://{MI_HOST}:{MI_PORT}/book" 8 | definitionType: "OAS3" 9 | securityType: "BASIC" 10 | mutualSSLEnabled: false 11 | -------------------------------------------------------------------------------- /WSO2Examples/SecretExample/wso2-secret-example/wso2-secret-exampleConfigs/src/main/resources/metadata/secretExample_v1_reader_api_swagger.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.1 2 | info: 3 | title: secretExample_v1_reader_api 4 | description: API Definition of secretExample_v1_reader_api 5 | version: 1.0.0 6 | servers: 7 | - url: http://localhost:8290/reader 8 | paths: 9 | /secret: 10 | get: 11 | responses: 12 | default: 13 | description: Default response 14 | -------------------------------------------------------------------------------- /WSO2Examples/custom-user-store-10/src/test/resources/docker-compose-is/configs/custom-user-store-10-1.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/WSO2Examples/custom-user-store-10/src/test/resources/docker-compose-is/configs/custom-user-store-10-1.0.0.jar -------------------------------------------------------------------------------- /Wiremock/ChangeLog.md: -------------------------------------------------------------------------------- 1 | #Changes 2 | 3 | ## 1.0.0-SNAPSHOT 4 | 5 | - Initial version. It contains samples of how configure Wiremock for HTTPS -------------------------------------------------------------------------------- /Wiremock/README.md: -------------------------------------------------------------------------------- 1 | # Wiremock 2 | 3 | Project to explain how works Wiremock 4 | 5 | You can see an explanation in Spanish here: http://DesarrolloJavaYYo.blogspot.com -------------------------------------------------------------------------------- /Wiremock/src/main/java/com/home/example/wiremockhttps/pojo/Token.java: -------------------------------------------------------------------------------- 1 | package com.home.example.wiremockhttps.pojo; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class Token { 9 | 10 | @SerializedName("access_token") 11 | private String accessToken; 12 | 13 | private String refreshToken; 14 | 15 | private String scope; 16 | 17 | private String tokenType; 18 | 19 | private long expiresIn; 20 | 21 | private String instance_url; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Wiremock/src/test/resources/log4j2.properties: -------------------------------------------------------------------------------- 1 | status = error 2 | name = PropertiesConfig 3 | 4 | filters = threshold 5 | 6 | filter.threshold.type = ThresholdFilter 7 | filter.threshold.level = debug 8 | 9 | appenders = console 10 | 11 | appender.console.type = Console 12 | appender.console.name = STDOUT 13 | appender.console.layout.type = PatternLayout 14 | appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n 15 | 16 | rootLogger.level = debug 17 | rootLogger.appenderRefs = stdout 18 | rootLogger.appenderRef.stdout.ref = STDOUT -------------------------------------------------------------------------------- /Wiremock/src/test/resources/wiremock/__files/tokenCredentialsResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "access_token": "123456", 3 | "refresh_token": "654321", 4 | "token_type": "bearer", 5 | "scope": "infinite", 6 | "expires_in": 123456 7 | } -------------------------------------------------------------------------------- /Wiremock/src/test/resources/wiremock/identity.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deesebc/PostExamples/1569f59b3177a25c814af234f22f51540eeea195/Wiremock/src/test/resources/wiremock/identity.jks -------------------------------------------------------------------------------- /Wiremock/src/test/resources/wiremock/mappings/token.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": 3 | { 4 | "urlPath": "/token", 5 | "method": "POST", 6 | "queryParameters": 7 | { 8 | "grant_type": 9 | { 10 | "equalTo": "client_credentials" 11 | } 12 | }, 13 | "headers": 14 | { 15 | "Authorization": { 16 | "equalTo": "Basic MTIzNDo0MzIx" 17 | } 18 | } 19 | }, 20 | "response": 21 | { 22 | "status": 200, 23 | "bodyFileName": "tokenCredentialsResponse.json", 24 | "headers": 25 | { 26 | "Access-Control-Allow-Methods": "POST", 27 | "Connection": "Keep-Alive", 28 | "Access-Control-Allow-Headers": "content-type", 29 | "Content-Type": "application/json" 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /weblogicWSExample/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /weblogicWSExample/lombok.config: -------------------------------------------------------------------------------- 1 | lombok.addLombokGeneratedAnnotation = true -------------------------------------------------------------------------------- /weblogicWSExample/src/main/java/com/example/weblogicWS/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package com.example.weblogicWS.pojo; 2 | 3 | //import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import lombok.ToString; 9 | 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | @ToString 14 | public class Book { 15 | 16 | // @JsonProperty 17 | private Integer id; 18 | // @JsonProperty 19 | private String name; 20 | // @JsonProperty 21 | private String author; 22 | } 23 | -------------------------------------------------------------------------------- /weblogicWSExample/src/main/java/com/example/weblogicWS/ws/BookService.java: -------------------------------------------------------------------------------- 1 | package com.example.weblogicWS.ws; 2 | 3 | import java.util.List; 4 | 5 | import com.example.weblogicWS.pojo.Book; 6 | 7 | public interface BookService { 8 | // http://localhost:7001/weblogicWS/BookSoapService 9 | 10 | void delete(final Integer id); 11 | 12 | List getAll(); 13 | 14 | Book getById(final Integer id); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /weblogicWSExample/src/test/resources/dockerProperties/domain.properties: -------------------------------------------------------------------------------- 1 | username=user1 2 | password=welcome1 -------------------------------------------------------------------------------- /wordCounterWS/src/main/java/es/home/sample/wordCounter/Application.java: -------------------------------------------------------------------------------- 1 | package es.home.sample.wordCounter; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.annotation.ComponentScan; 6 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 7 | 8 | @SpringBootApplication 9 | @EnableJpaAuditing 10 | @ComponentScan(basePackages = { "es.home.sample.wordCounter" }) 11 | public class Application { 12 | 13 | public static void main(final String[] args) { 14 | SpringApplication.run(Application.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /wordCounterWS/src/main/java/es/home/sample/wordCounter/repository/GenericDao.java: -------------------------------------------------------------------------------- 1 | package es.home.sample.wordCounter.repository; 2 | 3 | import java.io.Serializable; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 7 | import org.springframework.data.repository.NoRepositoryBean; 8 | 9 | import es.home.sample.wordCounter.entity.GenericEntity; 10 | 11 | @NoRepositoryBean 12 | public interface GenericDao, K extends Serializable> 13 | extends JpaRepository, JpaSpecificationExecutor { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /wordCounterWS/src/main/java/es/home/sample/wordCounter/repository/HistoryRepository.java: -------------------------------------------------------------------------------- 1 | package es.home.sample.wordCounter.repository; 2 | 3 | import java.util.List; 4 | 5 | import es.home.sample.wordCounter.entity.History; 6 | 7 | public interface HistoryRepository extends GenericDao { 8 | List findTop10ByOrderByCreatedDateDesc(); 9 | } --------------------------------------------------------------------------------