private boolean validateParams() { // another sort of weird scenario is that if the whichTarget is set to "domain", // that means ALL instances in the domains. To make life easier -- we just //set the whichTarget to zilch to signal all instances in domain if ("domain".equals(whichTarget)) { whichTarget = null; } // standaloneonly AND a whichTarget are mutually exclusive if (standaloneonly && StringUtils.ok(whichTarget)) { fail(Strings.get("list.instances.targetWithStandaloneOnly")); return false; } // long_opt is not allowed with nostatus. // It could be allowed in the future if desired but the table code needs // to change. if (long_opt && nostatus) { fail(Strings.get("list.instances.longAndNoStatus")); return false; } // details details details! // if the whichTarget is the weird screwy "server" then fail. // TODO - we *could* show DAS status in the future but it's stupid // since this command ONLY runs on DAS -- it is obviously running!! if (!notDas(whichTarget)) { fail(Strings.get("list.instances.serverTarget")); return false; } return true; }
private List<Server> getServersForNodeOrConfig() { if (whichTarget == null) throw new NullPointerException("impossible!"); List<Server> list = getServersForNode(); if (list == null) { list = getServersForConfig(); } return list; }
if (!validateParams()) { return; serverList = createServerList(); fail(Strings.get("list.instances.badTarget", whichTarget)); return; String msg = Strings.get("list.instances.onlyRunsOnDas"); logger.warning(msg); fail(msg); return; noStatus(serverList); yesStatus(serverList, timeoutInMsec, logger);
if (notDas(name)) { if (firstServer) { firstServer = false;
private List<Server> createServerList() { // 1. no whichTarget specified if (!StringUtils.ok(whichTarget)) return allServers.getServer(); ReferenceContainer rc = domain.getReferenceContainerNamed(whichTarget); // 2. Not a server or a cluster. Could be a config or a Node if (rc == null) { return getServersForNodeOrConfig(); } else if (rc.isServer()) { List<Server> l = new LinkedList<Server>(); l.add((Server) rc); return l; } else if (rc.isCluster()) { // can't be anything else currently! (June 2010) Cluster cluster = (Cluster) rc; return cluster.getInstances(); } else { return null; } }
if (!validateParams()) { return; serverList = createServerList(); fail(Strings.get("list.instances.badTarget", whichTarget )); return; String msg = Strings.get("list.instances.onlyRunsOnDas"); logger.warning(msg); fail(msg); return; noStatus(serverList); yesStatus(serverList, timeoutInMsec, logger);
if (notDas(name)) { if (firstServer) { firstServer = false;
private List<Server> createServerList() { // 1. no whichTarget specified if (!StringUtils.ok(whichTarget)) return allServers.getServer(); ReferenceContainer rc = domain.getReferenceContainerNamed(whichTarget); // 2. Not a server or a cluster. Could be a config or a Node if (rc == null) { return getServersForNodeOrConfig(); } else if (rc.isServer()) { List<Server> l = new LinkedList<Server>(); l.add((Server) rc); return l; } else if (rc.isCluster()) { // can't be anything else currently! (June 2010) Cluster cluster = (Cluster) rc; return cluster.getInstances(); } else { return null; } }
private List<Server> getServersForNodeOrConfig() { if (whichTarget == null) throw new NullPointerException("impossible!"); List<Server> list = getServersForNode(); if (list == null) { list = getServersForConfig(); } return list; }
private boolean validateParams() { // another sort of weird scenario is that if the whichTarget is set to "domain", // that means ALL instances in the domains. To make life easier -- we just //set the whichTarget to zilch to signal all instances in domain if ("domain".equals(whichTarget)) { whichTarget = null; } // standaloneonly AND a whichTarget are mutually exclusive if (standaloneonly && StringUtils.ok(whichTarget)) { fail(Strings.get("list.instances.targetWithStandaloneOnly")); return false; } // long_opt is not allowed with nostatus. // It could be allowed in the future if desired but the table code needs // to change. if (long_opt && nostatus) { fail(Strings.get("list.instances.longAndNoStatus")); return false; } // details details details! // if the whichTarget is the weird screwy "server" then fail. // TODO - we *could* show DAS status in the future but it's stupid // since this command ONLY runs on DAS -- it is obviously running!! if (!notDas(whichTarget)) { fail(Strings.get("list.instances.serverTarget")); return false; } return true; }
String clusterName = (cluster != null) ? cluster.getName() : null; if (notDas(name)) { ActionReport tReport = habitat.getComponent(ActionReport.class, "html"); InstanceInfo ii = new InstanceInfo(
String clusterName = (cluster != null) ? cluster.getName() : null; if (notDas(name)) { ActionReport tReport = habitat.getService(ActionReport.class, "html"); InstanceInfo ii = new InstanceInfo(