private void addClusterRefs(Cluster cluster, Server instance) throws TransactionFailure, PropertyVetoException { if (cluster != null) { for (ApplicationRef appRef : cluster.getApplicationRef()) { if (instance.getApplicationRef(appRef.getRef()) == null) { ApplicationRef newAppRef = instance.createChild(ApplicationRef.class); newAppRef.setRef(appRef.getRef()); newAppRef.setDisableTimeoutInMinutes(appRef.getDisableTimeoutInMinutes()); newAppRef.setEnabled(appRef.getEnabled()); newAppRef.setLbEnabled(appRef.getLbEnabled()); newAppRef.setVirtualServers(appRef.getVirtualServers()); instance.getApplicationRef().add(newAppRef); } } for (ResourceRef rr : cluster.getResourceRef()) { if (instance.getResourceRef(rr.getRef()) == null) { ResourceRef newRR = instance.createChild(ResourceRef.class); newRR.setRef(rr.getRef()); newRR.setEnabled(rr.getEnabled()); instance.getResourceRef().add(newRR); } } } } }
private void setAppRefAttributes(ApplicationRef appRef, DeployCommandParameters deployParams) throws PropertyVetoException { appRef.setRef(deployParams.name); if (deployParams.virtualservers != null) { appRef.setVirtualServers(deployParams.virtualservers); } else { // deploy to all virtual-servers, we need to get the list. appRef.setVirtualServers(DeploymentUtils.getVirtualServers(deployParams.target, env, domain)); } if(deployParams.lbenabled != null){ appRef.setLbEnabled(deployParams.lbenabled); } else { //check if system property exists and use that String lbEnabledDefault = System.getProperty(Server.lbEnabledSystemProperty); if (lbEnabledDefault != null) { appRef.setLbEnabled(lbEnabledDefault); } } appRef.setEnabled(deployParams.enabled.toString()); }
/** * 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 static ApplicationRef getApplicationRef(Cluster cluster, String appName) { for (ApplicationRef appRef : cluster.getApplicationRef()) { if (appRef.getRef().equals(appName)) { return appRef; } } return null; }
public static boolean isAppRefEnabledInTarget( Domain me, String appName, String target) { boolean found = false; Cluster containingCluster = getClusterForInstance(me, target); if (containingCluster != null) { // if this is a clustered instance, check the enable // attribute of its enclosing cluster first // and return false if the cluster level enable attribute // is false ApplicationRef clusterRef = getApplicationRefInTarget(me, appName, containingCluster.getName()); if (clusterRef == null || !Boolean.valueOf(clusterRef.getEnabled())) { return false; } } for (ApplicationRef ref : getApplicationRefsInTarget(me, target, true)) { if (ref.getRef().equals(appName)) { found = true; if (!Boolean.valueOf(ref.getEnabled())) { return false; } } } // if we found the ref(s) and the enable attribute(s) is/are true if (found) { return true; } return false; }
public String getEnabled(String sn, String moduleID) { ApplicationRef appRef = getApplicationRefInServer(sn, moduleID); if (appRef != null) { return appRef.getEnabled(); } else { return null; } }
deploymentParams.description = app.getDescription(); if (Boolean.valueOf(app.getEnabled()) && appRef != null && Boolean.valueOf(appRef.getEnabled())) { deploymentParams.enabled = Boolean.TRUE; } else { deploymentParams.asyncreplication = Boolean.parseBoolean(app.getAsyncReplication()); if (appRef != null) { deploymentParams.lbenabled = appRef.getLbEnabled(); deploymentParams.virtualservers = appRef.getVirtualServers();
if (appRef.getRef().equals(appName)) { ConfigBeanProxy appRef_w = t.enroll(appRef); ((ApplicationRef)appRef_w).setEnabled(String.valueOf(enabled)); break; if (appRef.getRef().equals(appName)) { ConfigBeanProxy appRef_w = t.enroll(appRef); ((ApplicationRef)appRef_w).setEnabled(String.valueOf(enabled)); break; for (ApplicationRef appRef : svr.getApplicationRef()) { if (appRef.getRef().equals(appName)) { ConfigBeanProxy appRef_w = t.enroll(appRef); ((ApplicationRef)appRef_w).setEnabled(String.valueOf(enabled)); break;
List<ApplicationRef> arefs = s.getApplicationRef(); ApplicationRef aref = s.createChild(ApplicationRef.class); aref.setRef(app.getName()); aref.setEnabled(Boolean.TRUE.toString()); aref.setVirtualServers(getVirtualServerList()); //TODO arefs.add(aref); return true;
servr.getName().equals(inst.getName()) ? isNewInstanceAppRefStateEnabled : Boolean.parseBoolean(inst.getApplicationRef(appName).getEnabled())); if (Boolean.parseBoolean(clusterAppRef.getEnabled()) != isAppRefEnabledOnAnyClusterInstance) { t.enroll(clusterAppRef).setEnabled(String.valueOf(isAppRefEnabledOnAnyClusterInstance));
public static String getVirtualServersForApplication(Domain d, String target, String appName) { ApplicationRef appRef = d.getApplicationRefInTarget( appName, target); if (appRef != null) { return appRef.getVirtualServers(); } else { return null; } }
if (application.getObjectType().equals("system-all") || application.getObjectType().equals("system-instance")) { ApplicationRef newAppRef = instance.createChild(ApplicationRef.class); newAppRef.setRef(application.getName()); instance.getApplicationRef().add(newAppRef);
public static ApplicationRef getApplicationRef(Server server, String appName) { for (ApplicationRef appRef : server.getApplicationRef()) { if (appRef.getRef().equals(appName)) { return appRef; } } return null; }
public static boolean isAppRefEnabledInTarget( Domain me, String appName, String target) { boolean found = false; Cluster containingCluster = getClusterForInstance(me, target); if (containingCluster != null) { // if this is a clustered instance, check the enable // attribute of its enclosing cluster first // and return false if the cluster level enable attribute // is false ApplicationRef clusterRef = getApplicationRefInTarget(me, appName, containingCluster.getName()); if (clusterRef == null || !Boolean.valueOf(clusterRef.getEnabled())) { return false; } } for (ApplicationRef ref : getApplicationRefsInTarget(me, target, true)) { if (ref.getRef().equals(appName)) { found = true; if (!Boolean.valueOf(ref.getEnabled())) { return false; } } } // if we found the ref(s) and the enable attribute(s) is/are true if (found) { return true; } return false; }
/** * 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; }
public static String getEnabledForApplication(Domain d, String target, String appName) { ApplicationRef appRef = d.getApplicationRefInTarget( appName, target); if (appRef != null) { return appRef.getEnabled(); } else { return null; } }
private void setAppRefAttributes(ApplicationRef appRef, DeployCommandParameters deployParams) throws PropertyVetoException { appRef.setRef(deployParams.name); if (deployParams.virtualservers != null) { appRef.setVirtualServers(deployParams.virtualservers); } else { // deploy to all virtual-servers, we need to get the list. appRef.setVirtualServers(DeploymentUtils.getVirtualServers(deployParams.target, env, domain)); } if(deployParams.lbenabled != null){ appRef.setLbEnabled(deployParams.lbenabled); } else { //check if system property exists and use that String lbEnabledDefault = System.getProperty(Server.lbEnabledSystemProperty); if (lbEnabledDefault != null) { appRef.setLbEnabled(lbEnabledDefault); } } appRef.setEnabled(deployParams.enabled.toString()); }
deploymentParams.description = app.getDescription(); if (Boolean.valueOf(app.getEnabled()) && appRef != null && Boolean.valueOf(appRef.getEnabled())) { deploymentParams.enabled = Boolean.TRUE; } else { deploymentParams.asyncreplication = Boolean.parseBoolean(app.getAsyncReplication()); if (appRef != null) { deploymentParams.lbenabled = appRef.getLbEnabled(); deploymentParams.virtualservers = appRef.getVirtualServers();
if (appRef.getRef().equals(appName)) { ConfigBeanProxy appRef_w = t.enroll(appRef); ((ApplicationRef)appRef_w).setEnabled(String.valueOf(enabled)); break; if (appRef.getRef().equals(appName)) { ConfigBeanProxy appRef_w = t.enroll(appRef); ((ApplicationRef)appRef_w).setEnabled(String.valueOf(enabled)); break; for (ApplicationRef appRef : svr.getApplicationRef()) { if (appRef.getRef().equals(appName)) { ConfigBeanProxy appRef_w = t.enroll(appRef); ((ApplicationRef)appRef_w).setEnabled(String.valueOf(enabled)); break;
servr.getName().equals(inst.getName()) ? isNewInstanceAppRefStateEnabled : Boolean.parseBoolean(inst.getApplicationRef(appName).getEnabled())); if (Boolean.parseBoolean(clusterAppRef.getEnabled()) != isAppRefEnabledOnAnyClusterInstance) { t.enroll(clusterAppRef).setEnabled(String.valueOf(isAppRefEnabledOnAnyClusterInstance));