Search in sources :

Example 1 with ComputeChecksumCommand

use of com.cloud.legacymodel.communication.command.ComputeChecksumCommand in project cosmic by MissionCriticalCloud.

the class TemplateManagerImpl method getChecksum.

@Override
public String getChecksum(final DataStore store, final String templatePath) {
    final EndPoint ep = this._epSelector.select(store);
    final ComputeChecksumCommand cmd = new ComputeChecksumCommand(store.getTO(), templatePath);
    final Answer answer;
    if (ep == null) {
        final 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()) {
        return answer.getDetails();
    }
    return null;
}
Also used : Answer(com.cloud.legacymodel.communication.answer.Answer) ComputeChecksumCommand(com.cloud.legacymodel.communication.command.ComputeChecksumCommand) EndPoint(com.cloud.engine.subsystem.api.storage.EndPoint)

Aggregations

EndPoint (com.cloud.engine.subsystem.api.storage.EndPoint)1 Answer (com.cloud.legacymodel.communication.answer.Answer)1 ComputeChecksumCommand (com.cloud.legacymodel.communication.command.ComputeChecksumCommand)1