Package org.dmtf.schemas.ovf.envelope._1

Examples of org.dmtf.schemas.ovf.envelope._1.ContentType


        try
        {
            ContentType contentType = OVFEnvelopeUtils.getTopLevelVirtualSystemContent(envelope);

            ProductSectionType product =
                OVFEnvelopeUtils.getSection(contentType, ProductSectionType.class);
            OperatingSystemSectionType ossection = null;
            try
            {
                ossection =
                    OVFEnvelopeUtils.getSection(contentType, OperatingSystemSectionType.class);
            }
            catch (Exception e) // no such section
            {
            }

            String description = null;
            if (product.getInfo() != null && product.getInfo().getValue() != null)
            {
                description = product.getInfo().getValue();
            }

            String categoryName = null;
            if (product.getOtherAttributes().containsKey(new QName("CategoryName")))
            {
                categoryName = product.getOtherAttributes().get(new QName("CategoryName"));
            }

            String iconPath = getIconPath(product, fileIdToFileType, ovfId);

            diskSectionType = OVFEnvelopeUtils.getSection(envelope, DiskSectionType.class);
View Full Code Here


                    .getName().getValue() : vsystem.getId();

            MsgType prod = new MsgType();
            prod.setValue(vsystemName);

            ProductSectionType product = new ProductSectionType();
            product.setInfo(vsystem.getInfo());
            product.setProduct(prod);

            try
            {
                OVFEnvelopeUtils.addSection(vsystem, product);
            }
View Full Code Here

        product.getCategoryOrProperty().add(createProperty("password", disk.getLoginPassword()));

        final String diskIcon = disk.getIconPath();
        if (diskIcon != null)
        {
            Icon icon = OVFProductUtils.createIcon(50, 50, "jpg", diskIcon); // XXX icon
            // details
            OVFProductUtils.addProductIcon(product, icon);
        }
        // warn
View Full Code Here

        if (icons == null || icons.size() == 0)
        {
            return null;
        }

        final Icon icon = icons.get(0);
        final String iconRef = icon.getFileRef();

        if (iconRef.startsWith("http"))
        {
            return iconRef;
        }
View Full Code Here

        if (icons == null || icons.size() == 0)
        {
            return null;
        }

        final Icon icon = icons.get(0);
        final String iconRef = icon.getFileRef();

        if (iconRef.startsWith("http"))
        {
            return iconRef;
        }
View Full Code Here

        product.getCategoryOrProperty().add(createProperty("password", disk.getLoginPassword()));

        final String diskIcon = disk.getIconUrl();
        if (diskIcon != null)
        {
            Icon icon = OVFProductUtils.createIcon(50, 50, "jpg", diskIcon); // XXX icon
            // details
            OVFProductUtils.addProductIcon(product, icon);
        }
        // warn
View Full Code Here

        CIMResourceAllocationSettingDataType hd =
            CIMResourceAllocationSettingDataUtils.createResourceAllocationSettingData("Hd", "1",
                CIMResourceTypeEnum.Disk_Drive, disk.getHd(), disk.getHdSizeUnit().name());

        RASDType rasdCpu = CIMResourceAllocationSettingDataUtils.createRASDTypeFromCIMRASD(cpu);
        RASDType rasdRam = CIMResourceAllocationSettingDataUtils.createRASDTypeFromCIMRASD(ram);
        RASDType rasdHd = CIMResourceAllocationSettingDataUtils.createRASDTypeFromCIMRASD(hd);

        rasdHd.getHostResource().add(CIMTypesUtils.createString("ovf:/disk/ovfdisk"));

        OVFVirtualHadwareSectionUtils.addRASD(vhsection, rasdCpu);
        OVFVirtualHadwareSectionUtils.addRASD(vhsection, rasdRam);
        OVFVirtualHadwareSectionUtils.addRASD(vhsection, rasdHd);
View Full Code Here

            CIMResourceAllocationSettingDataType ethDriver =
                CIMResourceAllocationSettingDataUtils.createResourceAllocationSettingData(
                    "ethernetDriver", "1", CIMResourceTypeEnum.Ethernet_Adapter, 0, null);
            ethDriver.setResourceSubType(CIMTypesUtils.createString(ethDriverType.name()));

            final RASDType rasdEthDriver =
                CIMResourceAllocationSettingDataUtils.createRASDTypeFromCIMRASD(ethDriver);
            OVFVirtualHadwareSectionUtils.addRASD(vhsection, rasdEthDriver);
        }
        return vhsection;
    }
View Full Code Here

        CIMResourceAllocationSettingDataType hd =
            CIMResourceAllocationSettingDataUtils.createResourceAllocationSettingData("Hd", "1",
                CIMResourceTypeEnum.Disk_Drive, disk.getRequiredHDInMB(), "MB");

        RASDType rasdCpu = CIMResourceAllocationSettingDataUtils.createRASDTypeFromCIMRASD(cpu);
        RASDType rasdRam = CIMResourceAllocationSettingDataUtils.createRASDTypeFromCIMRASD(ram);
        RASDType rasdHd = CIMResourceAllocationSettingDataUtils.createRASDTypeFromCIMRASD(hd);

        rasdHd.getHostResource().add(CIMTypesUtils.createString("ovf:/disk/ovfdisk"));

        OVFVirtualHadwareSectionUtils.addRASD(vhsection, rasdCpu);
        OVFVirtualHadwareSectionUtils.addRASD(vhsection, rasdRam);
        OVFVirtualHadwareSectionUtils.addRASD(vhsection, rasdHd);
View Full Code Here

            CIMResourceAllocationSettingDataType ethDriver =
                CIMResourceAllocationSettingDataUtils.createResourceAllocationSettingData(
                    "ethernetDriver", "1", CIMResourceTypeEnum.Ethernet_Adapter, 0, null);
            ethDriver.setResourceSubType(CIMTypesUtils.createString(disk.getEthernetDriverType()));

            final RASDType rasdEthDriver =
                CIMResourceAllocationSettingDataUtils.createRASDTypeFromCIMRASD(ethDriver);
            OVFVirtualHadwareSectionUtils.addRASD(vhsection, rasdEthDriver);
        }
        return vhsection;
    }
View Full Code Here

TOP

Related Classes of org.dmtf.schemas.ovf.envelope._1.ContentType

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.