public ReloadableProperties load(String nameProperty, String fallbackName, Map options) { ReloadableProperties result; FileNameKey key = new FileNameKey(nameProperty, fallbackName, options); key.setDebug(debug); synchronized (staticCache) { result = staticCache.get(key); if (result == null) { result = new ReloadableProperties(key); staticCache.put(key, result); } } return result.obtained(); }
@Override public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { this.subject = subject; this.callbackHandler = callbackHandler; succeeded = false; init(options); users = load(USER_FILE_PROP_NAME, "user", options).getProps(); groups = load(GROUP_FILE_PROP_NAME, "group", options).invertedPropertiesValuesMap(); }
public synchronized ReloadableProperties obtained() { if (reloadTime < 0 || (key.isReload() && hasModificationAfter(reloadTime))) { props = new Properties(); try { load(key.file(), props); invertedProps = null; invertedValueProps = null; if (key.isDebug()) { LOG.debug("Load of: " + key); } } catch (IOException e) { LOG.error("Failed to load: " + key + ", reason:" + e.getLocalizedMessage()); if (key.isDebug()) { LOG.debug("Load of: " + key + ", failure exception" + e); } } reloadTime = System.currentTimeMillis(); } return this; }
/** * Performs initialization of file paths. A standard JAAS override. */ @Override public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { super.initialize(subject, callbackHandler, sharedState, options); usersByDn = load(USER_FILE_PROP_NAME, "", options).invertedPropertiesMap(); groupsByUser = load(GROUP_FILE_PROP_NAME, "", options).invertedPropertiesValuesMap(); }
/** * Performs initialization of file paths. A standard JAAS override. */ @Override public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { super.initialize(subject, callbackHandler, sharedState, options); usersByDn = load(USER_FILE_PROP_NAME, "", options).invertedPropertiesMap(); groupsByUser = load(GROUP_FILE_PROP_NAME, "", options).invertedPropertiesValuesMap(); }
@Override public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { this.subject = subject; this.callbackHandler = callbackHandler; loginSucceeded = false; init(options); users = load(USER_FILE_PROP_NAME, "user", options).getProps(); groups = load(GROUP_FILE_PROP_NAME, "group", options).invertedPropertiesValuesMap(); }
/** * Performs initialization of file paths. A standard JAAS override. */ @Override public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { super.initialize(subject, callbackHandler, sharedState, options); usersByDn = load(USER_FILE_PROP_NAME, "", options).invertedPropertiesMap(); groupsByUser = load(GROUP_FILE_PROP_NAME, "", options).invertedPropertiesValuesMap(); }
public ReloadableProperties load(String nameProperty, String fallbackName, Map options) { ReloadableProperties result; FileNameKey key = new FileNameKey(nameProperty, fallbackName, options); key.setDebug(debug); synchronized (staticCache) { result = staticCache.get(key); if (result == null) { result = new ReloadableProperties(key); staticCache.put(key, result); } } return result.obtained(); }
public synchronized ReloadableProperties obtained() { if (reloadTime < 0 || (key.isReload() && hasModificationAfter(reloadTime))) { props = new Properties(); try { load(key.file(), props); invertedProps = null; invertedValueProps = null; if (key.isDebug()) { LOG.debug("Load of: " + key); } } catch (IOException e) { LOG.error("Failed to load: " + key + ", reason:" + e.getLocalizedMessage()); if (key.isDebug()) { LOG.debug("Load of: " + key + ", failure exception" + e); } } reloadTime = System.currentTimeMillis(); } return this; }
@Override public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { this.subject = subject; this.callbackHandler = callbackHandler; loginSucceeded = false; init(options); users = load(USER_FILE_PROP_NAME, "user", options).getProps(); groups = load(GROUP_FILE_PROP_NAME, "group", options).invertedPropertiesValuesMap(); }
public ReloadableProperties load(String nameProperty, String fallbackName, Map options) { ReloadableProperties result; FileNameKey key = new FileNameKey(nameProperty, fallbackName, options); key.setDebug(debug); synchronized (staticCache) { result = staticCache.get(key); if (result == null) { result = new ReloadableProperties(key); staticCache.put(key, result); } } return result.obtained(); }
public synchronized ReloadableProperties obtained() { if (reloadTime < 0 || (key.isReload() && hasModificationAfter(reloadTime))) { props = new Properties(); try { load(key.file(), props); invertedProps = null; invertedValueProps = null; if (key.isDebug()) { LOG.debug("Load of: " + key); } } catch (IOException e) { LOG.error("Failed to load: " + key + ", reason:" + e.getLocalizedMessage()); if (key.isDebug()) { LOG.debug("Load of: " + key + ", failure exception" + e); } } reloadTime = System.currentTimeMillis(); } return this; }