public static ApplicationRef getApplicationRef(Server server, String appName) { for (ApplicationRef appRef : server.getApplicationRef()) { if (appRef.getRef().equals(appName)) { return appRef; } } return null; }
public static List<ApplicationRef> getApplicationRefsInServer(Domain me, String sn) { Server server = getServerNamed(me, sn); if (server != null) { return server.getApplicationRef(); } else { return Collections.EMPTY_LIST; } }
public static List<ApplicationRef> getApplicationRefsInServer(Domain me, String sn) { Server server = getServerNamed(me, sn); if (server != null) { return server.getApplicationRef(); } else { return Collections.EMPTY_LIST; } }
public static ApplicationRef getApplicationRef(Server server, String appName) { for (ApplicationRef appRef : server.getApplicationRef()) { if (appRef.getRef().equals(appName)) { return appRef; } } return null; }
public boolean isAppEnabled(Application app) { if (Boolean.valueOf(app.getEnabled())) { ApplicationRef appRef = server.getApplicationRef(app.getName()); if (appRef != null && Boolean.valueOf(appRef.getEnabled())) { return true; } } return false; }
public boolean isAppEnabled(Application app) { if (Boolean.valueOf(app.getEnabled())) { ApplicationRef appRef = server.getApplicationRef(app.getName()); if (appRef != null && Boolean.valueOf(appRef.getEnabled())) { return true; } } return false; }
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 boolean isEnabled(Application application){ if(application == null){ return false; } boolean appEnabled = Boolean.valueOf(application.getEnabled()); ApplicationRef appRef = getServer().getApplicationRef(application.getName()); boolean appRefEnabled = false; if(appRef != null ){ appRefEnabled = Boolean.valueOf(appRef.getEnabled()); } return appEnabled && appRefEnabled; }
public static List<ApplicationRef> getApplicationRefsInTarget( Domain me, String tgt, boolean includeInstances) { List<String> targets = getTargets(me, tgt); 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; }
/** * Checks if the application reference is enabled * @param appName application-name * @since SJSAS 9.1 PE/SE/EE * @return boolean indicating the status */ private boolean isApplicationReferenceEnabled(String appName) { ApplicationRef appRef = getServer().getApplicationRef(appName); if (appRef == null) { if (_logger.isLoggable(Level.FINE)) { _logger.fine("ResourcesUtil :: isApplicationReferenceEnabled null ref"); } return false; } if(_logger.isLoggable(Level.FINE)) { _logger.fine("ResourcesUtil :: isApplicationReferenceEnabled appRef enabled ?" + appRef.getEnabled()); } return ConnectorsUtil.parseBoolean(appRef.getEnabled()); }
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 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 = serverContext.getDefaultServices().getService(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 = 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; }
/** * Returns true if the given resource is referenced by this server. * * @param resourceInfo the name of the resource * @return true if the named resource is used/referred by this server */ protected boolean isReferenced(ResourceInfo resourceInfo) { boolean refExists = false; if (ConnectorsUtil.isModuleScopedResource(resourceInfo) || ConnectorsUtil.isApplicationScopedResource(resourceInfo)) { refExists = getServer().getApplicationRef(resourceInfo.getApplicationName()) != null; } else { String resourceName = resourceInfo.getName(); refExists = getServer().isResourceRefExists(resourceName); } if (_logger.isLoggable(Level.FINE)) { _logger.fine("isReferenced :: " + resourceInfo + " - " + refExists); } return refExists; }