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

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


                    BigInteger.valueOf(diskSize), null, null);
            OVFReferenceUtils.addFile(references, fileRef);

            DiskSectionType diskSection = createDiskSection(template);
            VirtualSystemType vsystem = createVirtualSystem(template);
            ProductSectionType product = createProductSection(template);
            OperatingSystemSectionType ossection = createOperatingSystemSection(template);

            OVFEnvelopeUtils.addSection(vsystem, product);
            OVFEnvelopeUtils.addSection(vsystem, ossection);
            OVFEnvelopeUtils.addSection(envelope, diskSection);
View Full Code Here


    /**
     * Use Description, Name and IconPath.
     */
    private static ProductSectionType createProductSection(final TemplateDto disk) throws Exception
    {
        ProductSectionType product = new ProductSectionType();

        product.setInfo(CIMTypesUtils.createMsg(disk.getDescription(), "0"));
        product.setProduct(CIMTypesUtils.createMsg(disk.getName(), "0"));
        product.getCategoryOrProperty().add(createProperty("user", disk.getLoginUser()));
        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

        product.getOtherAttributes().put(new QName("CategoryName"), disk.getCategoryName());

        return 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.MsgType

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.