コード例 #1
0
 @Override
 protected void syncSearch() {
   if (getEntity() == null) {
     return;
   }
   GlusterVolumeEntity glusterVolumeEntity = getEntity();
   ArrayList<GlusterVolumeOptionEntity> list = new ArrayList<GlusterVolumeOptionEntity>();
   for (GlusterVolumeOptionEntity glusterVolumeOption : glusterVolumeEntity.getOptions()) {
     list.add(glusterVolumeOption);
   }
   setItems(list);
 }
コード例 #2
0
  /**
   * Sets all options of a volume by invoking the action {@link
   * VdcActionType#SetGlusterVolumeOption} in a loop. <br>
   * Errors if any are collected and added to "executeFailedMessages"
   *
   * @param volume
   */
  private void setVolumeOptions(GlusterVolumeEntity volume) {
    List<String> errors = new ArrayList<String>();
    for (GlusterVolumeOptionEntity option : volume.getOptions()) {
      // make sure that volume id is set
      option.setVolumeId(volume.getId());
      VdcReturnValueBase setOptionReturnValue =
          runBllAction(
              VdcActionType.SetGlusterVolumeOption, new GlusterVolumeOptionParameters(option));
      if (!getSucceeded()) {
        errors.addAll(setOptionReturnValue.getCanDoActionMessages());
        errors.addAll(setOptionReturnValue.getExecuteFailedMessages());
      }
    }

    if (!errors.isEmpty()) {
      handleVdsErrors(AuditLogType.GLUSTER_VOLUME_OPTION_SET_FAILED, errors);
    }
  }