Search in sources :

Example 1 with ListVolumeCommand

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

the class VolumeServiceImpl method listVolume.

private Map<Long, TemplateProp> listVolume(final DataStore store) {
    final ListVolumeCommand cmd = new ListVolumeCommand(store.getTO(), store.getUri());
    final EndPoint ep = _epSelector.select(store);
    Answer answer = null;
    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()) {
        final ListVolumeAnswer tanswer = (ListVolumeAnswer) answer;
        return tanswer.getTemplateInfo();
    } else {
        if (s_logger.isDebugEnabled()) {
            s_logger.debug("Can not list volumes for image store " + store.getId());
        }
    }
    return null;
}
Also used : ListVolumeAnswer(com.cloud.legacymodel.communication.answer.ListVolumeAnswer) Answer(com.cloud.legacymodel.communication.answer.Answer) CopyCmdAnswer(com.cloud.legacymodel.communication.answer.CopyCmdAnswer) ListVolumeCommand(com.cloud.legacymodel.communication.command.ListVolumeCommand) EndPoint(com.cloud.engine.subsystem.api.storage.EndPoint) RemoteHostEndPoint(com.cloud.storage.RemoteHostEndPoint) ListVolumeAnswer(com.cloud.legacymodel.communication.answer.ListVolumeAnswer)

Aggregations

EndPoint (com.cloud.engine.subsystem.api.storage.EndPoint)1 Answer (com.cloud.legacymodel.communication.answer.Answer)1 CopyCmdAnswer (com.cloud.legacymodel.communication.answer.CopyCmdAnswer)1 ListVolumeAnswer (com.cloud.legacymodel.communication.answer.ListVolumeAnswer)1 ListVolumeCommand (com.cloud.legacymodel.communication.command.ListVolumeCommand)1 RemoteHostEndPoint (com.cloud.storage.RemoteHostEndPoint)1