Search in sources :

Example 1 with UploadProgressCommand

use of com.cloud.agent.api.storage.UploadProgressCommand in project cloudstack by apache.

the class UploadListener method sendCommand.

public void sendCommand(RequestType reqType) {
    if (getJobId() != null) {
        if (s_logger.isTraceEnabled()) {
            log("Sending progress command ", Level.TRACE);
        }
        try {
            EndPoint ep = _epSelector.select(sserver);
            if (ep == null) {
                String errMsg = "No remote endpoint to send command, check if host or ssvm is down?";
                s_logger.error(errMsg);
                return;
            }
            ep.sendMessageAsync(new UploadProgressCommand(getCommand(), getJobId(), reqType), new Callback(ep.getId(), this));
        } catch (Exception e) {
            s_logger.debug("Send command failed", e);
            setDisconnected();
        }
    }
}
Also used : AsyncCompletionCallback(org.apache.cloudstack.framework.async.AsyncCompletionCallback) UploadProgressCommand(com.cloud.agent.api.storage.UploadProgressCommand) EndPoint(org.apache.cloudstack.engine.subsystem.api.storage.EndPoint) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException)

Aggregations

UploadProgressCommand (com.cloud.agent.api.storage.UploadProgressCommand)1 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)1 EndPoint (org.apache.cloudstack.engine.subsystem.api.storage.EndPoint)1 AsyncCompletionCallback (org.apache.cloudstack.framework.async.AsyncCompletionCallback)1