Exemplo n.º 1
0
  private Map<String, TemplateInfo> listTemplate(HostVO ssHost) {
    ListTemplateCommand cmd = new ListTemplateCommand(ssHost.getStorageUrl());
    Answer answer = _agentMgr.sendToSecStorage(ssHost, cmd);
    if (answer != null && answer.getResult()) {
      ListTemplateAnswer tanswer = (ListTemplateAnswer) answer;
      return tanswer.getTemplateInfo();
    } else {
      if (s_logger.isDebugEnabled()) {
        s_logger.debug("can not list template for secondary storage host " + ssHost.getId());
      }
    }

    return null;
  }
Exemplo n.º 2
0
 private Map<String, TemplateInfo> listTemplate(SwiftVO swift) {
   if (swift == null) {
     return null;
   }
   ListTemplateCommand cmd = new ListTemplateCommand(swift.toSwiftTO());
   Answer answer = _agentMgr.sendToSSVM(null, cmd);
   if (answer != null && answer.getResult()) {
     ListTemplateAnswer tanswer = (ListTemplateAnswer) answer;
     return tanswer.getTemplateInfo();
   } else {
     if (s_logger.isDebugEnabled()) {
       s_logger.debug("can not list template for swift " + swift);
     }
   }
   return null;
 }
  private Map<String, TemplateProp> listTemplate(DataStore ssStore) {
    ListTemplateCommand cmd = new ListTemplateCommand(ssStore.getTO());
    EndPoint ep = _epSelector.select(ssStore);
    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()) {
      ListTemplateAnswer tanswer = (ListTemplateAnswer) answer;
      return tanswer.getTemplateInfo();
    } else {
      if (s_logger.isDebugEnabled()) {
        s_logger.debug("can not list template for secondary storage host " + ssStore.getId());
      }
    }

    return null;
  }