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

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


        Map<String, TemplateDto> requiredByVSs = new HashMap<String, TemplateDto>();
        DiskSectionType diskSectionType;

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

            ProductSectionType product =
                OVFEnvelopeUtils.getSection(contentType, ProductSectionType.class);
            OperatingSystemSectionType ossection = null;
            try
View Full Code Here


                diskIdToDiskFormat.put(virtualDiskDescType.getDiskId(), virtualDiskDescType);
            }

            // /

            ContentType content = OVFEnvelopeUtils.getTopLevelVirtualSystemContent(envelope);

            if (content instanceof VirtualSystemCollectionType)
            {
                throw new EmptyEnvelopeException(
                    "Current OVF description document includes a VirtualSystemCollection, "
View Full Code Here

     */
    private static EnvelopeType fixMissingProductSection(final EnvelopeType envelope)
        throws InvalidSectionException, EmptyEnvelopeException
    {

        ContentType contentType = OVFEnvelopeUtils.getTopLevelVirtualSystemContent(envelope);

        if (!(contentType instanceof VirtualSystemType))
        {
            throw new InvalidSectionException(
                "abicloud only suport single virtual system definition,"
View Full Code Here

        Map<String, TemplateDto> requiredByVSs = new HashMap<String, TemplateDto>();
        DiskSectionType diskSectionType;

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

            ProductSectionType product =
                OVFEnvelopeUtils.getSection(contentType, ProductSectionType.class);
            OperatingSystemSectionType ossection = null;
            try
View Full Code Here

                diskIdToDiskFormat.put(virtualDiskDescType.getDiskId(), virtualDiskDescType);
            }

            // /

            ContentType content = OVFEnvelopeUtils.getTopLevelVirtualSystemContent(envelope);

            if (content instanceof VirtualSystemCollectionType)
            {
                throw new EmptyEnvelopeException("Current OVF description document includes a VirtualSystemCollection, "
                    + "abicloud only deal with single virtual system based OVFs");
View Full Code Here

     */
    private static EnvelopeType fixMissingProductSection(final EnvelopeType envelope)
        throws InvalidSectionException, EmptyEnvelopeException
    {

        ContentType contentType = OVFEnvelopeUtils.getTopLevelVirtualSystemContent(envelope);

        if (!(contentType instanceof VirtualSystemType))
        {
            throw new InvalidSectionException("abicloud only suport single virtual system definition,"
                + " current OVF envelope defines a VirtualSystemCollection");
View Full Code Here

{
    private final static Logger LOG = LoggerFactory.getLogger(TemplateFromOVFEnvelope.class);

    public static VirtualDiskDescType getDisk(final EnvelopeType envelope)
    {
        DiskSectionType diskSection = null;
        try
        {
            diskSection = OVFEnvelopeUtils.getSection(envelope, DiskSectionType.class);
        }
        catch (Exception e)// SectionNotPresentException InvalidSectionException
        {
            throw new AMException(AMError.TEMPLATE_INVALID, "missing DiskSection");
        }

        List<VirtualDiskDescType> disks = diskSection.getDisk();

        if (disks == null || disks.isEmpty() || disks.size() != 1)
        {
            throw new AMException(AMError.TEMPLATE_INVALID, "multiple Disk not supported");
        }
View Full Code Here

        Map<String, VirtualDiskDescType> diskIdToDiskFormat =
            new HashMap<String, VirtualDiskDescType>();
        Map<String, FileType> fileIdToFileType = new HashMap<String, FileType>();
        Map<String, List<String>> diskIdToVSs = new HashMap<String, List<String>>();
        Map<String, TemplateDto> requiredByVSs = new HashMap<String, TemplateDto>();
        DiskSectionType diskSectionType;

        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);

            for (FileType fileType : envelope.getReferences().getFile())
            {
                fileIdToFileType.put(fileType.getId(), fileType);
            }
            // Create a hash
            for (VirtualDiskDescType virtualDiskDescType : diskSectionType.getDisk())
            {
                diskIdToDiskFormat.put(virtualDiskDescType.getDiskId(), virtualDiskDescType);
            }

            if (contentType instanceof VirtualSystemType)
View Full Code Here

        {
            Map<String, VirtualDiskDescType> diskIdToDiskFormat =
                new HashMap<String, VirtualDiskDescType>();
            Map<String, FileType> fileIdToFileType = new HashMap<String, FileType>();

            DiskSectionType diskSectionType =
                OVFEnvelopeUtils.getSection(envelope, DiskSectionType.class);

            if (diskSectionType.getDisk().size() != 1)
            {
                // more than one disk in disk section
                throw new AMException(AMError.TEMPLATE_INVALID_MULTIPLE_DISKS);
            }
            else
            {
                int references = 0;
                for (FileType fileType : envelope.getReferences().getFile())
                {
                    fileIdToFileType.put(fileType.getId(), fileType);
                    if (diskSectionType.getDisk().get(0).getFileRef().equals(fileType.getId()))
                    {
                        references++;
                    }
                }
                if (references != 1)
                {
                    // file referenced in diskSection isn't found in file references or found more
                    // than one
                    throw new AMException(AMError.TEMPLATE_INVALID_MULTIPLE_FILES);
                }
            }
            // Create a hash
            for (VirtualDiskDescType virtualDiskDescType : diskSectionType.getDisk())
            {
                diskIdToDiskFormat.put(virtualDiskDescType.getDiskId(), virtualDiskDescType);
            }

            // /
View Full Code Here

    private static EnvelopeType fixDiskFormtatUriAndFileSizes(final EnvelopeType envelope,
        final String ovfId) throws SectionNotPresentException, InvalidSectionException
    {

        DiskSectionType diskSection = OVFEnvelopeUtils.getSection(envelope, DiskSectionType.class);

        if (diskSection.getDisk().size() != 1)
        {
            final String message =
                "abicloud only supports single disk definition on the OVF, the current envelope contains multiple disk";
            throw new InvalidSectionException(message);
        }

        VirtualDiskDescType vdisk = diskSection.getDisk().get(0);

        String formatUri = vdisk.getFormat();

        if (StringUtils.isEmpty(formatUri))
        {
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.