diff --git a/src/main/java/org/elasticsearch/shield/authc/esusers/FileUserPasswdStore.java b/src/main/java/org/elasticsearch/shield/authc/esusers/FileUserPasswdStore.java index 8546de39f8a..1fd55718cc9 100644 --- a/src/main/java/org/elasticsearch/shield/authc/esusers/FileUserPasswdStore.java +++ b/src/main/java/org/elasticsearch/shield/authc/esusers/FileUserPasswdStore.java @@ -39,7 +39,6 @@ import java.util.Map; public class FileUserPasswdStore extends AbstractComponent implements UserPasswdStore { private final Path file; - private final FileWatcher watcher; final Hasher hasher = Hasher.HTPASSWD; private volatile ImmutableMap esUsers; @@ -55,9 +54,9 @@ public class FileUserPasswdStore extends AbstractComponent implements UserPasswd super(settings); file = resolveFile(settings, env); esUsers = parseFile(file, logger); - watcher = new FileWatcher(file.getParent().toFile()); + FileWatcher watcher = new FileWatcher(file.getParent().toFile()); watcher.addListener(new FileListener()); - watcherService.add(watcher); + watcherService.add(watcher, ResourceWatcherService.Frequency.HIGH); this.listener = listener; } diff --git a/src/main/java/org/elasticsearch/shield/authc/esusers/FileUserRolesStore.java b/src/main/java/org/elasticsearch/shield/authc/esusers/FileUserRolesStore.java index c620672a5a0..ff11b48569e 100644 --- a/src/main/java/org/elasticsearch/shield/authc/esusers/FileUserRolesStore.java +++ b/src/main/java/org/elasticsearch/shield/authc/esusers/FileUserRolesStore.java @@ -55,7 +55,7 @@ public class FileUserRolesStore extends AbstractComponent implements UserRolesSt userRoles = parseFile(file, logger); FileWatcher watcher = new FileWatcher(file.getParent().toFile()); watcher.addListener(new FileListener()); - watcherService.add(watcher); + watcherService.add(watcher, ResourceWatcherService.Frequency.HIGH); this.listener = listener; } diff --git a/src/main/java/org/elasticsearch/shield/authc/ldap/LdapGroupToRoleMapper.java b/src/main/java/org/elasticsearch/shield/authc/ldap/LdapGroupToRoleMapper.java index 1457b71d599..0549b1d0d12 100644 --- a/src/main/java/org/elasticsearch/shield/authc/ldap/LdapGroupToRoleMapper.java +++ b/src/main/java/org/elasticsearch/shield/authc/ldap/LdapGroupToRoleMapper.java @@ -54,7 +54,7 @@ public class LdapGroupToRoleMapper extends AbstractComponent { groupRoles = parseFile(file, logger); FileWatcher watcher = new FileWatcher(file.getParent().toFile()); watcher.addListener(new FileListener()); - watcherService.add(watcher); + watcherService.add(watcher, ResourceWatcherService.Frequency.HIGH); this.listener = listener; } diff --git a/src/main/java/org/elasticsearch/shield/transport/n2n/IPFilteringN2NAuthenticator.java b/src/main/java/org/elasticsearch/shield/transport/n2n/IPFilteringN2NAuthenticator.java index 15316363064..19f1408c267 100644 --- a/src/main/java/org/elasticsearch/shield/transport/n2n/IPFilteringN2NAuthenticator.java +++ b/src/main/java/org/elasticsearch/shield/transport/n2n/IPFilteringN2NAuthenticator.java @@ -54,7 +54,7 @@ public class IPFilteringN2NAuthenticator extends AbstractComponent implements N2 rules = parseFile(file, logger); FileWatcher watcher = new FileWatcher(file.getParent().toFile()); watcher.addListener(new FileListener()); - watcherService.add(watcher); + watcherService.add(watcher, ResourceWatcherService.Frequency.HIGH); } private Path resolveFile(Settings settings, Environment env) {