@Override public String toString() { return "QueueConnectionRequest{group=" + getServerGroup() + ", excluded=" + getExcludedServers() + ", redundant= " + redundantCopies + ",findDurable=" + findDurable + ",proxyId=" + proxyId + "}"; }
private Object pickQueueServers(QueueConnectionRequest clientRequest) { Set excludedServers = new HashSet(clientRequest.getExcludedServers()); if (clientRequest.isFindDurable() && clientRequest.getProxyId().isDurable()) { servers = FindDurableQueueProcessor.sendAndFind(this, clientRequest.getProxyId(), getDistributionManager()); if (clientRequest.getRedundantCopies() == -1) { candidates = loadSnapshot.getServersForQueue(clientRequest.getProxyId(), clientRequest.getServerGroup(), excludedServers, -1); } else if (clientRequest.getRedundantCopies() > servers.size()) { int count = clientRequest.getRedundantCopies() - servers.size(); candidates = loadSnapshot.getServersForQueue(clientRequest.getProxyId(), clientRequest.getServerGroup(), excludedServers, count); } else {
@Override public List/* ServerLocation */ findServersForQueue(Set/* <ServerLocation> */ excludedServers, int numServers, ClientProxyMembershipID proxyId, boolean findDurableQueue) { if (PoolImpl.TEST_DURABLE_IS_NET_DOWN) { return new ArrayList(); } QueueConnectionRequest request = new QueueConnectionRequest(proxyId, numServers, excludedServers, serverGroup, findDurableQueue); QueueConnectionResponse response = (QueueConnectionResponse) queryLocators(request); if (response == null) { throw new NoAvailableLocatorsException( "Unable to connect to any locators in the list " + locators); } List result = response.getServers(); return result; }