Skip to content

Commit 153a97b

Browse files
committed
rename to reload
1 parent f89207c commit 153a97b

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ protected List<NotificationService> getReloadableServices() {
649649
@Override
650650
public void reload(Settings settings) throws Exception {
651651
for (NotificationService service : getReloadableServices()) {
652-
service.loadSettings(settings);
652+
service.reload(settings);
653653
}
654654
}
655655
}

x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/NotificationService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public NotificationService(Settings settings, String type) {
3030
this.type = type;
3131
}
3232

33-
public synchronized void loadSettings(Settings settings) {
33+
public synchronized void reload(Settings settings) {
3434
Tuple<Map<String, Account>, Account> accounts = buildAccounts(settings, this::createAccount);
3535
this.accounts = Collections.unmodifiableMap(accounts.v1());
3636
this.defaultAccount = accounts.v2();

x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/EmailService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public class EmailService extends NotificationService<Account> {
9696
public EmailService(Settings settings, @Nullable CryptoService cryptoService, ClusterSettings clusterSettings) {
9797
super(settings, "email");
9898
this.cryptoService = cryptoService;
99-
clusterSettings.addSettingsUpdateConsumer(this::loadSettings, getSettings());
99+
clusterSettings.addSettingsUpdateConsumer(this::reload, getSettings());
100100
// ensure logging of setting changes
101101
clusterSettings.addSettingsUpdateConsumer(SETTING_DEFAULT_ACCOUNT, (s) -> {});
102102
clusterSettings.addAffixUpdateConsumer(SETTING_PROFILE, (s, o) -> {}, (s, o) -> {});
@@ -116,7 +116,7 @@ public EmailService(Settings settings, @Nullable CryptoService cryptoService, Cl
116116
clusterSettings.addAffixUpdateConsumer(SETTING_SMTP_SEND_PARTIAL, (s, o) -> {}, (s, o) -> {});
117117
clusterSettings.addAffixUpdateConsumer(SETTING_SMTP_WAIT_ON_QUIT, (s, o) -> {}, (s, o) -> {});
118118
// do an initial load
119-
loadSettings(settings);
119+
reload(settings);
120120
}
121121

122122
@Override

x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/hipchat/HipChatService.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class HipChatService extends NotificationService<HipChatAccount> {
6767
public HipChatService(Settings settings, HttpClient httpClient, ClusterSettings clusterSettings) {
6868
super(settings, "hipchat");
6969
this.httpClient = httpClient;
70-
clusterSettings.addSettingsUpdateConsumer(this::loadSettings, getSettings());
70+
clusterSettings.addSettingsUpdateConsumer(this::reload, getSettings());
7171
// ensure logging of setting changes
7272
clusterSettings.addSettingsUpdateConsumer(SETTING_DEFAULT_ACCOUNT, (s) -> {});
7373
clusterSettings.addSettingsUpdateConsumer(SETTING_DEFAULT_HOST, (s) -> {});
@@ -80,13 +80,13 @@ public HipChatService(Settings settings, HttpClient httpClient, ClusterSettings
8080
clusterSettings.addAffixUpdateConsumer(SETTING_PORT, (s, o) -> {}, (s, o) -> {});
8181
clusterSettings.addAffixUpdateConsumer(SETTING_MESSAGE_DEFAULTS, (s, o) -> {}, (s, o) -> {});
8282

83-
loadSettings(settings);
83+
reload(settings);
8484
}
8585

8686
@Override
87-
public synchronized void loadSettings(Settings settings) {
87+
public synchronized void reload(Settings settings) {
8888
defaultServer = new HipChatServer(settings.getByPrefix("xpack.notification.hipchat."));
89-
super.loadSettings(settings);
89+
super.reload(settings);
9090
}
9191

9292
@Override

x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/jira/JiraService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class JiraService extends NotificationService<JiraAccount> {
6262
public JiraService(Settings settings, HttpClient httpClient, ClusterSettings clusterSettings) {
6363
super(settings, "jira");
6464
this.httpClient = httpClient;
65-
clusterSettings.addSettingsUpdateConsumer(this::loadSettings, getSettings());
65+
clusterSettings.addSettingsUpdateConsumer(this::reload, getSettings());
6666
// ensure logging of setting changes
6767
clusterSettings.addSettingsUpdateConsumer(SETTING_DEFAULT_ACCOUNT, (s) -> {});
6868
clusterSettings.addAffixUpdateConsumer(SETTING_ALLOW_HTTP, (s, o) -> {}, (s, o) -> {});
@@ -74,7 +74,7 @@ public JiraService(Settings settings, HttpClient httpClient, ClusterSettings clu
7474
clusterSettings.addAffixUpdateConsumer(SETTING_SECURE_PASSWORD, (s, o) -> {}, (s, o) -> {});
7575
clusterSettings.addAffixUpdateConsumer(SETTING_DEFAULTS, (s, o) -> {}, (s, o) -> {});
7676
// do an initial load
77-
loadSettings(settings);
77+
reload(settings);
7878
}
7979

8080
@Override

x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/PagerDutyService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public PagerDutyService(Settings settings, HttpClient httpClient, ClusterSetting
4545
clusterSettings.addAffixUpdateConsumer(SETTING_SERVICE_API_KEY, (s, o) -> {}, (s, o) -> {});
4646
clusterSettings.addAffixUpdateConsumer(SETTING_SECURE_SERVICE_API_KEY, (s, o) -> {}, (s, o) -> {});
4747
clusterSettings.addAffixUpdateConsumer(SETTING_DEFAULTS, (s, o) -> {}, (s, o) -> {});
48-
loadSettings(settings);
48+
reload(settings);
4949
}
5050

5151
@Override

x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/SlackService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ public class SlackService extends NotificationService<SlackAccount> {
4141
public SlackService(Settings settings, HttpClient httpClient, ClusterSettings clusterSettings) {
4242
super(settings, "slack");
4343
this.httpClient = httpClient;
44-
clusterSettings.addSettingsUpdateConsumer(this::loadSettings, getSettings());
44+
clusterSettings.addSettingsUpdateConsumer(this::reload, getSettings());
4545
clusterSettings.addSettingsUpdateConsumer(SETTING_DEFAULT_ACCOUNT, (s) -> {});
4646
clusterSettings.addAffixUpdateConsumer(SETTING_URL, (s, o) -> {}, (s, o) -> {});
4747
clusterSettings.addAffixUpdateConsumer(SETTING_URL_SECURE, (s, o) -> {}, (s, o) -> {});
4848
clusterSettings.addAffixUpdateConsumer(SETTING_DEFAULTS, (s, o) -> {}, (s, o) -> {});
49-
loadSettings(settings);
49+
reload(settings);
5050
}
5151

5252
@Override

x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/notification/NotificationServiceTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private static class TestNotificationService extends NotificationService<String>
8282

8383
TestNotificationService(Settings settings) {
8484
super(settings, "test");
85-
loadSettings(settings);
85+
reload(settings);
8686
}
8787

8888
@Override

x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherPluginTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ protected Account createAccount(String name, Settings accountSettings) {
115115
}
116116

117117
@Override
118-
public synchronized void loadSettings(Settings settings) {
118+
public synchronized void reload(Settings settings) {
119119
calledCreateAccount = true;
120-
super.loadSettings(settings);
120+
super.reload(settings);
121121
}
122122
}
123123

0 commit comments

Comments
 (0)