From 35f8b6b52adaf6df93e0037c29b690292f480145 Mon Sep 17 00:00:00 2001 From: Fabio Formosa Date: Sat, 6 Feb 2021 19:22:31 +0100 Subject: [PATCH] Update README.md --- README.md | 111 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 96 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 3136a45..aeb67ce 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,9 @@ The UI Dashboard is composed by a management panel to set the quartz trigger, to ## QUICK START -##### Import Maven Dependency ##### +* add the dependency + +MAVEN ``` @@ -30,30 +32,109 @@ The UI Dashboard is composed by a management panel to set the quartz trigger, to quartz-manager-starter-ui 3.0.1 - - - - it.fabioformosa.quartz-manager - quartz-manager-starter-security - 3.0.1 - ``` -Import `quartz-manager-starter-ui` if you want use the Quartz Manager API by the angular frontend. -Import `quartz-manager-starter-security` if your webapp doesn't have spring security enabled and if you give access to Quartz Manager API and Quartz Manager UI only to authenticated users. - -##### Import Gradle Dependency ##### +GRADLE + ``` compile group: 'it.fabioformosa.quartz-manager', name: 'quartz-manager-starter-api', version: '3.0.1' //optionally compile group: 'it.fabioformosa.quartz-manager', name: 'quartz-manager-starter-ui', version: '3.0.1' -//optionally +``` +Import `quartz-manager-starter-ui` as well, if you want use the Quartz Manager API by the angular frontend. + +* add a `quartz.properties` file in the classpath (`src/main/resources`): + +``` +org.quartz.scheduler.instanceName=example +org.quartz.scheduler.instanceId=AUTO +org.quartz.threadPool.threadCount=1 +``` + + +* Create the job class that you want to schedule + + ``` + public class SampleJob extends AbstractLoggingJob { + + @Override + public LogRecord doIt(JobExecutionContext jobExecutionContext) { + return new LogRecord(LogType.INFO, "Hello from QuartManagerDemo!"); + } + +} +``` +Extend the super-class `AbstractLoggingJob` + + +* Enable quartz-manager adding into the application.yml: + +``` +quartz: + enabled: true + +job: + frequency: 4000 + repeatCount: 19 + +quartz-manager: + jobClass: +``` + +* frontend +If you've imported the `quartz-manager-starter-ui` you can open the UI at URL: +[http://localhost:8080/quartz-manager-ui/index.html](http://localhost:8080/quartz-manager-ui/index.html) + +* security +If you want enable a security layer and allow the access to the REST API and to the UI only to authenticated users, add the dependency: + +MAVEN + +``` + + it.fabioformosa.quartz-manager + quartz-manager-starter-security + 3.0.1 + +``` + +GRADLE + +``` compile group: 'it.fabioformosa.quartz-manager', name: 'quartz-manager-starter-security', version: '3.0.1' ``` -Import `quartz-manager-starter-ui` if you want use the Quartz Manager API by the angular frontend. -Import `quartz-manager-starter-security` if your webapp doesn't have spring security enabled and if you give access to Quartz Manager API and Quartz Manager UI only to authenticated users. + +and in your application.yml: + +``` +quartz-manager: + security: + login-model: + form-login-enabled: true + userpwd-filter-enabled : false + jwt: + enabled: true + secret: "PLEASE_TYPE_HERE_A_SECRET" + expiration-in-sec: 28800 # 8 hours + header-strategy: + enabled: false + header: "Authorization" + cookie-strategy: + enabled: true + cookie: AUTH-TOKEN + accounts: + in-memory: + enabled: true + users: + - name: admin + password: admin + roles: + - ADMIN + +``` + ## ROADMAP Open the [Project Roadmap](https://github.com/fabioformosa/quartz-manager/projects) to take a look at the plan of Quartz Manager.