Commit 9f32437e authored by I Patini's avatar I Patini
Browse files

EMS: Util, Common: Modified @Value annotation to include EMS_PROPERTIES_PREFIX...

EMS: Util, Common: Modified @Value annotation to include EMS_PROPERTIES_PREFIX in properties prefixes.
parent 0d018ed1
...@@ -11,6 +11,7 @@ package eu.melodic.event.common.recovery; ...@@ -11,6 +11,7 @@ package eu.melodic.event.common.recovery;
import eu.melodic.event.common.client.SshClientProperties; import eu.melodic.event.common.client.SshClientProperties;
import eu.melodic.event.common.collector.CollectorContext; import eu.melodic.event.common.collector.CollectorContext;
import eu.melodic.event.util.EmsConstant;
import eu.melodic.event.util.EventBus; import eu.melodic.event.util.EventBus;
import eu.melodic.event.util.PasswordUtil; import eu.melodic.event.util.PasswordUtil;
import lombok.Getter; import lombok.Getter;
...@@ -41,7 +42,7 @@ public class EmsClientRecoveryTask<P extends SshClientProperties> extends VmNode ...@@ -41,7 +42,7 @@ public class EmsClientRecoveryTask<P extends SshClientProperties> extends VmNode
"/opt/baguette-client/bin/run.sh",0, 10000) "/opt/baguette-client/bin/run.sh",0, 10000)
)); ));
@Value("${self.healing.recovery.file.baguette:}") @Value("${" + EmsConstant.EMS_PROPERTIES_PREFIX + "self.healing.recovery.file.baguette:}")
private String emsRecoveryFile; private String emsRecoveryFile;
public EmsClientRecoveryTask(@NonNull EventBus<String, Object, Object> eventBus, @NonNull PasswordUtil passwordUtil, @NonNull TaskScheduler taskScheduler, @NonNull CollectorContext<P> collectorContext) { public EmsClientRecoveryTask(@NonNull EventBus<String, Object, Object> eventBus, @NonNull PasswordUtil passwordUtil, @NonNull TaskScheduler taskScheduler, @NonNull CollectorContext<P> collectorContext) {
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
package eu.melodic.event.common.recovery; package eu.melodic.event.common.recovery;
import eu.melodic.event.util.EmsConstant;
import eu.melodic.event.util.EventBus; import eu.melodic.event.util.EventBus;
import eu.melodic.event.util.PasswordUtil; import eu.melodic.event.util.PasswordUtil;
import lombok.Getter; import lombok.Getter;
...@@ -39,7 +40,7 @@ public class NetdataAgentLocalRecoveryTask extends ShellRecoveryTask { ...@@ -39,7 +40,7 @@ public class NetdataAgentLocalRecoveryTask extends ShellRecoveryTask {
"sudo netdata",0, 10000) "sudo netdata",0, 10000)
)); ));
@Value("${self.healing.recovery.file.netdata:}") @Value("${" + EmsConstant.EMS_PROPERTIES_PREFIX + "self.healing.recovery.file.netdata:}")
private String netdataRecoveryFile; private String netdataRecoveryFile;
public NetdataAgentLocalRecoveryTask(@NonNull EventBus<String, Object, Object> eventBus, @NonNull PasswordUtil passwordUtil, @NonNull TaskScheduler taskScheduler) { public NetdataAgentLocalRecoveryTask(@NonNull EventBus<String, Object, Object> eventBus, @NonNull PasswordUtil passwordUtil, @NonNull TaskScheduler taskScheduler) {
......
...@@ -11,6 +11,7 @@ package eu.melodic.event.common.recovery; ...@@ -11,6 +11,7 @@ package eu.melodic.event.common.recovery;
import eu.melodic.event.common.client.SshClientProperties; import eu.melodic.event.common.client.SshClientProperties;
import eu.melodic.event.common.collector.CollectorContext; import eu.melodic.event.common.collector.CollectorContext;
import eu.melodic.event.util.EmsConstant;
import eu.melodic.event.util.EventBus; import eu.melodic.event.util.EventBus;
import eu.melodic.event.util.PasswordUtil; import eu.melodic.event.util.PasswordUtil;
import lombok.Getter; import lombok.Getter;
...@@ -41,7 +42,7 @@ public class NetdataAgentRecoveryTask<P extends SshClientProperties> extends VmN ...@@ -41,7 +42,7 @@ public class NetdataAgentRecoveryTask<P extends SshClientProperties> extends VmN
"sudo netdata",0, 10000) "sudo netdata",0, 10000)
)); ));
@Value("${self.healing.recovery.file.netdata:}") @Value("${" + EmsConstant.EMS_PROPERTIES_PREFIX + "self.healing.recovery.file.netdata:}")
private String netdataRecoveryFile; private String netdataRecoveryFile;
public NetdataAgentRecoveryTask(@NonNull EventBus<String, Object, Object> eventBus, @NonNull PasswordUtil passwordUtil, @NonNull TaskScheduler taskScheduler, @NonNull CollectorContext<P> collectorContext) { public NetdataAgentRecoveryTask(@NonNull EventBus<String, Object, Object> eventBus, @NonNull PasswordUtil passwordUtil, @NonNull TaskScheduler taskScheduler, @NonNull CollectorContext<P> collectorContext) {
......
...@@ -27,7 +27,7 @@ public class PasswordUtil implements InitializingBean { ...@@ -27,7 +27,7 @@ public class PasswordUtil implements InitializingBean {
private final static Supplier<PasswordEncoder> passwordEncoderSupplier = AsterisksPasswordEncoder::new; private final static Supplier<PasswordEncoder> passwordEncoderSupplier = AsterisksPasswordEncoder::new;
private final static AtomicReference<PasswordEncoder> defaultPasswordEncoder = new AtomicReference<>(); private final static AtomicReference<PasswordEncoder> defaultPasswordEncoder = new AtomicReference<>();
@Value("${password-encoder-class:}") @Value("${" + EmsConstant.EMS_PROPERTIES_PREFIX + "password-encoder-class:}")
private String passwordEncoderClassName; private String passwordEncoderClassName;
private PasswordEncoder passwordEncoder; private PasswordEncoder passwordEncoder;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment