Search in sources :

Example 6 with ImageStatus

use of org.ovirt.engine.core.common.businessentities.storage.ImageStatus in project ovirt-engine by oVirt.

the class RemoveCinderDiskVolumeCommandCallback method childCommandsExecutionEnded.

@Override
protected void childCommandsExecutionEnded(CommandBase<?> command, boolean anyFailed, List<Guid> childCmdIds, CommandExecutionStatus status, int completedChildren) {
    RemoveCinderDiskVolumeCommand<RemoveCinderDiskVolumeParameters> removeCinderDiskVolumeCommand = (RemoveCinderDiskVolumeCommand<RemoveCinderDiskVolumeParameters>) command;
    CinderDisk removedVolume = removeCinderDiskVolumeCommand.getParameters().getRemovedVolume();
    // In case the volume/snapshot has been deleted from Cinder.
    if (!removeCinderDiskVolumeCommand.getCinderBroker().isVolumeExistsByClassificationType(removedVolume)) {
        setCommandEndStatus(command, false, status, childCmdIds);
    }
    ImageStatus imageStatus = checkImageStatus(removedVolume, removeCinderDiskVolumeCommand);
    if (imageStatus != null && imageStatus != removedVolume.getImageStatus()) {
        switch(imageStatus) {
            case ILLEGAL:
                setCommandEndStatus(command, true, status, childCmdIds);
                break;
        }
    }
}
Also used : RemoveCinderDiskVolumeParameters(org.ovirt.engine.core.common.action.RemoveCinderDiskVolumeParameters) ImageStatus(org.ovirt.engine.core.common.businessentities.storage.ImageStatus) CinderDisk(org.ovirt.engine.core.common.businessentities.storage.CinderDisk)

Example 7 with ImageStatus

use of org.ovirt.engine.core.common.businessentities.storage.ImageStatus in project ovirt-engine by oVirt.

the class DisksTree method getRootItem.

@Override
protected TreeItem getRootItem(DiskImage disk) {
    HorizontalPanel panel = new HorizontalPanel();
    panel.setSpacing(1);
    // $NON-NLS-1$
    panel.setWidth("100%");
    DiskVmElement dve = disk.getDiskVmElements().iterator().next();
    // $NON-NLS-1$
    addItemToPanel(panel, new Image(resources.diskImage()), "25px");
    // $NON-NLS-1$
    addTextBoxToPanel(panel, new StringValueLabel(), disk.getDiskAlias(), "");
    // $NON-NLS-1$
    addItemToPanel(panel, dve.isReadOnly() ? new Image(resources.readOnlyDiskIcon()) : new Image(), "60px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new DiskSizeLabel<Long>(), disk.getSizeInGigabytes(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new DiskSizeLabel<Long>(SizeConverter.SizeUnit.BYTES), disk.getActualSizeInBytes(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new EnumLabel<ImageStatus>(), disk.getImageStatus(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new EnumLabel<VolumeType>(), disk.getVolumeType(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new EnumLabel<DiskInterface>(), dve.getDiskInterface(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new EnumLabel<DiskStorageType>(), disk.getDiskStorageType(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new FullDateTimeLabel(), disk.getCreationDate(), "140px");
    TreeItem treeItem = new TreeItem(panel);
    treeItem.setUserObject(disk.getId());
    return treeItem;
}
Also used : TreeItem(com.google.gwt.user.client.ui.TreeItem) ImageStatus(org.ovirt.engine.core.common.businessentities.storage.ImageStatus) DiskStorageType(org.ovirt.engine.core.common.businessentities.storage.DiskStorageType) Image(com.google.gwt.user.client.ui.Image) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) StringValueLabel(org.ovirt.engine.ui.common.widget.label.StringValueLabel) FullDateTimeLabel(org.ovirt.engine.ui.webadmin.widget.label.FullDateTimeLabel) VolumeType(org.ovirt.engine.core.common.businessentities.storage.VolumeType) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) DiskVmElement(org.ovirt.engine.core.common.businessentities.storage.DiskVmElement) DiskInterface(org.ovirt.engine.core.common.businessentities.storage.DiskInterface)

Example 8 with ImageStatus

use of org.ovirt.engine.core.common.businessentities.storage.ImageStatus in project ovirt-engine by oVirt.

the class StoragesTree method getNodeItem.

@Override
protected TreeItem getNodeItem(DiskModel diskModel) {
    HorizontalPanel panel = new HorizontalPanel();
    panel.setSpacing(1);
    // $NON-NLS-1$
    panel.setWidth("100%");
    DiskImage disk = (DiskImage) diskModel.getDisk();
    // $NON-NLS-1$
    addItemToPanel(panel, new Image(resources.diskImage()), "30px");
    // $NON-NLS-1$
    addTextBoxToPanel(panel, new StringValueLabel(), disk.getDiskAlias(), "");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new DiskSizeLabel<Long>(), disk.getSizeInGigabytes(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new EnumLabel<ImageStatus>(), disk.getImageStatus(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new EnumLabel<VolumeType>(), disk.getVolumeType(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new EnumLabel<DiskInterface>(), disk.getDiskVmElements().iterator().next().getDiskInterface(), "110px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new EnumLabel<DiskStorageType>(), disk.getDiskStorageType(), "110px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new DateLabel(), disk.getCreationDate(), "100px");
    TreeItem treeItem = new TreeItem(panel);
    treeItem.setUserObject(getEntityId(diskModel));
    return treeItem;
}
Also used : TreeItem(com.google.gwt.user.client.ui.TreeItem) ImageStatus(org.ovirt.engine.core.common.businessentities.storage.ImageStatus) DiskStorageType(org.ovirt.engine.core.common.businessentities.storage.DiskStorageType) Image(com.google.gwt.user.client.ui.Image) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) StringValueLabel(org.ovirt.engine.ui.common.widget.label.StringValueLabel) DateLabel(com.google.gwt.user.client.ui.DateLabel) VolumeType(org.ovirt.engine.core.common.businessentities.storage.VolumeType) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) DiskInterface(org.ovirt.engine.core.common.businessentities.storage.DiskInterface) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage)

Aggregations

ImageStatus (org.ovirt.engine.core.common.businessentities.storage.ImageStatus)8 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)6 CinderDisk (org.ovirt.engine.core.common.businessentities.storage.CinderDisk)3 Guid (org.ovirt.engine.core.compat.Guid)3 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)2 Image (com.google.gwt.user.client.ui.Image)2 TreeItem (com.google.gwt.user.client.ui.TreeItem)2 ImagesContainterParametersBase (org.ovirt.engine.core.common.action.ImagesContainterParametersBase)2 DiskInterface (org.ovirt.engine.core.common.businessentities.storage.DiskInterface)2 DiskStorageType (org.ovirt.engine.core.common.businessentities.storage.DiskStorageType)2 VolumeType (org.ovirt.engine.core.common.businessentities.storage.VolumeType)2 StringValueLabel (org.ovirt.engine.ui.common.widget.label.StringValueLabel)2 DateLabel (com.google.gwt.user.client.ui.DateLabel)1 BaseImagesCommand (org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand)1 AddDiskParameters (org.ovirt.engine.core.common.action.AddDiskParameters)1 CreateCinderSnapshotParameters (org.ovirt.engine.core.common.action.CreateCinderSnapshotParameters)1 RemoveCinderDiskVolumeParameters (org.ovirt.engine.core.common.action.RemoveCinderDiskVolumeParameters)1 VmDiskOperationParameterBase (org.ovirt.engine.core.common.action.VmDiskOperationParameterBase)1 DiskVmElement (org.ovirt.engine.core.common.businessentities.storage.DiskVmElement)1 FullDateTimeLabel (org.ovirt.engine.ui.webadmin.widget.label.FullDateTimeLabel)1