Commit 3aa0dccc authored by I Patini's avatar I Patini
Browse files

EMS: Baguette Server, config: Removed @Value annotations from...

EMS: Baguette Server, config: Removed @Value annotations from 'BaguetteServerProperties' class and renamed fields when needed. Changed corresponding settings in 'eu.melodic.event.baguette-server.properties' (replaced '.' with '-' where needed).
parent 9f32437e
......@@ -11,9 +11,10 @@ package eu.melodic.event.baguette.server.properties;
import eu.melodic.event.baguette.server.ServerCoordinator;
import eu.melodic.event.util.CredentialsMap;
import eu.melodic.event.util.EmsConstant;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
......@@ -28,10 +29,13 @@ import java.util.Map;
@Data
@Validated
@Configuration
@ConfigurationProperties(prefix = "baguette.server")
@ConfigurationProperties(prefix = EmsConstant.EMS_PROPERTIES_PREFIX + "baguette.server")
@PropertySource("file:${MELODIC_CONFIG_DIR}/eu.melodic.event.baguette-server.properties")
@Slf4j
public class BaguetteServerProperties {
public class BaguetteServerProperties implements InitializingBean {
public void afterPropertiesSet() {
log.warn(">>>>>>>>>>>>>>>>>>>> {}", this);
}
/*XXX: TODO: Add combinatorial properties check
@Override
......@@ -50,47 +54,37 @@ public class BaguetteServerProperties {
}
}*/
//@Size(min = 1, message = "Please provide a valid Coordinator class (use Fully-Qualified Class Name)")
@Value("${baguette.server.coordinator.class:}")
private Class<ServerCoordinator> coordinatorClass;
private Map<String,String> coordinatorParameters = new HashMap<>();
@Value("${baguette.server.coordinator.id:}")
private List<String> coordinatorId;
private Map<String, CoordinatorConfig> coordinatorConfig = new HashMap<>();
@Value("${baguette.server.registration-window:30000}")
@Min(-1)
private long registrationWindow;
@Value("${baguette.server.num-of-instances:-1}")
private long registrationWindow = 30000;
@Min(-1)
private int numberOfInstances;
@Value("${baguette.server.num-of-segments:-1}")
private int numberOfInstances = -1;
@Min(-1)
private int NumberOfSegments;
private int NumberOfSegments = -1;
@Value("${baguette.server.address:}")
private String serverAddress;
private String address;
public String getServerAddress() { return address; }
@Value("${baguette.server.port:2222}")
@Min(value = 1, message = "Valid server ports are between 1 and 65535. Please prefer ports higher than 1023.")
@Max(value = 65535, message = "Valid server ports are between 1 and 65535. Please prefer ports higher than 1023.")
private int serverPort;
private int port = 2222;
public int getServerPort() { return port; }
private String keyFile = "hostkey.ser";
public String getServerKeyFile() { return keyFile; }
@Value("${baguette.server.key.file:hostkey.ser}")
private String serverKeyFile;
@Value("${baguette.server.heartbeat:false}")
private boolean heartbeatEnabled;
@Value("${baguette.server.heartbeat.period:60000}")
@Min(-1)
private long heartbeatPeriod;
private long heartbeatPeriod = 60000;
@Value("${baguette.server.debug.client-address-override-allowed:false}")
private boolean clientAddressOverrideAllowed;
@Value("${baguette.server.client-id-format}")
private String clientIdFormat;
@Value("${baguette.server.client-id-format.escape:~}")
private String clientIdFormatEscape;
private String clientIdFormatEscape = "~";
private final CredentialsMap credentials = new CredentialsMap();
......
......@@ -10,9 +10,9 @@
# Baguette Server configuration
# Coordinator and Registration settings
baguette.server.coordinator.class = eu.melodic.event.baguette.server.coordinator.cluster.ClusteringCoordinator
#baguette.server.coordinator.class = eu.melodic.event.baguette.server.coordinator.TestCoordinator
#coordinator.class = eu.melodic.event.baguette.server.coordinator.ServerCoordinatorPerCloud
baguette.server.coordinator-class = eu.melodic.event.baguette.server.coordinator.cluster.ClusteringCoordinator
#baguette.server.coordinator-class = eu.melodic.event.baguette.server.coordinator.TestCoordinator
#baguette.server.coordinator-class = eu.melodic.event.baguette.server.coordinator.ServerCoordinatorPerCloud
# Available Coordinators (in 'eu.melodic.event.baguette.server.coordinator' package) :
# ServerCoordinatorWaitAll, ServerCoordinatorTimeWin, ServerCoordinatorClientsOnly,
......@@ -21,7 +21,7 @@ baguette.server.coordinator.class = eu.melodic.event.baguette.server.coordinator
#baguette.server.coordinatorParameters.param1 = p1
#baguette.server.coordinatorParameters.param2 = p2
baguette.server.coordinator.id = clustering, 2level, noop
baguette.server.coordinator-id = clustering, 2level, noop
baguette.server.coordinatorConfig.clustering.coordinatorClass = eu.melodic.event.baguette.server.coordinator.cluster.ClusteringCoordinator
baguette.server.coordinatorConfig.clustering.parameters.zone-management-strategy-class = eu.melodic.event.baguette.server.coordinator.cluster.DefaultZoneManagementStrategy
baguette.server.coordinatorConfig.clustering.parameters.zone-port-start = 2000
......@@ -36,20 +36,20 @@ baguette.server.coordinatorConfig.clustering.parameters.zone-keystore-file-name-
baguette.server.coordinatorConfig.2level.coordinatorClass = eu.melodic.event.baguette.server.coordinator.TwoLevelCoordinator
baguette.server.coordinatorConfig.noop.coordinatorClass = eu.melodic.event.baguette.server.coordinator.NoopCoordinator
#baguette.server.num-of-instances = 1
#baguette.server.number-of-instances = 1
baguette.server.registration-window = 30000
# SSH Server settings
baguette.server.address = ${EMS_SERVER_ADDRESS}
baguette.server.port = 2222
baguette.server.key.file = ${MELODIC_CONFIG_DIR}/hostkey.ser
baguette.server.heartbeat = on
baguette.server.heartbeat.period = 60000
baguette.server.key-file = ${MELODIC_CONFIG_DIR}/hostkey.ser
baguette.server.heartbeat-enabled = on
baguette.server.heartbeat-period = 60000
baguette.server.credentials.aa=xx
baguette.server.credentials.bb=yy
#baguette.server.debug.client-address-override-allowed=true
baguette.server.client-id-format.escape = ~
#baguette.server.client-address-override-allowed=true
baguette.server.client-id-format-escape = ~
#baguette.server.client-id-format = ~{type}-~{operatingSystem}-~{id}-~{name}-~{providerId}-~{ip}-~{random}
baguette.server.client-id-format = ~{type:-_}-~{operatingSystem:-_}-~{id:-_}-~{name:-_}-~{provider:-_}-~{address:-_}-~{random:-_}
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