private boolean serverHas(SystemProperty sp) { List<SystemProperty> ssps = server.getSystemProperty(); return hasSystemProperty(ssps, sp); }
private SystemProperty getServerSystemProperty(String spName) { return getSystemProperty(server.getSystemProperty(), spName); }
private void setSystemProperty(String name, String value) throws TransactionFailure, PropertyVetoException { SystemProperty sp = _server.getSystemProperty(name); if (sp == null) { SystemProperty newSP = _server.createChild(SystemProperty.class); newSP.setName(name); newSP.setValue(value); _server.getSystemProperty().add(newSP); } else { //Don't change the system property if it already exists - leave the original port assignment //sp.setName(name); //sp.setValue(value); } }
private void setSystemProperty(String name, String value) throws TransactionFailure, PropertyVetoException { SystemProperty sp = _server.getSystemProperty(name); if (sp == null) { SystemProperty newSP = _server.createChild(SystemProperty.class); newSP.setName(name); newSP.setValue(value); _server.getSystemProperty().add(newSP); } else { //Don't change the system property if it already exists - leave the original port assignment //sp.setName(name); //sp.setValue(value); } }
private static String translatePortOld(String portString, Server server, Config config) { if (!isToken(portString)) return portString; // isToken returned true so we are NOT assuming anything below! String key = portString.substring(2, portString.length() - 1); // check cluster and the cluster's config if applicable // bnevins Jul 18, 2010 -- don't botehr this should never be called anymore SystemProperty prop = server.getSystemProperty(key); if (prop != null) { return prop.getValue(); } prop = config.getSystemProperty(key); if (prop != null) { return prop.getValue(); } return null; }
private static String translatePortOld(String portString, Server server, Config config) { if (!isToken(portString)) return portString; // isToken returned true so we are NOT assuming anything below! String key = portString.substring(2, portString.length() - 1); // check cluster and the cluster's config if applicable // bnevins Jul 18, 2010 -- don't botehr this should never be called anymore SystemProperty prop = server.getSystemProperty(key); if (prop != null) { return prop.getValue(); } prop = config.getSystemProperty(key); if (prop != null) { return prop.getValue(); } return null; }
List<SystemProperty> sps = newServer.getSystemProperty();
List<SystemProperty> sps = newServer.getSystemProperty();
newServer.getSystemProperty().add(newSP);
newServer.getSystemProperty().add(newSP);
propVal = getPropertyValue(propName, _server.getSystemProperty());
propVal = getPropertyValue(propName, _server.getSystemProperty());
/** * Make sure all ports that are specified by the user make sense. * @param server The new Server element * @return null if all went OK. Otherwise return a String with the error message. */ static void checkInternalConsistency(Server server) throws TransactionFailure { // Make sure all the system properties for ports have different numbers. List<SystemProperty> sysProps = server.getSystemProperty(); Set<Integer> ports = new TreeSet<Integer>(); for (SystemProperty sp : sysProps) { String name = sp.getName(); if (PORTSLIST.contains(name)) { String val = sp.getValue(); try { boolean wasAdded = ports.add(Integer.parseInt(val)); if (!wasAdded) //TODO unit test throw new TransactionFailure(Strings.get("PortUtils.duplicate_port", val, server.getName())); } catch(TransactionFailure tf) { // don't re-wrap the same Exception type! throw tf; } catch (Exception e) { //TODO unit test throw new TransactionFailure(Strings.get("PortUtils.non_int_port", val, server.getName())); } } } checkForLegalPorts(ports, server.getName()); }
/** * Make sure all ports that are specified by the user make sense. * @param server The new Server element * @return null if all went OK. Otherwise return a String with the error message. */ static void checkInternalConsistency(Server server) throws TransactionFailure { // Make sure all the system properties for ports have different numbers. List<SystemProperty> sysProps = server.getSystemProperty(); Set<Integer> ports = new TreeSet<Integer>(); for (SystemProperty sp : sysProps) { String name = sp.getName(); if (PORTSLIST.contains(name)) { String val = sp.getValue(); try { boolean wasAdded = ports.add(Integer.parseInt(val)); if (!wasAdded) //TODO unit test throw new TransactionFailure(Strings.get("PortUtils.duplicate_port", val, server.getName())); } catch(TransactionFailure tf) { // don't re-wrap the same Exception type! throw tf; } catch (Exception e) { //TODO unit test throw new TransactionFailure(Strings.get("PortUtils.non_int_port", val, server.getName())); } } } checkForLegalPorts(ports, server.getName()); }
private void setupSupplemental(AdminCommandContext context, final Server instance) { if (clusterName != null) { InstanceRegisterInstanceCommandParameters cp = new InstanceRegisterInstanceCommandParameters(); context.getActionReport(). setResultType(InstanceRegisterInstanceCommandParameters.class, cp); Node instNode = domain.getNodeNamed(node); cp.config = instance.getConfigRef(); cp.nodehost = instNode.getNodeHost(); cp.nodedir = instNode.getNodeDir(); cp.installdir = instNode.getInstallDir(); List<SystemProperty> spList = instance.getSystemProperty(); if (spList != null) { Properties p = new Properties(); for (SystemProperty sp : spList) { p.put(sp.getName(), sp.getValue()); } cp.systemProperties = p; } } }
private void setupSupplemental(AdminCommandContext context, final Server instance) { if (clusterName != null) { InstanceRegisterInstanceCommandParameters cp = new InstanceRegisterInstanceCommandParameters(); context.getActionReport(). setResultType(InstanceRegisterInstanceCommandParameters.class, cp); Node instNode = domain.getNodeNamed(node); cp.config = instance.getConfigRef(); cp.nodehost = instNode.getNodeHost(); cp.nodedir = instNode.getNodeDir(); cp.installdir = instNode.getInstallDir(); List<SystemProperty> spList = instance.getSystemProperty(); if (spList != null) { Properties p = new Properties(); for (SystemProperty sp : spList) { p.put(sp.getName(), sp.getValue()); } cp.systemProperties = p; } } }
private void initialize(Cluster cluster, Config config, Domain domain, Server theServer) { List<SystemProperty> propList; server = theServer; // 0. domain propList = domain.getSystemProperty(); addAll(propList); // 1. cluster if (cluster != null) { propList = cluster.getSystemProperty(); addAll(propList); } // 2. config if (config != null) { propList = config.getSystemProperty(); addAll(propList); } // 3. server propList = server.getSystemProperty(); addAll(propList); }
private void initialize(Cluster cluster, Config config, Domain domain, Server theServer) { List<SystemProperty> propList; server = theServer; // 0. domain propList = domain.getSystemProperty(); addAll(propList); // 1. cluster if (cluster != null) { propList = cluster.getSystemProperty(); addAll(propList); } // 2. config if (config != null) { propList = config.getSystemProperty(); addAll(propList); } // 3. server propList = server.getSystemProperty(); addAll(propList); }
private void setSystemPropertiesFromDomainXml() { // precedence order from high to low // 0. server // 1. cluster // 2. <server>-config or <cluster>-config // 3. domain // so we need to add System Properties in *reverse order* to get the // right precedence. List<SystemProperty> domainSPList = domain.getSystemProperty(); List<SystemProperty> configSPList = getConfigSystemProperties(); Cluster cluster = server.getCluster(); List<SystemProperty> clusterSPList = null; if (cluster != null) { clusterSPList = cluster.getSystemProperty(); } List<SystemProperty> serverSPList = server.getSystemProperty(); setSystemProperties( domainSPList); setSystemProperties( configSPList); if (clusterSPList != null) { setSystemProperties(clusterSPList); } setSystemProperties(serverSPList); }
gmsListenerPortProp.setName(propName); gmsListenerPortProp.setValue(dasGmsPortProp.getValue()); instance.getSystemProperty().add(gmsListenerPortProp);