├── Spring4-SSE ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── windoctor7 │ │ │ └── github │ │ │ └── io │ │ │ └── spring4 │ │ │ └── sse │ │ │ └── Spring4SSE │ │ │ ├── IJobExecutor.java │ │ │ ├── MensajeEvent.java │ │ │ ├── WebMvcConfig.java │ │ │ ├── Spring4SseApplication.java │ │ │ ├── Mensaje.java │ │ │ ├── GenerarArchivo.java │ │ │ ├── SseController.java │ │ │ └── JobExecutor.java │ └── test │ │ └── java │ │ └── windoctor7 │ │ └── github │ │ └── io │ │ └── spring4 │ │ └── sse │ │ └── Spring4SSE │ │ └── Spring4SseApplicationTests.java ├── .DS_Store ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle └── gradlew.bat ├── spring-auth-jwt ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── windoctor7 │ │ │ └── github │ │ │ └── io │ │ │ └── spring │ │ │ └── auth │ │ │ └── jwt │ │ │ ├── SpringAuthJwtApplication.java │ │ │ ├── Usuario.java │ │ │ ├── controllers │ │ │ └── UsuariosController.java │ │ │ └── security │ │ │ ├── JwtFilter.java │ │ │ ├── SecurityConfig.java │ │ │ └── JwtUtil.java │ └── test │ │ └── java │ │ └── windoctor7 │ │ └── github │ │ └── io │ │ └── spring │ │ └── auth │ │ └── jwt │ │ └── SpringAuthJwtApplicationTests.java ├── .DS_Store ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle └── gradlew.bat ├── spring-kotlin ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── kotlin │ │ │ └── windoctor7 │ │ │ └── github │ │ │ └── io │ │ │ └── kotlin │ │ │ └── spring │ │ │ └── springkotlin │ │ │ ├── Student.kt │ │ │ ├── StudentRepository.kt │ │ │ ├── SpringKotlinApplication.kt │ │ │ └── StudentController.kt │ └── test │ │ └── kotlin │ │ └── windoctor7 │ │ └── github │ │ └── io │ │ └── kotlin │ │ └── spring │ │ └── springkotlin │ │ └── SpringKotlinApplicationTests.kt ├── .DS_Store ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle └── gradlew.bat ├── spring-pwa ├── src │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── .DS_Store │ │ │ └── static │ │ │ │ ├── .DS_Store │ │ │ │ ├── assets │ │ │ │ ├── images │ │ │ │ │ ├── logo.jpg │ │ │ │ │ └── BAZ_mobile.png │ │ │ │ ├── manifest.webmanifest │ │ │ │ └── css │ │ │ │ │ └── signin.css │ │ │ │ └── sw.js │ │ ├── .DS_Store │ │ └── java │ │ │ ├── .DS_Store │ │ │ └── windoctor7 │ │ │ ├── .DS_Store │ │ │ └── github │ │ │ ├── .DS_Store │ │ │ └── io │ │ │ ├── .DS_Store │ │ │ └── pwa │ │ │ ├── .DS_Store │ │ │ └── demopwa │ │ │ ├── DemoPwaApplication.java │ │ │ └── LoginController.java │ ├── .DS_Store │ └── test │ │ └── java │ │ └── windoctor7 │ │ └── github │ │ └── io │ │ └── pwa │ │ └── demopwa │ │ └── DemoPwaApplicationTests.java ├── settings.gradle ├── .DS_Store ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore └── build.gradle ├── spring-web-flux ├── src │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── index.html │ │ └── java │ │ │ └── windoctor7 │ │ │ └── github │ │ │ └── io │ │ │ └── spring5 │ │ │ └── reactive │ │ │ ├── SpringWebFluxApplication.java │ │ │ └── NumerosController.java │ └── test │ │ └── java │ │ └── windoctor7 │ │ └── github │ │ └── io │ │ └── spring5 │ │ └── reactive │ │ └── SpringWebFluxApplicationTests.java ├── .DS_Store ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle └── gradlew.bat ├── spring-retry ├── ws-rest │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── windoctor7 │ │ │ │ └── github │ │ │ │ └── io │ │ │ │ └── spring │ │ │ │ └── retry │ │ │ │ ├── SpringRetryApplication.java │ │ │ │ ├── Empleado.java │ │ │ │ └── ConsultaController.java │ │ └── test │ │ │ └── java │ │ │ └── windoctor7 │ │ │ └── github │ │ │ └── io │ │ │ └── spring │ │ │ └── retry │ │ │ └── SpringRetryApplicationTests.java │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── build.gradle │ └── gradlew.bat ├── cliente-ws │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ ├── .DS_Store │ │ │ └── java │ │ │ │ ├── .DS_Store │ │ │ │ └── windoctor7 │ │ │ │ ├── .DS_Store │ │ │ │ └── github │ │ │ │ ├── .DS_Store │ │ │ │ └── io │ │ │ │ ├── .DS_Store │ │ │ │ └── spring │ │ │ │ └── retry │ │ │ │ └── test │ │ │ │ ├── SpringRetryTestApplication.java │ │ │ │ ├── Empleado.java │ │ │ │ └── ClienteRest.java │ │ ├── .DS_Store │ │ └── test │ │ │ └── java │ │ │ └── windoctor7 │ │ │ └── github │ │ │ └── io │ │ │ └── spring │ │ │ └── retry │ │ │ └── test │ │ │ └── SpringRetryTestApplicationTests.java │ ├── .DS_Store │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── build.gradle │ └── gradlew.bat └── .DS_Store ├── spring-state-machine ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── windoctor7 │ │ │ └── github │ │ │ └── io │ │ │ └── spring │ │ │ └── statemachine │ │ │ ├── Eventos.java │ │ │ ├── Estados.java │ │ │ └── Main.java │ └── test │ │ └── java │ │ └── windoctor7 │ │ └── github │ │ └── io │ │ └── spring │ │ └── statemachine │ │ └── SpringStateMachineApplicationTests.java ├── .DS_Store ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── .gitignore └── gradlew.bat ├── spring5-reactive-kotlin ├── src │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── static │ │ │ │ └── index.html │ │ └── kotlin │ │ │ └── windoctor7 │ │ │ └── github │ │ │ └── io │ │ │ └── spring5 │ │ │ └── reactive │ │ │ └── kotlin │ │ │ ├── UserResultGh.kt │ │ │ ├── Spring5ReactiveKotlinApplication.kt │ │ │ ├── User.kt │ │ │ ├── IRepositorySearch.kt │ │ │ ├── Controller.java │ │ │ ├── SearchUsersController.kt │ │ │ └── RepositorySearch.kt │ └── test │ │ └── kotlin │ │ └── windoctor7 │ │ └── github │ │ └── io │ │ └── spring5 │ │ └── reactive │ │ └── kotlin │ │ └── Spring5ReactiveKotlinApplicationTests.kt ├── .DS_Store ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle └── gradlew.bat ├── calculadora ├── settings.gradle ├── .DS_Store ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── src │ └── main │ │ └── java │ │ └── windoctor7 │ │ └── github │ │ └── io │ │ └── alexa │ │ └── skills │ │ └── calculadora │ │ ├── Intents.java │ │ ├── lambdas │ │ ├── SessionEndedRequestHandler.java │ │ ├── CancelAndStopIntent.java │ │ ├── NoIntentHandler.java │ │ ├── LaunchRequestHandler.java │ │ ├── HelpIntentHandler.java │ │ ├── RepeatIntentHandler.java │ │ └── SumaIntent.java │ │ └── MainStreamHandler.java └── gradlew.bat ├── java-streams ├── settings.gradle ├── .DS_Store ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── src │ └── main │ │ └── java │ │ └── windoctor7 │ │ └── github │ │ └── io │ │ └── streams │ │ ├── Main.java │ │ ├── Util.java │ │ └── Product.java └── gradlew.bat ├── spring-scheduler ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── windoctor7 │ │ │ └── github │ │ │ └── io │ │ │ └── spring │ │ │ └── scheduled │ │ │ ├── SpringSchedulerApplication.java │ │ │ └── TareasPeriodicas.java │ └── test │ │ └── java │ │ └── windoctor7 │ │ └── github │ │ └── io │ │ └── spring │ │ └── scheduled │ │ └── SpringSchedulerApplicationTests.java ├── .DS_Store ├── .gitignore ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle └── gradlew.bat ├── spring-set-profile ├── src │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── application-dev.properties │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ ├── PrimerEjemplo.java │ │ │ └── DemoApplication.java │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── DemoApplicationTests.java ├── .DS_Store ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle └── gradlew.bat ├── .DS_Store ├── spring-kafka-consumer ├── settings.gradle ├── .DS_Store ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ ├── test │ │ └── java │ │ │ └── windoctor7 │ │ │ └── github │ │ │ └── io │ │ │ └── spring │ │ │ └── kafka │ │ │ └── consumer │ │ │ └── SpringKafkaConsumerApplicationTests.java │ └── main │ │ ├── java │ │ └── windoctor7 │ │ │ └── github │ │ │ └── io │ │ │ └── spring │ │ │ └── kafka │ │ │ ├── consumer │ │ │ ├── SpringKafkaConsumerApplication.java │ │ │ └── CreditProductConsumer.java │ │ │ └── producer │ │ │ └── CreditProduct.java │ │ └── resources │ │ └── application.properties ├── .gitignore └── build.gradle ├── spring-kafka-producer ├── settings.gradle ├── .DS_Store ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ ├── main │ │ ├── java │ │ │ └── windoctor7 │ │ │ │ └── github │ │ │ │ └── io │ │ │ │ └── spring │ │ │ │ └── kafka │ │ │ │ └── producer │ │ │ │ ├── CreditProduct.java │ │ │ │ ├── SpringKafkaProducerApplication.java │ │ │ │ ├── CreditProductService.java │ │ │ │ ├── CreditProductController.java │ │ │ │ └── CreditProductProducer.java │ │ └── resources │ │ │ └── application.properties │ └── test │ │ └── java │ │ └── windoctor7 │ │ └── github │ │ └── io │ │ └── spring │ │ └── kafka │ │ └── producer │ │ └── SpringKafkaProducerApplicationTests.java ├── build.gradle └── .gitignore ├── inyeccion-dependencia ├── settings.gradle ├── .gitignore ├── .DS_Store ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ ├── main │ │ └── java │ │ │ └── basic │ │ │ ├── MedioContacto.java │ │ │ ├── IMensaje.java │ │ │ ├── ApplicationConfig.java │ │ │ ├── MensajeSms.java │ │ │ ├── MensajeTwitter.java │ │ │ ├── MensajeEmail.java │ │ │ ├── Recordatorio.java │ │ │ ├── RecordatorioTwitter.java │ │ │ ├── RecordatorioSms.java │ │ │ ├── RecordatorioEmail.java │ │ │ └── Main.java │ └── test │ │ └── java │ │ └── RecordatorioSpec.groovy ├── build.gradle └── gradlew.bat ├── spring-jdbc ├── src │ ├── main │ │ ├── resources │ │ │ ├── application-test.properties │ │ │ ├── schema-h2.sql │ │ │ ├── schema-mysql.sql │ │ │ ├── application.properties │ │ │ └── data.sql │ │ └── java │ │ │ └── windoctor7 │ │ │ └── github │ │ │ └── io │ │ │ └── spring │ │ │ └── jdbc │ │ │ └── springjdbc │ │ │ ├── Departamento.java │ │ │ ├── JdbcController.java │ │ │ ├── User.java │ │ │ ├── DepartamentoRepository.java │ │ │ ├── Empleado.java │ │ │ └── SpringJdbcApplication.java │ └── test │ │ └── java │ │ └── windoctor7 │ │ └── github │ │ └── io │ │ └── spring │ │ └── jdbc │ │ └── springjdbc │ │ └── SpringJdbcApplicationTests.java ├── .DS_Store ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle └── gradlew.bat ├── scripts_r ├── .DS_Store └── data │ └── .DS_Store ├── spring-async ├── .DS_Store ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── windoctor7 │ │ │ └── github │ │ │ └── io │ │ │ └── spring │ │ │ └── async │ │ │ ├── SpringAsyncApplication.java │ │ │ ├── RegistroController.java │ │ │ ├── Usuario.java │ │ │ └── RegistroAsync.java │ └── test │ │ └── java │ │ └── windoctor7 │ │ └── github │ │ └── io │ │ └── spring │ │ └── async │ │ └── SpringAsyncApplicationTests.java ├── build.gradle └── gradlew.bat ├── spring-webflux-2 ├── src │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── templates │ │ │ │ └── students.html │ │ └── java │ │ │ └── windoctor7 │ │ │ └── github │ │ │ └── io │ │ │ └── spring5 │ │ │ └── reactive │ │ │ └── springwebflux2 │ │ │ ├── StudentRepository.java │ │ │ ├── StudentReactiveRepository.java │ │ │ ├── Subscriber.java │ │ │ ├── Score.java │ │ │ ├── SpringWebflux2Application.java │ │ │ ├── Student.java │ │ │ ├── NumerosController.java │ │ │ ├── StudentController.java │ │ │ └── StudentListController.java │ └── test │ │ └── java │ │ └── windoctor7 │ │ └── github │ │ └── io │ │ └── spring5 │ │ └── reactive │ │ └── springwebflux2 │ │ └── SpringWebflux2ApplicationTests.java ├── .DS_Store ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle └── gradlew.bat ├── docker-springboot-java17 ├── .gitignore ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitattributes ├── app │ ├── src │ │ ├── test │ │ │ └── groovy │ │ │ │ └── docker │ │ │ │ └── springboot │ │ │ │ └── java17 │ │ │ │ └── AppTest.groovy │ │ └── main │ │ │ └── java │ │ │ └── docker │ │ │ └── springboot │ │ │ └── java17 │ │ │ └── App.java │ └── build.gradle ├── settings.gradle └── Dockerfile └── .gitignore /Spring4-SSE/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spring-auth-jwt/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spring-kotlin/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spring-pwa/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-web-flux/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spring-pwa/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'demo-pwa' 2 | -------------------------------------------------------------------------------- /spring-retry/ws-rest/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spring-state-machine/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spring5-reactive-kotlin/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /calculadora/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'calculadora' 2 | 3 | -------------------------------------------------------------------------------- /java-streams/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'java-streams' 2 | 3 | -------------------------------------------------------------------------------- /spring-scheduler/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | imprime.tarea=5000 -------------------------------------------------------------------------------- /spring-retry/cliente-ws/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8001 -------------------------------------------------------------------------------- /spring-set-profile/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | url.smtp=200.123.45.65 -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/.DS_Store -------------------------------------------------------------------------------- /spring-kafka-consumer/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'spring-kafka-consumer' 2 | -------------------------------------------------------------------------------- /spring-kafka-producer/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'spring-kafka-producer' 2 | -------------------------------------------------------------------------------- /spring-set-profile/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | url.smtp=10.60.34.123 -------------------------------------------------------------------------------- /inyeccion-dependencia/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'Inyeccion-Dependencia' 2 | 3 | -------------------------------------------------------------------------------- /spring-jdbc/src/main/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.platform=h2 2 | 3 | -------------------------------------------------------------------------------- /scripts_r/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/scripts_r/.DS_Store -------------------------------------------------------------------------------- /Spring4-SSE/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/Spring4-SSE/.DS_Store -------------------------------------------------------------------------------- /calculadora/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/calculadora/.DS_Store -------------------------------------------------------------------------------- /java-streams/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/java-streams/.DS_Store -------------------------------------------------------------------------------- /spring-async/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-async/.DS_Store -------------------------------------------------------------------------------- /spring-jdbc/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-jdbc/.DS_Store -------------------------------------------------------------------------------- /spring-pwa/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-pwa/.DS_Store -------------------------------------------------------------------------------- /spring-pwa/gradle.properties: -------------------------------------------------------------------------------- 1 | systemProp.maven.multiModuleProjectDirectory=/Users/ascariromopedraza/demo-pwa 2 | -------------------------------------------------------------------------------- /spring-retry/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-retry/.DS_Store -------------------------------------------------------------------------------- /spring-webflux-2/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.reactive.max-chunk-size=8142 2 | -------------------------------------------------------------------------------- /inyeccion-dependencia/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | .gradle/ 3 | .idea/ 4 | build/ 5 | -------------------------------------------------------------------------------- /scripts_r/data/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/scripts_r/data/.DS_Store -------------------------------------------------------------------------------- /spring-kotlin/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-kotlin/.DS_Store -------------------------------------------------------------------------------- /spring-pwa/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-pwa/src/.DS_Store -------------------------------------------------------------------------------- /spring-auth-jwt/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-auth-jwt/.DS_Store -------------------------------------------------------------------------------- /spring-scheduler/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-scheduler/.DS_Store -------------------------------------------------------------------------------- /spring-web-flux/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-web-flux/.DS_Store -------------------------------------------------------------------------------- /spring-webflux-2/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-webflux-2/.DS_Store -------------------------------------------------------------------------------- /spring-pwa/src/main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-pwa/src/main/.DS_Store -------------------------------------------------------------------------------- /spring-set-profile/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-set-profile/.DS_Store -------------------------------------------------------------------------------- /inyeccion-dependencia/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/inyeccion-dependencia/.DS_Store -------------------------------------------------------------------------------- /spring-kafka-consumer/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-kafka-consumer/.DS_Store -------------------------------------------------------------------------------- /spring-kafka-producer/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-kafka-producer/.DS_Store -------------------------------------------------------------------------------- /spring-state-machine/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-state-machine/.DS_Store -------------------------------------------------------------------------------- /spring-pwa/src/main/java/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-pwa/src/main/java/.DS_Store -------------------------------------------------------------------------------- /spring-retry/cliente-ws/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-retry/cliente-ws/.DS_Store -------------------------------------------------------------------------------- /spring5-reactive-kotlin/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring5-reactive-kotlin/.DS_Store -------------------------------------------------------------------------------- /spring-retry/cliente-ws/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-retry/cliente-ws/src/.DS_Store -------------------------------------------------------------------------------- /spring-pwa/src/main/resources/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-pwa/src/main/resources/.DS_Store -------------------------------------------------------------------------------- /spring-retry/cliente-ws/src/main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-retry/cliente-ws/src/main/.DS_Store -------------------------------------------------------------------------------- /docker-springboot-java17/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore Gradle project-specific cache directory 2 | .gradle 3 | 4 | # Ignore Gradle build output directory 5 | build 6 | -------------------------------------------------------------------------------- /spring-pwa/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-pwa/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Spring4-SSE/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/Spring4-SSE/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /calculadora/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/calculadora/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /java-streams/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/java-streams/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-async/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-async/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-jdbc/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-jdbc/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-pwa/src/main/java/windoctor7/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-pwa/src/main/java/windoctor7/.DS_Store -------------------------------------------------------------------------------- /spring-pwa/src/main/resources/static/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-pwa/src/main/resources/static/.DS_Store -------------------------------------------------------------------------------- /spring-retry/cliente-ws/src/main/java/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-retry/cliente-ws/src/main/java/.DS_Store -------------------------------------------------------------------------------- /spring-auth-jwt/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-auth-jwt/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-web-flux/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-web-flux/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-pwa/src/main/java/windoctor7/github/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-pwa/src/main/java/windoctor7/github/.DS_Store -------------------------------------------------------------------------------- /spring-scheduler/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | build 3 | !gradle/wrapper/gradle-wrapper.jar 4 | 5 | ### IntelliJ IDEA ### 6 | .idea 7 | *.iws 8 | *.iml 9 | *.ipr 10 | -------------------------------------------------------------------------------- /spring-scheduler/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-scheduler/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-set-profile/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-set-profile/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-webflux-2/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-webflux-2/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-retry/ws-rest/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-retry/ws-rest/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-state-machine/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-state-machine/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /inyeccion-dependencia/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/inyeccion-dependencia/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-kafka-consumer/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-kafka-consumer/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-kafka-producer/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-kafka-producer/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-pwa/src/main/java/windoctor7/github/io/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-pwa/src/main/java/windoctor7/github/io/.DS_Store -------------------------------------------------------------------------------- /spring-retry/cliente-ws/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-retry/cliente-ws/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring5-reactive-kotlin/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring5-reactive-kotlin/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /docker-springboot-java17/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/docker-springboot-java17/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /spring-pwa/src/main/java/windoctor7/github/io/pwa/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-pwa/src/main/java/windoctor7/github/io/pwa/.DS_Store -------------------------------------------------------------------------------- /spring-pwa/src/main/resources/static/assets/images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-pwa/src/main/resources/static/assets/images/logo.jpg -------------------------------------------------------------------------------- /spring-retry/cliente-ws/src/main/java/windoctor7/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-retry/cliente-ws/src/main/java/windoctor7/.DS_Store -------------------------------------------------------------------------------- /spring-pwa/src/main/resources/static/assets/images/BAZ_mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-pwa/src/main/resources/static/assets/images/BAZ_mobile.png -------------------------------------------------------------------------------- /spring-retry/cliente-ws/src/main/java/windoctor7/github/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-retry/cliente-ws/src/main/java/windoctor7/github/.DS_Store -------------------------------------------------------------------------------- /spring-retry/cliente-ws/src/main/java/windoctor7/github/io/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/windoctor7/codigo-tutoriales-blog/HEAD/spring-retry/cliente-ws/src/main/java/windoctor7/github/io/.DS_Store -------------------------------------------------------------------------------- /inyeccion-dependencia/src/main/java/basic/MedioContacto.java: -------------------------------------------------------------------------------- 1 | package basic; 2 | 3 | /** 4 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 20/03/17. 5 | */ 6 | public enum MedioContacto { 7 | SMS, EMAIL, TWITTER 8 | } 9 | -------------------------------------------------------------------------------- /inyeccion-dependencia/src/main/java/basic/IMensaje.java: -------------------------------------------------------------------------------- 1 | package basic; 2 | 3 | /** 4 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 20/03/17. 5 | */ 6 | public interface IMensaje { 7 | void enviar(String destinatario, String mensaje); 8 | } 9 | -------------------------------------------------------------------------------- /spring-pwa/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /calculadora/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-async/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip 6 | -------------------------------------------------------------------------------- /spring-web-flux/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip 6 | -------------------------------------------------------------------------------- /spring-retry/ws-rest/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip 6 | -------------------------------------------------------------------------------- /spring-scheduler/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip 6 | -------------------------------------------------------------------------------- /spring-set-profile/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip 6 | -------------------------------------------------------------------------------- /docker-springboot-java17/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-kafka-consumer/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-kafka-producer/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /spring-retry/cliente-ws/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip 6 | -------------------------------------------------------------------------------- /spring-state-machine/src/main/java/windoctor7/github/io/spring/statemachine/Eventos.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.statemachine; 2 | 3 | /** 4 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 14/04/17. 5 | */ 6 | public enum Eventos { 7 | SI, NO 8 | } 9 | -------------------------------------------------------------------------------- /docker-springboot-java17/.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # Linux start script should use lf 5 | /gradlew text eol=lf 6 | 7 | # These are Windows script files and should use crlf 8 | *.bat text eol=crlf 9 | 10 | -------------------------------------------------------------------------------- /Spring4-SSE/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Oct 13 21:09:51 CDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-all.zip 7 | -------------------------------------------------------------------------------- /java-streams/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Apr 17 21:08:02 CDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip 7 | -------------------------------------------------------------------------------- /spring-jdbc/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Oct 14 23:37:06 CDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-all.zip 7 | -------------------------------------------------------------------------------- /spring-kotlin/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Oct 21 22:31:08 CDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.2-all.zip 7 | -------------------------------------------------------------------------------- /spring-state-machine/src/main/java/windoctor7/github/io/spring/statemachine/Estados.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.statemachine; 2 | 3 | /** 4 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 14/04/17. 5 | */ 6 | public enum Estados { 7 | INICIO, CANDIDATO, FIN 8 | } 9 | -------------------------------------------------------------------------------- /docker-springboot-java17/app/src/test/groovy/docker/springboot/java17/AppTest.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * This Spock specification was generated by the Gradle 'init' task. 3 | */ 4 | package docker.springboot.java17 5 | 6 | import spock.lang.Specification 7 | 8 | class AppTest extends Specification { 9 | } 10 | -------------------------------------------------------------------------------- /spring-auth-jwt/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Apr 28 18:22:41 CDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip 7 | -------------------------------------------------------------------------------- /spring-webflux-2/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jul 28 13:37:07 BST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.2-bin.zip 7 | -------------------------------------------------------------------------------- /inyeccion-dependencia/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Mar 20 19:50:07 CST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /spring-state-machine/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 12 15:56:07 CDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip 7 | -------------------------------------------------------------------------------- /spring5-reactive-kotlin/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Oct 23 18:57:01 CDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.2-all.zip 7 | -------------------------------------------------------------------------------- /java-streams/build.gradle: -------------------------------------------------------------------------------- 1 | group 'windoctor7.github.io.streams' 2 | version '1.0-SNAPSHOT' 3 | 4 | apply plugin: 'java' 5 | 6 | sourceCompatibility = 1.8 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | testCompile group: 'junit', name: 'junit', version: '4.12' 14 | } 15 | -------------------------------------------------------------------------------- /Spring4-SSE/src/main/java/windoctor7/github/io/spring4/sse/Spring4SSE/IJobExecutor.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring4.sse.Spring4SSE; 2 | 3 | /** 4 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 08/10/17. 5 | */ 6 | public interface IJobExecutor { 7 | 8 | void executeBean(String beanClass); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /spring-jdbc/src/main/resources/schema-h2.sql: -------------------------------------------------------------------------------- 1 | 2 | CREATE TABLE departamento ( 3 | id IDENTITY PRIMARY KEY, 4 | nombre VARCHAR(64) NOT NULL 5 | ); 6 | 7 | CREATE TABLE empleado ( 8 | id IDENTITY PRIMARY KEY, 9 | nombre VARCHAR(64) NOT NULL, 10 | departamento_id INT, 11 | CONSTRAINT FK_EMP_DEPT_ID FOREIGN KEY(departamento_id) REFERENCES departamento(id) 12 | ); -------------------------------------------------------------------------------- /spring-pwa/src/test/java/windoctor7/github/io/pwa/demopwa/DemoPwaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.pwa.demopwa; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class DemoPwaApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Spring4-SSE/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | !gradle/wrapper/gradle-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | nbproject/private/ 21 | build/ 22 | nbbuild/ 23 | dist/ 24 | nbdist/ 25 | .nb-gradle/ -------------------------------------------------------------------------------- /spring-jdbc/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | !gradle/wrapper/gradle-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | nbproject/private/ 21 | build/ 22 | nbbuild/ 23 | dist/ 24 | nbdist/ 25 | .nb-gradle/ -------------------------------------------------------------------------------- /spring-auth-jwt/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | !gradle/wrapper/gradle-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | nbproject/private/ 21 | build/ 22 | nbbuild/ 23 | dist/ 24 | nbdist/ 25 | .nb-gradle/ -------------------------------------------------------------------------------- /spring-pwa/src/main/resources/static/assets/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "PWA Ejemplo", 3 | "name": "Ejemplo de app PWA", 4 | "display": "standalone", 5 | "icons": [{ 6 | "src": "./images/logo.jpg", 7 | "sizes": "192x192", 8 | "type": "image/jpg" 9 | }], 10 | "start_url": "../login", 11 | "theme_color": "#404549", 12 | "background_color": "#34373b" 13 | } -------------------------------------------------------------------------------- /spring-state-machine/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | apply plugin: 'idea' 3 | 4 | version = '0.0.1-SNAPSHOT' 5 | sourceCompatibility = 1.8 6 | 7 | repositories { 8 | mavenCentral() 9 | } 10 | 11 | 12 | dependencies { 13 | compile 'org.springframework:spring-context:4.3.7.RELEASE' 14 | compile 'org.springframework.statemachine:spring-statemachine-core:1.2.3.RELEASE' 15 | } 16 | -------------------------------------------------------------------------------- /spring-web-flux/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | !gradle/wrapper/gradle-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | nbproject/private/ 21 | build/ 22 | nbbuild/ 23 | dist/ 24 | nbdist/ 25 | .nb-gradle/ -------------------------------------------------------------------------------- /spring-state-machine/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | !gradle/wrapper/gradle-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | nbproject/private/ 21 | build/ 22 | nbbuild/ 23 | dist/ 24 | nbdist/ 25 | .nb-gradle/ -------------------------------------------------------------------------------- /spring5-reactive-kotlin/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | !gradle/wrapper/gradle-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | nbproject/private/ 21 | build/ 22 | nbbuild/ 23 | dist/ 24 | nbdist/ 25 | .nb-gradle/ -------------------------------------------------------------------------------- /inyeccion-dependencia/src/main/java/basic/ApplicationConfig.java: -------------------------------------------------------------------------------- 1 | package basic; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | 7 | /** 8 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 20/03/17. 9 | */ 10 | @Configuration 11 | @ComponentScan 12 | public class ApplicationConfig { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /spring-kotlin/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | /out/ 4 | gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | nbproject/private/ 22 | build/ 23 | nbbuild/ 24 | dist/ 25 | nbdist/ 26 | .nb-gradle/ 27 | -------------------------------------------------------------------------------- /spring-kotlin/src/main/kotlin/windoctor7/github/io/kotlin/spring/springkotlin/Student.kt: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.kotlin.spring.springkotlin 2 | 3 | import org.springframework.data.mongodb.core.mapping.Document 4 | 5 | /** 6 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 21/10/17. 7 | */ 8 | @Document(collection = "students") 9 | data class Student(val id:String, val name:String) { 10 | } -------------------------------------------------------------------------------- /spring-kafka-producer/src/main/java/windoctor7/github/io/spring/kafka/producer/CreditProduct.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.kafka.producer; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class CreditProduct { 9 | 10 | private final long id; 11 | private final String name; 12 | private final String description; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /spring-kafka-consumer/src/test/java/windoctor7/github/io/spring/kafka/consumer/SpringKafkaConsumerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.kafka.consumer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringKafkaConsumerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-kafka-producer/src/test/java/windoctor7/github/io/spring/kafka/producer/SpringKafkaProducerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.kafka.producer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringKafkaProducerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring5-reactive-kotlin/src/main/kotlin/windoctor7/github/io/spring5/reactive/kotlin/UserResultGh.kt: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.kotlin 2 | 3 | /** 4 | * Created by Ascari Q. Romo Pedraza - molder.itp@gmail.com on 24/10/2017. 5 | */ 6 | data class UserResultGh( //clase envoltorio para github 7 | val total_count:Int, 8 | val incomplete_results:Boolean, 9 | val items:ArrayList) 10 | -------------------------------------------------------------------------------- /spring-webflux-2/src/main/java/windoctor7/github/io/spring5/reactive/springwebflux2/StudentRepository.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.springwebflux2; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | /** 6 | * Created by Ascari Q. Romo Pedraza - molder.itp@gmail.com on 19/10/2017. 7 | */ 8 | public interface StudentRepository extends CrudRepository{ 9 | } 10 | -------------------------------------------------------------------------------- /spring-jdbc/src/main/resources/schema-mysql.sql: -------------------------------------------------------------------------------- 1 | 2 | CREATE TABLE IF NOT EXISTS departamento ( 3 | id MEDIUMINT NOT NULL AUTO_INCREMENT, 4 | nombre VARCHAR(64) NOT NULL, 5 | PRIMARY KEY(id) 6 | ); 7 | 8 | CREATE TABLE IF NOT EXISTS empleado ( 9 | id MEDIUMINT NOT NULL AUTO_INCREMENT, 10 | nombre VARCHAR(64) NOT NULL, 11 | departamento_id MEDIUMINT, 12 | PRIMARY KEY(id), 13 | FOREIGN KEY(departamento_id) REFERENCES departamento(id) 14 | 15 | ); -------------------------------------------------------------------------------- /spring-set-profile/src/test/java/com/example/DemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class DemoApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /docker-springboot-java17/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This 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 | * 6 | * Detailed information about configuring a multi-project build in Gradle can be found 7 | * in the user manual at https://docs.gradle.org/7.5.1/userguide/multi_project_builds.html 8 | */ 9 | 10 | rootProject.name = 'docker-springboot-java17' 11 | include('app') 12 | -------------------------------------------------------------------------------- /spring-pwa/src/main/java/windoctor7/github/io/pwa/demopwa/DemoPwaApplication.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.pwa.demopwa; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class DemoPwaApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(DemoPwaApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-webflux-2/src/main/java/windoctor7/github/io/spring5/reactive/springwebflux2/StudentReactiveRepository.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.springwebflux2; 2 | 3 | import org.springframework.data.repository.reactive.ReactiveCrudRepository; 4 | 5 | /** 6 | * Created by Ascari Q. Romo Pedraza - molder.itp@gmail.com on 19/10/2017. 7 | */ 8 | public interface StudentReactiveRepository extends ReactiveCrudRepository{ 9 | } 10 | -------------------------------------------------------------------------------- /spring-kotlin/src/main/kotlin/windoctor7/github/io/kotlin/spring/springkotlin/StudentRepository.kt: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.kotlin.spring.springkotlin 2 | 3 | import org.springframework.data.repository.CrudRepository 4 | import reactor.core.publisher.Flux 5 | 6 | /** 7 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 22/10/17. 8 | */ 9 | interface StudentRepository : CrudRepository{ 10 | fun findByName(name:String): Flux 11 | } -------------------------------------------------------------------------------- /spring-retry/ws-rest/src/main/java/windoctor7/github/io/spring/retry/SpringRetryApplication.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.retry; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringRetryApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringRetryApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spring-jdbc/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # establecer en false la segunda vez que ejecutes la aplicación. 2 | # Tambien podrías poner sentencias drop en el archivo data.sql para eliminar datos existentes 3 | spring.datasource.initialize=true 4 | 5 | spring.datasource.platform=mysql 6 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 7 | spring.datasource.url=jdbc:mysql://localhost:3306/springbootdb 8 | spring.datasource.username=root 9 | spring.datasource.password=ask123 -------------------------------------------------------------------------------- /spring-kotlin/src/main/kotlin/windoctor7/github/io/kotlin/spring/springkotlin/SpringKotlinApplication.kt: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.kotlin.spring.springkotlin 2 | 3 | import org.springframework.boot.SpringApplication 4 | import org.springframework.boot.autoconfigure.SpringBootApplication 5 | 6 | @SpringBootApplication 7 | class SpringKotlinApplication 8 | 9 | fun main(args: Array) { 10 | SpringApplication.run(SpringKotlinApplication::class.java, *args) 11 | } 12 | -------------------------------------------------------------------------------- /spring-auth-jwt/src/main/java/windoctor7/github/io/spring/auth/jwt/SpringAuthJwtApplication.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.auth.jwt; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringAuthJwtApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringAuthJwtApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spring-web-flux/src/main/java/windoctor7/github/io/spring5/reactive/SpringWebFluxApplication.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringWebFluxApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringWebFluxApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spring-async/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | # El servidor SMTP de gmail. El puerto 465 es el puerto seguro de gmail. 3 | spring.mail.host=smtp.gmail.com 4 | spring.mail.port= 465 5 | 6 | # Indicamos que se habilite el soporte SSL 7 | spring.mail.properties.mail.smtp.ssl.enable = true 8 | 9 | # aqui pon tu direccion de correo electronico de gmail 10 | spring.mail.username= 11 | 12 | # aqui pon tu contraseña de tu cuenta de correo gmail 13 | spring.mail.password= 14 | 15 | -------------------------------------------------------------------------------- /spring-state-machine/src/main/java/windoctor7/github/io/spring/statemachine/Main.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.statemachine; 2 | 3 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; 4 | 5 | /** 6 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 12/04/17. 7 | */ 8 | public class Main { 9 | public static void main(String[] args) { 10 | new AnnotationConfigApplicationContext(CuestionarioEstados.class); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docker-springboot-java17/app/src/main/java/docker/springboot/java17/App.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This Java source file was generated by the Gradle 'init' task. 3 | */ 4 | package docker.springboot.java17; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | 9 | @SpringBootApplication 10 | public class App { 11 | public static void main(String args[]){ 12 | SpringApplication.run(App.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /spring-pwa/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/** 6 | !**/src/test/** 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | 31 | ### VS Code ### 32 | .vscode/ 33 | -------------------------------------------------------------------------------- /Spring4-SSE/src/main/java/windoctor7/github/io/spring4/sse/Spring4SSE/MensajeEvent.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring4.sse.Spring4SSE; 2 | 3 | /** 4 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 13/10/17. 5 | */ 6 | public class MensajeEvent { 7 | 8 | private String beanClass; 9 | 10 | public MensajeEvent(String beanClass) { 11 | this.beanClass = beanClass; 12 | } 13 | 14 | public String getBeanClass() { 15 | return beanClass; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring5-reactive-kotlin/src/main/kotlin/windoctor7/github/io/spring5/reactive/kotlin/Spring5ReactiveKotlinApplication.kt: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.kotlin 2 | 3 | import org.springframework.boot.SpringApplication 4 | import org.springframework.boot.autoconfigure.SpringBootApplication 5 | 6 | @SpringBootApplication 7 | class Spring5ReactiveKotlinApplication 8 | 9 | fun main(args: Array) { 10 | SpringApplication.run(Spring5ReactiveKotlinApplication::class.java, *args) 11 | } 12 | -------------------------------------------------------------------------------- /inyeccion-dependencia/src/main/java/basic/MensajeSms.java: -------------------------------------------------------------------------------- 1 | package basic; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | /** 6 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 20/03/17. 7 | */ 8 | @Component(value = "mensaje") 9 | public class MensajeSms implements IMensaje { 10 | @Override 11 | public void enviar(String destinatario, String mensaje) { 12 | System.out.printf("Enviando mensaje SMS a %s \n Mensaje: %s", destinatario, mensaje); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /spring-async/src/test/java/windoctor7/github/io/spring/async/SpringAsyncApplicationTests.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.async; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringAsyncApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-retry/ws-rest/src/test/java/windoctor7/github/io/spring/retry/SpringRetryApplicationTests.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.retry; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringRetryApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-auth-jwt/src/test/java/windoctor7/github/io/spring/auth/jwt/SpringAuthJwtApplicationTests.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.auth.jwt; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringAuthJwtApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-kotlin/src/test/kotlin/windoctor7/github/io/kotlin/spring/springkotlin/SpringKotlinApplicationTests.kt: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.kotlin.spring.springkotlin 2 | 3 | import org.junit.Test 4 | import org.junit.runner.RunWith 5 | import org.springframework.boot.test.context.SpringBootTest 6 | import org.springframework.test.context.junit4.SpringRunner 7 | 8 | @RunWith(SpringRunner::class) 9 | @SpringBootTest 10 | class SpringKotlinApplicationTests { 11 | 12 | @Test 13 | fun contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Spring4-SSE/src/test/java/windoctor7/github/io/spring4/sse/Spring4SSE/Spring4SseApplicationTests.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring4.sse.Spring4SSE; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class Spring4SseApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-web-flux/src/test/java/windoctor7/github/io/spring5/reactive/SpringWebFluxApplicationTests.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringWebFluxApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-kafka-consumer/src/main/java/windoctor7/github/io/spring/kafka/consumer/SpringKafkaConsumerApplication.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.kafka.consumer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringKafkaConsumerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringKafkaConsumerApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-kafka-producer/src/main/java/windoctor7/github/io/spring/kafka/producer/SpringKafkaProducerApplication.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.kafka.producer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringKafkaProducerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringKafkaProducerApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-scheduler/src/test/java/windoctor7/github/io/spring/scheduled/SpringSchedulerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.scheduled; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringSchedulerApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /inyeccion-dependencia/src/main/java/basic/MensajeTwitter.java: -------------------------------------------------------------------------------- 1 | package basic; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | /** 6 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 20/03/17. 7 | */ 8 | @Component(value = "tweet") 9 | public class MensajeTwitter implements IMensaje { 10 | 11 | @Override 12 | public void enviar(String destinatario, String mensaje) { 13 | System.out.printf("Enviando mensaje via Twitter a %s \n Mensaje: %s", destinatario, mensaje); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-retry/cliente-ws/src/test/java/windoctor7/github/io/spring/retry/test/SpringRetryTestApplicationTests.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.retry.test; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringRetryTestApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-state-machine/src/test/java/windoctor7/github/io/spring/statemachine/SpringStateMachineApplicationTests.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.statemachine; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringStateMachineApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-async/src/main/java/windoctor7/github/io/spring/async/SpringAsyncApplication.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.async; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.scheduling.annotation.EnableAsync; 6 | 7 | @SpringBootApplication 8 | @EnableAsync 9 | public class SpringAsyncApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringAsyncApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /spring-webflux-2/src/test/java/windoctor7/github/io/spring5/reactive/springwebflux2/SpringWebflux2ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.springwebflux2; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringWebflux2ApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring5-reactive-kotlin/src/main/kotlin/windoctor7/github/io/spring5/reactive/kotlin/User.kt: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.kotlin 2 | 3 | import com.fasterxml.jackson.annotation.JsonAlias 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 5 | import com.fasterxml.jackson.annotation.JsonProperty 6 | 7 | /** 8 | * Created by Ascari Q. Romo Pedraza - molder.itp@gmail.com on 24/10/2017. 9 | */ 10 | data class User( 11 | @JsonAlias("uuid","id") val id:String, 12 | @JsonAlias("username","login") val username: String) { 13 | } 14 | -------------------------------------------------------------------------------- /spring5-reactive-kotlin/src/test/kotlin/windoctor7/github/io/spring5/reactive/kotlin/Spring5ReactiveKotlinApplicationTests.kt: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.kotlin.spring5reactivekotlin 2 | 3 | import org.junit.Test 4 | import org.junit.runner.RunWith 5 | import org.springframework.boot.test.context.SpringBootTest 6 | import org.springframework.test.context.junit4.SpringRunner 7 | 8 | @RunWith(SpringRunner::class) 9 | @SpringBootTest 10 | class Spring5ReactiveKotlinApplicationTests { 11 | 12 | @Test 13 | fun contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring5-reactive-kotlin/src/main/kotlin/windoctor7/github/io/spring5/reactive/kotlin/IRepositorySearch.kt: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.kotlin 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty 4 | import reactor.core.publisher.Flux 5 | import reactor.core.publisher.Mono 6 | 7 | /** 8 | * Created by Ascari Q. Romo Pedraza - molder.itp@gmail.com on 23/10/2017. 9 | */ 10 | interface IRepositorySearch { 11 | fun searchUsersGitHub(username:String) : Mono 12 | fun searchUsersBitBucket(username: String) : Flux 13 | } 14 | 15 | -------------------------------------------------------------------------------- /spring-scheduler/src/main/java/windoctor7/github/io/spring/scheduled/SpringSchedulerApplication.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.scheduled; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.scheduling.annotation.EnableScheduling; 6 | 7 | @SpringBootApplication 8 | @EnableScheduling 9 | public class SpringSchedulerApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringSchedulerApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /spring-webflux-2/src/main/java/windoctor7/github/io/spring5/reactive/springwebflux2/Subscriber.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.springwebflux2; 2 | 3 | /** 4 | * Created by Ascari Q. Romo Pedraza - molder.itp@gmail.com on 17/10/2017. 5 | */ 6 | public class Subscriber { 7 | 8 | public static void multiplicar(Integer n) { 9 | try { 10 | Thread.sleep(5000); 11 | } catch (InterruptedException e) { 12 | e.printStackTrace(); 13 | } 14 | System.out.println("Subscriber2: "+n*n); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /calculadora/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | dependencies { 6 | classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1' 7 | } 8 | } 9 | 10 | plugins { 11 | id 'java' 12 | } 13 | 14 | apply plugin: 'com.github.johnrengelman.shadow' 15 | 16 | 17 | 18 | group 'windoctor7.github.io.alexa' 19 | version '1.0-SNAPSHOT' 20 | 21 | sourceCompatibility = 1.8 22 | 23 | repositories { 24 | mavenCentral() 25 | } 26 | 27 | dependencies { 28 | compile group: 'com.amazon.alexa', name: 'ask-sdk', version: '2.30.0' 29 | } 30 | -------------------------------------------------------------------------------- /spring-pwa/src/main/resources/static/sw.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Service Worker javascript has been autogenerated by the progressify-spring : 0.2.0 4 | This file will be regenerated every build. Hence editing this directly is not recommended. 5 | 6 | */ 7 | 8 | importScripts('https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js'); 9 | 10 | //Route added based on annotation found at windoctor7.github.io.pwa.demopwa.LoginController : greeting 11 | workbox.routing.registerRoute( 12 | new RegExp('/login'), 13 | new workbox.strategies.StaleWhileRevalidate({ 14 | }) 15 | ); 16 | 17 | -------------------------------------------------------------------------------- /inyeccion-dependencia/src/main/java/basic/MensajeEmail.java: -------------------------------------------------------------------------------- 1 | package basic; 2 | 3 | import org.springframework.beans.factory.annotation.Qualifier; 4 | import org.springframework.stereotype.Component; 5 | 6 | /** 7 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 20/03/17. 8 | */ 9 | @Component(value = "correo") 10 | public class MensajeEmail implements IMensaje { 11 | @Override 12 | public void enviar(String destinatario, String mensaje) { 13 | System.out.printf("Enviando mensaje por correo electronico a %s \n Mensaje: %s", destinatario, mensaje); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-retry/cliente-ws/src/main/java/windoctor7/github/io/spring/retry/test/SpringRetryTestApplication.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.retry.test; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.retry.annotation.EnableRetry; 6 | 7 | @SpringBootApplication 8 | @EnableRetry 9 | public class SpringRetryTestApplication { 10 | 11 | public static void main(String[] args) throws Exception { 12 | SpringApplication.run(SpringRetryTestApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /spring-webflux-2/src/main/resources/templates/students.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Students 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
IDName
......
23 | 24 | -------------------------------------------------------------------------------- /Spring4-SSE/src/main/java/windoctor7/github/io/spring4/sse/Spring4SSE/WebMvcConfig.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring4.sse.Spring4SSE; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 6 | 7 | @Configuration 8 | public class WebMvcConfig extends WebMvcConfigurerAdapter { 9 | 10 | @Override 11 | public void configureAsyncSupport(AsyncSupportConfigurer configurer) { 12 | configurer.setDefaultTimeout(1000000); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /spring-kafka-consumer/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/**/build/ 6 | !**/src/test/**/build/ 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | bin/ 17 | !**/src/main/**/bin/ 18 | !**/src/test/**/bin/ 19 | 20 | ### IntelliJ IDEA ### 21 | .idea 22 | *.iws 23 | *.iml 24 | *.ipr 25 | out/ 26 | !**/src/main/**/out/ 27 | !**/src/test/**/out/ 28 | 29 | ### NetBeans ### 30 | /nbproject/private/ 31 | /nbbuild/ 32 | /dist/ 33 | /nbdist/ 34 | /.nb-gradle/ 35 | 36 | ### VS Code ### 37 | .vscode/ 38 | -------------------------------------------------------------------------------- /inyeccion-dependencia/src/main/java/basic/Recordatorio.java: -------------------------------------------------------------------------------- 1 | package basic; 2 | 3 | import java.util.Calendar; 4 | 5 | /** 6 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 20/03/17. 7 | */ 8 | public abstract class Recordatorio { 9 | 10 | Recordatorio recordatorio; 11 | 12 | public void nextHandler(Recordatorio recordatorio){ 13 | this.recordatorio = recordatorio; 14 | } 15 | 16 | public int getDay(){ 17 | Calendar calendar = Calendar.getInstance(); 18 | return calendar.get(Calendar.DAY_OF_WEEK); 19 | } 20 | 21 | public abstract void enviar(Cliente cliente); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Spring4-SSE/src/main/java/windoctor7/github/io/spring4/sse/Spring4SSE/Spring4SseApplication.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring4.sse.Spring4SSE; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.scheduling.annotation.EnableAsync; 6 | import org.springframework.scheduling.annotation.EnableScheduling; 7 | 8 | @SpringBootApplication 9 | @EnableScheduling 10 | @EnableAsync 11 | public class Spring4SseApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(Spring4SseApplication.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /spring-jdbc/src/main/java/windoctor7/github/io/spring/jdbc/springjdbc/Departamento.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.jdbc.springjdbc; 2 | 3 | /** 4 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 15/10/17. 5 | */ 6 | public class Departamento { 7 | 8 | private int id; 9 | private String nombre; 10 | 11 | public int getId() { 12 | return id; 13 | } 14 | 15 | public void setId(int id) { 16 | this.id = id; 17 | } 18 | 19 | public String getNombre() { 20 | return nombre; 21 | } 22 | 23 | public void setNombre(String nombre) { 24 | this.nombre = nombre; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /spring-kafka-consumer/src/main/java/windoctor7/github/io/spring/kafka/consumer/CreditProductConsumer.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.kafka.consumer; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.kafka.annotation.KafkaListener; 5 | import org.springframework.stereotype.Component; 6 | import windoctor7.github.io.spring.kafka.producer.CreditProduct; 7 | 8 | @Component 9 | @Slf4j 10 | public class CreditProductConsumer { 11 | 12 | @KafkaListener(topics = "${cloudkarafka.topic}") 13 | public void consumerMessage(CreditProduct product){ 14 | log.info("Nuevo Producto de Credito recibido: {}", product); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /spring-scheduler/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '1.5.2.RELEASE' 4 | } 5 | repositories { 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 10 | } 11 | } 12 | 13 | apply plugin: 'java' 14 | apply plugin: 'idea' 15 | apply plugin: 'org.springframework.boot' 16 | 17 | version = '0.0.1-SNAPSHOT' 18 | sourceCompatibility = 1.8 19 | 20 | repositories { 21 | mavenCentral() 22 | } 23 | 24 | 25 | dependencies { 26 | compile('org.springframework.boot:spring-boot-starter') 27 | testCompile('org.springframework.boot:spring-boot-starter-test') 28 | } 29 | -------------------------------------------------------------------------------- /spring-retry/ws-rest/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '1.5.2.RELEASE' 4 | } 5 | repositories { 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 10 | } 11 | } 12 | 13 | apply plugin: 'java' 14 | apply plugin: 'eclipse' 15 | apply plugin: 'org.springframework.boot' 16 | 17 | version = '0.0.1-SNAPSHOT' 18 | sourceCompatibility = 1.8 19 | 20 | repositories { 21 | mavenCentral() 22 | } 23 | 24 | 25 | dependencies { 26 | compile('org.springframework.boot:spring-boot-starter-web') 27 | testCompile('org.springframework.boot:spring-boot-starter-test') 28 | } 29 | -------------------------------------------------------------------------------- /spring-retry/ws-rest/src/main/java/windoctor7/github/io/spring/retry/Empleado.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.retry; 2 | 3 | /** 4 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 09/04/17. 5 | */ 6 | public class Empleado { 7 | 8 | public int id; 9 | public String nombre; 10 | 11 | public Empleado() { 12 | } 13 | 14 | public Empleado(int id, String nombre) { 15 | this.id = id; 16 | this.nombre = nombre; 17 | } 18 | 19 | @Override 20 | public String toString() { 21 | return "Empleado{" + 22 | "id=" + id + 23 | ", nombre='" + nombre + '\'' + 24 | '}'; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /inyeccion-dependencia/build.gradle: -------------------------------------------------------------------------------- 1 | group 'windoctor7.github.com' 2 | version '1.0-SNAPSHOT' 3 | 4 | apply plugin: 'java' 5 | 6 | sourceCompatibility = 1.8 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | compile group: 'org.springframework', name: 'spring-context', version: '4.1.9.RELEASE' 14 | testCompile group: 'cglib', name: 'cglib-nodep', version: '3.2.5' 15 | testCompile group: 'org.spockframework', name: 'spock-core', version: '1.0-groovy-2.4' 16 | testCompile group: 'org.springframework', name: 'spring-test', version: '4.1.9.RELEASE' 17 | testCompile group: 'org.spockframework', name: 'spock-spring', version: '1.0-groovy-2.4' 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /spring-kafka-producer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.kafka.bootstrap-servers=${CLOUDKARAFKA_BROKERS} 2 | spring.kafka.properties.security.protocol=SASL_SSL 3 | spring.kafka.properties.sasl.mechanism=SCRAM-SHA-256 4 | spring.kafka.properties.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="${CLOUDKARAFKA_USERNAME}" password="${CLOUDKARAFKA_PASSWORD}"; 5 | spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer 6 | spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer 7 | cloudkarafka.topic=${CLOUDKARAFKA_USERNAME}-default 8 | spring.kafka.producer.properties.enable.idempotence=false -------------------------------------------------------------------------------- /spring-webflux-2/src/main/java/windoctor7/github/io/spring5/reactive/springwebflux2/Score.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.springwebflux2; 2 | 3 | /** 4 | * Created by Ascari Q. Romo Pedraza - molder.itp@gmail.com on 19/10/2017. 5 | */ 6 | public class Score { 7 | 8 | private double score; 9 | private String type; 10 | 11 | public double getScore() { 12 | return score; 13 | } 14 | 15 | public void setScore(double score) { 16 | this.score = score; 17 | } 18 | 19 | public String getType() { 20 | return type; 21 | } 22 | 23 | public void setType(String type) { 24 | this.type = type; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /spring-retry/cliente-ws/src/main/java/windoctor7/github/io/spring/retry/test/Empleado.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.retry.test; 2 | 3 | /** 4 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 09/04/17. 5 | */ 6 | public class Empleado { 7 | 8 | public int id; 9 | public String nombre; 10 | 11 | public Empleado() { 12 | } 13 | 14 | public Empleado(int id, String nombre) { 15 | this.id = id; 16 | this.nombre = nombre; 17 | } 18 | 19 | @Override 20 | public String toString() { 21 | return "Empleado{" + 22 | "id=" + id + 23 | ", nombre='" + nombre + '\'' + 24 | '}'; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /spring-set-profile/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '1.5.2.RELEASE' 4 | } 5 | repositories { 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 10 | } 11 | } 12 | 13 | apply plugin: 'java' 14 | apply plugin: 'eclipse' 15 | apply plugin: 'org.springframework.boot' 16 | 17 | version = '0.0.1-SNAPSHOT' 18 | sourceCompatibility = 1.8 19 | 20 | repositories { 21 | mavenCentral() 22 | } 23 | 24 | 25 | dependencies { 26 | compile('org.springframework.boot:spring-boot-starter') 27 | testCompile('org.springframework.boot:spring-boot-starter-test') 28 | } 29 | 30 | bootRun { 31 | args = ["--spring.profiles.active=dev"] 32 | } -------------------------------------------------------------------------------- /spring-auth-jwt/src/main/java/windoctor7/github/io/spring/auth/jwt/Usuario.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.auth.jwt; 2 | 3 | /** 4 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 28/04/17. 5 | */ 6 | public class Usuario { 7 | private int id; 8 | private String name; 9 | 10 | public Usuario(int id, String name) { 11 | this.id = id; 12 | this.name = name; 13 | } 14 | 15 | public int getId() { 16 | return id; 17 | } 18 | 19 | public void setId(int id) { 20 | this.id = id; 21 | } 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-web-flux/src/main/java/windoctor7/github/io/spring5/reactive/NumerosController.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | import reactor.core.publisher.Flux; 6 | 7 | import java.time.Duration; 8 | 9 | /** 10 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 20/04/17. 11 | */ 12 | @RestController 13 | public class NumerosController { 14 | 15 | @GetMapping(path = "numeros", produces = "text/event-stream") 16 | public Flux all () { 17 | return Flux.range(1, 30) 18 | .delayElements(Duration.ofSeconds(1)).repeat().map(n->n); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /spring-pwa/src/main/java/windoctor7/github/io/pwa/demopwa/LoginController.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.pwa.demopwa; 2 | 3 | import org.progressify.spring.annotations.StaleWhileRevalidate; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestParam; 8 | 9 | @Controller 10 | public class LoginController { 11 | 12 | @StaleWhileRevalidate 13 | @GetMapping("/login") 14 | public String greeting(@RequestParam(name="name", required=false, defaultValue="Ascari") String name, Model model) { 15 | model.addAttribute("name", name); 16 | return "login"; 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /spring-jdbc/src/main/java/windoctor7/github/io/spring/jdbc/springjdbc/JdbcController.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.jdbc.springjdbc; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 15/10/17. 11 | */ 12 | @RestController 13 | public class JdbcController { 14 | 15 | @Autowired 16 | private DepartamentoRepository repository; 17 | 18 | @GetMapping("/departamentos") 19 | public List getUsers(){ 20 | return repository.findAll(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /spring-set-profile/src/main/java/com/example/PrimerEjemplo.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.core.env.Environment; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 08/04/17. 9 | */ 10 | @Component 11 | public class PrimerEjemplo { 12 | 13 | private Environment env; 14 | 15 | @Autowired 16 | public PrimerEjemplo(Environment env) { 17 | this.env = env; 18 | } 19 | 20 | public void imprimir(){ 21 | System.out.printf("Enviando un correo electronico usando el servidor SMTP %s", 22 | env.getProperty("url.smtp")); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /spring-kafka-consumer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8081 2 | spring.kafka.bootstrap-servers=${CLOUDKARAFKA_BROKERS} 3 | spring.kafka.properties.security.protocol=SASL_SSL 4 | spring.kafka.properties.sasl.mechanism=SCRAM-SHA-256 5 | spring.kafka.properties.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="${CLOUDKARAFKA_USERNAME}" password="${CLOUDKARAFKA_PASSWORD}"; 6 | spring.kafka.consumer.group-id=${CLOUDKARAFKA_USERNAME}-consumers 7 | spring.kafka.consumer.auto-offset-reset=latest 8 | spring.kafka.consumer.value-deserializer=org.springframework.kafka.support.serializer.JsonDeserializer 9 | spring.kafka.consumer.properties.spring.json.trusted.packages=* 10 | cloudkarafka.topic=${CLOUDKARAFKA_USERNAME}-default 11 | -------------------------------------------------------------------------------- /spring-auth-jwt/src/main/java/windoctor7/github/io/spring/auth/jwt/controllers/UsuariosController.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.auth.jwt.controllers; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | import windoctor7.github.io.spring.auth.jwt.Usuario; 6 | 7 | import java.util.Arrays; 8 | import java.util.List; 9 | 10 | /** 11 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 28/04/17. 12 | */ 13 | @RestController 14 | public class UsuariosController { 15 | 16 | @GetMapping(path = "/users") 17 | public List getUsers(){ 18 | return Arrays.asList(new Usuario(1,"Paco"), new Usuario(2,"Pedro"), new Usuario(3, "Juan")); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /spring-jdbc/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | insert into departamento(id, nombre) values(1, 'Sistemas'); 2 | insert into departamento(id, nombre) values(2, 'Contabilidad'); 3 | insert into departamento(id, nombre) values(3, 'Auditoria'); 4 | insert into departamento(id, nombre) values(4, 'Recursos Humanos'); 5 | insert into departamento(id, nombre) values(5, 'Mantenimiento'); 6 | 7 | insert into empleado(id, nombre, departamento_id) values(1, 'Ascari Romo', 1); 8 | insert into empleado(id, nombre, departamento_id) values(2, 'Juan Zavala', 2); 9 | insert into empleado(id, nombre, departamento_id) values(3, 'Antonio Pérez', 3); 10 | insert into empleado(id, nombre, departamento_id) values(4, 'Marco Ávila', 3); 11 | insert into empleado(id, nombre, departamento_id) values(5, 'Pedro Martínez', 1); -------------------------------------------------------------------------------- /Spring4-SSE/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '1.5.7.RELEASE' 4 | } 5 | repositories { 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 10 | } 11 | } 12 | 13 | apply plugin: 'java' 14 | apply plugin: 'eclipse' 15 | apply plugin: 'org.springframework.boot' 16 | 17 | group = 'windoctor7.github.io.spring4.sse' 18 | version = '0.0.1-SNAPSHOT' 19 | sourceCompatibility = 1.8 20 | 21 | repositories { 22 | mavenCentral() 23 | } 24 | 25 | 26 | dependencies { 27 | compile('org.springframework.boot:spring-boot-starter-web') 28 | compile group: 'commons-io', name: 'commons-io', version: '2.5' 29 | testCompile('org.springframework.boot:spring-boot-starter-test') 30 | } 31 | -------------------------------------------------------------------------------- /inyeccion-dependencia/src/main/java/basic/RecordatorioTwitter.java: -------------------------------------------------------------------------------- 1 | package basic; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.beans.factory.annotation.Qualifier; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 20/03/17. 9 | */ 10 | @Component 11 | public class RecordatorioTwitter extends Recordatorio { 12 | 13 | @Autowired 14 | @Qualifier("tweet") 15 | IMensaje tweet; 16 | 17 | @Override 18 | public void enviar(Cliente cliente) { 19 | int dias = cliente.getDiaPago() - getDay(); 20 | if(dias>=3 && dias<= 7) 21 | tweet.enviar(cliente.getTwitter(), "Mensaje enviado por Twitter"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /spring-web-flux/src/main/resources/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Numeros 6 | 7 | 8 |
9 | 25 | 26 | -------------------------------------------------------------------------------- /spring-async/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '1.5.2.RELEASE' 4 | } 5 | repositories { 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 10 | } 11 | } 12 | 13 | apply plugin: 'java' 14 | apply plugin: 'eclipse' 15 | apply plugin: 'org.springframework.boot' 16 | 17 | version = '0.0.1-SNAPSHOT' 18 | sourceCompatibility = 1.8 19 | 20 | repositories { 21 | mavenCentral() 22 | } 23 | 24 | 25 | dependencies { 26 | compile('org.springframework.boot:spring-boot-starter') 27 | compile('org.springframework.boot:spring-boot-starter-mail') 28 | compile('org.springframework.boot:spring-boot-starter-web') 29 | testCompile('org.springframework.boot:spring-boot-starter-test') 30 | } 31 | -------------------------------------------------------------------------------- /calculadora/src/main/java/windoctor7/github/io/alexa/skills/calculadora/Intents.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.alexa.skills.calculadora; 2 | 3 | public final class Intents { 4 | 5 | private Intents() { 6 | } 7 | 8 | /* Nuestro Intent creado */ 9 | public static final String SUMA_INTENT = "SumaIntent"; 10 | 11 | 12 | /* Intents provided by Amazon */ 13 | public static final String AMAZON_HELP = "AMAZON.HelpIntent"; 14 | public static final String AMAZON_STOP = "AMAZON.StopIntent"; 15 | public static final String AMAZON_CANCEL = "AMAZON.CancelIntent"; 16 | public static final String AMAZON_REPEAT = "AMAZON.RepeatIntent"; 17 | public static final String AMAZON_YES = "AMAZON.YesIntent"; 18 | public static final String AMAZON_NO = "AMAZON.NoIntent"; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /spring-auth-jwt/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '1.5.3.RELEASE' 4 | } 5 | repositories { 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 10 | } 11 | } 12 | 13 | apply plugin: 'java' 14 | apply plugin: 'eclipse' 15 | apply plugin: 'org.springframework.boot' 16 | 17 | version = '0.0.1-SNAPSHOT' 18 | sourceCompatibility = 1.8 19 | 20 | repositories { 21 | mavenCentral() 22 | } 23 | 24 | 25 | dependencies { 26 | compile('org.springframework.boot:spring-boot-starter-security') 27 | compile('org.springframework.boot:spring-boot-starter-web') 28 | compile group: 'io.jsonwebtoken', name: 'jjwt', version: '0.7.0' 29 | testCompile('org.springframework.boot:spring-boot-starter-test') 30 | } 31 | -------------------------------------------------------------------------------- /inyeccion-dependencia/src/main/java/basic/RecordatorioSms.java: -------------------------------------------------------------------------------- 1 | package basic; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.beans.factory.annotation.Qualifier; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 20/03/17. 9 | */ 10 | @Component 11 | public class RecordatorioSms extends Recordatorio { 12 | 13 | @Autowired 14 | @Qualifier("mensaje") 15 | IMensaje sms; 16 | 17 | @Override 18 | public void enviar(Cliente cliente) { 19 | int dias = cliente.getDiaPago() - getDay(); 20 | if(dias == 0) 21 | sms.enviar(cliente.getCelular(), "Mensaje enviado por SMS"); 22 | else 23 | recordatorio.enviar(cliente); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /spring-kotlin/src/main/kotlin/windoctor7/github/io/kotlin/spring/springkotlin/StudentController.kt: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.kotlin.spring.springkotlin 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 | import java.util.concurrent.atomic.AtomicInteger 7 | 8 | /** 9 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 21/10/17. 10 | */ 11 | @RestController 12 | class StudentController(val repository: StudentRepository) { 13 | 14 | @GetMapping("/dummy-student") 15 | fun students(@RequestParam name:String) = Student("1", name) 16 | 17 | @GetMapping("/students") 18 | fun studentByName(@RequestParam name:String) = repository.findByName(name) 19 | 20 | } -------------------------------------------------------------------------------- /spring-jdbc/src/main/java/windoctor7/github/io/spring/jdbc/springjdbc/User.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.jdbc.springjdbc; 2 | 3 | /** 4 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 15/10/17. 5 | */ 6 | public class User { 7 | 8 | private int id; 9 | private String name; 10 | private String email; 11 | 12 | public int getId() { 13 | return id; 14 | } 15 | 16 | public void setId(int id) { 17 | this.id = id; 18 | } 19 | 20 | public String getName() { 21 | return name; 22 | } 23 | 24 | public void setName(String name) { 25 | this.name = name; 26 | } 27 | 28 | public String getEmail() { 29 | return email; 30 | } 31 | 32 | public void setEmail(String email) { 33 | this.email = email; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Spring4-SSE/src/main/java/windoctor7/github/io/spring4/sse/Spring4SSE/Mensaje.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring4.sse.Spring4SSE; 2 | 3 | import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; 4 | 5 | /** 6 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 13/10/17. 7 | */ 8 | public class Mensaje { 9 | 10 | private int cve; 11 | private String msg; 12 | 13 | public Mensaje(int cve, String msg) { 14 | this.cve = cve; 15 | this.msg = msg; 16 | } 17 | 18 | public int getCve() { 19 | return cve; 20 | } 21 | 22 | public void setCve(int cve) { 23 | this.cve = cve; 24 | } 25 | 26 | public String getMsg() { 27 | return msg; 28 | } 29 | 30 | public void setMsg(String msg) { 31 | this.msg = msg; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /spring-jdbc/src/main/java/windoctor7/github/io/spring/jdbc/springjdbc/DepartamentoRepository.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.jdbc.springjdbc; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.jdbc.core.BeanPropertyRowMapper; 5 | import org.springframework.jdbc.core.JdbcTemplate; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 15/10/17. 12 | */ 13 | @Repository 14 | public class DepartamentoRepository { 15 | 16 | @Autowired 17 | private JdbcTemplate jdbcTemplate; 18 | 19 | public List findAll(){ 20 | return jdbcTemplate.query("select * from departamento", 21 | new BeanPropertyRowMapper<>(Departamento.class)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /inyeccion-dependencia/src/main/java/basic/RecordatorioEmail.java: -------------------------------------------------------------------------------- 1 | package basic; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.beans.factory.annotation.Qualifier; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 20/03/17. 9 | */ 10 | @Component 11 | public class RecordatorioEmail extends Recordatorio{ 12 | 13 | @Autowired 14 | @Qualifier("correo") 15 | IMensaje email; 16 | 17 | @Override 18 | public void enviar(Cliente cliente) { 19 | int dias = cliente.getDiaPago() - getDay(); 20 | 21 | if( dias >= 1 && dias <= 2 ) 22 | email.enviar(cliente.getEmail(), "Mensaje por correo electronico"); 23 | else 24 | recordatorio.enviar(cliente); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /spring-jdbc/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '1.5.7.RELEASE' 4 | } 5 | repositories { 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 10 | } 11 | } 12 | 13 | apply plugin: 'java' 14 | apply plugin: 'eclipse' 15 | apply plugin: 'org.springframework.boot' 16 | 17 | group = 'windoctor7.github.io.spring.jdbc' 18 | version = '0.0.1-SNAPSHOT' 19 | sourceCompatibility = 1.8 20 | 21 | repositories { 22 | mavenCentral() 23 | } 24 | 25 | 26 | dependencies { 27 | compile('org.springframework.boot:spring-boot-starter-jdbc') 28 | compile('org.springframework.boot:spring-boot-starter-web') 29 | compile('com.h2database:h2') 30 | compile('mysql:mysql-connector-java') 31 | 32 | testCompile('org.springframework.boot:spring-boot-starter-test') 33 | } 34 | -------------------------------------------------------------------------------- /spring-retry/cliente-ws/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '1.5.2.RELEASE' 4 | } 5 | repositories { 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 10 | } 11 | } 12 | 13 | apply plugin: 'java' 14 | apply plugin: 'idea' 15 | apply plugin: 'org.springframework.boot' 16 | 17 | version = '0.0.1-SNAPSHOT' 18 | sourceCompatibility = 1.8 19 | 20 | repositories { 21 | mavenCentral() 22 | } 23 | 24 | 25 | dependencies { 26 | compile('org.springframework.boot:spring-boot-starter-web') 27 | compile group: 'org.springframework.retry', name: 'spring-retry', version: '1.2.0.RELEASE' 28 | compile group: 'org.springframework.boot', name: 'spring-boot-starter-aop', version: '1.5.2.RELEASE' 29 | 30 | testCompile('org.springframework.boot:spring-boot-starter-test') 31 | } 32 | -------------------------------------------------------------------------------- /inyeccion-dependencia/src/main/java/basic/Main.java: -------------------------------------------------------------------------------- 1 | package basic; 2 | 3 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; 4 | 5 | /** 6 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 20/03/17. 7 | */ 8 | public class Main { 9 | 10 | public static void main(String[] args) { 11 | 12 | AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); 13 | ctx.register(ApplicationConfig.class); 14 | ctx.refresh(); 15 | 16 | Cliente cliente = (Cliente) ctx.getBean("cliente"); 17 | 18 | cliente.setAbono(280); 19 | cliente.setDiaPago(1); //1 Domingo, 2 Lunes, 3 Martes, etc. 20 | cliente.setEmail("molder.itp@gmail.com"); 21 | cliente.setTwitter("@windoctor"); 22 | cliente.setCelular("0123456789"); 23 | 24 | cliente.enviarRecordatorio(); 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /docker-springboot-java17/Dockerfile: -------------------------------------------------------------------------------- 1 | #Ascari Q. Romo - 9 Octubre 2022 2 | 3 | FROM amazoncorretto:17.0.4-alpine as packager 4 | 5 | # Primero creamos con jlink una JRE ligera con los módulos indispensables 6 | RUN $JAVA_HOME/bin/jlink \ 7 | --module-path $JAVA_HOME/jmods \ 8 | --verbose \ 9 | --add-modules java.base,java.desktop,java.instrument,java.management.rmi,java.naming,java.prefs,java.scripting,java.security.jgss,java.sql,jdk.httpserver,jdk.jfr,jdk.unsupported \ 10 | --compress 2 \ 11 | --no-header-files \ 12 | --output /opt/jre-17-minimal 13 | 14 | # Utilizamos una distro de linux ligera y agregamos nuestro microservicio 15 | FROM alpine:latest 16 | COPY --from=packager /opt/jre-17-minimal /opt/jre-17-minimal 17 | COPY app/build/libs/app-0.1.0.jar /opt/ 18 | 19 | ENV JAVA_HOME=/opt/jre-17-minimal 20 | ENV PATH="$PATH:$JAVA_HOME/bin" 21 | EXPOSE 8080 22 | CMD java -jar /opt/app-0.1.0.jar 23 | -------------------------------------------------------------------------------- /spring-set-profile/src/main/java/com/example/DemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.boot.CommandLineRunner; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | 9 | @SpringBootApplication 10 | public class DemoApplication { 11 | 12 | @Autowired 13 | PrimerEjemplo ejemplo; 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(DemoApplication.class, args); 17 | } 18 | 19 | @Bean 20 | public CommandLineRunner commandLineRunner(){ 21 | return new CommandLineRunner() { 22 | @Override 23 | public void run(String... args) throws Exception { 24 | ejemplo.imprimir(); 25 | } 26 | }; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /spring-kafka-consumer/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.6.7' 3 | id 'io.spring.dependency-management' version '1.0.11.RELEASE' 4 | id 'java' 5 | } 6 | 7 | group = 'spring-kafka-consumer' 8 | version = '0.0.1-SNAPSHOT' 9 | sourceCompatibility = '11' 10 | 11 | configurations { 12 | compileOnly { 13 | extendsFrom annotationProcessor 14 | } 15 | } 16 | 17 | repositories { 18 | mavenCentral() 19 | } 20 | 21 | dependencies { 22 | implementation 'org.springframework.boot:spring-boot-starter-web' 23 | implementation 'org.springframework.kafka:spring-kafka' 24 | compileOnly 'org.projectlombok:lombok' 25 | annotationProcessor 'org.projectlombok:lombok' 26 | testImplementation 'org.springframework.boot:spring-boot-starter-test' 27 | testImplementation 'org.springframework.kafka:spring-kafka-test' 28 | } 29 | 30 | tasks.named('test') { 31 | useJUnitPlatform() 32 | } 33 | -------------------------------------------------------------------------------- /spring-kafka-producer/src/main/java/windoctor7/github/io/spring/kafka/producer/CreditProductService.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.kafka.producer; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | 7 | @Slf4j 8 | @Service 9 | public class CreditProductService { 10 | 11 | private final CreditProductProducer producer; 12 | 13 | @Autowired 14 | public CreditProductService(CreditProductProducer producer) { 15 | this.producer = producer; 16 | } 17 | 18 | public String newProduct(CreditProduct product){ 19 | //aqui logica para guardar en BD 20 | log.debug("Producto guardado en BD!"); 21 | 22 | //aqui notificamos al bus que el nuevo producto ha sido creado 23 | producer.sendMessage(product); 24 | 25 | return "Producto creado exitosamente!"; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /spring-web-flux/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '2.0.0.BUILD-SNAPSHOT' 4 | } 5 | repositories { 6 | mavenCentral() 7 | maven { url "https://repo.spring.io/snapshot" } 8 | maven { url "https://repo.spring.io/milestone" } 9 | } 10 | dependencies { 11 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 12 | } 13 | } 14 | 15 | apply plugin: 'java' 16 | apply plugin: 'eclipse' 17 | apply plugin: 'org.springframework.boot' 18 | apply plugin: 'io.spring.dependency-management' 19 | 20 | version = '0.0.1-SNAPSHOT' 21 | sourceCompatibility = 1.8 22 | 23 | repositories { 24 | mavenCentral() 25 | maven { url "https://repo.spring.io/snapshot" } 26 | maven { url "https://repo.spring.io/milestone" } 27 | } 28 | 29 | 30 | dependencies { 31 | compile('org.springframework.boot:spring-boot-starter-webflux') 32 | testCompile('org.springframework.boot:spring-boot-starter-test') 33 | } 34 | -------------------------------------------------------------------------------- /spring-jdbc/src/main/java/windoctor7/github/io/spring/jdbc/springjdbc/Empleado.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.jdbc.springjdbc; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 15/10/17. 7 | */ 8 | public class Empleado { 9 | 10 | private int id; 11 | private String nombre; 12 | 13 | private Departamento departamento; 14 | 15 | public int getId() { 16 | return id; 17 | } 18 | 19 | public void setId(int id) { 20 | this.id = id; 21 | } 22 | 23 | public String getNombre() { 24 | return nombre; 25 | } 26 | 27 | public void setNombre(String nombre) { 28 | this.nombre = nombre; 29 | } 30 | 31 | public Departamento getDepartamento() { 32 | return departamento; 33 | } 34 | 35 | public void setDepartamento(Departamento departamento) { 36 | this.departamento = departamento; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /spring-kafka-producer/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.6.7' 3 | id 'io.spring.dependency-management' version '1.0.11.RELEASE' 4 | id 'java' 5 | } 6 | 7 | group = 'windoctor7.github.io.spring.kafka' 8 | version = '0.0.1-SNAPSHOT' 9 | sourceCompatibility = '11' 10 | 11 | configurations { 12 | compileOnly { 13 | extendsFrom annotationProcessor 14 | } 15 | } 16 | 17 | repositories { 18 | mavenCentral() 19 | } 20 | 21 | dependencies { 22 | implementation 'org.springframework.boot:spring-boot-starter-web' 23 | implementation 'org.springframework.kafka:spring-kafka' 24 | compileOnly 'org.projectlombok:lombok' 25 | annotationProcessor 'org.projectlombok:lombok' 26 | testImplementation 'org.springframework.boot:spring-boot-starter-test' 27 | testImplementation 'org.springframework.kafka:spring-kafka-test' 28 | } 29 | 30 | tasks.named('test') { 31 | useJUnitPlatform() 32 | } 33 | -------------------------------------------------------------------------------- /spring-webflux-2/src/main/java/windoctor7/github/io/spring5/reactive/springwebflux2/SpringWebflux2Application.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.springwebflux2; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.web.reactive.function.server.RouterFunction; 8 | import org.springframework.web.reactive.function.server.ServerResponse; 9 | 10 | import static org.springframework.web.reactive.function.server.RequestPredicates.GET; 11 | import static org.springframework.web.reactive.function.server.RouterFunctions.route; 12 | 13 | @SpringBootApplication 14 | public class SpringWebflux2Application { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(SpringWebflux2Application.class, args); 18 | } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /spring-jdbc/src/main/java/windoctor7/github/io/spring/jdbc/springjdbc/SpringJdbcApplication.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.jdbc.springjdbc; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Profile; 7 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; 8 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType; 9 | 10 | import javax.sql.DataSource; 11 | 12 | @SpringBootApplication 13 | public class SpringJdbcApplication { 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(SpringJdbcApplication.class, args); 17 | } 18 | 19 | @Bean 20 | @Profile("test") 21 | public DataSource testDataSource() { 22 | 23 | return new EmbeddedDatabaseBuilder() 24 | .setType(EmbeddedDatabaseType.H2) 25 | .build(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /spring-kafka-producer/src/main/java/windoctor7/github/io/spring/kafka/producer/CreditProductController.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.kafka.producer; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | @Slf4j 11 | @RestController 12 | @RequestMapping("/credit/products") 13 | public class CreditProductController { 14 | 15 | private final CreditProductService service; 16 | 17 | @Autowired 18 | public CreditProductController(CreditProductService service) { 19 | this.service = service; 20 | } 21 | 22 | @PostMapping 23 | public String createNewProduct(@RequestBody CreditProduct product){ 24 | return service.newProduct(product); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /spring-kafka-producer/.gitignore: -------------------------------------------------------------------------------- 1 | <<<<<<< HEAD 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | ======= 6 | HELP.md 7 | .gradle 8 | build/ 9 | !gradle/wrapper/gradle-wrapper.jar 10 | !**/src/main/**/build/ 11 | !**/src/test/**/build/ 12 | >>>>>>> 2d54103 (consumidor kafka) 13 | 14 | ### STS ### 15 | .apt_generated 16 | .classpath 17 | .factorypath 18 | .project 19 | .settings 20 | .springBeans 21 | <<<<<<< HEAD 22 | ======= 23 | .sts4-cache 24 | bin/ 25 | !**/src/main/**/bin/ 26 | !**/src/test/**/bin/ 27 | >>>>>>> 2d54103 (consumidor kafka) 28 | 29 | ### IntelliJ IDEA ### 30 | .idea 31 | *.iws 32 | *.iml 33 | *.ipr 34 | <<<<<<< HEAD 35 | 36 | ### NetBeans ### 37 | nbproject/private/ 38 | build/ 39 | nbbuild/ 40 | dist/ 41 | nbdist/ 42 | .nb-gradle/ 43 | ======= 44 | out/ 45 | !**/src/main/**/out/ 46 | !**/src/test/**/out/ 47 | 48 | ### NetBeans ### 49 | /nbproject/private/ 50 | /nbbuild/ 51 | /dist/ 52 | /nbdist/ 53 | /.nb-gradle/ 54 | 55 | ### VS Code ### 56 | .vscode/ 57 | >>>>>>> 2d54103 (consumidor kafka) 58 | -------------------------------------------------------------------------------- /spring-pwa/src/main/resources/static/assets/css/signin.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | height: 100%; 4 | } 5 | 6 | body { 7 | display: -ms-flexbox; 8 | display: flex; 9 | -ms-flex-align: center; 10 | align-items: center; 11 | padding-top: 40px; 12 | padding-bottom: 40px; 13 | background-color: #f5f5f5; 14 | } 15 | 16 | .form-signin { 17 | width: 100%; 18 | max-width: 330px; 19 | padding: 15px; 20 | margin: auto; 21 | } 22 | .form-signin .checkbox { 23 | font-weight: 400; 24 | } 25 | .form-signin .form-control { 26 | position: relative; 27 | box-sizing: border-box; 28 | height: auto; 29 | padding: 10px; 30 | font-size: 16px; 31 | } 32 | .form-signin .form-control:focus { 33 | z-index: 2; 34 | } 35 | .form-signin input[type="email"] { 36 | margin-bottom: -1px; 37 | border-bottom-right-radius: 0; 38 | border-bottom-left-radius: 0; 39 | } 40 | .form-signin input[type="password"] { 41 | margin-bottom: 10px; 42 | border-top-left-radius: 0; 43 | border-top-right-radius: 0; 44 | } 45 | -------------------------------------------------------------------------------- /spring-webflux-2/src/main/java/windoctor7/github/io/spring5/reactive/springwebflux2/Student.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.springwebflux2; 2 | 3 | import org.springframework.data.mongodb.core.mapping.Document; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by Ascari Q. Romo Pedraza - molder.itp@gmail.com on 19/10/2017. 9 | */ 10 | @Document(collection = "students") 11 | public class Student { 12 | 13 | private String id; 14 | private String name; 15 | private List scores; 16 | 17 | public String getId() { 18 | return id; 19 | } 20 | 21 | public void setId(String id) { 22 | this.id = id; 23 | } 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | public void setName(String name) { 30 | this.name = name; 31 | } 32 | 33 | public List getScores() { 34 | return scores; 35 | } 36 | 37 | public void setScores(List scores) { 38 | this.scores = scores; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /spring-retry/ws-rest/src/main/java/windoctor7/github/io/spring/retry/ConsultaController.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.retry; 2 | 3 | import org.springframework.http.MediaType; 4 | import org.springframework.web.bind.annotation.PathVariable; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RequestMethod; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | /** 10 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 09/04/17. 11 | */ 12 | @RestController 13 | @RequestMapping("/empleados") 14 | public class ConsultaController { 15 | 16 | @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE, value = "/{id}") 17 | public Empleado buscarPorId(@PathVariable int id){ 18 | if(id == 1) 19 | return new Empleado(id,"David Perez"); 20 | else if(id == 2) 21 | return new Empleado(id, "Juan Rodriguez"); 22 | else 23 | return new Empleado(-1, "Empleado no existente"); 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /java-streams/src/main/java/windoctor7/github/io/streams/Main.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.streams; 2 | 3 | import java.util.*; 4 | import java.util.stream.Collectors; 5 | import java.util.stream.Stream; 6 | 7 | /** 8 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 17/04/17. 9 | * Este es solo el codigo base usado en el workshop "Conociendo al API Stream de Java 8" 10 | * que puedes encontrar en mi blog 11 | * https://windoctor7.github.io/API-Stream-Java8.html 12 | * 13 | * Ahi se encuentran toda una serie de ejercicios y explicaciones. 14 | * Este codigo es solo la base, no contiene los ejercicios descritos en el blog. 15 | */ 16 | public class Main { 17 | 18 | public List sorted(){ 19 | List products = Util.getProducts(); 20 | Stream streams = products.stream() 21 | .map(Product::getName) 22 | ; 23 | 24 | return streams.collect(Collectors.toList()); 25 | } 26 | 27 | public static void main(String[] args) { 28 | Main main = new Main(); 29 | main.sorted().forEach(System.out::println); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /spring-async/src/main/java/windoctor7/github/io/spring/async/RegistroController.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.async; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RequestMethod; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 09/04/17. 10 | */ 11 | @RestController 12 | @RequestMapping("/registro") 13 | public class RegistroController { 14 | 15 | @Autowired 16 | RegistroAsync registroAsync; 17 | 18 | @RequestMapping(method = RequestMethod.GET, value = "/usuario") 19 | public String registrar(){ 20 | 21 | Usuario usuario = new Usuario("ascari", ""); //Pon la cuenta de correo a donde quieres enviar el correo 22 | Usuario registro = registroAsync.registrar(usuario); 23 | System.out.println("ahora enviamos el correo"); 24 | registroAsync.enviarCorreo(registro); 25 | return "registro exitoso, su usuario es: "+registro.getUser(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /calculadora/src/main/java/windoctor7/github/io/alexa/skills/calculadora/lambdas/SessionEndedRequestHandler.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.alexa.skills.calculadora.lambdas; 2 | 3 | import com.amazon.ask.dispatcher.request.handler.HandlerInput; 4 | import com.amazon.ask.dispatcher.request.handler.RequestHandler; 5 | import com.amazon.ask.model.Response; 6 | import com.amazon.ask.model.SessionEndedRequest; 7 | 8 | import java.util.Optional; 9 | 10 | import static com.amazon.ask.request.Predicates.requestType; 11 | 12 | /** 13 | * Used to handle logic for when a session ends, i.e., when 14 | * the user has finished a conversation with Alexa thus ending 15 | * this skill's session. 16 | * */ 17 | public class SessionEndedRequestHandler implements RequestHandler { 18 | @Override 19 | public boolean canHandle(HandlerInput handlerInput) { 20 | return handlerInput.matches(requestType(SessionEndedRequest.class)); 21 | } 22 | 23 | @Override 24 | public Optional handle(HandlerInput handlerInput) { 25 | //Any cleanup logic goes here 26 | return handlerInput.getResponseBuilder().build(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /spring-jdbc/src/test/java/windoctor7/github/io/spring/jdbc/springjdbc/SpringJdbcApplicationTests.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.jdbc.springjdbc; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | import org.springframework.test.context.ActiveProfiles; 8 | import org.springframework.test.context.junit4.SpringRunner; 9 | 10 | import java.util.List; 11 | 12 | import static org.junit.Assert.assertEquals; 13 | import static org.junit.Assert.assertNotNull; 14 | 15 | @RunWith(SpringRunner.class) 16 | @SpringBootTest() 17 | @ActiveProfiles("test") //establecemos a "test" el profile para iniciar esta prueba. 18 | public class SpringJdbcApplicationTests { 19 | 20 | @Autowired 21 | DepartamentoRepository repository; 22 | 23 | @Test 24 | public void contarDepartamentos() { 25 | List departamentos = repository.findAll(); 26 | assertNotNull(departamentos); // validamos que la lista no sea null 27 | assertEquals(5, departamentos.size()); // validamos que existan 5 departamentos 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /calculadora/src/main/java/windoctor7/github/io/alexa/skills/calculadora/MainStreamHandler.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.alexa.skills.calculadora; 2 | 3 | import com.amazon.ask.Skill; 4 | import com.amazon.ask.SkillStreamHandler; 5 | import com.amazon.ask.Skills; 6 | import windoctor7.github.io.alexa.skills.calculadora.lambdas.*; 7 | 8 | /** 9 | * Esta es la clase principal para cuando se suba a Amazon Lambda, debemos indicar esta clase como la clase principal 10 | * */ 11 | public class MainStreamHandler extends SkillStreamHandler { 12 | 13 | private static Skill getSkill() { 14 | return Skills.standard() 15 | .addRequestHandlers( 16 | new SumaIntent(), 17 | new CancelAndStopIntent(), 18 | new HelpIntentHandler(), 19 | new LaunchRequestHandler(), 20 | new SessionEndedRequestHandler(), 21 | new RepeatIntentHandler(), 22 | new NoIntentHandler()) 23 | .build(); 24 | } 25 | public MainStreamHandler() { 26 | super(getSkill()); 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /spring-webflux-2/src/main/java/windoctor7/github/io/spring5/reactive/springwebflux2/NumerosController.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.springwebflux2; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | import reactor.core.publisher.Flux; 6 | 7 | import java.time.Duration; 8 | 9 | /** 10 | * Created by Ascari Q. Romo Pedraza - molder.itp@gmail.com on 17/10/2017. 11 | */ 12 | @RestController 13 | public class NumerosController { 14 | 15 | @GetMapping(path = "/numeros", produces = "text/event-stream") 16 | public Flux all () { 17 | Flux flux = Flux.range(1,30) 18 | .delayElements(Duration.ofSeconds(1)) 19 | .filter(n -> n % 2 == 0) // solo números divisibles entre 2 20 | .map(n -> n*2); // a cada elemento que ha sido filtrado, lo multiplicamos por 2 21 | 22 | flux.subscribe(System.out::println); // suscriptor 1 23 | flux.subscribe(Subscriber::multiplicar); // suscriptor 2 24 | return flux; // retornamos el elemento. Sería como el suscriptor 3 25 | } 26 | } -------------------------------------------------------------------------------- /calculadora/src/main/java/windoctor7/github/io/alexa/skills/calculadora/lambdas/CancelAndStopIntent.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.alexa.skills.calculadora.lambdas; 2 | 3 | import com.amazon.ask.dispatcher.request.handler.HandlerInput; 4 | import com.amazon.ask.dispatcher.request.handler.RequestHandler; 5 | import com.amazon.ask.model.Response; 6 | import windoctor7.github.io.alexa.skills.calculadora.Intents; 7 | 8 | import java.util.Optional; 9 | 10 | import static com.amazon.ask.request.Predicates.intentName; 11 | 12 | /** 13 | * Se lanza cuando decimos "Alexa detente" o "Alexa para" 14 | * */ 15 | public class CancelAndStopIntent implements RequestHandler { 16 | @Override 17 | public boolean canHandle(HandlerInput handlerInput) { 18 | return handlerInput.matches(intentName(Intents.AMAZON_STOP).or(intentName(Intents.AMAZON_CANCEL))); 19 | } 20 | 21 | @Override 22 | public Optional handle(HandlerInput handlerInput) { 23 | return handlerInput.getResponseBuilder() 24 | .withSpeech("Muy bien, adiosin") 25 | .withSimpleCard("Adiosin", "Muy bien, hasta pronto") 26 | .build(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /spring-webflux-2/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '2.0.0.M5' 4 | } 5 | repositories { 6 | mavenCentral() 7 | maven { url "https://repo.spring.io/snapshot" } 8 | maven { url "https://repo.spring.io/milestone" } 9 | } 10 | dependencies { 11 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 12 | } 13 | } 14 | 15 | apply plugin: 'java' 16 | apply plugin: 'eclipse' 17 | apply plugin: 'org.springframework.boot' 18 | apply plugin: 'io.spring.dependency-management' 19 | 20 | group = 'windoctor7.github.io.spring5.reactive' 21 | version = '0.0.1-SNAPSHOT' 22 | sourceCompatibility = 1.8 23 | 24 | repositories { 25 | mavenCentral() 26 | maven { url "https://repo.spring.io/snapshot" } 27 | maven { url "https://repo.spring.io/milestone" } 28 | } 29 | 30 | 31 | dependencies { 32 | compile('org.springframework.boot:spring-boot-starter-webflux') 33 | compile('org.springframework.boot:spring-boot-starter-thymeleaf') 34 | compile('org.springframework.boot:spring-boot-starter-data-mongodb-reactive') 35 | testCompile('org.springframework.boot:spring-boot-starter-test') 36 | testCompile('io.projectreactor:reactor-test') 37 | } 38 | -------------------------------------------------------------------------------- /calculadora/src/main/java/windoctor7/github/io/alexa/skills/calculadora/lambdas/NoIntentHandler.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.alexa.skills.calculadora.lambdas; 2 | 3 | import com.amazon.ask.dispatcher.request.handler.HandlerInput; 4 | import com.amazon.ask.dispatcher.request.handler.RequestHandler; 5 | import com.amazon.ask.model.Response; 6 | import com.amazon.ask.request.Predicates; 7 | import windoctor7.github.io.alexa.skills.calculadora.Intents; 8 | 9 | import java.util.Optional; 10 | 11 | /** 12 | * A built-in intent that triggers when the user says: "no". 13 | * This will most likely be called when the conversation goes: 14 | * Alexa: "Would you like to hear the next message?" 15 | * User: "No." 16 | * Alexa: "Alright." 17 | * */ 18 | public class NoIntentHandler implements RequestHandler { 19 | @Override 20 | public boolean canHandle(HandlerInput handlerInput) { 21 | return handlerInput.matches(Predicates.intentName(Intents.AMAZON_NO)); 22 | } 23 | 24 | @Override 25 | public Optional handle(HandlerInput handlerInput) { 26 | return handlerInput.getResponseBuilder() 27 | .withSpeech("OK") 28 | .build(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /inyeccion-dependencia/src/test/java/RecordatorioSpec.groovy: -------------------------------------------------------------------------------- 1 | import basic.ApplicationConfig 2 | import basic.Cliente 3 | import basic.Recordatorio 4 | import basic.RecordatorioEmail 5 | import org.springframework.beans.factory.annotation.Autowired 6 | import org.springframework.test.context.ContextConfiguration 7 | import spock.lang.Specification 8 | 9 | /** 10 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 20/03/17. 11 | */ 12 | @ContextConfiguration(classes = ApplicationConfig.class) 13 | class RecordatorioSpec extends Specification{ 14 | 15 | @Autowired 16 | Cliente cliente 17 | 18 | RecordatorioEmail recordatorioEmail = Mock() 19 | 20 | def setup(){ 21 | cliente.setAbono(280); 22 | cliente.setDiaPago(7); //1 Domingo, 2 Lunes, 3 Martes, etc. 23 | cliente.setEmail("molder.itp@gmail.com"); 24 | cliente.setTwitter("@windoctor"); 25 | cliente.setCelular("0123456789"); 26 | cliente.recordatorioEmail = recordatorioEmail 27 | } 28 | 29 | def 'enviar recordatorio de pago a clientes'(){ 30 | when: 31 | cliente.enviarRecordatorio() 32 | then: 33 | 1 * recordatorioEmail.enviar(cliente); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /calculadora/src/main/java/windoctor7/github/io/alexa/skills/calculadora/lambdas/LaunchRequestHandler.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.alexa.skills.calculadora.lambdas; 2 | 3 | import com.amazon.ask.dispatcher.request.handler.HandlerInput; 4 | import com.amazon.ask.dispatcher.request.handler.RequestHandler; 5 | import com.amazon.ask.model.LaunchRequest; 6 | import com.amazon.ask.model.Response; 7 | import com.amazon.ask.request.Predicates; 8 | 9 | import java.util.Optional; 10 | 11 | /** 12 | * Se lanza cuando decimos "Alexa, abre calculadora" 13 | * */ 14 | public class LaunchRequestHandler implements RequestHandler { 15 | 16 | @Override 17 | public boolean canHandle(HandlerInput handlerInput) { 18 | return handlerInput.matches(Predicates.requestType(LaunchRequest.class)); 19 | } 20 | 21 | @Override 22 | public Optional handle(HandlerInput handlerInput) { 23 | String speechText = "Hola raton con cola, yo puedo sumar dos números, dime cuales"; 24 | return handlerInput.getResponseBuilder() 25 | .withSpeech(speechText) 26 | .withSimpleCard("Bienvenido", speechText) 27 | .withReprompt(speechText) 28 | .build(); 29 | } 30 | } -------------------------------------------------------------------------------- /calculadora/src/main/java/windoctor7/github/io/alexa/skills/calculadora/lambdas/HelpIntentHandler.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.alexa.skills.calculadora.lambdas; 2 | 3 | import com.amazon.ask.dispatcher.request.handler.HandlerInput; 4 | import com.amazon.ask.dispatcher.request.handler.RequestHandler; 5 | import com.amazon.ask.model.Response; 6 | import com.amazon.ask.request.Predicates; 7 | import windoctor7.github.io.alexa.skills.calculadora.Intents; 8 | 9 | import java.util.Optional; 10 | 11 | /** 12 | * Se lanza cuando decimos "ayuda" o "ayudame" 13 | * */ 14 | public class HelpIntentHandler implements RequestHandler { 15 | @Override 16 | public boolean canHandle(HandlerInput handlerInput) { 17 | return handlerInput.matches(Predicates.intentName(Intents.AMAZON_HELP)); 18 | } 19 | 20 | @Override 21 | public Optional handle(HandlerInput handlerInput) { 22 | String speechText = "Con calculadora solo necesitas decir suma cuarenta y tres mas veinti tres por ejemplo"; 23 | return handlerInput.getResponseBuilder() 24 | .withSpeech(speechText) 25 | .withSimpleCard("Calculadora", speechText) 26 | .withReprompt(speechText) 27 | .build(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /spring-async/src/main/java/windoctor7/github/io/spring/async/Usuario.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.async; 2 | 3 | /** 4 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 09/04/17. 5 | */ 6 | public class Usuario { 7 | 8 | private String nombre; 9 | private String email; 10 | private String user; 11 | 12 | public Usuario(String nombre, String email) { 13 | this.nombre = nombre; 14 | this.email = email; 15 | } 16 | 17 | public String getUser() { 18 | return user; 19 | } 20 | 21 | public void setUser(String user) { 22 | this.user = user; 23 | } 24 | 25 | public String getNombre() { 26 | return nombre; 27 | } 28 | 29 | public void setNombre(String nombre) { 30 | this.nombre = nombre; 31 | } 32 | 33 | public String getEmail() { 34 | return email; 35 | } 36 | 37 | public void setEmail(String email) { 38 | this.email = email; 39 | } 40 | 41 | 42 | @Override 43 | public String toString() { 44 | return "Usuario{" + 45 | "nombre='" + nombre + '\'' + 46 | ", email='" + email + '\'' + 47 | ", user='" + user + '\'' + 48 | '}'; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /spring-scheduler/src/main/java/windoctor7/github/io/spring/scheduled/TareasPeriodicas.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.scheduled; 2 | 3 | import org.springframework.scheduling.annotation.Scheduled; 4 | import org.springframework.stereotype.Component; 5 | 6 | import java.util.Date; 7 | 8 | /** 9 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 07/04/17. 10 | */ 11 | @Component 12 | public class TareasPeriodicas { 13 | 14 | 15 | // Se ejecuta cada 3 segundos 16 | @Scheduled(fixedRate = 3000) 17 | public void tarea1() { 18 | System.out.println("Tarea usando fixedRate cada 3 segundos - " + System.currentTimeMillis() / 1000); 19 | } 20 | 21 | @Scheduled(fixedRateString = "${imprime.tarea}") 22 | public void tarea2() { 23 | System.out.println("Tarea usando fixedRateString cada 5 segundos - " + System.currentTimeMillis() / 1000); 24 | } 25 | 26 | @Scheduled(fixedRate = 3000, initialDelay = 10000) 27 | public void tarea3() { 28 | System.out.println("Tarea con retraso inicial de 10 segundos - " + System.currentTimeMillis() / 1000); 29 | } 30 | 31 | 32 | @Scheduled(cron = "0/15 * 0 ? * 6,7 ") 33 | public void tarea4() { 34 | System.out.println("Tarea usando expresiones cron - " + new Date()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /calculadora/src/main/java/windoctor7/github/io/alexa/skills/calculadora/lambdas/RepeatIntentHandler.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.alexa.skills.calculadora.lambdas; 2 | 3 | import com.amazon.ask.dispatcher.request.handler.HandlerInput; 4 | import com.amazon.ask.dispatcher.request.handler.RequestHandler; 5 | import com.amazon.ask.model.Response; 6 | import com.amazon.ask.request.Predicates; 7 | import windoctor7.github.io.alexa.skills.calculadora.Intents; 8 | 9 | import java.util.Map; 10 | import java.util.Optional; 11 | 12 | 13 | public class RepeatIntentHandler implements RequestHandler { 14 | 15 | @Override 16 | public boolean canHandle(HandlerInput handlerInput) { 17 | return handlerInput.matches(Predicates.intentName(Intents.AMAZON_REPEAT)); 18 | } 19 | 20 | @Override 21 | public Optional handle(HandlerInput handlerInput) { 22 | Map sessionAttributes = handlerInput.getAttributesManager().getSessionAttributes(); 23 | String response = "Ups, aun no tengo programada esta funcionalidad, disculpame"; 24 | 25 | return handlerInput.getResponseBuilder() 26 | .withShouldEndSession(false) 27 | .withSpeech(response) 28 | .withSimpleCard("Ups", response) 29 | .build(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spring5-reactive-kotlin/src/main/kotlin/windoctor7/github/io/spring5/reactive/kotlin/Controller.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.kotlin; 2 | 3 | import org.springframework.web.client.RestTemplate; 4 | import reactor.core.Disposable; 5 | import reactor.core.publisher.Flux; 6 | import reactor.core.publisher.FluxSink; 7 | import reactor.core.publisher.Mono; 8 | import reactor.core.publisher.MonoSink; 9 | import reactor.util.context.Context; 10 | 11 | import java.util.function.Consumer; 12 | import java.util.function.LongConsumer; 13 | 14 | /** 15 | * Created by Ascari Q. Romo Pedraza - molder.itp@gmail.com on 30/10/2017. 16 | */ 17 | public class Controller { 18 | 19 | Flux metodo(){ 20 | 21 | return Flux.create(new Consumer>() { 22 | @Override 23 | public void accept(FluxSink fluxSink) { 24 | 25 | } 26 | }); 27 | 28 | } 29 | 30 | Mono metodo2(){ 31 | return Mono.create(userMonoSink -> { 32 | String url = "https://api.github.com/search/users?q=windoctor"; 33 | UserResultGh resultGh = new RestTemplate().getForObject(url, UserResultGh.class); 34 | userMonoSink.success(resultGh); // agregamos el elemento al Stream. 35 | }); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring-kafka-consumer/src/main/java/windoctor7/github/io/spring/kafka/producer/CreditProduct.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.kafka.producer; 2 | 3 | 4 | public class CreditProduct { 5 | 6 | private long id; 7 | private String name; 8 | private String description; 9 | 10 | public CreditProduct() { 11 | } 12 | 13 | public CreditProduct(long id, String name, String description) { 14 | this.id = id; 15 | this.name = name; 16 | this.description = description; 17 | } 18 | 19 | public long getId() { 20 | return id; 21 | } 22 | 23 | public void setId(long id) { 24 | this.id = id; 25 | } 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | 31 | public void setName(String name) { 32 | this.name = name; 33 | } 34 | 35 | public String getDescription() { 36 | return description; 37 | } 38 | 39 | public void setDescription(String description) { 40 | this.description = description; 41 | } 42 | 43 | @Override 44 | public String toString() { 45 | return "CreditProduct{" + 46 | "id=" + id + 47 | ", name='" + name + '\'' + 48 | ", description='" + description + '\'' + 49 | '}'; 50 | } 51 | } -------------------------------------------------------------------------------- /spring-pwa/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.2.5.RELEASE' 3 | id 'io.spring.dependency-management' version '1.0.9.RELEASE' 4 | id 'java' 5 | } 6 | 7 | group = 'windoctor7.github.io.pwa' 8 | version = '0.0.1-SNAPSHOT' 9 | sourceCompatibility = '1.8' 10 | 11 | configurations { 12 | developmentOnly 13 | runtimeClasspath { 14 | extendsFrom developmentOnly 15 | } 16 | compileOnly { 17 | extendsFrom annotationProcessor 18 | } 19 | } 20 | 21 | repositories { 22 | mavenCentral() 23 | maven{ 24 | url 'https://search.maven.org' 25 | } 26 | } 27 | 28 | dependencies { 29 | annotationProcessor 'org.progressify:progressify-spring:0.2.0' 30 | 31 | implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' 32 | implementation 'org.springframework.boot:spring-boot-starter-webflux' 33 | implementation 'org.progressify:progressify-spring:0.2.0' 34 | developmentOnly 'org.springframework.boot:spring-boot-devtools' 35 | testImplementation('org.springframework.boot:spring-boot-starter-test') { 36 | exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' 37 | } 38 | testImplementation 'io.projectreactor:reactor-test' 39 | } 40 | 41 | test { 42 | useJUnitPlatform() 43 | } 44 | 45 | 46 | -------------------------------------------------------------------------------- /spring-webflux-2/src/main/java/windoctor7/github/io/spring5/reactive/springwebflux2/StudentController.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.springwebflux2; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | import org.thymeleaf.spring5.context.webflux.ReactiveDataDriverContextVariable; 10 | import reactor.core.publisher.Flux; 11 | import reactor.core.publisher.Mono; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * Created by Ascari Q. Romo Pedraza - molder.itp@gmail.com on 19/10/2017. 17 | */ 18 | @RestController 19 | @RequestMapping("/api/students") 20 | public class StudentController { 21 | 22 | @Autowired 23 | private StudentReactiveRepository repository; 24 | 25 | @GetMapping 26 | public Flux allStudents(){ 27 | return repository.findAll(); 28 | } 29 | 30 | @GetMapping("/{id}") 31 | public Mono getUser(@PathVariable String id) { 32 | return repository.findById(id); 33 | } 34 | 35 | 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring-auth-jwt/src/main/java/windoctor7/github/io/spring/auth/jwt/security/JwtFilter.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.auth.jwt.security; 2 | 3 | import org.springframework.security.core.context.SecurityContextHolder; 4 | import org.springframework.web.filter.GenericFilterBean; 5 | import org.springframework.security.core.Authentication; 6 | import javax.servlet.FilterChain; 7 | import javax.servlet.ServletException; 8 | import javax.servlet.ServletRequest; 9 | import javax.servlet.ServletResponse; 10 | import javax.servlet.http.HttpServletRequest; 11 | import java.io.IOException; 12 | 13 | /** 14 | * Las peticiones que no sean /login pasarán por este filtro 15 | * el cuál se encarga de pasar el "request" a nuestra clase de utilidad JwtUtil 16 | * para que valide el token. 17 | */ 18 | public class JwtFilter extends GenericFilterBean { 19 | 20 | @Override 21 | public void doFilter(ServletRequest request, 22 | ServletResponse response, 23 | FilterChain filterChain) 24 | throws IOException, ServletException { 25 | 26 | 27 | Authentication authentication = JwtUtil.getAuthentication((HttpServletRequest)request); 28 | 29 | SecurityContextHolder.getContext().setAuthentication(authentication); 30 | 31 | filterChain.doFilter(request,response); 32 | } 33 | } -------------------------------------------------------------------------------- /Spring4-SSE/src/main/java/windoctor7/github/io/spring4/sse/Spring4SSE/GenerarArchivo.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring4.sse.Spring4SSE; 2 | 3 | import org.apache.commons.io.FileUtils; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.context.ApplicationEventPublisher; 6 | import org.springframework.scheduling.annotation.Async; 7 | import org.springframework.scheduling.annotation.Scheduled; 8 | import org.springframework.stereotype.Component; 9 | 10 | import java.io.File; 11 | import java.io.IOException; 12 | 13 | /** 14 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 08/10/17. 15 | */ 16 | @Component 17 | public class GenerarArchivo { 18 | 19 | @Autowired 20 | private ApplicationEventPublisher publisher; 21 | 22 | // se ejecuta cada 5 minutos 23 | @Scheduled(cron = "0 5 * ? * *") 24 | @Async 25 | public void generar() throws IOException { 26 | System.out.println("Iniciando escritura de archivo"); 27 | File file = new File("/Users/ascariromopedraza/archivo.txt"); 28 | for(int i = 0; i < 50000; i++){ 29 | String cad = "linea "+i; 30 | FileUtils.writeStringToFile(file, cad, "UTF-8",true); 31 | } 32 | publisher.publishEvent(new MensajeEvent(this.getClass().getName())); 33 | System.out.println("Finalizando escritura de archivo"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /spring-webflux-2/src/main/java/windoctor7/github/io/spring5/reactive/springwebflux2/StudentListController.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.springwebflux2; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.thymeleaf.spring5.context.webflux.ReactiveDataDriverContextVariable; 8 | import reactor.core.publisher.Flux; 9 | 10 | import java.time.Duration; 11 | 12 | /** 13 | * Created by Ascari Q. Romo Pedraza - molder.itp@gmail.com on 19/10/2017. 14 | */ 15 | @Controller 16 | public class StudentListController { 17 | 18 | @Autowired 19 | private StudentReactiveRepository repository; 20 | 21 | @GetMapping("/list-students") 22 | public String listStudents(Model model){ 23 | Flux flux = repository.findAll(); // recuperamos todos los registros de forma reactiva 24 | model.addAttribute("students", flux); 25 | return "students"; // direccionamos al students.html 26 | } 27 | 28 | 29 | @GetMapping("/list-students-reactive") 30 | public String listUsersReactive(Model model) 31 | { 32 | Flux userFlux = repository.findAll(); 33 | model.addAttribute("students", new ReactiveDataDriverContextVariable(userFlux, 50)); 34 | return "students"; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /docker-springboot-java17/app/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Creado por Ascari Q. Romo Pedraza (molder.itp@gmail.com) 3 | * 9 Octubre 2022 4 | * Hecho con Gradle v7.5.1 5 | * */ 6 | 7 | plugins { 8 | id 'org.springframework.boot' version '2.6.2' 9 | id 'io.spring.dependency-management' version '1.0.11.RELEASE' 10 | id 'io.freefair.lombok' version '6.5.1' 11 | 12 | id 'groovy' // requerido para unit test con Spock 13 | id 'application' 14 | } 15 | 16 | version '0.1.0' 17 | 18 | repositories { 19 | // Use Maven Central for resolving dependencies. 20 | mavenCentral() 21 | } 22 | 23 | dependencies { 24 | // Use the latest Groovy version for Spock testing 25 | testImplementation 'org.codehaus.groovy:groovy:3.0.10' 26 | 27 | // Use the awesome Spock testing and specification framework even with Java 28 | testImplementation 'org.spockframework:spock-core:2.1-groovy-3.0' 29 | testImplementation 'junit:junit:4.13.2' 30 | 31 | // This dependency is used by the application. 32 | implementation 'org.springframework.boot:spring-boot-starter-web' 33 | implementation 'org.springframework.boot:spring-boot-starter-actuator' 34 | testImplementation 'org.springframework.boot:spring-boot-starter-test' 35 | } 36 | 37 | application { 38 | // Define the main class for the application. 39 | mainClass = 'docker.springboot.java17.App' 40 | } 41 | 42 | 43 | tasks.named('test') { 44 | // Use JUnit Platform for unit tests. 45 | useJUnitPlatform() 46 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ############################## 2 | ## Java 3 | ############################## 4 | .mtj.tmp/ 5 | *.class 6 | *.jar 7 | *.war 8 | *.ear 9 | *.nar 10 | hs_err_pid* 11 | 12 | ############################## 13 | ## Maven 14 | ############################## 15 | target/ 16 | pom.xml.tag 17 | pom.xml.releaseBackup 18 | pom.xml.versionsBackup 19 | pom.xml.next 20 | pom.xml.bak 21 | release.properties 22 | dependency-reduced-pom.xml 23 | buildNumber.properties 24 | .mvn/timing.properties 25 | .mvn/wrapper/maven-wrapper.jar 26 | 27 | ############################## 28 | ## Gradle 29 | ############################## 30 | bin/ 31 | build/ 32 | .gradle 33 | .gradletasknamecache 34 | gradle-app.setting 35 | !gradle-wrapper.jar 36 | 37 | ############################## 38 | ## IntelliJ 39 | ############################## 40 | out/ 41 | .idea/ 42 | .idea_modules/ 43 | *.iml 44 | *.ipr 45 | *.iws 46 | 47 | ############################## 48 | ## Eclipse 49 | ############################## 50 | .settings/ 51 | bin/ 52 | tmp/ 53 | .metadata 54 | .classpath 55 | .project 56 | *.tmp 57 | *.bak 58 | *.swp 59 | *~.nib 60 | local.properties 61 | .loadpath 62 | .factorypath 63 | 64 | ############################## 65 | ## NetBeans 66 | ############################## 67 | nbproject/private/ 68 | build/ 69 | nbbuild/ 70 | dist/ 71 | nbdist/ 72 | nbactions.xml 73 | nb-configuration.xml 74 | 75 | ############################## 76 | ## Visual Studio Code 77 | ############################## 78 | .vscode/ 79 | .code-workspace 80 | 81 | ############################## 82 | ## OS X 83 | ############################## 84 | .DS_Store -------------------------------------------------------------------------------- /spring-kotlin/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | kotlinVersion = '1.1.51' 4 | springBootVersion = '2.0.0.M5' 5 | } 6 | repositories { 7 | mavenCentral() 8 | maven { url "https://repo.spring.io/snapshot" } 9 | maven { url "https://repo.spring.io/milestone" } 10 | } 11 | dependencies { 12 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 13 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}") 14 | classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}") 15 | } 16 | } 17 | 18 | apply plugin: 'kotlin' 19 | apply plugin: 'kotlin-spring' 20 | apply plugin: 'eclipse' 21 | apply plugin: 'org.springframework.boot' 22 | apply plugin: 'io.spring.dependency-management' 23 | 24 | group = 'windoctor7.github.io.kotlin.spring' 25 | version = '0.0.1-SNAPSHOT' 26 | sourceCompatibility = 1.8 27 | compileKotlin { 28 | kotlinOptions.jvmTarget = "1.8" 29 | } 30 | compileTestKotlin { 31 | kotlinOptions.jvmTarget = "1.8" 32 | } 33 | 34 | repositories { 35 | mavenCentral() 36 | maven { url "https://repo.spring.io/snapshot" } 37 | maven { url "https://repo.spring.io/milestone" } 38 | } 39 | 40 | 41 | dependencies { 42 | compile('org.springframework.boot:spring-boot-starter-webflux') 43 | compile("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}") 44 | compile("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}") 45 | compile('org.springframework.boot:spring-boot-starter-data-mongodb-reactive') 46 | testCompile('org.springframework.boot:spring-boot-starter-test') 47 | testCompile('io.projectreactor:reactor-test') 48 | } 49 | -------------------------------------------------------------------------------- /spring5-reactive-kotlin/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | kotlinVersion = '1.1.51' 4 | springBootVersion = '2.0.0.M5' 5 | } 6 | repositories { 7 | mavenCentral() 8 | maven { url "https://repo.spring.io/snapshot" } 9 | maven { url "https://repo.spring.io/milestone" } 10 | } 11 | dependencies { 12 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 13 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}") 14 | classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}") 15 | classpath "org.jetbrains.kotlin:kotlin-noarg:$kotlinVersion" 16 | } 17 | } 18 | 19 | apply plugin: "kotlin-noarg" 20 | apply plugin: 'kotlin' 21 | apply plugin: 'kotlin-spring' 22 | apply plugin: 'eclipse' 23 | apply plugin: 'org.springframework.boot' 24 | apply plugin: 'io.spring.dependency-management' 25 | 26 | group = 'windoctor7.github.io.spring5.reactive.kotlin' 27 | version = '0.0.1-SNAPSHOT' 28 | sourceCompatibility = 1.8 29 | compileKotlin { 30 | kotlinOptions.jvmTarget = "1.8" 31 | } 32 | compileTestKotlin { 33 | kotlinOptions.jvmTarget = "1.8" 34 | } 35 | 36 | 37 | 38 | repositories { 39 | mavenCentral() 40 | maven { url "https://repo.spring.io/snapshot" } 41 | maven { url "https://repo.spring.io/milestone" } 42 | } 43 | 44 | 45 | dependencies { 46 | compile('org.springframework.boot:spring-boot-starter-webflux') 47 | compile("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}") 48 | compile("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}") 49 | 50 | testCompile('org.springframework.boot:spring-boot-starter-test') 51 | testCompile('io.projectreactor:reactor-test') 52 | } 53 | 54 | -------------------------------------------------------------------------------- /spring5-reactive-kotlin/src/main/kotlin/windoctor7/github/io/spring5/reactive/kotlin/SearchUsersController.kt: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.kotlin 2 | 3 | import org.springframework.core.io.ClassPathResource 4 | import org.springframework.http.MediaType 5 | import org.springframework.http.codec.ServerSentEvent 6 | import org.springframework.web.bind.annotation.GetMapping 7 | import org.springframework.web.bind.annotation.RequestParam 8 | import org.springframework.web.bind.annotation.RestController 9 | import reactor.core.publisher.Flux 10 | import reactor.core.publisher.Mono 11 | 12 | /** 13 | * Created by Ascari Q. Romo Pedraza - molder.itp@gmail.com on 23/10/2017. 14 | */ 15 | @RestController 16 | class SearchUsersController(val repositorySearch: IRepositorySearch) { 17 | 18 | // text/event-stream para indicar que se trata de Server-Sent Event 19 | @GetMapping(path = arrayOf("/search/users"), produces = arrayOf("text/event-stream")) 20 | fun searchUsers(@RequestParam username: String): Flux { 21 | 22 | //iniciamos búsqueda en github. Recordar que existe un retardo de 5 segundos 23 | val gh = repositorySearch.searchUsersGitHub(username) 24 | .flatMapIterable { gh -> gh.items } 25 | 26 | //iniciamos búsqueda en bitbucket. 27 | val bk = repositorySearch.searchUsersBitBucket(username) 28 | 29 | //finalmente hacemos un merge del Mono(github) y Flux (bitbucket) 30 | return Flux.merge(gh, bk) 31 | } 32 | 33 | //Cargamos el HTML 34 | @GetMapping(path = arrayOf("/"), produces = arrayOf(MediaType.TEXT_HTML_VALUE)) 35 | fun index() = ClassPathResource("static/index.html") 36 | 37 | } -------------------------------------------------------------------------------- /calculadora/src/main/java/windoctor7/github/io/alexa/skills/calculadora/lambdas/SumaIntent.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.alexa.skills.calculadora.lambdas; 2 | 3 | import com.amazon.ask.dispatcher.request.handler.HandlerInput; 4 | import com.amazon.ask.dispatcher.request.handler.RequestHandler; 5 | import com.amazon.ask.model.*; 6 | import com.amazon.ask.request.Predicates; 7 | import windoctor7.github.io.alexa.skills.calculadora.Intents; 8 | 9 | import java.util.Map; 10 | import java.util.Optional; 11 | 12 | public class SumaIntent implements RequestHandler { 13 | @Override 14 | public boolean canHandle(HandlerInput handlerInput) { 15 | return handlerInput.matches(Predicates.intentName(Intents.SUMA_INTENT)); 16 | } 17 | 18 | @Override 19 | public Optional handle(HandlerInput handlerInput) { 20 | String speechText = "Con calculadora solo necesitas decir suma cuarenta y tres mas veinti tres por ejemplo"; 21 | 22 | Request request = handlerInput.getRequestEnvelope().getRequest(); 23 | IntentRequest intentRequest = (IntentRequest) request; 24 | Intent intent = intentRequest.getIntent(); 25 | Map slots = intent.getSlots(); 26 | 27 | //recuperamos el valor de nuestros slots y los convertimos a enteros para sumarlos 28 | int uno = Integer.parseInt(slots.get("uno").getValue()); 29 | int dos = Integer.parseInt(slots.get("dos").getValue()); 30 | int suma = uno + dos; 31 | 32 | return handlerInput.getResponseBuilder() 33 | .withSpeech("el resultado es "+suma) 34 | .withSimpleCard("Calculadora", "el resultado es "+suma) 35 | .withReprompt(speechText) 36 | .build(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /spring-kafka-producer/src/main/java/windoctor7/github/io/spring/kafka/producer/CreditProductProducer.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.kafka.producer; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.beans.factory.annotation.Value; 6 | import org.springframework.kafka.core.KafkaTemplate; 7 | import org.springframework.kafka.support.SendResult; 8 | import org.springframework.stereotype.Component; 9 | import org.springframework.util.concurrent.ListenableFuture; 10 | import org.springframework.util.concurrent.ListenableFutureCallback; 11 | 12 | @Slf4j 13 | @Component 14 | public class CreditProductProducer { 15 | 16 | private final KafkaTemplate kafkaTemplate; 17 | 18 | @Value(value = "${cloudkarafka.topic}") 19 | private String topicName; 20 | 21 | @Autowired 22 | public CreditProductProducer(KafkaTemplate kafkaTemplate) { 23 | this.kafkaTemplate = kafkaTemplate; 24 | } 25 | 26 | public void sendMessage(CreditProduct creditProduct){ 27 | ListenableFuture> future = kafkaTemplate.send(topicName, "key", creditProduct); 28 | future.addCallback(new ListenableFutureCallback>() { 29 | @Override 30 | public void onFailure(Throwable ex) { 31 | log.error("Ups, ocurrio un error al enviar el mensaje.", ex.getCause()); 32 | } 33 | 34 | @Override 35 | public void onSuccess(SendResult result) { 36 | log.info("El mensaje fue enviado con éxito {}", creditProduct); 37 | } 38 | }); 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /spring-async/src/main/java/windoctor7/github/io/spring/async/RegistroAsync.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.async; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.mail.MailSender; 5 | import org.springframework.mail.SimpleMailMessage; 6 | import org.springframework.scheduling.annotation.Async; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 09/04/17. 11 | */ 12 | @Service 13 | public class RegistroAsync { 14 | 15 | private MailSender mailSender; 16 | 17 | @Autowired 18 | public RegistroAsync(MailSender mailSender) { 19 | this.mailSender = mailSender; 20 | } 21 | 22 | // Metodo que simula el registro de un usuario en alguna base de datos 23 | public Usuario registrar(Usuario usuario){ 24 | 25 | System.out.printf("Registrando a nuevo usuario: %s", usuario); 26 | 27 | /** 28 | * Aqui el código requerido para guardar los datos en la base de datos 29 | */ 30 | 31 | usuario.setUser("windoctor"); 32 | 33 | System.out.println("Finaliza el registro del usuario."); 34 | 35 | return usuario; 36 | } 37 | 38 | @Async 39 | public void enviarCorreo(Usuario usuario){ 40 | for(int i = 1; i < 21; i++) { 41 | System.out.println("enviando correo "+i); 42 | SimpleMailMessage mailMessage = new SimpleMailMessage(); 43 | mailMessage.setFrom(""); //pon tu cuenta de correo gmail u otro texto que sirva como remitente 44 | mailMessage.setTo(usuario.getEmail()); 45 | mailMessage.setSubject("Registro completado"); 46 | mailMessage.setText("Su registro fue completado con exito"); 47 | 48 | mailSender.send(mailMessage); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /spring5-reactive-kotlin/src/main/kotlin/windoctor7/github/io/spring5/reactive/kotlin/RepositorySearch.kt: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring5.reactive.kotlin 2 | 3 | import org.springframework.core.ParameterizedTypeReference 4 | import org.springframework.http.HttpMethod 5 | import org.springframework.http.MediaType 6 | import org.springframework.stereotype.Component 7 | import org.springframework.web.client.RestTemplate 8 | import reactor.core.publisher.Flux 9 | import java.net.HttpURLConnection 10 | import java.net.InetSocketAddress 11 | import java.net.Proxy 12 | import java.net.URL 13 | import kotlin.text.Charsets 14 | import java.io.IOException 15 | import java.io.InputStream 16 | import java.io.ByteArrayInputStream 17 | import java.nio.charset.StandardCharsets 18 | import java.util.* 19 | import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter 20 | import reactor.core.publisher.Mono 21 | import java.time.Duration 22 | 23 | 24 | /** 25 | * Created by Ascari Q. Romo Pedraza - molder.itp@gmail.com on 23/10/2017. 26 | */ 27 | @Component 28 | class RepositorySearch() : IRepositorySearch { 29 | 30 | override fun searchUsersGitHub(username: String): Mono { 31 | val url = "https://api.github.com/search/users?q=$username" 32 | return Mono.create { sink -> 33 | sink.success( RestTemplate().getForObject(url, UserResultGh::class.java) ) 34 | }.delayElement(Duration.ofSeconds(5)) //agregamos un retardo intencional de 5 segundos 35 | } 36 | 37 | override fun searchUsersBitBucket(username: String): Flux { 38 | val url = "https://api.bitbucket.org/2.0/users/$username" 39 | return Flux.create { sink -> 40 | val user:User? = RestTemplate().getForObject(url, User::class.java) 41 | sink.next( user) 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /spring-auth-jwt/src/main/java/windoctor7/github/io/spring/auth/jwt/security/SecurityConfig.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.auth.jwt.security; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 5 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 6 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 7 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 8 | import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; 9 | 10 | @Configuration 11 | @EnableWebSecurity 12 | public class SecurityConfig extends WebSecurityConfigurerAdapter { 13 | @Override 14 | protected void configure(HttpSecurity http) throws Exception { 15 | http.csrf().disable().authorizeRequests() 16 | .antMatchers("/login").permitAll() //permitimos el acceso a /login a cualquiera 17 | .anyRequest().authenticated() //cualquier otra peticion requiere autenticacion 18 | .and() 19 | // Las peticiones /login pasaran previamente por este filtro 20 | .addFilterBefore(new LoginFilter("/login", authenticationManager()), 21 | UsernamePasswordAuthenticationFilter.class) 22 | 23 | // Las demás peticiones pasarán por este filtro para validar el token 24 | .addFilterBefore(new JwtFilter(), 25 | UsernamePasswordAuthenticationFilter.class); 26 | } 27 | 28 | @Override 29 | protected void configure(AuthenticationManagerBuilder auth) throws Exception { 30 | // Creamos una cuenta de usuario por default 31 | auth.inMemoryAuthentication() 32 | .withUser("ask") 33 | .password("123") 34 | .roles("ADMIN"); 35 | } 36 | } -------------------------------------------------------------------------------- /java-streams/src/main/java/windoctor7/github/io/streams/Util.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.streams; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Scanner; 6 | 7 | /** 8 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 17/04/17. 9 | * Este es solo el codigo base usado en el workshop "Conociendo al API Stream de Java 8" 10 | * que puedes encontrar en mi blog 11 | * https://windoctor7.github.io/API-Stream-Java8.html 12 | * 13 | * Ahi se encuentran toda una serie de ejercicios y explicaciones. 14 | * Este codigo es solo la base, no contiene los ejercicios descritos en el blog. 15 | */ 16 | public class Util { 17 | 18 | public static List getProducts(){ 19 | // Cargamos el archivo ubicado en la carpeta resources. 20 | ClassLoader classLoader = Util.class.getClassLoader(); 21 | Scanner sc = new Scanner(classLoader.getResourceAsStream("products.csv")); 22 | 23 | sc.nextLine(); // comenzamos a leer a partir de la segunda linea (la primera tiene solo los titulos) 24 | sc.useDelimiter(","); // separamos por comas para obtener las columnas 25 | 26 | List products = new ArrayList<>(); 27 | 28 | while(sc.hasNextLine()){ 29 | //con los metodos nextXX() obtenemos las columnas en el orden en el que se encuentran en el archivo 30 | Product product = new Product(); 31 | product.setId(sc.nextInt()); 32 | product.setName(sc.next()); 33 | product.setSupplier(sc.nextInt()); 34 | product.setCategory(sc.nextInt()); 35 | sc.next(); //saltamos la columna quantityPerUnit 36 | product.setUnitPrice(sc.nextDouble()); 37 | product.setUnitsInStock(sc.nextInt()); 38 | 39 | products.add(product); // agregamos el producto a la lista. 40 | 41 | sc.nextLine(); // pasamos a la siguiente linea 42 | } 43 | 44 | return products; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /spring5-reactive-kotlin/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | demo-spring-sse 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 58 | 59 | -------------------------------------------------------------------------------- /spring-retry/cliente-ws/src/main/java/windoctor7/github/io/spring/retry/test/ClienteRest.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.retry.test; 2 | 3 | import org.springframework.boot.CommandLineRunner; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.retry.annotation.Backoff; 6 | import org.springframework.retry.annotation.Recover; 7 | import org.springframework.retry.annotation.Retryable; 8 | import org.springframework.stereotype.Component; 9 | import org.springframework.web.client.RestTemplate; 10 | 11 | /** 12 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 09/04/17. 13 | */ 14 | @Component("clienteRest") 15 | public class ClienteRest implements CommandLineRunner { 16 | 17 | @Retryable(backoff = @Backoff(7000), maxAttempts = 5) 18 | public void run(String... args) { 19 | System.out.println("Iniciando el llamado al WS - " + System.currentTimeMillis() / 1000); 20 | String url = "http://localhost:8080/empleados/{id}"; 21 | int id = 1; 22 | 23 | RestTemplate restTemplate = new RestTemplate(); 24 | ResponseEntity entity = restTemplate.getForEntity(url, Empleado.class, id); 25 | Empleado empleado = entity.getBody(); 26 | System.out.println(empleado); 27 | 28 | } 29 | 30 | /** 31 | * Lamentablemente nosotros no podemos ver esto 32 | * pues al utilizar la interfaz CommandLineRunner, si en el método run(String… args) se lanza una excepción, 33 | * causará que el contexto de spring se cierre y nuestra aplicación se detendrá, 34 | * ocasionando que el método recover no se ejecute. 35 | * 36 | * Para que una aplicación que usa CommandLineRunner no se termine en el caso de lanzar una excepción 37 | * en el método run(..) será necesario agregar un bloque try/catch sin embargo si lo hacemos 38 | * la excepción no se lanzará un nuestra política de reintentos no se ejecutará sencillamente porque 39 | * no habrá detectado ninguna excepción. 40 | * 41 | * Sin embargo esto no es ningun problema, en una aplicación real no usarás CommandLineRunner, 42 | * aquí se uso solo para fines demostrativos y rápidos. 43 | */ 44 | @Recover 45 | public void recover(){ 46 | System.out.println("Aqui el código que deseamos ejecutar en caso que la política de reintentos falle"); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Spring4-SSE/src/main/java/windoctor7/github/io/spring4/sse/Spring4SSE/SseController.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring4.sse.Spring4SSE; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestParam; 6 | import org.springframework.web.bind.annotation.RestController; 7 | import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; 8 | 9 | import java.io.IOException; 10 | 11 | /** 12 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 13/10/17. 13 | */ 14 | @RestController 15 | public class SseController { 16 | 17 | @Autowired 18 | private GenerarArchivo task; 19 | 20 | @Autowired 21 | private IJobExecutor jobExecutor; 22 | 23 | @GetMapping("/execute") 24 | public SseEmitter ejecutar(@RequestParam String beanClass) throws IOException { 25 | 26 | SseEmitter emitter = new SseEmitter(); 27 | 28 | // validamos que el Map NO contenga ya el Job. Si lo contiene, NO permitimos la ejecución del Job. 29 | if (isTaskExists(beanClass)) { 30 | String msg = String.format("El Job %s ya está siendo ejecutado. No es posible ejecutarlo en este momento.", beanClass); 31 | emitter.send(new Mensaje(2, msg)); 32 | emitter.complete(); 33 | return emitter; 34 | } 35 | 36 | config(emitter,beanClass); 37 | 38 | //Agregamos el emiter al Map y lo ejecutamos 39 | JobExecutor.EMITTERS.put(beanClass, emitter); 40 | jobExecutor.executeBean(beanClass); 41 | 42 | // Dado que la ejecución del Job ahora es asíncrona, 43 | //devolvemos inmediatamente la respuesta al cliente. 44 | emitter.send(new Mensaje(1,"Ejecutanto tarea...")); 45 | return emitter; 46 | } 47 | 48 | private boolean isTaskExists(String beanClass){ 49 | return JobExecutor.EMITTERS.containsKey(beanClass); 50 | } 51 | 52 | // Establecemos que cuando el SseEmitter concluya, remueva dicho emitter del Map 53 | private void config(SseEmitter emitter, String beanClass){ 54 | emitter.onCompletion(() -> { 55 | if (isTaskExists(beanClass)) 56 | System.out.println("ELIMINANDO EMITTER"); 57 | JobExecutor.EMITTERS.remove(beanClass); 58 | } 59 | ); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /spring-auth-jwt/src/main/java/windoctor7/github/io/spring/auth/jwt/security/JwtUtil.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring.auth.jwt.security; 2 | 3 | import io.jsonwebtoken.Jwts; 4 | import io.jsonwebtoken.SignatureAlgorithm; 5 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 6 | import org.springframework.security.core.Authentication; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | import java.util.Date; 11 | 12 | import static java.util.Collections.emptyList; 13 | 14 | public class JwtUtil { 15 | 16 | // Método para crear el JWT y enviarlo al cliente en el header de la respuesta 17 | static void addAuthentication(HttpServletResponse res, String username) { 18 | 19 | String token = Jwts.builder() 20 | .setSubject(username) 21 | 22 | // Vamos a asignar un tiempo de expiracion de 1 minuto 23 | // solo con fines demostrativos en el video que hay al final 24 | .setExpiration(new Date(System.currentTimeMillis() + 60000)) 25 | 26 | // Hash con el que firmaremos la clave 27 | .signWith(SignatureAlgorithm.HS512, "P@tit0") 28 | .compact(); 29 | 30 | //agregamos al encabezado el token 31 | res.addHeader("Authorization", "Bearer " + token); 32 | } 33 | 34 | // Método para validar el token enviado por el cliente 35 | static Authentication getAuthentication(HttpServletRequest request) { 36 | 37 | // Obtenemos el token que viene en el encabezado de la peticion 38 | String token = request.getHeader("Authorization"); 39 | 40 | // si hay un token presente, entonces lo validamos 41 | if (token != null) { 42 | String user = Jwts.parser() 43 | .setSigningKey("P@tit0") 44 | .parseClaimsJws(token.replace("Bearer", "")) //este metodo es el que valida 45 | .getBody() 46 | .getSubject(); 47 | 48 | // Recordamos que para las demás peticiones que no sean /login 49 | // no requerimos una autenticacion por username/password 50 | // por este motivo podemos devolver un UsernamePasswordAuthenticationToken sin password 51 | return user != null ? 52 | new UsernamePasswordAuthenticationToken(user, null, emptyList()) : 53 | null; 54 | } 55 | return null; 56 | } 57 | } -------------------------------------------------------------------------------- /Spring4-SSE/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /spring-jdbc/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /spring-kotlin/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /inyeccion-dependencia/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /spring5-reactive-kotlin/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /java-streams/src/main/java/windoctor7/github/io/streams/Product.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.streams; 2 | 3 | /** 4 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 17/04/17. 5 | * Este es solo el codigo base usado en el workshop "Conociendo al API Stream de Java 8" 6 | * que puedes encontrar en mi blog 7 | * https://windoctor7.github.io/API-Stream-Java8.html 8 | * 9 | * Ahi se encuentran toda una serie de ejercicios y explicaciones. 10 | * Este codigo es solo la base, no contiene los ejercicios descritos en el blog. 11 | */ 12 | public class Product implements Comparable{ 13 | private int id; 14 | private String name; 15 | private int supplier; 16 | private int category; 17 | private double unitPrice; 18 | private int unitsInStock; 19 | 20 | public int getId() { 21 | return id; 22 | } 23 | 24 | public void setId(int id) { 25 | this.id = id; 26 | } 27 | 28 | public String getName() { 29 | return name; 30 | } 31 | 32 | public void setName(String name) { 33 | this.name = name; 34 | } 35 | 36 | public int getSupplier() { 37 | return supplier; 38 | } 39 | 40 | public void setSupplier(int supplier) { 41 | this.supplier = supplier; 42 | } 43 | 44 | public int getCategory() { 45 | return category; 46 | } 47 | 48 | public void setCategory(int category) { 49 | this.category = category; 50 | } 51 | 52 | public double getUnitPrice() { 53 | return unitPrice; 54 | } 55 | 56 | public void setUnitPrice(double unitPrice) { 57 | this.unitPrice = unitPrice; 58 | } 59 | 60 | public int getUnitsInStock() { 61 | return unitsInStock; 62 | } 63 | 64 | public void setUnitsInStock(int unitsInStock) { 65 | this.unitsInStock = unitsInStock; 66 | } 67 | 68 | @Override 69 | public String toString() { 70 | return "Product{" + 71 | "id=" + id + 72 | ", name='" + name + '\'' + 73 | ", supplier=" + supplier + 74 | ", category=" + category + 75 | ", unitPrice=" + unitPrice + 76 | ", unitsInStock=" + unitsInStock + 77 | '}'; 78 | } 79 | 80 | 81 | @Override 82 | public int compareTo(Product p) { 83 | if(this.getUnitsInStock() < p.getUnitsInStock()) 84 | return -1; 85 | else if(this.getUnitsInStock() > p.getUnitsInStock()) 86 | return 1; 87 | else 88 | return 0; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /calculadora/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /java-streams/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /spring-async/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /spring-auth-jwt/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /spring-web-flux/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /spring-retry/ws-rest/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /spring-scheduler/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /spring-set-profile/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /spring-state-machine/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /spring-webflux-2/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /spring-retry/cliente-ws/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /Spring4-SSE/src/main/java/windoctor7/github/io/spring4/sse/Spring4SSE/JobExecutor.java: -------------------------------------------------------------------------------- 1 | package windoctor7.github.io.spring4.sse.Spring4SSE; 2 | 3 | import org.springframework.aop.support.AopUtils; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.context.ApplicationContext; 6 | import org.springframework.context.ApplicationEventPublisher; 7 | import org.springframework.context.event.EventListener; 8 | import org.springframework.scheduling.annotation.Scheduled; 9 | import org.springframework.stereotype.Component; 10 | import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; 11 | 12 | import java.io.IOException; 13 | import java.lang.reflect.Method; 14 | import java.util.Map; 15 | import java.util.concurrent.ConcurrentHashMap; 16 | 17 | /** 18 | * Creado por Ascari Q. Romo Pedraza - molder.itp@gmail.com on 08/10/17. 19 | */ 20 | @Component 21 | public class JobExecutor implements IJobExecutor{ 22 | 23 | @Autowired 24 | private ApplicationContext appContext; 25 | 26 | public final static Map EMITTERS = new ConcurrentHashMap<>(); 27 | 28 | public void executeBean(String beanClass) { 29 | Object bean = null; 30 | SseEmitter emitter = JobExecutor.EMITTERS.get(beanClass); 31 | try { 32 | //Cargamos la clase 33 | Class clazz = Class.forName(beanClass); 34 | bean = getExistingBean(clazz); 35 | 36 | //Si el Job no existe, mandamos un mensaje y completamos el emitter 37 | if (bean == null) { 38 | String msg = String.format("No existe ningún Job con el nombre: %s", bean); 39 | emitter.send(new Mensaje(3, msg)); 40 | emitter.complete(); 41 | } 42 | for (Method method : AopUtils.getTargetClass(bean).getMethods()) { 43 | if (method.isAnnotationPresent(Scheduled.class)) { 44 | method.invoke(bean); 45 | break; 46 | } 47 | } 48 | } 49 | catch (Exception e) { 50 | emitter.completeWithError(e); 51 | } 52 | } 53 | 54 | private Object getExistingBean(Class beanClass){ 55 | Object bean; 56 | bean = appContext.getBean(beanClass); 57 | 58 | return bean; 59 | 60 | } 61 | 62 | @EventListener 63 | public void eventListener(MensajeEvent mensajeEvent) throws IOException { 64 | String bean = mensajeEvent.getBeanClass(); 65 | SseEmitter emitter = JobExecutor.EMITTERS.get(bean); 66 | String msg = String.format("El Job %s ha finalizado correctamente", bean); 67 | emitter.send(new Mensaje(2,msg)); 68 | emitter.complete(); 69 | } 70 | } 71 | --------------------------------------------------------------------------------