Make node field in JoinRequest private
This commit moves the node field in the JoinRequest object to be a
private field, adding a dedicated accessor. This is a minor breaking
change in that it is no longer possible for all callers to overwrite
this field, but that is a feature.
@@ -108,7 +108,11 @@ public class MembershipAction {
public static class JoinRequest extends TransportRequest {
- DiscoveryNode node;
+ private DiscoveryNode node;
+
+ public DiscoveryNode getNode() {
+ return node;
+ }
public JoinRequest() {
}
@@ -135,7 +139,7 @@ public class MembershipAction {
@Override
public void messageReceived(final JoinRequest request, final TransportChannel channel) throws Exception {
- listener.onJoin(request.node, new JoinCallback() {
+ listener.onJoin(request.getNode(), new JoinCallback() {
@Override
public void onSuccess() {
try {
