Пример #1
0
  private void deleteSubConfig(ServiceConfig sc, String subConfigName)
      throws SSOException, SMSException {
    StringTokenizer st = new StringTokenizer(subConfigName, "/");
    int tokenCount = st.countTokens();

    for (int i = 1; i <= tokenCount; i++) {
      String scn = SMSSchema.unescapeName(st.nextToken());

      if (i != tokenCount) {
        sc = sc.getSubConfig(scn);
      } else {
        sc.removeSubConfig(scn);
      }
    }
  }
Пример #2
0
  private void addSubConfig(
      ServiceConfig sc, String subConfigName, String subConfigId, Map attrValues, int priority)
      throws SSOException, SMSException {
    StringTokenizer st = new StringTokenizer(subConfigName, "/");
    int tokenCount = st.countTokens();

    for (int i = 1; i <= tokenCount; i++) {
      String scn = SMSSchema.unescapeName(st.nextToken());

      if (i != tokenCount) {
        sc = sc.getSubConfig(scn);
      } else {
        if (subConfigId == null) {
          subConfigId = scn;
        }

        sc.addSubConfig(subConfigId, scn, priority, attrValues);
      }
    }
  }