Skip to content

Commit

Permalink
Rename ServerXml to ServerConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed May 4, 2023
1 parent fed16ed commit 827fb86
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import com.netscape.certsrv.property.EPropertyException;
import com.netscape.certsrv.property.IDescriptor;
import com.netscape.cmscore.apps.CMS;
import com.netscape.cmscore.apps.ServerXml;
import com.netscape.cmscore.apps.ServerConfig;
import com.netscape.cmscore.base.ConfigStore;
import com.netscape.cmscore.request.Request;

Expand Down Expand Up @@ -453,8 +453,8 @@ public String getBuiltinOCSPPort() throws Exception {
String instanceDir = CMS.getInstanceDir();
String path = instanceDir + File.separator + "conf" + File.separator + "server.xml";

ServerXml serverXml = ServerXml.load(path);
port = serverXml.getUnsecurePort();
ServerConfig serverConfig = ServerConfig.load(path);
port = serverConfig.getUnsecurePort();
logger.debug("AuthInfoAccessExtDefault: server.xml port: " + port);

return port;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import com.netscape.certsrv.system.SecurityDomainClient;
import com.netscape.cmscore.apps.CMSEngine;
import com.netscape.cmscore.apps.EngineConfig;
import com.netscape.cmscore.apps.ServerXml;
import com.netscape.cmscore.apps.ServerConfig;

/**
* Utility class for functions to be used by the RESTful installer.
Expand All @@ -51,12 +51,12 @@ public class Configurator {

protected CMSEngine engine;
protected EngineConfig cs;
protected ServerXml serverXml;
protected ServerConfig serverConfig;

public Configurator(CMSEngine engine) {
this.engine = engine;
this.cs = engine.getConfig();
this.serverXml = engine.getServerXml();
this.serverConfig = engine.getServerConfig();
}

public static PKIClient createClient(
Expand All @@ -78,8 +78,8 @@ public void setConfigStore(EngineConfig cs) {
this.cs = cs;
}

public void setServerXml(ServerXml serverXml) throws Exception {
this.serverXml = serverXml;
public void setServerConfig(ServerConfig serverConfig) throws Exception {
this.serverConfig = serverConfig;
}

public String getInstallToken(String sdhost, int sdport, String user, String passwd) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public class CMSEngine {

protected EngineConfig config;
protected EngineConfig mConfig;
protected ServerXml serverXml;
protected ServerConfig serverConfig;

// AutoSD : AutoShutdown
private String mAutoSD_CrumbFile = null;
Expand Down Expand Up @@ -805,9 +805,9 @@ public void configurePorts() throws Exception {

String path = instanceDir + File.separator + "conf" + File.separator + SERVER_XML;

serverXml = ServerXml.load(path);
unsecurePort = serverXml.getUnsecurePort();
securePort = serverXml.getSecurePort();
serverConfig = ServerConfig.load(path);
unsecurePort = serverConfig.getUnsecurePort();
securePort = serverConfig.getSecurePort();

String port = config.getString("proxy.securePort", "");
if (!port.equals("")) {
Expand Down Expand Up @@ -1598,8 +1598,8 @@ public EngineConfig getConfig() {
return mConfig;
}

public ServerXml getServerXml() {
return serverXml;
public ServerConfig getServerConfig() {
return serverConfig;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class ServerXml {
public class ServerConfig {

public static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ServerXml.class);
public static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ServerConfig.class);

String unsecurePort;
String securePort;

public static ServerXml load(String filename) throws Exception {
public static ServerConfig load(String filename) throws Exception {

logger.debug("ServerXml: Parsing " + filename);
logger.debug("ServerConfig: Parsing " + filename);

ServerXml serverXml = new ServerXml();
ServerConfig serverConfig = new ServerConfig();

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
Expand Down Expand Up @@ -68,16 +68,16 @@ public static ServerXml load(String filename) throws Exception {
String port = connector.getAttribute("port");

if (scheme != null && scheme.equals("https")) {
logger.debug("ServerXml: - secure port: " + port);
serverXml.setSecurePort(port);
logger.debug("ServerConfig: - secure port: " + port);
serverConfig.setSecurePort(port);

} else {
logger.debug("ServerXml: - unsecure port: " + port);
serverXml.setUnsecurePort(port);
logger.debug("ServerConfig: - unsecure port: " + port);
serverConfig.setUnsecurePort(port);
}
}

return serverXml;
return serverConfig;
}

public String getUnsecurePort() {
Expand Down

0 comments on commit 827fb86

Please sign in to comment.