diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..63c228a --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,18 @@ +name: Maven Build + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Build with Maven + run: mvn -B install --no-transfer-progress --file pom.xml diff --git a/.github/workflows/release-to-maven-central.yml b/.github/workflows/release-to-maven-central.yml new file mode 100644 index 0000000..3736315 --- /dev/null +++ b/.github/workflows/release-to-maven-central.yml @@ -0,0 +1,56 @@ +name: release-to-maven-central +on: + workflow_dispatch: + inputs: + releaseversion: + description: 'Release version' + required: true + default: '1.1.0' +jobs: + publish: + runs-on: ubuntu-latest + steps: + - run: echo "Will start a Maven Central upload with version ${{ github.event.inputs.releaseversion }}" + + - uses: actions/checkout@v2 + + - name: Set up settings.xml for Maven Central Repository + uses: actions/setup-java@v1 + with: + java-version: 11 + server-id: oss.sonatype.org + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + - name: Set projects Maven version to GitHub Action GUI set version + run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" --no-transfer-progress + + - name: Publish package + run: mvn --batch-mode clean deploy --no-transfer-progress -P central-deploy -DskipTests=true + env: + MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + + - name: Generate changelog + id: changelog + uses: metcalfc/changelog-generator@v0.4.4 + with: + myToken: ${{ secrets.GITHUB_TOKEN }} + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.event.inputs.releaseversion }} + release_name: ${{ github.event.inputs.releaseversion }} + body: | + Grab the new version from Maven central https://repo1.maven.org/maven2/de/codecentric/reedelk/module-scheduler/${{ github.event.inputs.releaseversion }}/ + ### Things that changed in this release + ${{ steps.changelog.outputs.changelog }} + draft: false + prerelease: false \ No newline at end of file diff --git a/pom.xml b/pom.xml index fec1de5..8200d15 100644 --- a/pom.xml +++ b/pom.xml @@ -5,13 +5,13 @@ 4.0.0 - com.reedelk + de.codecentric.reedelk module-parent - 1.0.6 + 2.0.0 bundle - 1.0.6 + 2.0.0 module-scheduler diff --git a/src/main/java/com/reedelk/scheduler/ModuleDefinition.java b/src/main/java/com/reedelk/scheduler/ModuleDefinition.java deleted file mode 100644 index dec8bc3..0000000 --- a/src/main/java/com/reedelk/scheduler/ModuleDefinition.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.reedelk.scheduler; - -import com.reedelk.runtime.api.annotation.Module; - -@Module("Scheduler Module") -public class ModuleDefinition { -} - diff --git a/src/main/java/com/reedelk/scheduler/internal/attribute/SchedulerAttributes.java b/src/main/java/com/reedelk/scheduler/internal/attribute/SchedulerAttributes.java deleted file mode 100644 index a17e461..0000000 --- a/src/main/java/com/reedelk/scheduler/internal/attribute/SchedulerAttributes.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.reedelk.scheduler.internal.attribute; - -import com.reedelk.runtime.api.annotation.Type; -import com.reedelk.runtime.api.annotation.TypeProperty; -import com.reedelk.runtime.api.message.MessageAttributes; -import org.quartz.JobExecutionContext; - -import static com.reedelk.scheduler.internal.attribute.SchedulerAttributes.FIRED_AT; - -@Type -@TypeProperty(name = FIRED_AT, type = long.class) -public class SchedulerAttributes extends MessageAttributes { - - static final String FIRED_AT = "firedAt"; - - public SchedulerAttributes(JobExecutionContext executionContext) { - put(FIRED_AT, executionContext.getFireTime().getTime()); - } -} diff --git a/src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategyScheduler.java b/src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategyScheduler.java deleted file mode 100644 index c8f9fc9..0000000 --- a/src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategyScheduler.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.reedelk.scheduler.internal.scheduler; - -import com.reedelk.runtime.api.component.InboundEventListener; - -public interface SchedulingStrategyScheduler { - - SchedulerJob schedule(InboundEventListener listener); -} diff --git a/src/main/java/de/codecentric/reedelk/scheduler/ModuleDefinition.java b/src/main/java/de/codecentric/reedelk/scheduler/ModuleDefinition.java new file mode 100644 index 0000000..ebbdf8b --- /dev/null +++ b/src/main/java/de/codecentric/reedelk/scheduler/ModuleDefinition.java @@ -0,0 +1,8 @@ +package de.codecentric.reedelk.scheduler; + +import de.codecentric.reedelk.runtime.api.annotation.Module; + +@Module("Scheduler Module") +public class ModuleDefinition { +} + diff --git a/src/main/java/com/reedelk/scheduler/component/CronConfiguration.java b/src/main/java/de/codecentric/reedelk/scheduler/component/CronConfiguration.java similarity index 99% rename from src/main/java/com/reedelk/scheduler/component/CronConfiguration.java rename to src/main/java/de/codecentric/reedelk/scheduler/component/CronConfiguration.java index 3ae55b2..002b9f9 100644 --- a/src/main/java/com/reedelk/scheduler/component/CronConfiguration.java +++ b/src/main/java/de/codecentric/reedelk/scheduler/component/CronConfiguration.java @@ -1,7 +1,7 @@ -package com.reedelk.scheduler.component; +package de.codecentric.reedelk.scheduler.component; -import com.reedelk.runtime.api.annotation.*; -import com.reedelk.runtime.api.component.Implementor; +import de.codecentric.reedelk.runtime.api.annotation.*; +import de.codecentric.reedelk.runtime.api.component.Implementor; import org.osgi.service.component.annotations.Component; import static org.osgi.service.component.annotations.ServiceScope.PROTOTYPE; diff --git a/src/main/java/com/reedelk/scheduler/component/FixedFrequencyConfiguration.java b/src/main/java/de/codecentric/reedelk/scheduler/component/FixedFrequencyConfiguration.java similarity index 89% rename from src/main/java/com/reedelk/scheduler/component/FixedFrequencyConfiguration.java rename to src/main/java/de/codecentric/reedelk/scheduler/component/FixedFrequencyConfiguration.java index 94d07e2..a7d3103 100644 --- a/src/main/java/com/reedelk/scheduler/component/FixedFrequencyConfiguration.java +++ b/src/main/java/de/codecentric/reedelk/scheduler/component/FixedFrequencyConfiguration.java @@ -1,7 +1,7 @@ -package com.reedelk.scheduler.component; +package de.codecentric.reedelk.scheduler.component; -import com.reedelk.runtime.api.annotation.*; -import com.reedelk.runtime.api.component.Implementor; +import de.codecentric.reedelk.runtime.api.annotation.*; +import de.codecentric.reedelk.runtime.api.component.Implementor; import org.osgi.service.component.annotations.Component; import static org.osgi.service.component.annotations.ServiceScope.PROTOTYPE; diff --git a/src/main/java/com/reedelk/scheduler/component/Scheduler.java b/src/main/java/de/codecentric/reedelk/scheduler/component/Scheduler.java similarity index 83% rename from src/main/java/com/reedelk/scheduler/component/Scheduler.java rename to src/main/java/de/codecentric/reedelk/scheduler/component/Scheduler.java index abaa47f..97651b1 100644 --- a/src/main/java/com/reedelk/scheduler/component/Scheduler.java +++ b/src/main/java/de/codecentric/reedelk/scheduler/component/Scheduler.java @@ -1,11 +1,11 @@ -package com.reedelk.scheduler.component; +package de.codecentric.reedelk.scheduler.component; -import com.reedelk.runtime.api.annotation.*; -import com.reedelk.runtime.api.component.AbstractInbound; -import com.reedelk.scheduler.internal.attribute.SchedulerAttributes; -import com.reedelk.scheduler.internal.scheduler.SchedulerJob; -import com.reedelk.scheduler.internal.scheduler.SchedulingStrategyBuilder; +import de.codecentric.reedelk.runtime.api.annotation.*; +import de.codecentric.reedelk.runtime.api.component.AbstractInbound; +import de.codecentric.reedelk.scheduler.internal.attribute.SchedulerAttributes; +import de.codecentric.reedelk.scheduler.internal.scheduler.SchedulerJob; +import de.codecentric.reedelk.scheduler.internal.scheduler.SchedulingStrategyBuilder; import org.osgi.service.component.annotations.Component; import static org.osgi.service.component.annotations.ServiceScope.PROTOTYPE; diff --git a/src/main/java/com/reedelk/scheduler/component/SchedulingStrategy.java b/src/main/java/de/codecentric/reedelk/scheduler/component/SchedulingStrategy.java similarity index 52% rename from src/main/java/com/reedelk/scheduler/component/SchedulingStrategy.java rename to src/main/java/de/codecentric/reedelk/scheduler/component/SchedulingStrategy.java index 1695ae7..db9f507 100644 --- a/src/main/java/com/reedelk/scheduler/component/SchedulingStrategy.java +++ b/src/main/java/de/codecentric/reedelk/scheduler/component/SchedulingStrategy.java @@ -1,6 +1,6 @@ -package com.reedelk.scheduler.component; +package de.codecentric.reedelk.scheduler.component; -import com.reedelk.runtime.api.annotation.DisplayName; +import de.codecentric.reedelk.runtime.api.annotation.DisplayName; public enum SchedulingStrategy { diff --git a/src/main/java/com/reedelk/scheduler/component/TimeUnit.java b/src/main/java/de/codecentric/reedelk/scheduler/component/TimeUnit.java similarity index 62% rename from src/main/java/com/reedelk/scheduler/component/TimeUnit.java rename to src/main/java/de/codecentric/reedelk/scheduler/component/TimeUnit.java index 9f82db1..dd360ca 100644 --- a/src/main/java/com/reedelk/scheduler/component/TimeUnit.java +++ b/src/main/java/de/codecentric/reedelk/scheduler/component/TimeUnit.java @@ -1,6 +1,6 @@ -package com.reedelk.scheduler.component; +package de.codecentric.reedelk.scheduler.component; -import com.reedelk.runtime.api.annotation.DisplayName; +import de.codecentric.reedelk.runtime.api.annotation.DisplayName; public enum TimeUnit { diff --git a/src/main/java/com/reedelk/scheduler/internal/SchedulerModuleActivator.java b/src/main/java/de/codecentric/reedelk/scheduler/internal/SchedulerModuleActivator.java similarity index 76% rename from src/main/java/com/reedelk/scheduler/internal/SchedulerModuleActivator.java rename to src/main/java/de/codecentric/reedelk/scheduler/internal/SchedulerModuleActivator.java index 3af553d..3894445 100644 --- a/src/main/java/com/reedelk/scheduler/internal/SchedulerModuleActivator.java +++ b/src/main/java/de/codecentric/reedelk/scheduler/internal/SchedulerModuleActivator.java @@ -1,6 +1,6 @@ -package com.reedelk.scheduler.internal; +package de.codecentric.reedelk.scheduler.internal; -import com.reedelk.scheduler.internal.scheduler.SchedulerProvider; +import de.codecentric.reedelk.scheduler.internal.scheduler.SchedulerProvider; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Deactivate; diff --git a/src/main/java/de/codecentric/reedelk/scheduler/internal/attribute/SchedulerAttributes.java b/src/main/java/de/codecentric/reedelk/scheduler/internal/attribute/SchedulerAttributes.java new file mode 100644 index 0000000..80e25ab --- /dev/null +++ b/src/main/java/de/codecentric/reedelk/scheduler/internal/attribute/SchedulerAttributes.java @@ -0,0 +1,19 @@ +package de.codecentric.reedelk.scheduler.internal.attribute; + +import de.codecentric.reedelk.runtime.api.annotation.Type; +import de.codecentric.reedelk.runtime.api.annotation.TypeProperty; +import de.codecentric.reedelk.runtime.api.message.MessageAttributes; +import org.quartz.JobExecutionContext; + +import static de.codecentric.reedelk.scheduler.internal.attribute.SchedulerAttributes.FIRED_AT; + +@Type +@TypeProperty(name = FIRED_AT, type = long.class) +public class SchedulerAttributes extends MessageAttributes { + + static final String FIRED_AT = "firedAt"; + + public SchedulerAttributes(JobExecutionContext executionContext) { + put(FIRED_AT, executionContext.getFireTime().getTime()); + } +} diff --git a/src/main/java/com/reedelk/scheduler/internal/scheduler/ExecuteFlowJob.java b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/ExecuteFlowJob.java similarity index 64% rename from src/main/java/com/reedelk/scheduler/internal/scheduler/ExecuteFlowJob.java rename to src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/ExecuteFlowJob.java index cef5d7e..2fa3435 100644 --- a/src/main/java/com/reedelk/scheduler/internal/scheduler/ExecuteFlowJob.java +++ b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/ExecuteFlowJob.java @@ -1,17 +1,15 @@ -package com.reedelk.scheduler.internal.scheduler; - -import com.reedelk.runtime.api.component.InboundEventListener; -import com.reedelk.runtime.api.message.Message; -import com.reedelk.runtime.api.message.MessageAttributes; -import com.reedelk.runtime.api.message.MessageBuilder; -import com.reedelk.scheduler.component.Scheduler; -import com.reedelk.scheduler.internal.attribute.SchedulerAttributes; +package de.codecentric.reedelk.scheduler.internal.scheduler; + +import de.codecentric.reedelk.runtime.api.component.InboundEventListener; +import de.codecentric.reedelk.runtime.api.message.Message; +import de.codecentric.reedelk.runtime.api.message.MessageAttributes; +import de.codecentric.reedelk.runtime.api.message.MessageBuilder; +import de.codecentric.reedelk.scheduler.component.Scheduler; +import de.codecentric.reedelk.scheduler.internal.attribute.SchedulerAttributes; import org.quartz.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static com.reedelk.scheduler.internal.scheduler.Messages.Scheduler.ERROR_QUARTZ_CONTEXT; - public class ExecuteFlowJob implements Job { private static final Logger logger = LoggerFactory.getLogger(ExecuteFlowJob.class); @@ -30,7 +28,7 @@ public void execute(JobExecutionContext jobExecutionContext) throws JobExecution try { context = jobExecutionContext.getScheduler().getContext(); } catch (SchedulerException exception) { - String message = ERROR_QUARTZ_CONTEXT.format(exception.getMessage()); + String message = Messages.Scheduler.ERROR_QUARTZ_CONTEXT.format(exception.getMessage()); logger.error(message, exception); throw new JobExecutionException(exception); } diff --git a/src/main/java/com/reedelk/scheduler/internal/scheduler/Messages.java b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/Messages.java similarity index 89% rename from src/main/java/com/reedelk/scheduler/internal/scheduler/Messages.java rename to src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/Messages.java index e462dbc..4468e01 100644 --- a/src/main/java/com/reedelk/scheduler/internal/scheduler/Messages.java +++ b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/Messages.java @@ -1,6 +1,6 @@ -package com.reedelk.scheduler.internal.scheduler; +package de.codecentric.reedelk.scheduler.internal.scheduler; -import com.reedelk.runtime.api.commons.FormattedMessage; +import de.codecentric.reedelk.runtime.api.commons.FormattedMessage; public class Messages { diff --git a/src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulerJob.java b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulerJob.java similarity index 80% rename from src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulerJob.java rename to src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulerJob.java index f426920..ece4dd9 100644 --- a/src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulerJob.java +++ b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulerJob.java @@ -1,4 +1,4 @@ -package com.reedelk.scheduler.internal.scheduler; +package de.codecentric.reedelk.scheduler.internal.scheduler; import org.quartz.JobKey; diff --git a/src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulerProvider.java b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulerProvider.java similarity index 77% rename from src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulerProvider.java rename to src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulerProvider.java index a6a6a4a..086ad33 100644 --- a/src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulerProvider.java +++ b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulerProvider.java @@ -1,7 +1,7 @@ -package com.reedelk.scheduler.internal.scheduler; +package de.codecentric.reedelk.scheduler.internal.scheduler; -import com.reedelk.runtime.api.component.InboundEventListener; -import com.reedelk.runtime.api.exception.PlatformException; +import de.codecentric.reedelk.runtime.api.component.InboundEventListener; +import de.codecentric.reedelk.runtime.api.exception.PlatformException; import org.quartz.*; import org.quartz.impl.StdSchedulerFactory; import org.slf4j.Logger; @@ -9,8 +9,6 @@ import java.util.Optional; -import static com.reedelk.scheduler.internal.scheduler.Messages.Scheduler.*; - public class SchedulerProvider { private static final Logger logger = LoggerFactory.getLogger(SchedulerProvider.class); @@ -21,7 +19,7 @@ public class SchedulerProvider { quartzScheduler = new StdSchedulerFactory().getScheduler(); quartzScheduler.start(); } catch (SchedulerException exception) { - String message = ERROR_QUARTZ_SCHEDULER_INIT.format(exception.getMessage()); + String message = Messages.Scheduler.ERROR_QUARTZ_SCHEDULER_INIT.format(exception.getMessage()); throw new PlatformException(message, exception); } } @@ -42,7 +40,7 @@ public static void dispose() { } quartzScheduler = null; } catch (SchedulerException exception) { - String message = ERROR_QUARTZ_SCHEDULER_DISPOSE.format(exception.getMessage()); + String message = Messages.Scheduler.ERROR_QUARTZ_SCHEDULER_DISPOSE.format(exception.getMessage()); logger.warn(message, exception); } } @@ -62,7 +60,7 @@ void deleteJob(JobKey jobKey) { quartzScheduler.checkExists(jobKey); quartzScheduler.deleteJob(jobKey); } catch (SchedulerException exception) { - String message = ERROR_DELETE_JOB.format(jobKey.toString(), exception.getMessage()); + String message = Messages.Scheduler.ERROR_DELETE_JOB.format(jobKey.toString(), exception.getMessage()); logger.warn(message, exception); } } @@ -76,7 +74,7 @@ void scheduleJob(InboundEventListener listener, JobDetail job, Trigger trigger) // Cleanup getContext().ifPresent(schedulerContext -> schedulerContext.remove(jobID)); deleteJob(job.getKey()); - String message = ERROR_SCHEDULE_JOB.format(jobID, exception.getMessage()); + String message = Messages.Scheduler.ERROR_SCHEDULE_JOB.format(jobID, exception.getMessage()); throw new PlatformException(message, exception); } } @@ -85,7 +83,7 @@ private Optional getContext() { try { return Optional.ofNullable(quartzScheduler.getContext()); } catch (SchedulerException exception) { - String message = ERROR_QUARTZ_CONTEXT.format(exception.getMessage()); + String message = Messages.Scheduler.ERROR_QUARTZ_CONTEXT.format(exception.getMessage()); logger.warn(message, exception); return Optional.empty(); } diff --git a/src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategyBuilder.java b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategyBuilder.java similarity index 74% rename from src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategyBuilder.java rename to src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategyBuilder.java index c254bb3..f07932a 100644 --- a/src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategyBuilder.java +++ b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategyBuilder.java @@ -1,13 +1,13 @@ -package com.reedelk.scheduler.internal.scheduler; +package de.codecentric.reedelk.scheduler.internal.scheduler; -import com.reedelk.scheduler.component.CronConfiguration; -import com.reedelk.scheduler.component.FixedFrequencyConfiguration; -import com.reedelk.scheduler.component.Scheduler; -import com.reedelk.scheduler.component.SchedulingStrategy; +import de.codecentric.reedelk.scheduler.component.CronConfiguration; +import de.codecentric.reedelk.scheduler.component.FixedFrequencyConfiguration; +import de.codecentric.reedelk.scheduler.component.Scheduler; +import de.codecentric.reedelk.scheduler.component.SchedulingStrategy; -import static com.reedelk.runtime.api.commons.ComponentPrecondition.Configuration.requireNotNull; -import static com.reedelk.runtime.api.commons.ComponentPrecondition.Configuration.requireTrue; -import static com.reedelk.scheduler.internal.scheduler.Messages.Scheduler.*; +import static de.codecentric.reedelk.runtime.api.commons.ComponentPrecondition.Configuration.requireNotNull; +import static de.codecentric.reedelk.runtime.api.commons.ComponentPrecondition.Configuration.requireTrue; +import static de.codecentric.reedelk.scheduler.internal.scheduler.Messages.Scheduler.*; public class SchedulingStrategyBuilder { diff --git a/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategyScheduler.java b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategyScheduler.java new file mode 100644 index 0000000..2a57329 --- /dev/null +++ b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategyScheduler.java @@ -0,0 +1,8 @@ +package de.codecentric.reedelk.scheduler.internal.scheduler; + +import de.codecentric.reedelk.runtime.api.component.InboundEventListener; + +public interface SchedulingStrategyScheduler { + + SchedulerJob schedule(InboundEventListener listener); +} diff --git a/src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerCron.java b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerCron.java similarity index 77% rename from src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerCron.java rename to src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerCron.java index bc1721a..c256c87 100644 --- a/src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerCron.java +++ b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerCron.java @@ -1,8 +1,8 @@ -package com.reedelk.scheduler.internal.scheduler; +package de.codecentric.reedelk.scheduler.internal.scheduler; -import com.reedelk.runtime.api.commons.StringUtils; -import com.reedelk.runtime.api.component.InboundEventListener; -import com.reedelk.scheduler.component.CronConfiguration; +import de.codecentric.reedelk.runtime.api.commons.StringUtils; +import de.codecentric.reedelk.runtime.api.component.InboundEventListener; +import de.codecentric.reedelk.scheduler.component.CronConfiguration; import org.quartz.JobBuilder; import org.quartz.JobDetail; import org.quartz.Trigger; @@ -10,7 +10,6 @@ import java.util.TimeZone; -import static com.reedelk.scheduler.component.CronConfiguration.SYSTEM_TIMEZONE; import static org.quartz.CronScheduleBuilder.cronSchedule; class SchedulingStrategySchedulerCron implements SchedulingStrategyScheduler { @@ -40,7 +39,7 @@ void scheduleJob(InboundEventListener listener, JobDetail job, Trigger trigger) TimeZone getTimeZoneOrDefault() { String timeZone = configuration.getTimeZone(); - if (StringUtils.isBlank(timeZone) || SYSTEM_TIMEZONE.equals(timeZone)) { + if (StringUtils.isBlank(timeZone) || CronConfiguration.SYSTEM_TIMEZONE.equals(timeZone)) { return TimeZone.getDefault(); } else { return TimeZone.getTimeZone(timeZone); diff --git a/src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerFixedFrequency.java b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerFixedFrequency.java similarity index 90% rename from src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerFixedFrequency.java rename to src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerFixedFrequency.java index aa8bf6f..5a719fc 100644 --- a/src/main/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerFixedFrequency.java +++ b/src/main/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerFixedFrequency.java @@ -1,8 +1,8 @@ -package com.reedelk.scheduler.internal.scheduler; +package de.codecentric.reedelk.scheduler.internal.scheduler; -import com.reedelk.runtime.api.component.InboundEventListener; -import com.reedelk.scheduler.component.FixedFrequencyConfiguration; -import com.reedelk.scheduler.component.TimeUnit; +import de.codecentric.reedelk.runtime.api.component.InboundEventListener; +import de.codecentric.reedelk.scheduler.component.FixedFrequencyConfiguration; +import de.codecentric.reedelk.scheduler.component.TimeUnit; import org.quartz.*; import java.util.Date; diff --git a/src/main/resources/com.reedelk.scheduler.component.Scheduler-icon.png b/src/main/resources/de.codecentric.reedelk.scheduler.component.Scheduler-icon.png similarity index 100% rename from src/main/resources/com.reedelk.scheduler.component.Scheduler-icon.png rename to src/main/resources/de.codecentric.reedelk.scheduler.component.Scheduler-icon.png diff --git a/src/main/resources/com.reedelk.scheduler.component.Scheduler.png b/src/main/resources/de.codecentric.reedelk.scheduler.component.Scheduler.png similarity index 100% rename from src/main/resources/com.reedelk.scheduler.component.Scheduler.png rename to src/main/resources/de.codecentric.reedelk.scheduler.component.Scheduler.png diff --git a/src/main/resources/module-descriptor.json b/src/main/resources/module-descriptor.json index c3cbc81..1d53efc 100644 --- a/src/main/resources/module-descriptor.json +++ b/src/main/resources/module-descriptor.json @@ -1 +1 @@ -{"name":"module-scheduler","displayName":"Scheduler Module","version":"1.0.6","components":[{"hidden":false,"displayName":"Scheduler","description":"The Scheduler component can be used to fire flow events at regular intervals or fires events according to the given cron expression. The Scheduler is an Inbound component and it can only be placed at the beginning of a flow.","fullyQualifiedName":"com.reedelk.scheduler.component.Scheduler","type":"INBOUND","output":{"description":"","dynamicPropertyName":"","payload":["java.lang.Void"],"attributes":["com.reedelk.scheduler.internal.attribute.SchedulerAttributes"]},"properties":[{"mandatory":false,"name":"strategy","example":"CRON","initValue":"FIXED_FREQUENCY","description":"There are two possible execution strategies for a scheduler: \u003ci\u003eFixed Frequency\u003c/i\u003e fires flow events at regular intervals. \u003ci\u003eCron\u003c/i\u003e fires events according to the given cron expression.","displayName":"Strategy","defaultValue":"FIXED_FREQUENCY","type":{"classname":"com.reedelk.module.descriptor.model.property.EnumDescriptor","instance":{"nameAndDisplayNameMap":{"CRON":"Cron","FIXED_FREQUENCY":"Fixed Frequency"},"type":"java.lang.Enum"}},"whens":[]},{"mandatory":false,"name":"fixedFrequencyConfig","initValue":"###USE_DEFAULT_VALUE###","displayName":"Fixed Frequency Configuration","type":{"classname":"com.reedelk.module.descriptor.model.property.ObjectDescriptor","instance":{"shared":"NO","collapsible":"NO","typeFullyQualifiedName":"com.reedelk.scheduler.component.FixedFrequencyConfiguration","objectProperties":[{"mandatory":false,"name":"period","example":"2500","initValue":"1000","hintValue":"1000","description":"The frequency at which the Scheduler triggers the flow. The value in this field depends on the \u003ci\u003eTime Unit\u003c/i\u003e property.","displayName":"Frequency","defaultValue":"1000","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"int"}},"whens":[]},{"mandatory":false,"name":"timeUnit","example":"SECONDS","initValue":"MILLISECONDS","description":"The Time Unit the Frequency value is expressed. Possible values are: \u003cb\u003eMILLISECONDS\u003c/b\u003e, \u003cb\u003eHOURS\u003c/b\u003e, \u003cb\u003eMINUTES\u003c/b\u003e, \u003cb\u003eSECONDS\u003c/b\u003e.","displayName":"Time unit","defaultValue":"MILLISECONDS","type":{"classname":"com.reedelk.module.descriptor.model.property.EnumDescriptor","instance":{"nameAndDisplayNameMap":{"MILLISECONDS":"Milliseconds","HOURS":"Hours","SECONDS":"Seconds","MINUTES":"Minutes"},"type":"java.lang.Enum"}},"whens":[]},{"mandatory":false,"name":"delay","example":"1500","initValue":"###USE_DEFAULT_VALUE###","hintValue":"1500","description":"The amount of time to wait before triggering the first event.","displayName":"Start delay","defaultValue":"0","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"int"}},"whens":[]}],"type":"com.reedelk.module.descriptor.model.property.ObjectDescriptor$TypeObject"}},"whens":[{"propertyName":"strategy","propertyValue":"FIXED_FREQUENCY"}]},{"mandatory":false,"name":"cronConfig","initValue":"###USE_DEFAULT_VALUE###","displayName":"Cron Configuration","type":{"classname":"com.reedelk.module.descriptor.model.property.ObjectDescriptor","instance":{"shared":"NO","collapsible":"NO","typeFullyQualifiedName":"com.reedelk.scheduler.component.CronConfiguration","objectProperties":[{"mandatory":false,"name":"expression","example":"0 15 10 * * ? 2020 Run at 10:15 a.m., every day during the year 2020","initValue":"* * * ? * *","hintValue":"* * * ? * *","description":"A valid cron expression to be used to trigger the scheduler e.g \u003ci\u003e0 15 10 * * ? 2020\u003c/i\u003e Run at 10:15 a.m., every day during the year 2020.","displayName":"Expression","type":{"classname":"com.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.String"}},"whens":[]},{"mandatory":false,"name":"timeZone","example":"Europe/Brussels","initValue":"###USE_DEFAULT_VALUE###","description":"Sets the time zone of the cron expression.","displayName":"Time Zone","defaultValue":"System timezone","type":{"classname":"com.reedelk.module.descriptor.model.property.ComboDescriptor","instance":{"editable":true,"prototype":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","comboValues":["System timezone","Asia/Aden","America/Cuiaba","Etc/GMT+9","Etc/GMT+8","Africa/Nairobi","America/Marigot","Asia/Aqtau","Pacific/Kwajalein","America/El_Salvador","Asia/Pontianak","Africa/Cairo","Pacific/Pago_Pago","Africa/Mbabane","Asia/Kuching","Pacific/Honolulu","Pacific/Rarotonga","America/Guatemala","Australia/Hobart","Europe/London","America/Belize","America/Panama","Asia/Chungking","America/Managua","America/Indiana/Petersburg","Asia/Yerevan","Europe/Brussels","GMT","Europe/Warsaw","America/Chicago","Asia/Kashgar","Chile/Continental","Pacific/Yap","CET","Etc/GMT-1","Etc/GMT-0","Europe/Jersey","America/Tegucigalpa","Etc/GMT-5","Europe/Istanbul","America/Eirunepe","Etc/GMT-4","America/Miquelon","Etc/GMT-3","Europe/Luxembourg","Etc/GMT-2","Etc/GMT-9","America/Argentina/Catamarca","Etc/GMT-8","Etc/GMT-7","Etc/GMT-6","Europe/Zaporozhye","Canada/Yukon","Canada/Atlantic","Atlantic/St_Helena","Australia/Tasmania","Libya","Europe/Guernsey","America/Grand_Turk","US/Pacific-New","Asia/Samarkand","America/Argentina/Cordoba","Asia/Phnom_Penh","Africa/Kigali","Asia/Almaty","US/Alaska","Asia/Dubai","Europe/Isle_of_Man","America/Araguaina","Cuba","Asia/Novosibirsk","America/Argentina/Salta","Etc/GMT+3","Africa/Tunis","Etc/GMT+2","Etc/GMT+1","Pacific/Fakaofo","Africa/Tripoli","Etc/GMT+0","Israel","Africa/Banjul","Etc/GMT+7","Indian/Comoro","Etc/GMT+6","Etc/GMT+5","Etc/GMT+4","Pacific/Port_Moresby","US/Arizona","Antarctica/Syowa","Indian/Reunion","Pacific/Palau","Europe/Kaliningrad","America/Montevideo","Africa/Windhoek","Asia/Karachi","Africa/Mogadishu","Australia/Perth","Brazil/East","Etc/GMT","Asia/Chita","Pacific/Easter","Antarctica/Davis","Antarctica/McMurdo","Asia/Macao","America/Manaus","Africa/Freetown","Europe/Bucharest","America/Argentina/Mendoza","Asia/Macau","Europe/Malta","Mexico/BajaSur","Pacific/Tahiti","Africa/Asmera","Europe/Busingen","America/Argentina/Rio_Gallegos","Africa/Malabo","Europe/Skopje","America/Catamarca","America/Godthab","Europe/Sarajevo","Australia/ACT","GB-Eire","Africa/Lagos","America/Cordoba","Europe/Rome","Asia/Dacca","Indian/Mauritius","Pacific/Samoa","America/Regina","America/Fort_Wayne","America/Dawson_Creek","Africa/Algiers","Europe/Mariehamn","America/St_Johns","America/St_Thomas","Europe/Zurich","America/Anguilla","Asia/Dili","America/Denver","Africa/Bamako","GB","Mexico/General","Pacific/Wallis","Europe/Gibraltar","Africa/Conakry","Africa/Lubumbashi","Asia/Istanbul","America/Havana","NZ-CHAT","Asia/Choibalsan","America/Porto_Acre","Asia/Omsk","Europe/Vaduz","US/Michigan","Asia/Dhaka","America/Barbados","Europe/Tiraspol","Atlantic/Cape_Verde","Asia/Yekaterinburg","America/Louisville","Pacific/Johnston","Pacific/Chatham","Europe/Ljubljana","America/Sao_Paulo","Asia/Jayapura","America/Curacao","Asia/Dushanbe","America/Guyana","America/Guayaquil","America/Martinique","Portugal","Europe/Berlin","Europe/Moscow","Europe/Chisinau","America/Puerto_Rico","America/Rankin_Inlet","Pacific/Ponape","Europe/Stockholm","Europe/Budapest","America/Argentina/Jujuy","Australia/Eucla","Asia/Shanghai","Universal","Europe/Zagreb","America/Port_of_Spain","Europe/Helsinki","Asia/Beirut","Asia/Tel_Aviv","Pacific/Bougainville","US/Central","Africa/Sao_Tome","Indian/Chagos","America/Cayenne","Asia/Yakutsk","Pacific/Galapagos","Australia/North","Europe/Paris","Africa/Ndjamena","Pacific/Fiji","America/Rainy_River","Indian/Maldives","Australia/Yancowinna","SystemV/AST4","Asia/Oral","America/Yellowknife","Pacific/Enderbury","America/Juneau","Australia/Victoria","America/Indiana/Vevay","Asia/Tashkent","Asia/Jakarta","Africa/Ceuta","America/Recife","America/Buenos_Aires","America/Noronha","America/Swift_Current","Australia/Adelaide","America/Metlakatla","Africa/Djibouti","America/Paramaribo","Europe/Simferopol","Europe/Sofia","Africa/Nouakchott","Europe/Prague","America/Indiana/Vincennes","Antarctica/Mawson","America/Kralendijk","Antarctica/Troll","Europe/Samara","Indian/Christmas","America/Antigua","Pacific/Gambier","America/Indianapolis","America/Inuvik","America/Iqaluit","Pacific/Funafuti","UTC","Antarctica/Macquarie","Canada/Pacific","America/Moncton","Africa/Gaborone","Pacific/Chuuk","Asia/Pyongyang","America/St_Vincent","Asia/Gaza","Etc/Universal","PST8PDT","Atlantic/Faeroe","Asia/Qyzylorda","Canada/Newfoundland","America/Kentucky/Louisville","America/Yakutat","Asia/Ho_Chi_Minh","Antarctica/Casey","Europe/Copenhagen","Africa/Asmara","Atlantic/Azores","Europe/Vienna","ROK","Pacific/Pitcairn","America/Mazatlan","Australia/Queensland","Pacific/Nauru","Europe/Tirane","Asia/Kolkata","SystemV/MST7","Australia/Canberra","MET","Australia/Broken_Hill","Europe/Riga","America/Dominica","Africa/Abidjan","America/Mendoza","America/Santarem","Kwajalein","America/Asuncion","Asia/Ulan_Bator","NZ","America/Boise","Australia/Currie","EST5EDT","Pacific/Guam","Pacific/Wake","Atlantic/Bermuda","America/Costa_Rica","America/Dawson","Asia/Chongqing","Eire","Europe/Amsterdam","America/Indiana/Knox","America/North_Dakota/Beulah","Africa/Accra","Atlantic/Faroe","Mexico/BajaNorte","America/Maceio","Etc/UCT","Pacific/Apia","America/Atka","Pacific/Niue","Canada/East-Saskatchewan","Australia/Lord_Howe","Europe/Dublin","Pacific/Truk","MST7MDT","America/Monterrey","America/Nassau","America/Jamaica","Asia/Bishkek","America/Atikokan","Atlantic/Stanley","Australia/NSW","US/Hawaii","SystemV/CST6","Indian/Mahe","Asia/Aqtobe","America/Sitka","Asia/Vladivostok","Africa/Libreville","Africa/Maputo","Zulu","America/Kentucky/Monticello","Africa/El_Aaiun","Africa/Ouagadougou","America/Coral_Harbour","Pacific/Marquesas","Brazil/West","America/Aruba","America/North_Dakota/Center","America/Cayman","Asia/Ulaanbaatar","Asia/Baghdad","Europe/San_Marino","America/Indiana/Tell_City","America/Tijuana","Pacific/Saipan","SystemV/YST9","Africa/Douala","America/Chihuahua","America/Ojinaga","Asia/Hovd","America/Anchorage","Chile/EasterIsland","America/Halifax","Antarctica/Rothera","America/Indiana/Indianapolis","US/Mountain","Asia/Damascus","America/Argentina/San_Luis","America/Santiago","Asia/Baku","America/Argentina/Ushuaia","Atlantic/Reykjavik","Africa/Brazzaville","Africa/Porto-Novo","America/La_Paz","Antarctica/DumontDUrville","Asia/Taipei","Antarctica/South_Pole","Asia/Manila","Asia/Bangkok","Africa/Dar_es_Salaam","Poland","Atlantic/Madeira","Antarctica/Palmer","America/Thunder_Bay","Africa/Addis_Ababa","Europe/Uzhgorod","Brazil/DeNoronha","Asia/Ashkhabad","Etc/Zulu","America/Indiana/Marengo","America/Creston","America/Mexico_City","Antarctica/Vostok","Asia/Jerusalem","Europe/Andorra","US/Samoa","PRC","Asia/Vientiane","Pacific/Kiritimati","America/Matamoros","America/Blanc-Sablon","Asia/Riyadh","Iceland","Pacific/Pohnpei","Asia/Ujung_Pandang","Atlantic/South_Georgia","Europe/Lisbon","Asia/Harbin","Europe/Oslo","Asia/Novokuznetsk","CST6CDT","Atlantic/Canary","America/Knox_IN","Asia/Kuwait","SystemV/HST10","Pacific/Efate","Africa/Lome","America/Bogota","America/Menominee","America/Adak","Pacific/Norfolk","America/Resolute","Pacific/Tarawa","Africa/Kampala","Asia/Krasnoyarsk","Greenwich","SystemV/EST5","America/Edmonton","Europe/Podgorica","Australia/South","Canada/Central","Africa/Bujumbura","America/Santo_Domingo","US/Eastern","Europe/Minsk","Pacific/Auckland","Africa/Casablanca","America/Glace_Bay","Canada/Eastern","Asia/Qatar","Europe/Kiev","Singapore","Asia/Magadan","SystemV/PST8","America/Port-au-Prince","Europe/Belfast","America/St_Barthelemy","Asia/Ashgabat","Africa/Luanda","America/Nipigon","Atlantic/Jan_Mayen","Brazil/Acre","Asia/Muscat","Asia/Bahrain","Europe/Vilnius","America/Fortaleza","Etc/GMT0","US/East-Indiana","America/Hermosillo","America/Cancun","Africa/Maseru","Pacific/Kosrae","Africa/Kinshasa","Asia/Kathmandu","Asia/Seoul","Australia/Sydney","America/Lima","Australia/LHI","America/St_Lucia","Europe/Madrid","America/Bahia_Banderas","America/Montserrat","Asia/Brunei","America/Santa_Isabel","Canada/Mountain","America/Cambridge_Bay","Asia/Colombo","Australia/West","Indian/Antananarivo","Australia/Brisbane","Indian/Mayotte","US/Indiana-Starke","Asia/Urumqi","US/Aleutian","Europe/Volgograd","America/Lower_Princes","America/Vancouver","Africa/Blantyre","America/Rio_Branco","America/Danmarkshavn","America/Detroit","America/Thule","Africa/Lusaka","Asia/Hong_Kong","Iran","America/Argentina/La_Rioja","Africa/Dakar","SystemV/CST6CDT","America/Tortola","America/Porto_Velho","Asia/Sakhalin","Etc/GMT+10","America/Scoresbysund","Asia/Kamchatka","Asia/Thimbu","Africa/Harare","Etc/GMT+12","Etc/GMT+11","Navajo","America/Nome","Europe/Tallinn","Turkey","Africa/Khartoum","Africa/Johannesburg","Africa/Bangui","Europe/Belgrade","Jamaica","Africa/Bissau","Asia/Tehran","WET","Africa/Juba","America/Campo_Grande","America/Belem","Etc/Greenwich","Asia/Saigon","America/Ensenada","Pacific/Midway","America/Jujuy","Africa/Timbuktu","America/Bahia","America/Goose_Bay","America/Virgin","America/Pangnirtung","Asia/Katmandu","America/Phoenix","Africa/Niamey","America/Whitehorse","Pacific/Noumea","Asia/Tbilisi","America/Montreal","Asia/Makassar","America/Argentina/San_Juan","Hongkong","UCT","Asia/Nicosia","America/Indiana/Winamac","SystemV/MST7MDT","America/Argentina/ComodRivadavia","America/Boa_Vista","America/Grenada","Australia/Darwin","Asia/Khandyga","Asia/Kuala_Lumpur","Asia/Thimphu","Asia/Rangoon","Europe/Bratislava","Asia/Calcutta","America/Argentina/Tucuman","Asia/Kabul","Indian/Cocos","Japan","Pacific/Tongatapu","America/New_York","Etc/GMT-12","Etc/GMT-11","Etc/GMT-10","SystemV/YST9YDT","Etc/GMT-14","Etc/GMT-13","W-SU","America/Merida","EET","America/Rosario","Canada/Saskatchewan","America/St_Kitts","Arctic/Longyearbyen","America/Caracas","America/Guadeloupe","Asia/Hebron","Indian/Kerguelen","SystemV/PST8PDT","Africa/Monrovia","Asia/Ust-Nera","Egypt","Asia/Srednekolymsk","America/North_Dakota/New_Salem","Asia/Anadyr","Australia/Melbourne","Asia/Irkutsk","America/Shiprock","America/Winnipeg","Europe/Vatican","Asia/Amman","Etc/UTC","SystemV/AST4ADT","Asia/Tokyo","America/Toronto","Asia/Singapore","Australia/Lindeman","America/Los_Angeles","SystemV/EST5EDT","Pacific/Majuro","America/Argentina/Buenos_Aires","Europe/Nicosia","Pacific/Guadalcanal","Europe/Athens","US/Pacific","Europe/Monaco"],"type":"com.reedelk.runtime.api.annotation.Combo"}},"whens":[]}],"type":"com.reedelk.module.descriptor.model.property.ObjectDescriptor$TypeObject"}},"whens":[{"propertyName":"strategy","propertyValue":"CRON"}]}]}],"types":[{"global":false,"type":"com.reedelk.scheduler.internal.attribute.SchedulerAttributes","extendsType":"com.reedelk.runtime.api.message.MessageAttributes","description":"","mapKeyType":"java.lang.Object","mapValueType":"java.lang.Object","functions":[],"properties":[{"name":"firedAt","type":"long","example":"","description":""}]}]} \ No newline at end of file +{"name":"module-scheduler","displayName":"Scheduler Module","version":"1.1.0","components":[{"hidden":false,"displayName":"Scheduler","description":"The Scheduler component can be used to fire flow events at regular intervals or fires events according to the given cron expression. The Scheduler is an Inbound component and it can only be placed at the beginning of a flow.","fullyQualifiedName":"de.codecentric.reedelk.scheduler.component.Scheduler","type":"INBOUND","output":{"description":"","dynamicPropertyName":"","payload":["java.lang.Void"],"attributes":["de.codecentric.reedelk.scheduler.internal.attribute.SchedulerAttributes"]},"properties":[{"mandatory":false,"name":"strategy","example":"CRON","initValue":"FIXED_FREQUENCY","description":"There are two possible execution strategies for a scheduler: \u003ci\u003eFixed Frequency\u003c/i\u003e fires flow events at regular intervals. \u003ci\u003eCron\u003c/i\u003e fires events according to the given cron expression.","displayName":"Strategy","defaultValue":"FIXED_FREQUENCY","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.EnumDescriptor","instance":{"nameAndDisplayNameMap":{"CRON":"Cron","FIXED_FREQUENCY":"Fixed Frequency"},"type":"java.lang.Enum"}},"whens":[]},{"mandatory":false,"name":"fixedFrequencyConfig","initValue":"###USE_DEFAULT_VALUE###","displayName":"Fixed Frequency Configuration","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.ObjectDescriptor","instance":{"shared":"NO","collapsible":"NO","typeFullyQualifiedName":"de.codecentric.reedelk.scheduler.component.FixedFrequencyConfiguration","objectProperties":[{"mandatory":false,"name":"period","example":"2500","initValue":"1000","hintValue":"1000","description":"The frequency at which the Scheduler triggers the flow. The value in this field depends on the \u003ci\u003eTime Unit\u003c/i\u003e property.","displayName":"Frequency","defaultValue":"1000","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"int"}},"whens":[]},{"mandatory":false,"name":"timeUnit","example":"SECONDS","initValue":"MILLISECONDS","description":"The Time Unit the Frequency value is expressed. Possible values are: \u003cb\u003eMILLISECONDS\u003c/b\u003e, \u003cb\u003eHOURS\u003c/b\u003e, \u003cb\u003eMINUTES\u003c/b\u003e, \u003cb\u003eSECONDS\u003c/b\u003e.","displayName":"Time unit","defaultValue":"MILLISECONDS","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.EnumDescriptor","instance":{"nameAndDisplayNameMap":{"MILLISECONDS":"Milliseconds","HOURS":"Hours","SECONDS":"Seconds","MINUTES":"Minutes"},"type":"java.lang.Enum"}},"whens":[]},{"mandatory":false,"name":"delay","example":"1500","initValue":"###USE_DEFAULT_VALUE###","hintValue":"1500","description":"The amount of time to wait before triggering the first event.","displayName":"Start delay","defaultValue":"0","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"int"}},"whens":[]}],"type":"de.codecentric.reedelk.module.descriptor.model.property.ObjectDescriptor$TypeObject"}},"whens":[{"propertyName":"strategy","propertyValue":"FIXED_FREQUENCY"}]},{"mandatory":false,"name":"cronConfig","initValue":"###USE_DEFAULT_VALUE###","displayName":"Cron Configuration","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.ObjectDescriptor","instance":{"shared":"NO","collapsible":"NO","typeFullyQualifiedName":"de.codecentric.reedelk.scheduler.component.CronConfiguration","objectProperties":[{"mandatory":false,"name":"expression","example":"0 15 10 * * ? 2020 Run at 10:15 a.m., every day during the year 2020","initValue":"* * * ? * *","hintValue":"* * * ? * *","description":"A valid cron expression to be used to trigger the scheduler e.g \u003ci\u003e0 15 10 * * ? 2020\u003c/i\u003e Run at 10:15 a.m., every day during the year 2020.","displayName":"Expression","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.PrimitiveDescriptor","instance":{"type":"java.lang.String"}},"whens":[]},{"mandatory":false,"name":"timeZone","example":"Europe/Brussels","initValue":"###USE_DEFAULT_VALUE###","description":"Sets the time zone of the cron expression.","displayName":"Time Zone","defaultValue":"System timezone","type":{"classname":"de.codecentric.reedelk.module.descriptor.model.property.ComboDescriptor","instance":{"editable":true,"prototype":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","comboValues":["System timezone","Asia/Aden","America/Cuiaba","Etc/GMT+9","Etc/GMT+8","Africa/Nairobi","America/Marigot","Asia/Aqtau","Pacific/Kwajalein","America/El_Salvador","Asia/Pontianak","Africa/Cairo","Pacific/Pago_Pago","Africa/Mbabane","Asia/Kuching","Pacific/Honolulu","Pacific/Rarotonga","America/Guatemala","Australia/Hobart","Europe/London","America/Belize","America/Panama","Asia/Chungking","America/Managua","America/Indiana/Petersburg","Asia/Yerevan","Europe/Brussels","GMT","Europe/Warsaw","America/Chicago","Asia/Kashgar","Chile/Continental","Pacific/Yap","CET","Etc/GMT-1","Etc/GMT-0","Europe/Jersey","America/Tegucigalpa","Etc/GMT-5","Europe/Istanbul","America/Eirunepe","Etc/GMT-4","America/Miquelon","Etc/GMT-3","Europe/Luxembourg","Etc/GMT-2","Etc/GMT-9","America/Argentina/Catamarca","Etc/GMT-8","Etc/GMT-7","Etc/GMT-6","Europe/Zaporozhye","Canada/Yukon","Canada/Atlantic","Atlantic/St_Helena","Australia/Tasmania","Libya","Europe/Guernsey","America/Grand_Turk","US/Pacific-New","Asia/Samarkand","America/Argentina/Cordoba","Asia/Phnom_Penh","Africa/Kigali","Asia/Almaty","US/Alaska","Asia/Dubai","Europe/Isle_of_Man","America/Araguaina","Cuba","Asia/Novosibirsk","America/Argentina/Salta","Etc/GMT+3","Africa/Tunis","Etc/GMT+2","Etc/GMT+1","Pacific/Fakaofo","Africa/Tripoli","Etc/GMT+0","Israel","Africa/Banjul","Etc/GMT+7","Indian/Comoro","Etc/GMT+6","Etc/GMT+5","Etc/GMT+4","Pacific/Port_Moresby","US/Arizona","Antarctica/Syowa","Indian/Reunion","Pacific/Palau","Europe/Kaliningrad","America/Montevideo","Africa/Windhoek","Asia/Karachi","Africa/Mogadishu","Australia/Perth","Brazil/East","Etc/GMT","Asia/Chita","Pacific/Easter","Antarctica/Davis","Antarctica/McMurdo","Asia/Macao","America/Manaus","Africa/Freetown","Europe/Bucharest","America/Argentina/Mendoza","Asia/Macau","Europe/Malta","Mexico/BajaSur","Pacific/Tahiti","Africa/Asmera","Europe/Busingen","America/Argentina/Rio_Gallegos","Africa/Malabo","Europe/Skopje","America/Catamarca","America/Godthab","Europe/Sarajevo","Australia/ACT","GB-Eire","Africa/Lagos","America/Cordoba","Europe/Rome","Asia/Dacca","Indian/Mauritius","Pacific/Samoa","America/Regina","America/Fort_Wayne","America/Dawson_Creek","Africa/Algiers","Europe/Mariehamn","America/St_Johns","America/St_Thomas","Europe/Zurich","America/Anguilla","Asia/Dili","America/Denver","Africa/Bamako","GB","Mexico/General","Pacific/Wallis","Europe/Gibraltar","Africa/Conakry","Africa/Lubumbashi","Asia/Istanbul","America/Havana","NZ-CHAT","Asia/Choibalsan","America/Porto_Acre","Asia/Omsk","Europe/Vaduz","US/Michigan","Asia/Dhaka","America/Barbados","Europe/Tiraspol","Atlantic/Cape_Verde","Asia/Yekaterinburg","America/Louisville","Pacific/Johnston","Pacific/Chatham","Europe/Ljubljana","America/Sao_Paulo","Asia/Jayapura","America/Curacao","Asia/Dushanbe","America/Guyana","America/Guayaquil","America/Martinique","Portugal","Europe/Berlin","Europe/Moscow","Europe/Chisinau","America/Puerto_Rico","America/Rankin_Inlet","Pacific/Ponape","Europe/Stockholm","Europe/Budapest","America/Argentina/Jujuy","Australia/Eucla","Asia/Shanghai","Universal","Europe/Zagreb","America/Port_of_Spain","Europe/Helsinki","Asia/Beirut","Asia/Tel_Aviv","Pacific/Bougainville","US/Central","Africa/Sao_Tome","Indian/Chagos","America/Cayenne","Asia/Yakutsk","Pacific/Galapagos","Australia/North","Europe/Paris","Africa/Ndjamena","Pacific/Fiji","America/Rainy_River","Indian/Maldives","Australia/Yancowinna","SystemV/AST4","Asia/Oral","America/Yellowknife","Pacific/Enderbury","America/Juneau","Australia/Victoria","America/Indiana/Vevay","Asia/Tashkent","Asia/Jakarta","Africa/Ceuta","America/Recife","America/Buenos_Aires","America/Noronha","America/Swift_Current","Australia/Adelaide","America/Metlakatla","Africa/Djibouti","America/Paramaribo","Europe/Simferopol","Europe/Sofia","Africa/Nouakchott","Europe/Prague","America/Indiana/Vincennes","Antarctica/Mawson","America/Kralendijk","Antarctica/Troll","Europe/Samara","Indian/Christmas","America/Antigua","Pacific/Gambier","America/Indianapolis","America/Inuvik","America/Iqaluit","Pacific/Funafuti","UTC","Antarctica/Macquarie","Canada/Pacific","America/Moncton","Africa/Gaborone","Pacific/Chuuk","Asia/Pyongyang","America/St_Vincent","Asia/Gaza","Etc/Universal","PST8PDT","Atlantic/Faeroe","Asia/Qyzylorda","Canada/Newfoundland","America/Kentucky/Louisville","America/Yakutat","Asia/Ho_Chi_Minh","Antarctica/Casey","Europe/Copenhagen","Africa/Asmara","Atlantic/Azores","Europe/Vienna","ROK","Pacific/Pitcairn","America/Mazatlan","Australia/Queensland","Pacific/Nauru","Europe/Tirane","Asia/Kolkata","SystemV/MST7","Australia/Canberra","MET","Australia/Broken_Hill","Europe/Riga","America/Dominica","Africa/Abidjan","America/Mendoza","America/Santarem","Kwajalein","America/Asuncion","Asia/Ulan_Bator","NZ","America/Boise","Australia/Currie","EST5EDT","Pacific/Guam","Pacific/Wake","Atlantic/Bermuda","America/Costa_Rica","America/Dawson","Asia/Chongqing","Eire","Europe/Amsterdam","America/Indiana/Knox","America/North_Dakota/Beulah","Africa/Accra","Atlantic/Faroe","Mexico/BajaNorte","America/Maceio","Etc/UCT","Pacific/Apia","America/Atka","Pacific/Niue","Canada/East-Saskatchewan","Australia/Lord_Howe","Europe/Dublin","Pacific/Truk","MST7MDT","America/Monterrey","America/Nassau","America/Jamaica","Asia/Bishkek","America/Atikokan","Atlantic/Stanley","Australia/NSW","US/Hawaii","SystemV/CST6","Indian/Mahe","Asia/Aqtobe","America/Sitka","Asia/Vladivostok","Africa/Libreville","Africa/Maputo","Zulu","America/Kentucky/Monticello","Africa/El_Aaiun","Africa/Ouagadougou","America/Coral_Harbour","Pacific/Marquesas","Brazil/West","America/Aruba","America/North_Dakota/Center","America/Cayman","Asia/Ulaanbaatar","Asia/Baghdad","Europe/San_Marino","America/Indiana/Tell_City","America/Tijuana","Pacific/Saipan","SystemV/YST9","Africa/Douala","America/Chihuahua","America/Ojinaga","Asia/Hovd","America/Anchorage","Chile/EasterIsland","America/Halifax","Antarctica/Rothera","America/Indiana/Indianapolis","US/Mountain","Asia/Damascus","America/Argentina/San_Luis","America/Santiago","Asia/Baku","America/Argentina/Ushuaia","Atlantic/Reykjavik","Africa/Brazzaville","Africa/Porto-Novo","America/La_Paz","Antarctica/DumontDUrville","Asia/Taipei","Antarctica/South_Pole","Asia/Manila","Asia/Bangkok","Africa/Dar_es_Salaam","Poland","Atlantic/Madeira","Antarctica/Palmer","America/Thunder_Bay","Africa/Addis_Ababa","Europe/Uzhgorod","Brazil/DeNoronha","Asia/Ashkhabad","Etc/Zulu","America/Indiana/Marengo","America/Creston","America/Mexico_City","Antarctica/Vostok","Asia/Jerusalem","Europe/Andorra","US/Samoa","PRC","Asia/Vientiane","Pacific/Kiritimati","America/Matamoros","America/Blanc-Sablon","Asia/Riyadh","Iceland","Pacific/Pohnpei","Asia/Ujung_Pandang","Atlantic/South_Georgia","Europe/Lisbon","Asia/Harbin","Europe/Oslo","Asia/Novokuznetsk","CST6CDT","Atlantic/Canary","America/Knox_IN","Asia/Kuwait","SystemV/HST10","Pacific/Efate","Africa/Lome","America/Bogota","America/Menominee","America/Adak","Pacific/Norfolk","America/Resolute","Pacific/Tarawa","Africa/Kampala","Asia/Krasnoyarsk","Greenwich","SystemV/EST5","America/Edmonton","Europe/Podgorica","Australia/South","Canada/Central","Africa/Bujumbura","America/Santo_Domingo","US/Eastern","Europe/Minsk","Pacific/Auckland","Africa/Casablanca","America/Glace_Bay","Canada/Eastern","Asia/Qatar","Europe/Kiev","Singapore","Asia/Magadan","SystemV/PST8","America/Port-au-Prince","Europe/Belfast","America/St_Barthelemy","Asia/Ashgabat","Africa/Luanda","America/Nipigon","Atlantic/Jan_Mayen","Brazil/Acre","Asia/Muscat","Asia/Bahrain","Europe/Vilnius","America/Fortaleza","Etc/GMT0","US/East-Indiana","America/Hermosillo","America/Cancun","Africa/Maseru","Pacific/Kosrae","Africa/Kinshasa","Asia/Kathmandu","Asia/Seoul","Australia/Sydney","America/Lima","Australia/LHI","America/St_Lucia","Europe/Madrid","America/Bahia_Banderas","America/Montserrat","Asia/Brunei","America/Santa_Isabel","Canada/Mountain","America/Cambridge_Bay","Asia/Colombo","Australia/West","Indian/Antananarivo","Australia/Brisbane","Indian/Mayotte","US/Indiana-Starke","Asia/Urumqi","US/Aleutian","Europe/Volgograd","America/Lower_Princes","America/Vancouver","Africa/Blantyre","America/Rio_Branco","America/Danmarkshavn","America/Detroit","America/Thule","Africa/Lusaka","Asia/Hong_Kong","Iran","America/Argentina/La_Rioja","Africa/Dakar","SystemV/CST6CDT","America/Tortola","America/Porto_Velho","Asia/Sakhalin","Etc/GMT+10","America/Scoresbysund","Asia/Kamchatka","Asia/Thimbu","Africa/Harare","Etc/GMT+12","Etc/GMT+11","Navajo","America/Nome","Europe/Tallinn","Turkey","Africa/Khartoum","Africa/Johannesburg","Africa/Bangui","Europe/Belgrade","Jamaica","Africa/Bissau","Asia/Tehran","WET","Africa/Juba","America/Campo_Grande","America/Belem","Etc/Greenwich","Asia/Saigon","America/Ensenada","Pacific/Midway","America/Jujuy","Africa/Timbuktu","America/Bahia","America/Goose_Bay","America/Virgin","America/Pangnirtung","Asia/Katmandu","America/Phoenix","Africa/Niamey","America/Whitehorse","Pacific/Noumea","Asia/Tbilisi","America/Montreal","Asia/Makassar","America/Argentina/San_Juan","Hongkong","UCT","Asia/Nicosia","America/Indiana/Winamac","SystemV/MST7MDT","America/Argentina/ComodRivadavia","America/Boa_Vista","America/Grenada","Australia/Darwin","Asia/Khandyga","Asia/Kuala_Lumpur","Asia/Thimphu","Asia/Rangoon","Europe/Bratislava","Asia/Calcutta","America/Argentina/Tucuman","Asia/Kabul","Indian/Cocos","Japan","Pacific/Tongatapu","America/New_York","Etc/GMT-12","Etc/GMT-11","Etc/GMT-10","SystemV/YST9YDT","Etc/GMT-14","Etc/GMT-13","W-SU","America/Merida","EET","America/Rosario","Canada/Saskatchewan","America/St_Kitts","Arctic/Longyearbyen","America/Caracas","America/Guadeloupe","Asia/Hebron","Indian/Kerguelen","SystemV/PST8PDT","Africa/Monrovia","Asia/Ust-Nera","Egypt","Asia/Srednekolymsk","America/North_Dakota/New_Salem","Asia/Anadyr","Australia/Melbourne","Asia/Irkutsk","America/Shiprock","America/Winnipeg","Europe/Vatican","Asia/Amman","Etc/UTC","SystemV/AST4ADT","Asia/Tokyo","America/Toronto","Asia/Singapore","Australia/Lindeman","America/Los_Angeles","SystemV/EST5EDT","Pacific/Majuro","America/Argentina/Buenos_Aires","Europe/Nicosia","Pacific/Guadalcanal","Europe/Athens","US/Pacific","Europe/Monaco"],"type":"de.codecentric.reedelk.runtime.api.annotation.Combo"}},"whens":[]}],"type":"de.codecentric.reedelk.module.descriptor.model.property.ObjectDescriptor$TypeObject"}},"whens":[{"propertyName":"strategy","propertyValue":"CRON"}]}]}],"types":[{"global":false,"type":"de.codecentric.reedelk.scheduler.internal.attribute.SchedulerAttributes","extendsType":"de.codecentric.reedelk.runtime.api.message.MessageAttributes","description":"","mapKeyType":"java.lang.Object","mapValueType":"java.lang.Object","functions":[],"properties":[{"name":"firedAt","type":"long","example":"","description":""}]}]} \ No newline at end of file diff --git a/src/test/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerCronTest.java b/src/test/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerCronTest.java similarity index 79% rename from src/test/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerCronTest.java rename to src/test/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerCronTest.java index 9e92c38..92350e5 100644 --- a/src/test/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerCronTest.java +++ b/src/test/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerCronTest.java @@ -1,10 +1,11 @@ -package com.reedelk.scheduler.internal.scheduler; +package de.codecentric.reedelk.scheduler.internal.scheduler; -import com.reedelk.runtime.api.component.InboundEventListener; -import com.reedelk.scheduler.component.CronConfiguration; +import de.codecentric.reedelk.runtime.api.component.InboundEventListener; +import de.codecentric.reedelk.scheduler.component.CronConfiguration; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; +import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; import org.quartz.JobDetail; import org.quartz.Trigger; @@ -34,7 +35,7 @@ void shouldCorrectlyScheduleJob() { private SchedulingStrategySchedulerCron strategyWith(CronConfiguration configuration) { SchedulingStrategySchedulerCron strategy = - spy(new SchedulingStrategySchedulerCron(configuration)); + Mockito.spy(new SchedulingStrategySchedulerCron(configuration)); doNothing().when(strategy).scheduleJob(any(InboundEventListener.class), any(JobDetail.class), any(Trigger.class)); return strategy; } diff --git a/src/test/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerFixedFrequencyTest.java b/src/test/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerFixedFrequencyTest.java similarity index 82% rename from src/test/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerFixedFrequencyTest.java rename to src/test/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerFixedFrequencyTest.java index 1423d7f..bd2cd49 100644 --- a/src/test/java/com/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerFixedFrequencyTest.java +++ b/src/test/java/de/codecentric/reedelk/scheduler/internal/scheduler/SchedulingStrategySchedulerFixedFrequencyTest.java @@ -1,8 +1,7 @@ -package com.reedelk.scheduler.internal.scheduler; +package de.codecentric.reedelk.scheduler.internal.scheduler; -import com.reedelk.runtime.api.component.InboundEventListener; -import com.reedelk.scheduler.component.FixedFrequencyConfiguration; -import com.reedelk.scheduler.internal.scheduler.SchedulingStrategySchedulerFixedFrequency; +import de.codecentric.reedelk.runtime.api.component.InboundEventListener; +import de.codecentric.reedelk.scheduler.component.FixedFrequencyConfiguration; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock;