Package com.cloud.utils.xmlobject

Examples of com.cloud.utils.xmlobject.XmlObject


        cmd.putElement("dn", dn);
        return cmd.toString();
    }

    public static String associateProfileToBlade(String cookie, String profileDn, String bladeDn) {
        XmlObject cmd = new XmlObject("configConfMos").putElement("cookie", cookie).putElement("inHierarchical", "true").putElement(
                "inConfigs", new XmlObject("inConfigs").putElement(
                        "pair", new XmlObject("pair").putElement("key", profileDn).putElement(
                                "lsServer", new XmlObject("lsServer")
                                .putElement("agentPolicyName", "")
                                .putElement("biosProfileName", "")
                                .putElement("bootPolicyName", "")
                                .putElement("descr", "")
                                .putElement("dn", profileDn)
                                .putElement("dynamicConPolicyName", "")
                                .putElement("extIPState", "none")
                                .putElement("hostFwPolicyName", "")
                                .putElement("identPoolName", "")
                                .putElement("localDiskPolicyName", "")
                                .putElement("maintPolicyName", "")
                                .putElement("mgmtAccessPolicyName", "")
                                .putElement("mgmtFwPolicyName", "")
                                .putElement("powerPolicyName", "")
                                .putElement("scrubPolicyName", "")
                                .putElement("solPolicyName", "")
                                .putElement("srcTemplName", "")
                                .putElement("statsPolicyName", "default")
                                .putElement("status", "")
                                .putElement("usrLbl", "")
                                .putElement("uuid", "")
                                .putElement("vconProfileName", "")
                                .putElement("lsBinding", new XmlObject("lsBinding")
                                            .putElement("pnDn", bladeDn)
                                            .putElement("restrictMigration", "no")
                                            .putElement("rn", "pn")
                                        )
                                )
                        )
                );

        return cmd.dump();
    }
View Full Code Here


        return xo.evaluateObject(p);
    }

    public static List<UcsProfile> fromXmlString(String xmlstr) {
        List<UcsProfile> ps = new ArrayList<UcsProfile>();
        XmlObject xo = XmlObjectParser.parseFromString(xmlstr);
        List<XmlObject> xos = xo.getAsList("outDns.dn");
        if (xos != null) {
            for (XmlObject x : xos) {
                //UcsProfile p = UcsProfile.fromXmlObject(x);
                UcsProfile p = new UcsProfile();
                p.setDn(x.get("value").toString());
View Full Code Here

        return xo.evaluateObject(p);
    }

    public static List<UcsProfile> fromXmlString(String xmlstr) {
        List<UcsProfile> ps = new ArrayList<UcsProfile>();
        XmlObject xo = XmlObjectParser.parseFromString(xmlstr);
        List<XmlObject> xos = xo.getAsList("outDns.dn");
        if (xos != null) {
            for (XmlObject x : xos) {
                //UcsProfile p = UcsProfile.fromXmlObject(x);
                UcsProfile p = new UcsProfile();
                p.setDn(x.get("value").toString());
View Full Code Here

                    cmd = UcsCommands.refreshCmd(mgrvo.getUsername(), mgrvo.getPassword(), cookie);
                }
            }
            if (!(cmd == null)) {
                String ret = client.call(cmd);
                XmlObject xo = XmlObjectParser.parseFromString(ret);
                String cookie = xo.get("outCookie");
                ucsCookie = new UcsCookie(cookie, currentTime);
                cookies.put(ucsMgrId, ucsCookie);
                //cookiesTime.put(cookie, currentTime); //This is currentTime on purpose, and not latest time.
            }
            return ucsCookie.getCookie();
View Full Code Here

        UcsManagerVO mgrvo = ucsDao.findById(ucsMgrId);
        UcsHttpClient client = new UcsHttpClient(mgrvo.getUrl());
        String cookie = getCookie(ucsMgrId);
        String cmd = UcsCommands.cloneProfile(cookie, srcDn, newProfileName);
        String res = client.call(cmd);
        XmlObject xo = XmlObjectParser.parseFromString(res);
        return xo.get("outConfig.lsServer.dn");
    }
View Full Code Here

        UcsManagerVO mgrvo = ucsDao.findById(ucsMgrId);
        UcsHttpClient client = new UcsHttpClient(mgrvo.getUrl());
        String cookie = getCookie(ucsMgrId);
        String cmd = UcsCommands.configResolveDn(cookie, dn);
        String res = client.call(cmd);
        XmlObject xo = XmlObjectParser.parseFromString(res);
        s_logger.debug(String.format("association response is %s", res));

        if (xo.get("outConfig.computeBlade.association").equals("none")) {
            throw new CloudRuntimeException(String.format("cannot associated a profile to blade[dn:%s]. please check your UCS manasger for detailed error information",
                dn));
        }

        return xo.get("outConfig.computeBlade.association").equals("associated");
    }
View Full Code Here

    String operPower;
    String totalMemory;
    String uuid;

    public static List<ComputeBlade> fromXmString(String xmlstr) {
        XmlObject root = XmlObjectParser.parseFromString(xmlstr);
        List<XmlObject> lst = root.getAsList("outConfigs.computeBlade");
        List<ComputeBlade> blades = new ArrayList<ComputeBlade>();
        if (lst == null) {
            return blades;
        }
        for (XmlObject xo : lst) {
View Full Code Here

                    cmd = UcsCommands.refreshCmd(mgrvo.getUsername(), mgrvo.getPassword(), cookie);
                }
            }
            if(cmd != null) {
                String ret = client.call(cmd);
                XmlObject xo = XmlObjectParser.parseFromString(ret);
                String cookie = xo.get("outCookie");
                ucsCookie = new UcsCookie(cookie, currentTime);
                cookies.put(ucsMgrId, ucsCookie);
                //cookiesTime.put(cookie, currentTime); //This is currentTime on purpose, and not latest time.
            }
            return ucsCookie.getCookie();
View Full Code Here

        UcsManagerVO mgrvo = ucsDao.findById(ucsMgrId);
        UcsHttpClient client = new UcsHttpClient(mgrvo.getUrl());
        String cookie = getCookie(ucsMgrId);
        String cmd = UcsCommands.cloneProfile(cookie, srcDn, newProfileName);
        String res = client.call(cmd);
        XmlObject xo = XmlObjectParser.parseFromString(res);
        return xo.get("outConfig.lsServer.dn");
    }
View Full Code Here

        UcsManagerVO mgrvo = ucsDao.findById(ucsMgrId);
        UcsHttpClient client = new UcsHttpClient(mgrvo.getUrl());
        String cookie = getCookie(ucsMgrId);
        String cmd = UcsCommands.configResolveDn(cookie, dn);
        String res = client.call(cmd);
        XmlObject xo = XmlObjectParser.parseFromString(res);

        return xo.get("outConfig.lsServer.assocState").equals("associated");
    }
View Full Code Here

TOP

Related Classes of com.cloud.utils.xmlobject.XmlObject

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.