Пример #1
0
  static void checkFlags(SSOToken token) throws SMSException, SSOException {
    try {
      CachedSMSEntry entry = CachedSMSEntry.getInstance(token, REALM_ENTRY);
      if (entry.isDirty()) {
        entry.refresh();
      }
      if (!entry.isNewEntry()) {
        ditUpgradedCache = true;
        ServiceConfigManagerImpl ssm =
            ServiceConfigManagerImpl.getInstance(token, REALM_SERVICE, SERVICE_VERSION);
        ServiceConfigImpl sc = null;
        Map map = null;
        if (ssm == null
            || (sc = ssm.getGlobalConfig(token, null)) == null
            || (map = sc.getAttributes()) == null) {
          return;
        }
        Set coexistEntry = (Set) map.get(COEXISTENCE_ATTR_NAME);
        if (coexistEntry != null && coexistEntry.contains("false")) {
          coexistenceCache = false;
        }
        Set realmEntry = (Set) map.get(REALM_ATTR_NAME);
        if (realmEntry != null && realmEntry.contains("true")) {
          realmCache = true;
        }
        // Get the default services to be loaded
        requiredServices = (Set) map.get(DEFAULT_SERVICES_FOR_REALMS);
        defaultServicesToLoad = new HashSet();
        defaultServicesToLoad.addAll(requiredServices);

        // Make this flag false, for always the union of
        // auto assignment services from idRepoService.xml and
        // auth services from AMAuthenticationManager code
        // should be returned for deep copy for a newly created
        // sub realm.
        loadedAuthServices = false;
      }
      if (debug.messageEnabled()) {
        debug.message("ServiceManager::checkFlags:realmEnabled=" + realmCache);
        debug.message("ServiceManager::checkFlags:coexistenceMode=" + coexistenceCache);
      }
    } catch (SMSException e) {
      debug.error("ServiceManager::unable to check " + "if Realm is enabled: ", e);
      throw (e);
    }
  }