Skip to content

Commit c295463

Browse files
committed
Add cluster status and other corrections
1 parent 40e7489 commit c295463

File tree

22 files changed

+550
-229
lines changed

22 files changed

+550
-229
lines changed

docs/domains/Domain.json

Lines changed: 69 additions & 43 deletions
Large diffs are not rendered by default.

docs/domains/Domain.md

Lines changed: 52 additions & 43 deletions
Large diffs are not rendered by default.

docs/domains/index.html

Lines changed: 69 additions & 43 deletions
Large diffs are not rendered by default.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
import org.apache.commons.lang3.builder.HashCodeBuilder;
1414
import org.apache.commons.lang3.builder.ToStringBuilder;
1515

16-
@Description("AdminServer represents the operator configuration for the admin server.")
16+
@Description("AdminServer represents the operator configuration for the Administration Server.")
1717
public class AdminServer extends Server {
1818

1919
@Description(
20-
"Configures which of the admin server's WebLogic admin channels should be exposed outside"
20+
"Configures which of the Administration Server's WebLogic admin channels should be exposed outside"
2121
+ " the Kubernetes cluster via a node port service.")
2222
private AdminService adminService;
2323

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
public class AdminService implements ServiceConfigurator {
2121
@SerializedName("channels")
2222
@Description(
23-
"Specifies which of the admin server's WebLogic channels should be exposed outside "
23+
"Specifies which of the Administration Server's WebLogic channels should be exposed outside "
2424
+ "the Kubernetes cluster via a node port service, along with the node port for "
25-
+ "each channel. If not specified, the admin server's node port service will "
25+
+ "each channel. If not specified, the Administration Server's node port service will "
2626
+ "not be created.")
2727
private List<Channel> channels = new ArrayList<>();
2828

29-
@Description("Labels to associate with the external channel service")
29+
@Description("Labels to associate with the external channel service.")
3030
private Map<String, String> labels = new HashMap<>();
3131

32-
@Description("Annotations to associate with the external channel service")
32+
@Description("Annotations to associate with the external channel service.")
3333
private Map<String, String> annotations = new HashMap<>();
3434

3535
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
*/
3434
public abstract class BaseConfiguration {
3535

36-
@Description("Configuration affecting server pods")
36+
@Description("Configuration affecting server pods.")
3737
private ServerPod serverPod = new ServerPod();
3838

3939
@Description(
40-
"Customization affecting ClusterIP Kubernetes services for WebLogic server instances.")
40+
"Customization affecting ClusterIP Kubernetes services for WebLogic Server instances.")
4141
@SerializedName("serverService")
4242
@Expose
4343
private ServerService serverService = new ServerService();

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
import org.apache.commons.lang3.builder.HashCodeBuilder;
1313
import org.apache.commons.lang3.builder.ToStringBuilder;
1414

15-
@Description("Describes a single channel used by the admin server.")
15+
@Description("Describes a single channel used by the Administration Server.")
1616
public class Channel implements Comparable<Channel> {
1717
@SerializedName("channelName")
1818
@Description(
19-
"Name of channel.\n'default' refers to the admin server's default channel (configured "
19+
"Name of channel.\n'default' refers to the Administration Server's default channel (configured "
2020
+ "via the ServerMBean's ListenPort) "
21-
+ "\n'default-secure' refers to the admin server's default secure channel "
21+
+ "\n'default-secure' refers to the Administration Server's default secure channel "
2222
+ "(configured via the ServerMBean's SSLMBean's ListenPort) "
23-
+ "\n'default-admin' refers to the admin server's default administrative channel "
23+
+ "\n'default-admin' refers to the Administration Server's default administrative channel "
2424
+ "(configured via the DomainMBean's AdministrationPort) "
25-
+ "\nOtherwise, the name is the name of one of the admin server's network access points "
25+
+ "\nOtherwise, the name is the name of one of the Administration Server's network access points "
2626
+ "(configured via the ServerMBean's NetworkAccessMBeans).")
2727
@Nonnull
2828
private String channelName;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class Cluster extends BaseConfiguration implements Comparable<Cluster> {
3131
private String clusterName;
3232

3333
/** The number of replicas to run in the cluster, if specified. */
34-
@Description("The number of managed servers to run in this cluster.")
34+
@Description("The number of cluster members to run.")
3535
@Range(minimum = 0)
3636
private Integer replicas;
3737

@@ -53,7 +53,7 @@ public class Cluster extends BaseConfiguration implements Comparable<Cluster> {
5353
@Range(minimum = 1)
5454
private Integer maxUnavailable;
5555

56-
@Description("Customization affecting ClusterIP Kubernetes services for WebLogic cluster.")
56+
@Description("Customization affecting ClusterIP Kubernetes services for the WebLogic cluster.")
5757
@SerializedName("clusterService")
5858
@Expose
5959
private KubernetesResource clusterService = new KubernetesResource();
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
// Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved.
2+
// Licensed under the Universal Permissive License v 1.0 as shown at
3+
// http://oss.oracle.com/licenses/upl.
4+
5+
package oracle.kubernetes.weblogic.domain.model;
6+
7+
import javax.validation.Valid;
8+
import javax.validation.constraints.NotNull;
9+
10+
import com.google.gson.annotations.Expose;
11+
import com.google.gson.annotations.SerializedName;
12+
import oracle.kubernetes.json.Description;
13+
import oracle.kubernetes.json.Range;
14+
import org.apache.commons.lang3.builder.EqualsBuilder;
15+
import org.apache.commons.lang3.builder.HashCodeBuilder;
16+
import org.apache.commons.lang3.builder.ToStringBuilder;
17+
18+
/** ServerStatus describes the current status of a specific WebLogic Server. */
19+
public class ClusterStatus implements Comparable<ClusterStatus> {
20+
21+
@Description("WebLogic cluster name. Required.")
22+
@SerializedName("clusterName")
23+
@Expose
24+
private String clusterName;
25+
26+
/** The number of intended cluster members. Required. */
27+
@Description("The number of intended cluster members. Required.")
28+
@Range(minimum = 0)
29+
private Integer replicas;
30+
31+
/** The number of ready cluster members. Required. */
32+
@Description("The number of ready cluster members. Required.")
33+
@Range(minimum = 0)
34+
private Integer readyReplicas;
35+
36+
/**
37+
* WebLogic cluster name. Required.
38+
*
39+
* @return cluster name
40+
*/
41+
public String getClusterName() {
42+
return clusterName;
43+
}
44+
45+
/**
46+
* WebLogic cluster name. Required.
47+
*
48+
* @param clusterName cluster name
49+
*/
50+
public void setClusterName(String clusterName) {
51+
this.clusterName = clusterName;
52+
}
53+
54+
/**
55+
* WebLogic cluster name. Required.
56+
*
57+
* @param clusterName cluster name
58+
* @return this
59+
*/
60+
public ClusterStatus withClusterName(String clusterName) {
61+
this.clusterName = clusterName;
62+
return this;
63+
}
64+
65+
public Integer getReplicas() {
66+
return replicas;
67+
}
68+
69+
public void setReplicas(Integer replicas) {
70+
this.replicas = replicas;
71+
}
72+
73+
public ClusterStatus withReplicas(Integer replicas) {
74+
this.replicas = replicas;
75+
return this;
76+
}
77+
78+
public Integer getReadyReplicas() {
79+
return readyReplicas;
80+
}
81+
82+
public void setReadyReplicas(Integer readyReplicas) {
83+
this.readyReplicas = readyReplicas;
84+
}
85+
86+
public ClusterStatus withReadyReplicas(Integer readyReplicas) {
87+
this.readyReplicas = readyReplicas;
88+
return this;
89+
}
90+
91+
@Override
92+
public String toString() {
93+
return new ToStringBuilder(this)
94+
.append("clusterName", clusterName)
95+
.append("replicas", replicas)
96+
.append("readyReplicas", readyReplicas)
97+
.toString();
98+
}
99+
100+
@Override
101+
public int hashCode() {
102+
return new HashCodeBuilder()
103+
.append(clusterName)
104+
.append(replicas)
105+
.append(readyReplicas)
106+
.toHashCode();
107+
}
108+
109+
@Override
110+
public boolean equals(Object other) {
111+
if (other == this) {
112+
return true;
113+
}
114+
if (!(other instanceof ClusterStatus)) {
115+
return false;
116+
}
117+
ClusterStatus rhs = ((ClusterStatus) other);
118+
return new EqualsBuilder()
119+
.append(clusterName, rhs.clusterName)
120+
.append(replicas, rhs.replicas)
121+
.append(readyReplicas, rhs.readyReplicas)
122+
.isEquals();
123+
}
124+
125+
@Override
126+
public int compareTo(ClusterStatus o) {
127+
return clusterName.compareTo(o.clusterName);
128+
}
129+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public class Domain {
6666
@SerializedName("spec")
6767
@Expose
6868
@Valid
69-
@Description("The specification of the domain. Required")
69+
@Description("The specification of the domain. Required.")
7070
@Nonnull
7171
private DomainSpec spec = new DomainSpec();
7272

0 commit comments

Comments
 (0)