public static List<String> getTargets(final Domain me, final String tgt) { List<String> targets = new ArrayList<String>(); if (!tgt.equals("domain")) { targets.add(tgt); } else { targets = me.getAllTargets(); } return targets; }
public static List<String> getAllReferencedTargetsForApplication( Domain me, String appName) { List<String> referencedTargets = new ArrayList<String>(); for (String target : me.getAllTargets()) { if (me.getApplicationRefInTarget(appName, target) != null) { referencedTargets.add(target); } } return referencedTargets; }
public static List<String> getAllReferencedTargetsForApplication( Domain me, String appName) { List<String> referencedTargets = new ArrayList<String>(); for (String target : me.getAllTargets()) { if (me.getApplicationRefInTarget(appName, target) != null) { referencedTargets.add(target); } } return referencedTargets; }
public static List<ApplicationRef> getApplicationRefsInTarget( Domain me, String tgt, boolean includeInstances) { List<String> targets = new ArrayList<String>(); if (!tgt.equals("domain")) { targets.add(tgt); } else { targets = me.getAllTargets(); } List<ApplicationRef> allAppRefs = new ArrayList<ApplicationRef>(); for (String target : targets) { Server server = me.getServerNamed(target); if (server != null) { allAppRefs.addAll(server.getApplicationRef()); } else { Cluster cluster = getClusterNamed(me, target); if (cluster != null) { allAppRefs.addAll(cluster.getApplicationRef()); if (includeInstances) { for (Server svr : cluster.getInstances() ) { allAppRefs.addAll(svr.getApplicationRef()); } } } } } return allAppRefs; }
public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); ActionReport.MessagePart part = report.getTopMessagePart(); List<String> targets = null; if (appName == null || appName.equals("*")) { targets = domain.getAllTargets(); } else { targets = domain.getAllReferencedTargetsForApplication(appName); } for (String target : targets) { ActionReport.MessagePart childPart = part.addChild(); childPart.setMessage(target); } } }
List<String> targets = domain.getAllTargets(); for(String aTarget : targets) { if(CommandTarget.CLUSTER.isValid(habitat, aTarget) &&
List<String> targets = domain.getAllTargets(); for(String aTarget : targets) { if(CommandTarget.CLUSTER.isValid(habitat, aTarget) &&
List<String> allTargets = domain.getAllTargets(); for (String target : allTargets) { Server servr = domain.getServerNamed(target);