Search in sources :

Example 1 with GetImageTicketVDSCommandParameters

use of org.ovirt.engine.core.common.vdscommands.GetImageTicketVDSCommandParameters in project ovirt-engine by oVirt.

the class TransferImageCommand method pollTransferStatus.

private void pollTransferStatus(final StateContext context) {
    if (context.entity.getVdsId() == null || context.entity.getImagedTicketId() == null || !FeatureSupported.getImageTicketSupported(vdsDao.get(context.entity.getVdsId()).getClusterCompatibilityVersion())) {
        // Old engines update the transfer status in UploadImageHandler::updateBytesSent.
        return;
    }
    ImageTicketInformation ticketInfo;
    try {
        ticketInfo = (ImageTicketInformation) runVdsCommand(VDSCommandType.GetImageTicket, new GetImageTicketVDSCommandParameters(context.entity.getVdsId(), context.entity.getImagedTicketId())).getReturnValue();
    } catch (EngineException e) {
        log.error("Could not get image ticket '{}' from vdsm", context.entity.getImagedTicketId(), e);
        updateEntityPhaseToPausedBySystem(AuditLogType.TRANSFER_IMAGE_PAUSED_BY_SYSTEM_MISSING_TICKET);
        return;
    }
    ImageTransfer upToDateImageTransfer = updateTransferStatusWithTicketInformation(context.entity, ticketInfo);
    if (getParameters().getTransferType() == TransferType.Download) {
        finalizeDownloadIfNecessary(context, upToDateImageTransfer);
    }
}
Also used : ImageTransfer(org.ovirt.engine.core.common.businessentities.storage.ImageTransfer) GetImageTicketVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.GetImageTicketVDSCommandParameters) EngineException(org.ovirt.engine.core.common.errors.EngineException) ImageTicketInformation(org.ovirt.engine.core.common.businessentities.storage.ImageTicketInformation)

Aggregations

ImageTicketInformation (org.ovirt.engine.core.common.businessentities.storage.ImageTicketInformation)1 ImageTransfer (org.ovirt.engine.core.common.businessentities.storage.ImageTransfer)1 EngineException (org.ovirt.engine.core.common.errors.EngineException)1 GetImageTicketVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.GetImageTicketVDSCommandParameters)1