use of org.ovirt.engine.core.common.vdscommands.ExtendImageTicketVDSCommandParameters in project ovirt-engine by oVirt.
the class TransferImageCommand method extendImageTransferSession.
private boolean extendImageTransferSession(final ImageTransfer entity) {
if (entity.getImagedTicketId() == null) {
log.error("Failed to extend image transfer session: no existing session to extend");
return false;
}
long timeout = getHostTicketLifetime();
Guid resourceId = entity.getImagedTicketId();
ExtendImageTicketVDSCommandParameters transferCommandParams = new ExtendImageTicketVDSCommandParameters(entity.getVdsId(), entity.getImagedTicketId(), timeout);
// TODO This is called from doPolling(), we should run it async (runFutureVDSCommand?)
VDSReturnValue vdsRetVal;
try {
vdsRetVal = backend.getResourceManager().runVdsCommand(VDSCommandType.ExtendImageTicket, transferCommandParams);
} catch (RuntimeException e) {
log.error("Failed to extend image transfer session for ticket '{}': {}", resourceId.toString(), e);
return false;
}
if (!vdsRetVal.getSucceeded()) {
log.error("Failed to extend image transfer session");
return false;
}
log.info("Transfer session with ticket id {} extended, timeout {} seconds", resourceId.toString(), timeout);
setNewSessionExpiration(timeout);
return true;
}
Aggregations