summaryrefslogtreecommitdiffstats
path: root/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/GlusterServerService.java
diff options
context:
space:
mode:
authorSelvasundaram <selvam@gluster.com>2011-08-18 21:24:30 +0530
committerSelvasundaram <selvam@gluster.com>2011-08-18 21:24:30 +0530
commiteeac0d5ae3d106b2f19a29fb643336e289acb0fa (patch)
tree63ec563708db4f4b894b0ef723ddf3127429f2c2 /src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/GlusterServerService.java
parent77c9470096a4abf1304474f1c31015812ec7b697 (diff)
Avoiding the delete CIFS config when uncheck with empty users
and the volume was not having CIFS user config. Using new online server exception handling issue fix
Diffstat (limited to 'src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/GlusterServerService.java')
-rw-r--r--src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/GlusterServerService.java44
1 files changed, 26 insertions, 18 deletions
diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/GlusterServerService.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/GlusterServerService.java
index d4f484f4..72e414fc 100644
--- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/GlusterServerService.java
+++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/GlusterServerService.java
@@ -81,12 +81,15 @@ public class GlusterServerService {
// check if online server has gone offline. If yes, try again one more time.
if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) {
// online server has gone offline! try with a different one.
- onlineServer = clusterService.getNewOnlineServer(clusterName);
- }
- if (onlineServer == null) {
- throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]");
+ onlineServer = clusterService.getNewOnlineServer(clusterName);
+ if (onlineServer == null) {
+ throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]");
+ }
+ glusterServers = getGlusterServers(clusterName, onlineServer, fetchDetails, maxCount, previousServerName);
+ } else {
+ throw new GlusterRuntimeException(e.getMessage());
}
- glusterServers = getGlusterServers(clusterName, onlineServer, fetchDetails, maxCount, previousServerName);
+
}
return glusterServers;
}
@@ -101,12 +104,13 @@ public class GlusterServerService {
if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) {
// online server has gone offline! try with a different one.
onlineServer = clusterService.getNewOnlineServer(clusterName);
+ if (onlineServer == null) {
+ throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]");
+ }
+ glusterServers = glusterUtil.getGlusterServers(onlineServer);
+ } else {
+ throw new GlusterRuntimeException(e.getMessage());
}
- if (onlineServer == null) {
- throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]");
- }
-
- glusterServers = glusterUtil.getGlusterServers(onlineServer);
}
// skip the servers by maxCount / previousServerName
@@ -166,11 +170,13 @@ public class GlusterServerService {
if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) {
// online server has gone offline! try with a different one.
onlineServer = clusterService.getNewOnlineServer(clusterName);
+ if (onlineServer == null) {
+ throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]");
+ }
+ server = glusterUtil.getGlusterServer(onlineServer, serverName);
+ } else {
+ throw new GlusterRuntimeException(e.getMessage());
}
- if (onlineServer == null) {
- throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]");
- }
- server = glusterUtil.getGlusterServer(onlineServer, serverName);
}
if (fetchDetails && server.isOnline()) {
@@ -226,11 +232,13 @@ public class GlusterServerService {
if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) {
// online server has gone offline! try with a different one.
onlineServer = clusterService.getNewOnlineServer(clusterName, serverName);
+ if (onlineServer == null) {
+ throw new GlusterRuntimeException("No online server found in cluster [" + clusterName + "]");
+ }
+ glusterUtil.removeServer(onlineServer.getName(), serverName);
+ } else {
+ throw new GlusterRuntimeException(e.getMessage());
}
- if (onlineServer == null) {
- throw new GlusterRuntimeException("No online server found in cluster [" + clusterName + "]");
- }
- glusterUtil.removeServer(onlineServer.getName(), serverName);
}
try {