Removed the word "service" from all settings, to avoid confusion with arbitrary data services.

Updated setting names:

domainMapServiceEnabled -> domainMapEnabled
domainMapServicePort -> domainMapPort
gatewayServiceEnabled -> gatewayEnabled
gatewayServicePort -> gatewayPort
This commit is contained in:
CalDescent 2021-12-10 12:29:33 +00:00
parent c7c88dec04
commit cc297ccfcd
4 changed files with 30 additions and 30 deletions

View File

@ -88,7 +88,7 @@ public class DomainMapService {
HttpConfiguration httpConfig = new HttpConfiguration(); HttpConfiguration httpConfig = new HttpConfiguration();
httpConfig.setSecureScheme("https"); httpConfig.setSecureScheme("https");
httpConfig.setSecurePort(Settings.getInstance().getDomainMapServicePort()); httpConfig.setSecurePort(Settings.getInstance().getDomainMapPort());
SecureRequestCustomizer src = new SecureRequestCustomizer(); SecureRequestCustomizer src = new SecureRequestCustomizer();
httpConfig.addCustomizer(src); httpConfig.addCustomizer(src);
@ -100,13 +100,13 @@ public class DomainMapService {
new DetectorConnectionFactory(sslConnectionFactory), new DetectorConnectionFactory(sslConnectionFactory),
httpConnectionFactory); httpConnectionFactory);
portUnifiedConnector.setHost(Settings.getInstance().getBindAddress()); portUnifiedConnector.setHost(Settings.getInstance().getBindAddress());
portUnifiedConnector.setPort(Settings.getInstance().getDomainMapServicePort()); portUnifiedConnector.setPort(Settings.getInstance().getDomainMapPort());
this.server.addConnector(portUnifiedConnector); this.server.addConnector(portUnifiedConnector);
} else { } else {
// Non-SSL // Non-SSL
InetAddress bindAddr = InetAddress.getByName(Settings.getInstance().getBindAddress()); InetAddress bindAddr = InetAddress.getByName(Settings.getInstance().getBindAddress());
InetSocketAddress endpoint = new InetSocketAddress(bindAddr, Settings.getInstance().getDomainMapServicePort()); InetSocketAddress endpoint = new InetSocketAddress(bindAddr, Settings.getInstance().getDomainMapPort());
this.server = new Server(endpoint); this.server = new Server(endpoint);
} }

View File

@ -87,7 +87,7 @@ public class GatewayService {
HttpConfiguration httpConfig = new HttpConfiguration(); HttpConfiguration httpConfig = new HttpConfiguration();
httpConfig.setSecureScheme("https"); httpConfig.setSecureScheme("https");
httpConfig.setSecurePort(Settings.getInstance().getGatewayServicePort()); httpConfig.setSecurePort(Settings.getInstance().getGatewayPort());
SecureRequestCustomizer src = new SecureRequestCustomizer(); SecureRequestCustomizer src = new SecureRequestCustomizer();
httpConfig.addCustomizer(src); httpConfig.addCustomizer(src);
@ -99,13 +99,13 @@ public class GatewayService {
new DetectorConnectionFactory(sslConnectionFactory), new DetectorConnectionFactory(sslConnectionFactory),
httpConnectionFactory); httpConnectionFactory);
portUnifiedConnector.setHost(Settings.getInstance().getBindAddress()); portUnifiedConnector.setHost(Settings.getInstance().getBindAddress());
portUnifiedConnector.setPort(Settings.getInstance().getGatewayServicePort()); portUnifiedConnector.setPort(Settings.getInstance().getGatewayPort());
this.server.addConnector(portUnifiedConnector); this.server.addConnector(portUnifiedConnector);
} else { } else {
// Non-SSL // Non-SSL
InetAddress bindAddr = InetAddress.getByName(Settings.getInstance().getBindAddress()); InetAddress bindAddr = InetAddress.getByName(Settings.getInstance().getBindAddress());
InetSocketAddress endpoint = new InetSocketAddress(bindAddr, Settings.getInstance().getGatewayServicePort()); InetSocketAddress endpoint = new InetSocketAddress(bindAddr, Settings.getInstance().getGatewayPort());
this.server = new Server(endpoint); this.server = new Server(endpoint);
} }

View File

@ -510,8 +510,8 @@ public class Controller extends Thread {
return; // Not System.exit() so that GUI can display error return; // Not System.exit() so that GUI can display error
} }
if (Settings.getInstance().isGatewayServiceEnabled()) { if (Settings.getInstance().isGatewayEnabled()) {
LOGGER.info(String.format("Starting gateway service on port %d", Settings.getInstance().getGatewayServicePort())); LOGGER.info(String.format("Starting gateway service on port %d", Settings.getInstance().getGatewayPort()));
try { try {
GatewayService gatewayService = GatewayService.getInstance(); GatewayService gatewayService = GatewayService.getInstance();
gatewayService.start(); gatewayService.start();
@ -523,8 +523,8 @@ public class Controller extends Thread {
} }
} }
if (Settings.getInstance().isDomainMapServiceEnabled()) { if (Settings.getInstance().isDomainMapEnabled()) {
LOGGER.info(String.format("Starting domain map service on port %d", Settings.getInstance().getDomainMapServicePort())); LOGGER.info(String.format("Starting domain map service on port %d", Settings.getInstance().getDomainMapPort()));
try { try {
DomainMapService domainMapService = DomainMapService.getInstance(); DomainMapService domainMapService = DomainMapService.getInstance();
domainMapService.start(); domainMapService.start();

View File

@ -38,11 +38,11 @@ public class Settings {
private static final int MAINNET_API_PORT = 12393; private static final int MAINNET_API_PORT = 12393;
private static final int TESTNET_API_PORT = 62393; private static final int TESTNET_API_PORT = 62393;
private static final int MAINNET_DOMAIN_MAP_SERVICE_PORT = 80; private static final int MAINNET_DOMAIN_MAP_PORT = 80;
private static final int TESTNET_DOMAIN_MAP_SERVICE_PORT = 8080; private static final int TESTNET_DOMAIN_MAP_PORT = 8080;
private static final int MAINNET_GATEWAY_SERVICE_PORT = 80; private static final int MAINNET_GATEWAY_PORT = 80;
private static final int TESTNET_GATEWAY_SERVICE_PORT = 8080; private static final int TESTNET_GATEWAY_PORT = 8080;
private static final Logger LOGGER = LogManager.getLogger(Settings.class); private static final Logger LOGGER = LogManager.getLogger(Settings.class);
private static final String SETTINGS_FILENAME = "settings.json"; private static final String SETTINGS_FILENAME = "settings.json";
@ -91,14 +91,14 @@ public class Settings {
private String sslKeystorePassword = null; private String sslKeystorePassword = null;
// Domain mapping // Domain mapping
private Integer domainMapServicePort; private Integer domainMapPort;
private boolean domainMapServiceEnabled = false; private boolean domainMapEnabled = false;
private boolean domainMapLoggingEnabled = false; private boolean domainMapLoggingEnabled = false;
private List<DomainMap> domainMap = null; private List<DomainMap> domainMap = null;
// Gateway // Gateway
private Integer gatewayServicePort; private Integer gatewayPort;
private boolean gatewayServiceEnabled = false; private boolean gatewayEnabled = false;
private boolean gatewayLoggingEnabled = false; private boolean gatewayLoggingEnabled = false;
// Specific to this node // Specific to this node
@ -526,15 +526,15 @@ public class Settings {
return this.sslKeystorePassword; return this.sslKeystorePassword;
} }
public int getDomainMapServicePort() { public int getDomainMapPort() {
if (this.domainMapServicePort != null) if (this.domainMapPort != null)
return this.domainMapServicePort; return this.domainMapPort;
return this.isTestNet ? TESTNET_DOMAIN_MAP_SERVICE_PORT : MAINNET_DOMAIN_MAP_SERVICE_PORT; return this.isTestNet ? TESTNET_DOMAIN_MAP_PORT : MAINNET_DOMAIN_MAP_PORT;
} }
public boolean isDomainMapServiceEnabled() { public boolean isDomainMapEnabled() {
return this.domainMapServiceEnabled; return this.domainMapEnabled;
} }
public boolean isDomainMapLoggingEnabled() { public boolean isDomainMapLoggingEnabled() {
@ -555,15 +555,15 @@ public class Settings {
} }
public int getGatewayServicePort() { public int getGatewayPort() {
if (this.gatewayServicePort != null) if (this.gatewayPort != null)
return this.gatewayServicePort; return this.gatewayPort;
return this.isTestNet ? TESTNET_GATEWAY_SERVICE_PORT : MAINNET_GATEWAY_SERVICE_PORT; return this.isTestNet ? TESTNET_GATEWAY_PORT : MAINNET_GATEWAY_PORT;
} }
public boolean isGatewayServiceEnabled() { public boolean isGatewayEnabled() {
return this.gatewayServiceEnabled; return this.gatewayEnabled;
} }
public boolean isGatewayLoggingEnabled() { public boolean isGatewayLoggingEnabled() {