public static ApplicationRef getApplicationRefInTarget( Domain me, String appName, String target) { for (ApplicationRef ref : getApplicationRefsInTarget(me, target)) { if (ref.getRef().equals(appName)) { return ref; } } return null; }
public static ApplicationRef getApplicationRef(Cluster cluster, String appName) { for (ApplicationRef appRef : cluster.getApplicationRef()) { if (appRef.getRef().equals(appName)) { return appRef; } } return null; }
public static ApplicationRef getApplicationRef(Server server, String appName) { for (ApplicationRef appRef : server.getApplicationRef()) { if (appRef.getRef().equals(appName)) { return appRef; } } return null; }
public static ApplicationRef getApplicationRefInTarget( Domain me, String appName, String target) { for (ApplicationRef ref : getApplicationRefsInTarget(me, target)) { if (ref.getRef().equals(appName)) { return ref; } } return null; }
public static ApplicationRef getApplicationRef(Cluster cluster, String appName) { for (ApplicationRef appRef : cluster.getApplicationRef()) { if (appRef.getRef().equals(appName)) { return appRef; } } return null; }
public static ApplicationRef getApplicationRef(Server server, String appName) { for (ApplicationRef appRef : server.getApplicationRef()) { if (appRef.getRef().equals(appName)) { return appRef; } } return null; }
protected void registerApplications() { final List<ApplicationRef> appRefs = mServer.getApplicationRef(); for (final ApplicationRef ref : appRefs) { try { processApplicationRef(ref); } catch( final Exception e ) { // log it: we want to continue with other apps, even if this one had a problem mLogger.log( Level.INFO, AMXEELoggerInfo.registeringApplicationException, new Object[] { ref.getRef(), e}); } } }
public static List<Application> getSystemApplicationsReferencedFrom(Domain d, String sn) { if (d == null || sn == null) throw new IllegalArgumentException("Null argument"); List<Application> allApps = d.getAllDefinedSystemApplications(); if (allApps.isEmpty()) return allApps; //if there are no sys-apps, none can reference one :) //allApps now contains ALL the system applications Server s = getServerNamed(d,sn); List<Application> referencedApps = new ArrayList<Application>(); List<ApplicationRef> appsReferenced = s.getApplicationRef(); for (ApplicationRef ref : appsReferenced) { for (Application app : allApps) { if (ref.getRef().equals(app.getName())) { referencedApps.add(app); } } } return Collections.unmodifiableList(referencedApps); }
public static List<Application> getSystemApplicationsReferencedFrom(Domain d, String sn) { if (d == null || sn == null) throw new IllegalArgumentException("Null argument"); List<Application> allApps = d.getAllDefinedSystemApplications(); if (allApps.isEmpty()) return allApps; //if there are no sys-apps, none can reference one :) //allApps now contains ALL the system applications Server s = getServerNamed(d,sn); List<Application> referencedApps = new ArrayList<Application>(); List<ApplicationRef> appsReferenced = s.getApplicationRef(); for (ApplicationRef ref : appsReferenced) { for (Application app : allApps) { if (ref.getRef().equals(app.getName())) { referencedApps.add(app); } } } return Collections.unmodifiableList(referencedApps); }
public static List<Application> getApplicationsInTarget(Domain me, String target) { if (target.equals("domain")) { // special target domain return me.getApplications().getApplications(); } List<Application> apps = new ArrayList<Application>(); List<ApplicationRef> applicationRefs = me.getApplicationRefsInTarget(target); for (ApplicationRef ref : applicationRefs) { Application app = me.getApplications().getApplication(ref.getRef()); if (app != null) { apps.add(app); } } return apps; }
public static List<Application> getApplicationsInTarget(Domain me, String target) { if (target.equals("domain")) { // special target domain return me.getApplications().getApplications(); } List<Application> apps = new ArrayList<Application>(); List<ApplicationRef> applicationRefs = me.getApplicationRefsInTarget(target); for (ApplicationRef ref : applicationRefs) { Application app = me.getApplications().getApplication(ref.getRef()); if (app != null) { apps.add(app); } } return apps; }
public static ApplicationRef getApplicationRefInServer(Domain me, String sn, String name) { Servers ss = me.getServers(); List<Server> list = ss.getServer(); Server theServer = null; for (Server s : list) { if (s.getName().equals(sn)) { theServer = s; break; } } ApplicationRef aref = null; if (theServer != null) { List <ApplicationRef> arefs = theServer.getApplicationRef(); for (ApplicationRef ar : arefs) { if (ar.getRef().equals(name)) { aref = ar; break; } } } return aref; }
/** * Virtual servers are maintained in the reference contained * in Server element. First, we need to find the server * and then get the virtual server from the correct reference * * @param appName Name of the app to get vs * * @return virtual servers as a string (separated by space or comma) */ private String getVirtualServers(String appName) { String ret = null; Server server = serverContext.getDefaultServices().getService(Server.class); for (ApplicationRef appRef : server.getApplicationRef()) { if (appRef.getRef().equals(appName)) { return appRef.getVirtualServers(); } } return ret; }
public ApplicationRef getApplicationRefInServer(String sn, String name) { Servers ss = domain.getServers(); List<Server> list = ss.getServer(); Server theServer = null; for (Server s : list) { if (s.getName().equals(sn)) { theServer = s; break; } } ApplicationRef aref = null; if (theServer != null) { List <ApplicationRef> arefs = theServer.getApplicationRef(); for (ApplicationRef ar : arefs) { if (ar.getRef().equals(name)) { aref = ar; break; } } } return aref; }
public static ApplicationRef getApplicationRefInServer(Domain me, String sn, String name) { Servers ss = me.getServers(); List<Server> list = ss.getServer(); Server theServer = null; for (Server s : list) { if (s.getName().equals(sn)) { theServer = s; break; } } ApplicationRef aref = null; if (theServer != null) { List <ApplicationRef> arefs = theServer.getApplicationRef(); for (ApplicationRef ar : arefs) { if (ar.getRef().equals(name)) { aref = ar; break; } } } return aref; }
public static ApplicationRef getApplicationRefInServer(String sn, String name) { Servers ss = domain.getServers(); List<Server> list = ss.getServer(); Server theServer = null; for (Server s : list) { if (s.getName().equals(sn)) { theServer = s; break; } } ApplicationRef aref = null; if (theServer != null) { List <ApplicationRef> arefs = theServer.getApplicationRef(); for (ApplicationRef ar : arefs) { if (ar.getRef().equals(name)) { aref = ar; break; } } } return aref; }
/** * Virtual servers are maintained in the reference contained * in Server element. First, we need to find the server * and then get the virtual server from the correct reference * * @param appName Name of the app to get vs * * @return virtual servers as a string (separated by space or comma) */ private String getVirtualServers(String appName) { String ret = null; Server server = Globals.getDefaultHabitat().getComponent(Server.class); for (ApplicationRef appRef : server.getApplicationRef()) { if (appRef.getRef().equals(appName)) { return appRef.getVirtualServers(); } } return ret; }
/** * Virtual servers are maintained in the reference contained * in Server element. First, we need to find the server * and then get the virtual server from the correct reference * * @param appName Name of the app to get vs * * @return virtual servers as a string (separated by space or comma) */ private String getVirtualServers(String appName) { String ret = null; Server server = serverContext.getDefaultHabitat().getComponent(Server.class); for (ApplicationRef appRef : server.getApplicationRef()) { if (appRef.getRef().equals(appName)) { return appRef.getVirtualServers(); } } return ret; }
public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); ActionReport.MessagePart part = report.getTopMessagePart(); part.setMessage(target); part.setChildrenType("application"); List<ApplicationRef> appRefs = domain.getApplicationRefsInTarget(target); for (ApplicationRef appRef : appRefs) { if (state.equals("all") || (state.equals("running") && Boolean.valueOf(appRef.getEnabled())) || (state.equals("non-running") && !Boolean.valueOf(appRef.getEnabled())) ) { if (isApplicationOfThisType(appRef.getRef(), type)) { ActionReport.MessagePart childPart = part.addChild(); childPart.setMessage(appRef.getRef()); } } } report.setActionExitCode(ActionReport.ExitCode.SUCCESS); }
private String getLongStatus(ApplicationRef ref) { String message = ""; if (DeploymentUtils.isDomainTarget(target)) { // ignore --verbose for target domain return message; } boolean isVersionEnabled = domain.isAppRefEnabledInTarget(ref.getRef(), target); if ( isVersionEnabled ) { message = localStrings.getLocalString("list.applications.verbose.enabled", "enabled"); } else { message = localStrings.getLocalString("list.applications.verbose.disabled", "disabled"); } return message; } }