Package lcmc.common.domain

Examples of lcmc.common.domain.StringValue


                    /* ignore flags */
                    continue;
                }
                if ("handler".equals(type)) {
                    final List<Value> items = new ArrayList<Value>();
                    items.add(new StringValue());
                    paramItemsMap.put(name, items);
                    paramDefaultMap.put(name, HARDCODED_DEFAULTS.get(name));
                } else if ("boolean".equals(type)) {
                    final List<Value> l = new ArrayList<Value>();
                    l.add(CONFIG_YES);
                    l.add(CONFIG_NO);
                    paramItemsMap.put(name, l);
                    paramDefaultMap.put(name, CONFIG_NO);
                }
                if ("fence-peer".equals(name)) {
                    final List<Value> l = new ArrayList<Value>();
                    l.add(new StringValue());
                    if (host.getArch() != null && !host.getArch().isEmpty()) {
                        l.add(new StringValue(host.getHeartbeatLibPath() + "/drbd-peer-outdater -t 5"));
                    }
                    l.add(new StringValue("/usr/lib/drbd/crm-fence-peer.sh"));
                    paramItemsMap.put(name, l);
                } else if ("after-resync-target".equals(name)) {
                    final List<Value> l = new ArrayList<Value>();
                    l.add(new StringValue());
                    l.add(new StringValue("/usr/lib/drbd/crm-unfence-peer.sh"));
                    paramItemsMap.put(name, l);
                } else if ("split-brain".equals(name)) {
                    final List<Value> l = new ArrayList<Value>();
                    l.add(new StringValue());
                    l.add(new StringValue("/usr/lib/drbd/notify-split-brain.sh root"));
                    paramItemsMap.put(name, l);
                } else if ("become-primary-on".equals(name)) {
                    final List<Value> l = new ArrayList<Value>();
                    l.add(new StringValue());
                    l.add(new StringValue("both"));
                    for (final Host h : hosts) {
                        l.add(new StringValue(h.getName()));
                    }
                    paramItemsMap.put(name, l);
                } else if ("verify-alg".equals(name)
                           || "csums-alg".equals(name)
                           || "data-integrity-alg".equals(name)
                           || "cram-hmac-alg".equals(name)) {
                    final List<Value> l = new ArrayList<Value>();
                    l.add(new StringValue());
                    for (final String cr : host.getAvailableCryptoModules()) {
                        l.add(new StringValue(cr));
                    }
                    paramItemsMap.put(name, l);
                }
                final NodeList optionInfos = optionNode.getChildNodes();
                for (int j = 0; j < optionInfos.getLength(); j++) {
                    final Node optionInfo = optionInfos.item(j);
                    final String tag = optionInfo.getNodeName();
                    /* <min>, <max>, <handler>, <default> */
                    if ("min".equals(tag)) {
                        final Value minValue = new StringValue(getText(optionInfo),
                                                               parseUnit(name, paramDefaultUnitMap.get(name)));
                        paramMinMap.put(name, convertToUnit(name, minValue));
                    } else if ("max".equals(tag)) {
                        final Value maxValue = new StringValue(getText(optionInfo),
                                                               parseUnit(name, paramDefaultUnitMap.get(name)));
                        paramMaxMap.put(name, convertToUnit(name, maxValue));
                    } else if ("handler".equals(tag)) {
                        paramItemsMap.get(name).add(new StringValue(getText(optionInfo)));
                    } else if ("default".equals(tag)) {
                        paramDefaultMap.put(name, new StringValue(getText(optionInfo),
                                                                  parseUnit(name, paramDefaultUnitMap.get(name))));
                    } else if ("unit".equals(tag)) {
                        paramUnitLongMap.put(name, getText(optionInfo));
                    } else if ("unit_prefix".equals(tag)) {
                        if (!"after".equals(name)
View Full Code Here


                if (valueS == null) { /* boolean option */
                    value = CONFIG_YES;
                } else if (hasUnitPrefix(name)) {
                    value = parseValue(name, valueS);
                } else {
                    value = new StringValue(valueS);
                }
                nameValueMap.put(name, value);
            } else if ("section".equals(option.getNodeName())) {
                final String name = getAttribute(option, "name");
                if ("plugin".equals(name)) {
View Full Code Here

                } else {
                    /* boolean */
                    name = DrbdProxy.PLUGIN_PARAM_PREFIX + nameValues;
                    value = CONFIG_YES.getValueForConfig();
                }
                nameValueMap.put(name, new StringValue(value));
            }
        }
    }
View Full Code Here

                outsideIp = getText(option);
                outsidePort = getAttribute(option, "port");
            }
        }
        resourceHostProxyMap.put(resName, hostName, new HostProxy(proxyHostName,
                                                                  new StringValue(insideIp),
                                                                  new StringValue(insidePort),
                                                                  new StringValue(outsideIp),
                                                                  new StringValue(outsidePort)));
        proxyHostNames.add(proxyHostName);
    }
View Full Code Here

                nameValueMap = new HashMap<String, Value>();
            } else {
                optionsMap.remove(resName + '.' + "resource");
            }

            nameValueMap.put(PROTOCOL_PARAM, new StringValue(resProtocol));
            optionsMap.put(resName + '.' + "resource", nameValueMap);
        }
        final NodeList c = resourceNode.getChildNodes();
        for (int i = 0; i < c.getLength(); i++) {
            final Node n = c.item(i);
View Full Code Here

        if (m.matches()) {
            final String value = m.group(1);
            final String u = m.group(2);

            final Unit unit = parseUnit(param, u);
            return new StringValue(value, unit);
        }
        return new StringValue(v);
    }
View Full Code Here

        final JPanel optionsPanel = new JPanel();
        optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.PAGE_AXIS));
        optionsPanel.setAlignmentY(java.awt.Component.TOP_ALIGNMENT);
        interfaceInfo.savePreferredValues();
        interfaceInfo.getResource().setValue(InterfaceData.TYPE, InterfaceInfo.TYPE_NETWORK);
        interfaceInfo.getResource().setValue(InterfaceData.SOURCE_NETWORK, new StringValue("default"));
        interfaceInfo.getResource().setValue(InterfaceData.MODEL_TYPE, new StringValue());
        interfaceInfo.addWizardParams(optionsPanel,
                                      PARAMS,
                                      buttonClass(nextButton()),
                                      application.getDefaultSize("Dialog.vm.Resource.LabelWidth"),
                                      application.getDefaultSize("Dialog.vm.Resource.FieldWidth"),
                                      null);
        interfaceInfo.getWidget(InterfaceData.MODEL_TYPE, Widget.WIZARD_PREFIX).setValue(new StringValue());

        panel.add(optionsPanel);

        final JScrollPane scrollPane = new JScrollPane(panel);
        scrollPane.setMaximumSize(new Dimension(Short.MAX_VALUE, 200));
View Full Code Here

        if (serviceInfoRsc == null || serviceInfoWithRsc == null) {
            /* rsc set placeholder */
            final CrmXml.ColocationData colocationData = clStatus.getColocationData(colId);
            final String score = colocationData.getScore();
            resourceNode.put(CrmXml.SCORE_CONSTRAINT_PARAM, new StringValue(score));
        } else if (serviceInfoRsc.isConstraintPlaceholder()
                   || serviceInfoWithRsc.isConstraintPlaceholder()) {
            /* rsc set edge */
            final ConstraintPHInfo cphi;
            final CrmXml.RscSet rscSet;
            if (serviceInfoRsc.isConstraintPlaceholder()) {
                cphi = (ConstraintPHInfo) serviceInfoRsc;
                rscSet = cphi.getRscSetConnectionDataColocation().getRscSet1();
            } else {
                cphi = (ConstraintPHInfo) serviceInfoWithRsc;
                rscSet = cphi.getRscSetConnectionDataColocation().getRscSet2();
            }
            resourceNode.put("sequential", new StringValue(rscSet.getSequential()));
            resourceNode.put("role", new StringValue(rscSet.getColocationRole()));
        } else {
            final CrmXml.ColocationData colocationData = clStatus.getColocationData(colId);
            if (colocationData != null) {
                final String score = colocationData.getScore();
                final String rscRole = colocationData.getRscRole();
                final String withRscRole = colocationData.getWithRscRole();

                resourceNode.put(CrmXml.SCORE_CONSTRAINT_PARAM, new StringValue(score));
                resourceNode.put("rsc-role", new StringValue(rscRole));
                resourceNode.put("with-rsc-role", new StringValue(withRscRole));
            }
        }

        final String[] params = getParametersFromXML();
        if (params != null) {
View Full Code Here

                        }
                    }
                }
            }
            if (vgNameCorrect) {
                vgNameWi.setBackground(new StringValue(), new StringValue(), true);
            } else {
                enable = false;
                vgNameWi.wrongValue();
            }
        }
View Full Code Here

            }
            i++;
        }
        vgNameWi = widgetFactory.createInstance(
                                      Widget.Type.TEXTFIELD,
                                      new StringValue(defaultName),
                                      Widget.NO_ITEMS,
                                      Widget.NO_REGEXP,
                                      250,
                                      Widget.NO_ABBRV,
                                      new AccessMode(AccessMode.OP, AccessMode.NORMAL),
View Full Code Here

TOP

Related Classes of lcmc.common.domain.StringValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.