private void unlinkAction(Long actionId, Long serverId) {
   CallableMode proc =
       ModeFactory.getCallableMode(
           TaskConstants.MODE_NAME, TaskConstants.TASK_QUERY_KSCLEANUP_REMOVE_ACTION);
   Map params = new HashMap();
   params.put("server_id", serverId);
   params.put("action_id", actionId);
   proc.execute(params, new HashMap());
 }
  /** {@inheritDoc} */
  public ValidatorError store() {
    Iterator i = this.user.getOrg().getMonitoringScouts().iterator();

    while (i.hasNext()) {
      SatCluster sc = (SatCluster) i.next();
      Map in = new HashMap();
      in.put("org_id", this.user.getOrg().getId());
      in.put("scout_id", sc.getId());
      in.put("user_id", this.user.getId().toString());

      CallableMode m = ModeFactory.getCallableMode("Monitoring_queries", "push_scout_config");

      m.execute(in, new HashMap());
    }

    return null;
  }
  private ValidatorError store(
      Long satMax, Long orgMax, Long satCurrent, Long orgCurrent, Long proposed, boolean isFlex) {
    // No sense making the call if its the same.
    if (orgMax == proposed) {
      return null;
    }

    if (orgMax == null) {
      orgMax = 0L;
    }

    Long avail = 0L;
    if (satMax != null) {
      avail = satMax - satCurrent + orgMax;
    }

    if (proposed == null || proposed < 0 || avail < proposed) {
      String key =
          isFlex
              ? "org.entitlements.software.not_in_range.flex"
              : "org.entitlements.software.not_in_range";

      return new ValidatorError(key, this.org.getName(), this.channelFamily.getName(), 0, avail);
    }

    // Proposed cannot be lower than current members
    if (!forceUnentitlement(orgCurrent, proposed)) {
      return new ValidatorError(
          "org.entitlements.software.proposedwarning",
          this.channelFamily.getName(),
          this.org.getName());
    }

    Long toOrgId;
    Long fromOrgId;
    long actualTotal;
    // If we are decreasing the # of entitlements
    // we give back to the default org.
    if (orgMax.longValue() > proposed) {
      fromOrgId = this.org.getId();
      toOrgId = OrgFactory.getSatelliteOrg().getId();
      actualTotal = orgMax.longValue() - proposed;
    } else {
      toOrgId = this.org.getId();
      fromOrgId = OrgFactory.getSatelliteOrg().getId();
      actualTotal = proposed - orgMax.longValue();
    }

    Map in = new HashMap();
    // "group_label, from_org_id, to_org_id, quantity"
    in.put("channel_family_label", channelFamily.getLabel());
    in.put("from_org_id", fromOrgId);
    in.put("to_org_id", toOrgId);
    if (isFlex) {
      in.put("quantity", 0);
      in.put("flex_quantity", actualTotal);

    } else {
      in.put("quantity", actualTotal);
      in.put("flex_quantity", 0);
    }
    CallableMode m = ModeFactory.getCallableMode("Org_queries", "assign_software_entitlements");
    m.execute(in, new HashMap());
    return null;
  }