} catch (Exception e) {
validJoinRequest = false;
}
final Connection conn = joinRequest.getConnection();
if (validJoinRequest) {
final MemberImpl member = getMember(joinMessage.getAddress());
if (member != null) {
if (joinMessage.getUuid().equals(member.getUuid())) {
if (logger.isFinestEnabled()) {
String message = "Ignoring join request, member already exists.. => " + joinMessage;
logger.finest(message);
}
// send members update back to node trying to join again...
nodeEngine.getOperationService().send(new MemberInfoUpdateOperation(createMemberInfos(getMemberList(), true), getClusterTime(), false),
member.getAddress());
return;
}
// If this node is master then remove old member and process join request.
// If requesting address is equal to master node's address, that means master node
// somehow disconnected and wants to join back.
// So drop old member and process join request if this node becomes master.
if (node.isMaster() || member.getAddress().equals(node.getMasterAddress())) {
logger.warning("New join request has been received from an existing endpoint! => " + member
+ " Removing old member and processing join request...");
doRemoveAddress(member.getAddress(), false);
}
}
final boolean multicastEnabled = node.getConfig().getNetworkConfig().getJoin().getMulticastConfig().isEnabled();
if (!multicastEnabled && node.isActive() && node.joined() && node.getMasterAddress() != null && !node.isMaster()) {
sendMasterAnswer(joinMessage);