Skip to content

Commit b64689d

Browse files
committed
Remove schema elements that code from domain topology scan
1 parent aeb3e2c commit b64689d

40 files changed

+335
-405
lines changed

model/src/main/java/oracle/kubernetes/weblogic/domain/AdminServerConfigurator.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
@SuppressWarnings("UnusedReturnValue")
1010
public interface AdminServerConfigurator extends ServerConfigurator {
1111

12-
AdminServerConfigurator withPort(int port);
13-
1412
AdminServerConfigurator withNodePort(int nodePort);
1513

1614
AdminServerConfigurator withExportedNetworkAccessPoints(String... names);

model/src/main/java/oracle/kubernetes/weblogic/domain/DomainConfigurator.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,8 @@ public DomainConfigurator withDomainHomeInImage(boolean domainHomeInImage) {
5454
return this;
5555
}
5656

57-
/**
58-
* Defines a name for the domain's admin server.
59-
*
60-
* @param adminServerName the name of the admin server
61-
*/
62-
public abstract AdminServerConfigurator configureAdminServer(String adminServerName);
57+
/** Defines a name for the domain's admin server. */
58+
public abstract AdminServerConfigurator configureAdminServer();
6359

6460
public void withDefaultReplicaCount(int replicas) {
6561
getDomainSpec().setReplicas(replicas);
@@ -246,10 +242,6 @@ protected DomainSpec getDomainSpec() {
246242
return domain.getSpec();
247243
}
248244

249-
protected String getAsName() {
250-
return domain.getAsName();
251-
}
252-
253245
public abstract DomainConfigurator withAdditionalVolume(String name, String path);
254246

255247
public abstract DomainConfigurator withAdditionalVolumeMount(String name, String path);

model/src/main/java/oracle/kubernetes/weblogic/domain/v2/Domain.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -271,24 +271,6 @@ public V1SecretReference getAdminSecret() {
271271
return spec.getAdminSecret();
272272
}
273273

274-
/**
275-
* Returns the name of the admin server.
276-
*
277-
* @return admin server name
278-
*/
279-
public String getAsName() {
280-
return spec.getAsName();
281-
}
282-
283-
/**
284-
* Returns the port used by the admin server.
285-
*
286-
* @return admin server port
287-
*/
288-
public Integer getAsPort() {
289-
return spec.getAsPort();
290-
}
291-
292274
/**
293275
* Returns the domain unique identifier.
294276
*
@@ -298,15 +280,6 @@ public String getDomainUID() {
298280
return spec.getDomainUID();
299281
}
300282

301-
/**
302-
* Returns the domain name
303-
*
304-
* @return domain name
305-
*/
306-
public String getDomainName() {
307-
return spec.getDomainName();
308-
}
309-
310283
public String getLogHome() {
311284
return spec.getLogHome();
312285
}

model/src/main/java/oracle/kubernetes/weblogic/domain/v2/DomainSpec.java

Lines changed: 3 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ public class DomainSpec extends BaseConfiguration {
3838
@Pattern("^[a-z0-9_.]{1,253}$")
3939
private String domainUID;
4040

41-
/** Domain name (Required) */
42-
@NotNull private String domainName;
43-
4441
/**
4542
* Domain home
4643
*
@@ -58,20 +55,6 @@ public class DomainSpec extends BaseConfiguration {
5855
*/
5956
@Valid @NotNull private V1SecretReference adminSecret;
6057

61-
/**
62-
* Admin server name. Note: Possibly temporary as we could find this value through domain home
63-
* inspection. (Required)
64-
*/
65-
@NotNull private String asName;
66-
67-
/**
68-
* Administration server port. Note: Possibly temporary as we could find this value through domain
69-
* home inspection. (Required)
70-
*/
71-
@NotNull
72-
@Range(minimum = 100)
73-
private Integer asPort;
74-
7558
/**
7659
* The in-pod name of the directory to store the domain, node manager, server logs, and server
7760
* .out files in.
@@ -207,14 +190,13 @@ public DomainSpec withCluster(Cluster cluster) {
207190
return this;
208191
}
209192

210-
AdminServer getOrCreateAdminServer(String adminServerName) {
193+
AdminServer getOrCreateAdminServer() {
211194
if (adminServer != null) return adminServer;
212195

213-
return createAdminServer(adminServerName);
196+
return createAdminServer();
214197
}
215198

216-
private AdminServer createAdminServer(String adminServerName) {
217-
setAsName(adminServerName);
199+
private AdminServer createAdminServer() {
218200
AdminServer adminServer = new AdminServer();
219201
setAdminServer(adminServer);
220202
return adminServer;
@@ -254,35 +236,6 @@ public DomainSpec withDomainUID(String domainUID) {
254236
return this;
255237
}
256238

257-
/**
258-
* Domain name (Required)
259-
*
260-
* @return domain name
261-
*/
262-
public String getDomainName() {
263-
return domainName;
264-
}
265-
266-
/**
267-
* Domain name (Required)
268-
*
269-
* @param domainName domain name
270-
*/
271-
public void setDomainName(String domainName) {
272-
this.domainName = domainName;
273-
}
274-
275-
/**
276-
* Domain name (Required)
277-
*
278-
* @param domainName domain name
279-
* @return this
280-
*/
281-
public DomainSpec withDomainName(String domainName) {
282-
this.domainName = domainName;
283-
return this;
284-
}
285-
286239
/**
287240
* Domain home
288241
*
@@ -335,48 +288,6 @@ public DomainSpec withAdminSecret(V1SecretReference adminSecret) {
335288
return this;
336289
}
337290

338-
public String getAsName() {
339-
return asName;
340-
}
341-
342-
private void setAsName(String asName) {
343-
this.asName = asName;
344-
}
345-
346-
/**
347-
* Admin server name. Note: Possibly temporary as we could find this value through domain home
348-
* inspection. (Required)
349-
*
350-
* @param asName admin server name
351-
* @return this
352-
*/
353-
public DomainSpec withAsName(String asName) {
354-
this.asName = asName;
355-
return this;
356-
}
357-
358-
public Integer getAsPort() {
359-
return asPort;
360-
}
361-
362-
@SuppressWarnings("WeakerAccess")
363-
// public access is needed for yaml processing
364-
public void setAsPort(Integer asPort) {
365-
this.asPort = asPort;
366-
}
367-
368-
/**
369-
* Administration server port. Note: Possibly temporary as we could find this value through domain
370-
* home inspection. (Required)
371-
*
372-
* @param asPort admin server port
373-
* @return this
374-
*/
375-
public DomainSpec withAsPort(Integer asPort) {
376-
this.asPort = asPort;
377-
return this;
378-
}
379-
380291
@Nullable
381292
public String getImage() {
382293
return image;
@@ -581,12 +492,9 @@ public String toString() {
581492
new ToStringBuilder(this)
582493
.appendSuper(super.toString())
583494
.append("domainUID", domainUID)
584-
.append("domainName", domainName)
585495
.append("domainHome", domainHome)
586496
.append("domainHomeInImage", domainHomeInImage)
587497
.append("adminSecret", adminSecret)
588-
.append("asName", asName)
589-
.append("asPort", asPort)
590498
.append("image", image)
591499
.append("imagePullPolicy", imagePullPolicy)
592500
.append("storage", storage)
@@ -610,12 +518,9 @@ public int hashCode() {
610518
new HashCodeBuilder()
611519
.appendSuper(super.hashCode())
612520
.append(domainUID)
613-
.append(domainName)
614521
.append(domainHome)
615522
.append(domainHomeInImage)
616523
.append(adminSecret)
617-
.append(asName)
618-
.append(asPort)
619524
.append(image)
620525
.append(imagePullPolicy)
621526
.append(storage)
@@ -643,12 +548,9 @@ public boolean equals(Object other) {
643548
new EqualsBuilder()
644549
.appendSuper(super.equals(other))
645550
.append(domainUID, rhs.domainUID)
646-
.append(domainName, rhs.domainName)
647551
.append(domainHome, rhs.domainHome)
648552
.append(domainHomeInImage, rhs.domainHomeInImage)
649553
.append(adminSecret, rhs.adminSecret)
650-
.append(asName, rhs.asName)
651-
.append(asPort, rhs.asPort)
652554
.append(image, rhs.image)
653555
.append(storage, rhs.storage)
654556
.append(imagePullPolicy, rhs.imagePullPolicy)

model/src/main/java/oracle/kubernetes/weblogic/domain/v2/DomainV2Configurator.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ private void setApiVersion(Domain domain) {
3939
}
4040

4141
@Override
42-
public AdminServerConfigurator configureAdminServer(String adminServerName) {
43-
return new AdminServerConfiguratorImpl(getOrCreateAdminServer(adminServerName));
42+
public AdminServerConfigurator configureAdminServer() {
43+
return new AdminServerConfiguratorImpl(getOrCreateAdminServer());
4444
}
4545

4646
@Override
@@ -124,12 +124,6 @@ class AdminServerConfiguratorImpl extends ServerConfiguratorImpl
124124
this.adminServer = adminServer;
125125
}
126126

127-
@Override
128-
public AdminServerConfigurator withPort(int port) {
129-
getDomainSpec().setAsPort(port);
130-
return this;
131-
}
132-
133127
@Override
134128
public AdminServerConfigurator withNodePort(int nodePort) {
135129
adminServer.setNodePort(nodePort);
@@ -162,8 +156,8 @@ public ExportedNetworkAccessPoint configureExportedNetworkAccessPoint(String cha
162156
}
163157
}
164158

165-
private AdminServer getOrCreateAdminServer(String adminServerName) {
166-
return getDomainSpec().getOrCreateAdminServer(adminServerName);
159+
private AdminServer getOrCreateAdminServer() {
160+
return getDomainSpec().getOrCreateAdminServer();
167161
}
168162

169163
@Override
@@ -365,7 +359,7 @@ private Cluster createCluster(@Nonnull String clusterName) {
365359

366360
@Override
367361
public void setShuttingDown(boolean shuttingDown) {
368-
configureAdminServer("").withServerStartPolicy(shuttingDown ? START_NEVER : START_ALWAYS);
362+
configureAdminServer().withServerStartPolicy(shuttingDown ? START_NEVER : START_ALWAYS);
369363
}
370364

371365
class ClusterConfiguratorImpl implements ClusterConfigurator {

model/src/test/java/oracle/kubernetes/weblogic/domain/DomainTestBase.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,11 @@ public abstract class DomainTestBase {
3838
private static final String VALUE1 = "value1";
3939
private static final String VALUE2 = "value2";
4040
private static final V1SecretReference SECRET = new V1SecretReference().name("secret");
41-
private static final int AS_PORT = 8000;
4241
private static final String NS = "test-namespace";
43-
private static final String DOMAIN_NAME = "test";
4442
private static final String DOMAIN_UID = "uid1";
4543
private static final String DOMAIN_V2_SAMPLE_YAML = "v2/domain-sample.yaml";
4644
private static final String IMAGE = "myimage";
4745
private static final String PULL_SECRET_NAME = "pull-secret";
48-
private static final String AS_NAME = "admin";
4946
protected static final String CLUSTER_NAME = "cluster1";
5047
protected static final String SERVER1 = "ms1";
5148
protected static final String SERVER2 = "ms2";
@@ -54,13 +51,7 @@ public abstract class DomainTestBase {
5451
protected static Domain createDomain() {
5552
return new Domain()
5653
.withMetadata(new V1ObjectMeta().namespace(NS))
57-
.withSpec(
58-
new DomainSpec()
59-
.withAdminSecret(SECRET)
60-
.withAsName(AS_NAME)
61-
.withAsPort(AS_PORT)
62-
.withDomainName(DOMAIN_NAME)
63-
.withDomainUID(DOMAIN_UID));
54+
.withSpec(new DomainSpec().withAdminSecret(SECRET).withDomainUID(DOMAIN_UID));
6455
}
6556

6657
protected abstract DomainConfigurator configureDomain(Domain domain);
@@ -75,14 +66,11 @@ protected static String getNamespace() {
7566

7667
@Test
7768
public void canGetAdminServerInfoFromDomain() {
78-
assertThat(domain.getAsName(), equalTo(AS_NAME));
79-
assertThat(domain.getAsPort(), equalTo(AS_PORT));
8069
assertThat(domain.getAdminSecret(), equalTo(SECRET));
8170
}
8271

8372
@Test
8473
public void canGetDomainInfoFromDomain() {
85-
assertThat(domain.getDomainName(), equalTo(DOMAIN_NAME));
8674
assertThat(domain.getDomainUID(), equalTo(DOMAIN_UID));
8775
}
8876

@@ -203,7 +191,7 @@ public void whenSpecified_adminServerHasEnvironmentVariables() {
203191
}
204192

205193
protected AdminServerConfigurator configureAdminServer() {
206-
return configureDomain(domain).configureAdminServer(AS_NAME).withPort(AS_PORT);
194+
return configureDomain(domain).configureAdminServer();
207195
}
208196

209197
private V1EnvVar[] createEnvironment() {

model/src/test/java/oracle/kubernetes/weblogic/domain/v2/DomainV2Test.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public void whenExportT3ChannelsNotDefined_exportedNamesIsEmpty() {
247247

248248
@Test
249249
public void whenExportT3ChannelsDefined_returnChannelNames() {
250-
AdminServerConfigurator configurator = configureDomain(domain).configureAdminServer("");
250+
AdminServerConfigurator configurator = configureDomain(domain).configureAdminServer();
251251
configurator.withExportedNetworkAccessPoints("channel1", "channel2");
252252

253253
assertThat(
@@ -263,7 +263,7 @@ public void whenAdminServerConfiguredWithNodePort_returnNodePort() {
263263

264264
@Test
265265
public void whenExportT3ChannelsDefinedWithLabels_returnChannelNames() {
266-
AdminServerConfigurator configurator = configureDomain(domain).configureAdminServer("");
266+
AdminServerConfigurator configurator = configureDomain(domain).configureAdminServer();
267267
configurator
268268
.configureExportedNetworkAccessPoint("channel1")
269269
.addLabel("label1", "value1")
@@ -279,7 +279,7 @@ public void whenExportT3ChannelsDefinedWithLabels_returnChannelNames() {
279279

280280
@Test
281281
public void whenExportT3ChannelsDefinedWithLabels_returnLabels() {
282-
AdminServerConfigurator configurator = configureDomain(domain).configureAdminServer("");
282+
AdminServerConfigurator configurator = configureDomain(domain).configureAdminServer();
283283
configurator
284284
.configureExportedNetworkAccessPoint("channel1")
285285
.addLabel("label1", "value1")
@@ -290,7 +290,7 @@ public void whenExportT3ChannelsDefinedWithLabels_returnLabels() {
290290

291291
@Test
292292
public void whenExportT3ChannelsDefinedWithAnnotations_returnAnnotations() {
293-
AdminServerConfigurator configurator = configureDomain(domain).configureAdminServer("");
293+
AdminServerConfigurator configurator = configureDomain(domain).configureAdminServer();
294294
configurator
295295
.configureExportedNetworkAccessPoint("channel1")
296296
.addAnnotation("annotation1", "value1")

0 commit comments

Comments
 (0)