Search in sources :

Example 1 with NoAvailableLocatorsException

use of org.apache.geode.cache.client.NoAvailableLocatorsException in project geode by apache.

the class AutoConnectionSourceImpl method findServer.

public ServerLocation findServer(Set excludedServers) {
    if (PoolImpl.TEST_DURABLE_IS_NET_DOWN) {
        return null;
    }
    ClientConnectionRequest request = new ClientConnectionRequest(excludedServers, serverGroup);
    ClientConnectionResponse response = (ClientConnectionResponse) queryLocators(request);
    if (response == null) {
        // getLogger().warning("Unable to connect to any locators in the list " + locators);
        throw new NoAvailableLocatorsException("Unable to connect to any locators in the list " + locators);
    }
    return response.getServer();
}
Also used : ClientConnectionResponse(org.apache.geode.cache.client.internal.locator.ClientConnectionResponse) ClientConnectionRequest(org.apache.geode.cache.client.internal.locator.ClientConnectionRequest) NoAvailableLocatorsException(org.apache.geode.cache.client.NoAvailableLocatorsException)

Example 2 with NoAvailableLocatorsException

use of org.apache.geode.cache.client.NoAvailableLocatorsException in project geode by apache.

the class AutoConnectionSourceImpl method findReplacementServer.

public ServerLocation findReplacementServer(ServerLocation currentServer, Set excludedServers) {
    if (PoolImpl.TEST_DURABLE_IS_NET_DOWN) {
        return null;
    }
    ClientReplacementRequest request = new ClientReplacementRequest(currentServer, excludedServers, serverGroup);
    ClientConnectionResponse response = (ClientConnectionResponse) queryLocators(request);
    if (response == null) {
        // getLogger().warning("Unable to connect to any locators in the list " + locators);
        throw new NoAvailableLocatorsException("Unable to connect to any locators in the list " + locators);
    }
    return response.getServer();
}
Also used : ClientConnectionResponse(org.apache.geode.cache.client.internal.locator.ClientConnectionResponse) ClientReplacementRequest(org.apache.geode.cache.client.internal.locator.ClientReplacementRequest) NoAvailableLocatorsException(org.apache.geode.cache.client.NoAvailableLocatorsException)

Example 3 with NoAvailableLocatorsException

use of org.apache.geode.cache.client.NoAvailableLocatorsException in project geode by apache.

the class AutoConnectionSourceImpl method findServersForQueue.

public List findServersForQueue(Set 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;
}
Also used : QueueConnectionRequest(org.apache.geode.cache.client.internal.locator.QueueConnectionRequest) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) QueueConnectionResponse(org.apache.geode.cache.client.internal.locator.QueueConnectionResponse) NoAvailableLocatorsException(org.apache.geode.cache.client.NoAvailableLocatorsException)

Aggregations

NoAvailableLocatorsException (org.apache.geode.cache.client.NoAvailableLocatorsException)3 ClientConnectionResponse (org.apache.geode.cache.client.internal.locator.ClientConnectionResponse)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ClientConnectionRequest (org.apache.geode.cache.client.internal.locator.ClientConnectionRequest)1 ClientReplacementRequest (org.apache.geode.cache.client.internal.locator.ClientReplacementRequest)1 QueueConnectionRequest (org.apache.geode.cache.client.internal.locator.QueueConnectionRequest)1 QueueConnectionResponse (org.apache.geode.cache.client.internal.locator.QueueConnectionResponse)1