Fixed scheduler and mgmt simulator after rollout management changes (#352)

* Fixed scheduler and mgmt simulator

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix typo

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
Kai Zimmermann
2016-11-18 08:47:41 +01:00
committed by Michael Hirsch
parent c221f82ba4
commit 710627ce46
4 changed files with 132 additions and 21 deletions

View File

@@ -18,18 +18,31 @@ import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties("hawkbit.rollout")
public class RolloutProperties {
// used by @Scheduled annotation which needs constant
public static final String PROP_SCHEDULER_DELAY_PLACEHOLDER = "${hawkbit.rollout.scheduler.fixedDelay:30000}";
// used by @Scheduled annotation which needs constant
public static final String PROP_CREATING_SCHEDULER_DELAY_PLACEHOLDER = "${hawkbit.rollout.creatingScheduler.fixedDelay:2000}";
// used by @Scheduled annotation which needs constant
public static final String PROP_STARTING_SCHEDULER_DELAY_PLACEHOLDER = "${hawkbit.rollout.startingScheduler.fixedDelay:2000}";
/**
* Rollout scheduler configuration.
*/
public static class Scheduler {
// used by @Scheduled annotation which needs constant
public static final String PROP_SCHEDULER_DELAY_PLACEHOLDER = "${hawkbit.rollout.scheduler.fixedDelay:30000}";
/**
* Schedule where the rollout scheduler looks necessary state changes in
* milliseconds.
*/
private long fixedDelay = 30000L;
private long fixedDelay;
private boolean enabled = true;
public Scheduler(final long fixedDelay) {
this.fixedDelay = fixedDelay;
}
public long getFixedDelay() {
return fixedDelay;
@@ -39,12 +52,30 @@ public class RolloutProperties {
this.fixedDelay = fixedDelay;
}
public boolean isEnabled() {
return enabled;
}
public void setEnabled(final boolean enabled) {
this.enabled = enabled;
}
}
private final Scheduler scheduler = new Scheduler();
private final Scheduler scheduler = new Scheduler(30000L);
private final Scheduler creatingScheduler = new Scheduler(2000L);
private final Scheduler startingScheduler = new Scheduler(2000L);
public Scheduler getScheduler() {
return scheduler;
}
public Scheduler getCreatingScheduler() {
return creatingScheduler;
}
public Scheduler getStartingScheduler() {
return startingScheduler;
}
}