private void UpdateOptions() {
    getCompulsoryActions().clear();
    getOptionalActions().clear();

    if (getEntity() != null) {
      storage_pool dataCenter = null;
      if (getEntity().getstorage_pool_id() != null) {
        dataCenter = DataProvider.GetDataCenterById(getEntity().getstorage_pool_id().getValue());
      }
      if (dataCenter == null || dataCenter.getstorage_pool_type() != StorageType.LOCALFS) {
        // Add host action.
        UICommand addHostAction = new UICommand("AddHost", this);

        // 				var hosts = DataProvider.GetHostListByCluster(Entity.name)
        // 					.Skip(1)
        // 					.ToList();
        java.util.ArrayList<VDS> hosts = DataProvider.GetHostListByCluster(getEntity().getname());
        if (hosts.size() > 1) {
          hosts.remove(0);
        }

        if (hosts.isEmpty()) {
          addHostAction.setTitle(ClusterConfigureHostsAction);
          getCompulsoryActions().add(addHostAction);
        } else {
          addHostAction.setTitle(ClusterAddAnotherHostAction);
          getOptionalActions().add(addHostAction);
        }
        if (getEntity().getstorage_pool_id() == null) {
          addHostAction.setIsExecutionAllowed(false);
          addHostAction
              .getExecuteProhibitionReasons()
              .add("The Cluster isn't attached to a Data Center");
          return;
        }
        java.util.ArrayList<VDSGroup> clusters =
            DataProvider.GetClusterList((Guid) getEntity().getstorage_pool_id());
        Version minimalClusterVersion = Linq.GetMinVersionByClusters(clusters);
        java.util.ArrayList<VDS> availableHosts = new java.util.ArrayList<VDS>();
        for (VDS vds : DataProvider.GetHostList()) {
          if ((!Linq.IsHostBelongsToAnyOfClusters(clusters, vds))
              && (vds.getstatus() == VDSStatus.Maintenance
                  || vds.getstatus() == VDSStatus.PendingApproval)
              && (vds.getVersion().getFullVersion() == null
                  || Extensions.GetFriendlyVersion(vds.getVersion().getFullVersion())
                          .compareTo(minimalClusterVersion)
                      >= 0)) {
            availableHosts.add(vds);
          }
        }
        // Select host action.
        UICommand selectHostAction = new UICommand("SelectHost", this);

        if (availableHosts.size() > 0 && clusters.size() > 0) {
          if (hosts.isEmpty()) {
            selectHostAction.setTitle(SelectHostsAction);
            getCompulsoryActions().add(selectHostAction);
          } else {
            selectHostAction.setTitle(SelectHostsAction);
            getOptionalActions().add(selectHostAction);
          }
        }
      } else {
        UICommand tempVar = new UICommand("AddHost", this);
        tempVar.setTitle(ClusterAddAnotherHostAction);
        UICommand addHostAction = tempVar;
        UICommand tempVar2 = new UICommand("SelectHost", this);
        tempVar2.setTitle(SelectHostsAction);
        UICommand selectHost = tempVar2;
        VDS host = DataProvider.GetLocalStorageHost(dataCenter.getname());
        if (host != null) {
          addHostAction.setIsExecutionAllowed(false);
          selectHost.setIsExecutionAllowed(false);
          String hasHostReason =
              "This Cluster belongs to a Local Data Center which already contain a Host";
          addHostAction.getExecuteProhibitionReasons().add(hasHostReason);
          selectHost.getExecuteProhibitionReasons().add(hasHostReason);
        }
        getCompulsoryActions().add(addHostAction);
        getOptionalActions().add(selectHost);
      }
    }
  }