Skip to content

Commit 691ee1b

Browse files
committed
Refactoring WlsServerConfig constructor to include adminPort and adminPortEnabled
1 parent 9128a8d commit 691ee1b

File tree

6 files changed

+27
-19
lines changed

6 files changed

+27
-19
lines changed

operator/src/main/java/oracle/kubernetes/operator/utils/WlsDomainConfigSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static class ServerConfigBuilder {
107107
}
108108

109109
WlsServerConfig build() {
110-
return new WlsServerConfig(name, null, null, null, false, null, null);
110+
return new WlsServerConfig(name, null, null, null, false, null, null, null, false);
111111
}
112112
}
113113

operator/src/main/java/oracle/kubernetes/operator/wlsconfig/WlsDynamicServerConfig.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ private WlsDynamicServerConfig(
104104
sslListenPort,
105105
sslPortEnabled,
106106
machineName,
107-
networkAccessPoints);
107+
networkAccessPoints,
108+
null,
109+
false);
108110
}
109111

110112
/**

operator/src/main/java/oracle/kubernetes/operator/wlsconfig/WlsServerConfig.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,12 @@ static WlsServerConfig create(Map<String, Object> serverConfigMap) {
150150
(String) serverConfigMap.get("listenAddress"),
151151
sslListenPort,
152152
sslPortEnabled,
153-
(Integer) serverConfigMap.get("adminPort"),
154-
(boolean) serverConfigMap.get("adminPortEnabled"),
153+
/*(Integer) serverConfigMap.get("adminPort"),
154+
(boolean) serverConfigMap.get("adminPortEnabled"),*/
155155
getMachineNameFromJsonMap(serverConfigMap),
156-
networkAccessPoints);
156+
networkAccessPoints,
157+
null,
158+
false);
157159
}
158160

159161
/**
@@ -164,30 +166,29 @@ static WlsServerConfig create(Map<String, Object> serverConfigMap) {
164166
* @param listenAddress Configured listen address for this WLS server
165167
* @param sslListenPort Configured SSL listen port for this WLS server
166168
* @param sslPortEnabled boolean indicating whether the SSL listen port should be enabled
167-
* @param adminPort Configured domain wide administration port
168-
* @param adminPortEnabled boolean indicating whether administration port should be enabled
169169
* @param machineName Configured machine name for this WLS server
170170
* @param networkAccessPoints List of NetworkAccessPoint containing channels configured for this
171-
* WLS server
171+
* @param adminPort Configured domain wide administration port
172+
* @param adminPortEnabled boolean indicating whether administration port should be enabled
172173
*/
173174
public WlsServerConfig(
174175
String name,
175176
Integer listenPort,
176177
String listenAddress,
177178
Integer sslListenPort,
178179
boolean sslPortEnabled,
179-
Integer adminPort,
180-
boolean adminPortEnabled,
181180
String machineName,
182-
List<NetworkAccessPoint> networkAccessPoints) {
181+
List<NetworkAccessPoint> networkAccessPoints,
182+
Integer adminPort,
183+
boolean adminPortEnabled) {
183184
this.name = name;
184185
this.listenPort = listenPort;
185186
this.listenAddress = listenAddress;
186187
this.networkAccessPoints = networkAccessPoints;
187188
this.sslListenPort = sslListenPort;
188189
this.sslPortEnabled = sslPortEnabled;
189-
this.adminPort = adminPort;
190-
this.adminPortEnabled = adminPortEnabled;
190+
this.adminPort = this.adminPort;
191+
this.adminPortEnabled = this.adminPortEnabled;
191192
this.machineName = machineName;
192193
}
193194

operator/src/test/java/oracle/kubernetes/operator/helpers/ManagedPodHelperTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public void augmentPacket() {
6161
}
6262

6363
private WlsServerConfig createServerConfig() {
64-
return new WlsServerConfig(SERVER_NAME, LISTEN_PORT, null, null, false, null, null);
64+
return new WlsServerConfig(
65+
SERVER_NAME, LISTEN_PORT, null, null, false, null, null, null, false);
6566
}
6667

6768
@Override

operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsClusterConfigTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ public void verifyGetMachineNamesReturnsUndefinedMachineNamesEvenWithSameTargetS
663663
static WlsDynamicServersConfig createDynamicServersConfig(
664664
int clusterSize, int maxClusterSize, String serverNamePrefix, String clusterName) {
665665
WlsServerConfig serverTemplate =
666-
new WlsServerConfig("serverTemplate1", 7001, "host1", 7002, false, null, null);
666+
new WlsServerConfig("serverTemplate1", 7001, "host1", 7002, false, null, null, null, false);
667667
List<String> serverNames = new ArrayList<>();
668668
final int startingServerNameIndex = 1;
669669
for (int i = 0; i < clusterSize; i++) {

operator/src/test/java/oracle/kubernetes/operator/wlsconfig/WlsDynamicServerConfigTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ public void testCreateWithFixedPorts() {
1919
List<NetworkAccessPoint> networkAccessPointList = new ArrayList<>();
2020
networkAccessPointList.add(networkAccessPoint);
2121
WlsServerConfig template =
22-
new WlsServerConfig("template1", 1000, null, 2000, true, null, networkAccessPointList);
22+
new WlsServerConfig(
23+
"template1", 1000, null, 2000, true, null, networkAccessPointList, null, false);
2324

2425
WlsServerConfig wlsServerConfig =
2526
WlsDynamicServerConfig.create("server1", 2, "cluster1", "domain1", false, template);
@@ -37,7 +38,8 @@ public void testCreateWithNullPorts() {
3738
List<NetworkAccessPoint> networkAccessPointList = new ArrayList<>();
3839
networkAccessPointList.add(networkAccessPoint);
3940
WlsServerConfig template =
40-
new WlsServerConfig("template1", null, null, null, true, null, networkAccessPointList);
41+
new WlsServerConfig(
42+
"template1", null, null, null, true, null, networkAccessPointList, null, false);
4143

4244
WlsServerConfig wlsServerConfig =
4345
WlsDynamicServerConfig.create("server1", 2, "cluster1", "domain1", false, template);
@@ -55,7 +57,8 @@ public void testCreateWithCalculatedPorts() {
5557
List<NetworkAccessPoint> networkAccessPointList = new ArrayList<>();
5658
networkAccessPointList.add(networkAccessPoint);
5759
WlsServerConfig template =
58-
new WlsServerConfig("template1", 1000, null, 2000, true, null, networkAccessPointList);
60+
new WlsServerConfig(
61+
"template1", 1000, null, 2000, true, null, networkAccessPointList, null, false);
5962

6063
WlsServerConfig wlsServerConfig =
6164
WlsDynamicServerConfig.create("server1", 2, "cluster1", "domain1", true, template);
@@ -73,7 +76,8 @@ public void testCreateWithCalculatedDefaultPorts() {
7376
List<NetworkAccessPoint> networkAccessPointList = new ArrayList<>();
7477
networkAccessPointList.add(networkAccessPoint);
7578
WlsServerConfig template =
76-
new WlsServerConfig("template1", null, null, null, true, null, networkAccessPointList);
79+
new WlsServerConfig(
80+
"template1", null, null, null, true, null, networkAccessPointList, null, false);
7781

7882
WlsServerConfig wlsServerConfig =
7983
WlsDynamicServerConfig.create("server1", 2, "cluster1", "domain1", true, template);

0 commit comments

Comments
 (0)