forked from box/mojito
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
322 additions
and
238 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 0 additions & 61 deletions
61
.../src/main/java/com/box/l10n/mojito/quartz/multi/QuartzMultiSchedulerConfigProperties.java
This file was deleted.
Oops, something went wrong.
74 changes: 74 additions & 0 deletions
74
...in/java/com/box/l10n/mojito/quartz/multi/QuartzMultiSchedulerConfigurationProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package com.box.l10n.mojito.quartz.multi; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import javax.annotation.PostConstruct; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@ConfigurationProperties("l10n.org.multi-quartz") | ||
@ConditionalOnProperty(name = "l10n.org.multi-quartz.enabled", havingValue = "true") | ||
public class QuartzMultiSchedulerConfigurationProperties { | ||
|
||
Map<String, Map<String, String>> schedulers; | ||
|
||
List<SchedulerConfigurationProperties> schedulerConfigurationProperties = new ArrayList<>(); | ||
|
||
public Map<String, Map<String, String>> getSchedulers() { | ||
return schedulers; | ||
} | ||
|
||
public void setSchedulers(Map<String, Map<String, String>> schedulers) { | ||
this.schedulers = schedulers; | ||
} | ||
|
||
public List<SchedulerConfigurationProperties> getSchedulerConfigurationProperties() { | ||
return schedulerConfigurationProperties; | ||
} | ||
|
||
@PostConstruct | ||
public void init() { | ||
schedulerConfigurationProperties.addAll(extractSchedulerConfigs()); | ||
} | ||
|
||
private List<SchedulerConfigurationProperties> extractSchedulerConfigs() { | ||
List<SchedulerConfigurationProperties> schedulerProperties = new ArrayList<>(); | ||
|
||
for (Map.Entry<String, Map<String, String>> entry : schedulers.entrySet()) { | ||
SchedulerConfigurationProperties config = new SchedulerConfigurationProperties(); | ||
config.setName(entry.getKey()); | ||
for (Map.Entry<String, String> quartzEntry : entry.getValue().entrySet()) { | ||
config.getQuartz().put(quartzEntry.getKey().replace("quartz.", ""), quartzEntry.getValue()); | ||
} | ||
schedulerProperties.add(config); | ||
} | ||
return schedulerProperties; | ||
} | ||
} | ||
|
||
class SchedulerConfigurationProperties { | ||
|
||
private String name; | ||
|
||
private Map<String, String> quartz = new HashMap<>(); | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Map<String, String> getQuartz() { | ||
return quartz; | ||
} | ||
|
||
public void setQuartz(Map<String, String> quartz) { | ||
this.quartz = quartz; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
webapp/src/main/java/com/box/l10n/mojito/quartz/multi/SchedulerConfig.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.