Examples of IdNotFoundException


Examples of com.abiquo.ovfmanager.ovf.exceptions.IdNotFoundException

                String fileId = diskDescType.getFileRef();

                if (!fileIdToFileType.containsKey(fileId))
                {
                    String msg = "File Id [" + fileId + "] not found on the ReferencesSection";
                    throw new IdNotFoundException(msg);
                }

                FileType file = fileIdToFileType.get(fileId);
                final String filePath = file.getHref();
                final Long fileSize = file.getSize().longValue();

                String format = diskDescType.getFormat(); // XXX using the same format on the OVF
                // disk

                if (!diskIdToVSs.containsKey(diskId))
                {
                    throw new IdNotFoundException("Any virtualSystem is using diskId[" + diskId
                        + "]"); // XXX warning ??
                }

                if (diskIdToVSs.size() != 1)
                {
                    throw new AMException(AMError.TEMPLATE_INVALID, String.format(
                        "There are more than one virtual system on the OVF Envelope [%s]", ovfId));
                }

                for (String vssName : diskIdToVSs.get(diskId))
                {
                    diskInfo = new TemplateDto();
                    diskInfo.setName(vssName);
                    diskInfo.setUrl(ovfId);
                    diskInfo.setLoginUser(getProductPropertyValue(product, "user"));
                    diskInfo.setLoginPassword(getProductPropertyValue(product, "password"));
                    diskInfo.setOsType(getOSType(ossection));
                    diskInfo.setOsVersion(getOSVersion(ossection));

                    DiskFormat diskFormat = DiskFormat.fromValue(format);
                    DiskFormatType ovfDiskFormat = DiskFormatType.valueOf(diskFormat.name());

                    diskInfo.setDiskFileFormat(ovfDiskFormat);
                    diskInfo.setDiskFileSize(fileSize);

                    // Note that getHRef() will now return the relative path
                    // of the file at the downloaded repository space

                    if (filePath.startsWith("http:"))
                    {
                        diskInfo.setDiskFilePath(FilenameUtils.getName(filePath));
                    }
                    else
                    {
                        diskInfo.setDiskFilePath(filePath);
                    }

                    diskInfo.setIconPath(iconPath);
                    diskInfo.setDescription(description);
                    diskInfo.setCategoryName(categoryName);
                    // XXX diskInfo.setSO(value);

                    if (!requiredByVSs.containsKey(vssName))
                    {
                        throw new IdNotFoundException("VirtualSystem id not found [" + vssName
                            + "]");
                    }

                    TemplateDto requirement = requiredByVSs.get(vssName);
View Full Code Here

Examples of com.abiquo.ovfmanager.ovf.exceptions.IdNotFoundException

                String fileId = diskDescType.getFileRef();

                if (!fileIdToFileType.containsKey(fileId))
                {
                    String msg = "File Id [" + fileId + "] not found on the ReferencesSection";
                    throw new IdNotFoundException(msg);
                }

                FileType file = fileIdToFileType.get(fileId);
                final String filePath = file.getHref();
                final Long fileSize = file.getSize().longValue();

                String format = diskDescType.getFormat(); // XXX using the same format on the OVF
                // disk

                if (!diskIdToVSs.containsKey(diskId))
                {
                    throw new IdNotFoundException("Any virtualSystem is using diskId[" + diskId
                        + "]"); // XXX warning ??
                }

                if (diskIdToVSs.size() != 1)
                {
                    throw new AMException(AMError.TEMPLATE_INVALID, String.format(
                        "There are more than one virtual system on the OVF Envelope [%s]", ovfId));
                }

                for (String vssName : diskIdToVSs.get(diskId))
                {
                    diskInfo = new TemplateDto();
                    diskInfo.setName(vssName);
                    diskInfo.setUrl(ovfId);
                    diskInfo.setLoginUser(getProductPropertyValue(product, "user"));
                    diskInfo.setLoginPassword(getProductPropertyValue(product, "password"));
                    diskInfo.setOsType(getOSType(ossection));
                    diskInfo.setOsVersion(getOSVersion(ossection));

                    DiskFormatOVF diskFormat = DiskFormatOVF.fromValue(format);

                    diskInfo.setDiskFileFormat(diskFormat.name());
                    diskInfo.setDiskFileSize(fileSize);

                    // Note that getHRef() will now return the relative path
                    // of the file at the downloaded repository space

                    if (filePath.startsWith("http:"))
                    {
                        diskInfo.setDiskFilePath(FilenameUtils.getName(filePath));
                    }
                    else
                    {
                        diskInfo.setDiskFilePath(filePath);
                    }

                    diskInfo.setIconUrl(iconPath);
                    diskInfo.setDescription(description);
                    diskInfo.setCategoryName(categoryName);
                    // XXX diskInfo.setSO(value);

                    if (!requiredByVSs.containsKey(vssName))
                    {
                        throw new IdNotFoundException("VirtualSystem id not found [" + vssName
                            + "]");
                    }

                    TemplateDto requirement = requiredByVSs.get(vssName);
View Full Code Here

Examples of com.abiquo.ovfmanager.ovf.exceptions.IdNotFoundException

                String fileId = diskDescType.getFileRef();

                if (!fileIdToFileType.containsKey(fileId))
                {
                    String msg = "File Id [" + fileId + "] not found on the ReferencesSection";
                    throw new IdNotFoundException(msg);
                }

                FileType file = fileIdToFileType.get(fileId);
                final String filePath = file.getHref();
                final Long fileSize = file.getSize().longValue();

                String format = diskDescType.getFormat(); // XXX using the same format on the OVF
                // disk

                if (!diskIdToVSs.containsKey(diskId))
                {
                    throw new IdNotFoundException("Any virtualSystem is using diskId[" + diskId
                        + "]"); // XXX warning ??
                }

                if (diskIdToVSs.size() != 1)
                {
                    throw new AMException(AMError.TEMPLATE_INVALID, String.format(
                        "There are more than one virtual system on the OVF Envelope [%s]", ovfId));
                }

                for (String vssName : diskIdToVSs.get(diskId))
                {
                    diskInfo = new TemplateDto();
                    diskInfo.setName(vssName);
                    diskInfo.setUrl(ovfId);
                    diskInfo.setLoginUser(getProductPropertyValue(product, "user"));
                    diskInfo.setLoginPassword(getProductPropertyValue(product, "password"));
                    diskInfo.setOsType(getOSType(ossection));
                    diskInfo.setOsVersion(getOSVersion(ossection));

                    DiskFormatOVF diskFormat = DiskFormatOVF.fromValue(format);

                    diskInfo.setDiskFileFormat(diskFormat.name());
                    diskInfo.setDiskFileSize(fileSize);

                    // Note that getHRef() will now return the relative path
                    // of the file at the downloaded repository space

                    if (filePath.startsWith("http:"))
                    {
                        diskInfo.setDiskFilePath(FilenameUtils.getName(filePath));
                    }
                    else
                    {
                        diskInfo.setDiskFilePath(filePath);
                    }

                    diskInfo.setIconUrl(iconPath);
                    diskInfo.setDescription(description);
                    diskInfo.setCategoryName(categoryName);
                    // XXX diskInfo.setSO(value);

                    if (!requiredByVSs.containsKey(vssName))
                    {
                        throw new IdNotFoundException("VirtualSystem id not found [" + vssName
                            + "]");
                    }

                    TemplateDto requirement = requiredByVSs.get(vssName);
View Full Code Here

Examples of com.abiquo.ovfmanager.ovf.exceptions.IdNotFoundException

                String fileId = diskDescType.getFileRef();

                if (!fileIdToFileType.containsKey(fileId))
                {
                    String msg = "File Id [" + fileId + "] not found on the ReferencesSection";
                    throw new IdNotFoundException(msg);
                }

                FileType file = fileIdToFileType.get(fileId);
                final String filePath = file.getHref();
                final Long fileSize = file.getSize().longValue();

                String format = diskDescType.getFormat(); // XXX using the same format on the OVF
                // disk

                if (!diskIdToVSs.containsKey(diskId))
                {
                    throw new IdNotFoundException("Any virtualSystem is using diskId[" + diskId
                        + "]"); // XXX warning ??
                }

                if (diskIdToVSs.size() != 1)
                {
                    throw new AMException(AMError.TEMPLATE_INVALID, String.format(
                        "There are more than one virtual system on the OVF Envelope [%s]", ovfId));
                }

                for (String vssName : diskIdToVSs.get(diskId))
                {
                    diskInfo = new TemplateDto();
                    diskInfo.setName(vssName);
                    diskInfo.setUrl(ovfId);
                    diskInfo.setLoginUser(getProductPropertyValue(product, "user"));
                    diskInfo.setLoginPassword(getProductPropertyValue(product, "password"));
                    diskInfo.setOsType(getOSType(ossection));
                    diskInfo.setOsVersion(getOSVersion(ossection));

                    DiskFormatOVF diskFormat = DiskFormatOVF.fromValue(format);

                    diskInfo.setDiskFileFormat(diskFormat.name());
                    diskInfo.setDiskFileSize(fileSize);

                    // Note that getHRef() will now return the relative path
                    // of the file at the downloaded repository space

                    if (filePath.startsWith("http:"))
                    {
                        diskInfo.setDiskFilePath(FilenameUtils.getName(filePath));
                    }
                    else
                    {
                        diskInfo.setDiskFilePath(filePath);
                    }

                    diskInfo.setIconUrl(iconPath);
                    diskInfo.setDescription(description);
                    diskInfo.setCategoryName(categoryName);
                    // XXX diskInfo.setSO(value);

                    if (!requiredByVSs.containsKey(vssName))
                    {
                        throw new IdNotFoundException("VirtualSystem id not found [" + vssName
                            + "]");
                    }

                    TemplateDto requirement = requiredByVSs.get(vssName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.