Search in sources :

Example 1 with ForgetObjectCmd

use of org.apache.cloudstack.storage.command.ForgetObjectCmd in project cloudstack by apache.

the class HypervisorHelperImpl method forgetObject.

@Override
public boolean forgetObject(DataTO object, Scope scope, Long storeId) {
    EndPoint ep = selector.select(scope, storeId);
    ForgetObjectCmd cmd = new ForgetObjectCmd(object);
    Answer answer = null;
    if (ep == null) {
        String errMsg = "No remote endpoint to send command, check if host or ssvm is down?";
        s_logger.error(errMsg);
        answer = new Answer(cmd, false, errMsg);
    } else {
        answer = ep.sendMessage(cmd);
    }
    if (answer == null || !answer.getResult()) {
        String errMsg = answer == null ? null : answer.getDetails();
        if (errMsg != null) {
            s_logger.debug("Failed to forget object: " + errMsg);
        }
        return false;
    }
    return true;
}
Also used : CreateVMSnapshotAnswer(com.cloud.agent.api.CreateVMSnapshotAnswer) Answer(com.cloud.agent.api.Answer) IntroduceObjectAnswer(org.apache.cloudstack.storage.command.IntroduceObjectAnswer) EndPoint(org.apache.cloudstack.engine.subsystem.api.storage.EndPoint) ForgetObjectCmd(org.apache.cloudstack.storage.command.ForgetObjectCmd)

Aggregations

Answer (com.cloud.agent.api.Answer)1 CreateVMSnapshotAnswer (com.cloud.agent.api.CreateVMSnapshotAnswer)1 EndPoint (org.apache.cloudstack.engine.subsystem.api.storage.EndPoint)1 ForgetObjectCmd (org.apache.cloudstack.storage.command.ForgetObjectCmd)1 IntroduceObjectAnswer (org.apache.cloudstack.storage.command.IntroduceObjectAnswer)1