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