public boolean checkAuthorization(String groupName, String groupPassword, Address target) { AbstractRemotelyCallable<Boolean> authorizationCall = new AuthorizationCall(groupName, groupPassword); AsyncRemotelyBooleanOp op = new NoneMemberAsyncRemotelyBooleanOp(authorizationCall, target, true); op.execute(); return op.getResultAsBoolean(); }
void doCall(AbstractRemotelyCallable callable, List<Address> targets, boolean ignoreThis) { List<AsyncRemotelyBooleanOp> calls = new ArrayList<AsyncRemotelyBooleanOp>(targets.size()); for (final Address target : targets) { boolean skip = ignoreThis && thisAddress.equals(target); if (!skip) { AsyncRemotelyBooleanOp op = new AsyncRemotelyBooleanOp(callable, target, false); op.execute(); calls.add(op); } } for (AsyncRemotelyBooleanOp call : calls) { if (!call.getResultAsBoolean(5)) { targets.remove(call.getTarget()); } } }
public void finalizeJoin() { Set<Member> members = node.getClusterImpl().getMembers(); List<AsyncRemotelyBooleanOp> calls = new ArrayList<AsyncRemotelyBooleanOp>(); for (Member m : members) { MemberImpl member = (MemberImpl) m; if (!member.localMember()) { AsyncRemotelyBooleanOp op = new AsyncRemotelyBooleanOp(new FinalizeJoin(), member.getAddress(), false); op.execute(); calls.add(op); } } for (AsyncRemotelyBooleanOp call : calls) { call.getResultAsBoolean(); } }