Skip to content

Commit 27a7f86

Browse files
author
Vladimir Kotal
committed
hook{,s} -> webhook{,s}
1 parent b042461 commit 27a7f86

File tree

5 files changed

+31
-31
lines changed

5 files changed

+31
-31
lines changed

plugins/src/opengrok/auth/plugin/configuration/Configuration.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import java.util.ArrayList;
3838
import java.util.List;
3939
import opengrok.auth.plugin.ldap.LdapServer;
40-
import opengrok.auth.plugin.util.Hooks;
40+
import opengrok.auth.plugin.util.WebHooks;
4141

4242
public class Configuration implements Serializable {
4343

@@ -46,7 +46,7 @@ public class Configuration implements Serializable {
4646
private List<LdapServer> servers = new ArrayList<>();
4747
private int interval;
4848
private String searchBase;
49-
private Hooks hooks;
49+
private WebHooks webHooks;
5050
private int searchTimeout;
5151
private int connectTimeout;
5252
private int countLimit;
@@ -59,12 +59,12 @@ public List<LdapServer> getServers() {
5959
return servers;
6060
}
6161

62-
public void setHooks(Hooks hooks) {
63-
this.hooks = hooks;
62+
public void setWebHooks(WebHooks webHooks) {
63+
this.webHooks = webHooks;
6464
}
6565

66-
public Hooks getHooks() {
67-
return hooks;
66+
public WebHooks getWebHooks() {
67+
return webHooks;
6868
}
6969

7070
public int getInterval() {

plugins/src/opengrok/auth/plugin/ldap/LdapFacade.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343

4444
import opengrok.auth.plugin.configuration.Configuration;
4545
import opengrok.auth.plugin.entity.User;
46-
import opengrok.auth.plugin.util.Hook;
47-
import opengrok.auth.plugin.util.Hooks;
46+
import opengrok.auth.plugin.util.WebHook;
47+
import opengrok.auth.plugin.util.WebHooks;
4848
import org.opengrok.indexer.authorization.LdapException;
4949
import opengrok.auth.plugin.util.RestfulClient;
5050

@@ -97,9 +97,9 @@ public class LdapFacade extends AbstractLdapProvider {
9797
private List<LdapServer> servers = new ArrayList<>();
9898

9999
/**
100-
* server hooks
100+
* server webHooks
101101
*/
102-
Hooks hooks;
102+
private WebHooks webHooks;
103103

104104
private SearchControls controls;
105105
private int actualServer = 0;
@@ -183,13 +183,13 @@ public LdapFacade(Configuration cfg) {
183183
setServers(cfg.getServers(), cfg.getConnectTimeout());
184184
setInterval(cfg.getInterval());
185185
setSearchBase(cfg.getSearchBase());
186-
setHooks(cfg.getHooks());
186+
setWebHooks(cfg.getWebHooks());
187187
prepareSearchControls(cfg.getSearchTimeout(), cfg.getCountLimit());
188188
prepareServers();
189189
}
190190

191-
private void setHooks(Hooks hooks) {
192-
this.hooks = hooks;
191+
private void setWebHooks(WebHooks webHooks) {
192+
this.webHooks = webHooks;
193193
}
194194

195195
/**
@@ -330,8 +330,8 @@ private <T> T lookup(String dn, String filter, String[] attributes, AttributeMap
330330
LOGGER.log(Level.SEVERE, "Tried all LDAP servers in a pool but no server works");
331331
errorTimestamp = System.currentTimeMillis();
332332
reported = false;
333-
Hook hook;
334-
if ((hook = hooks.getFail()) != null) {
333+
WebHook hook;
334+
if ((hook = webHooks.getFail()) != null) {
335335
RestfulClient.postIt(hook.getURI(), hook.getContent());
336336
}
337337
throw new LdapException("Tried all LDAP servers in a pool but no server works");
@@ -351,8 +351,8 @@ private <T> T lookup(String dn, String filter, String[] attributes, AttributeMap
351351
reported = false;
352352
if (errorTimestamp > 0) {
353353
errorTimestamp = 0;
354-
Hook hook;
355-
if ((hook = hooks.getRecover()) != null) {
354+
WebHook hook;
355+
if ((hook = webHooks.getRecover()) != null) {
356356
RestfulClient.postIt(hook.getURI(), hook.getContent());
357357
}
358358
}

plugins/src/opengrok/auth/plugin/util/Hook.java renamed to plugins/src/opengrok/auth/plugin/util/WebHook.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
import java.io.Serializable;
2727

28-
public class Hook implements Serializable {
28+
public class WebHook implements Serializable {
2929
private static final long serialVersionUID = -1;
3030

3131
private String URI;

plugins/src/opengrok/auth/plugin/util/Hooks.java renamed to plugins/src/opengrok/auth/plugin/util/WebHooks.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@
2525

2626
import java.io.Serializable;
2727

28-
public class Hooks implements Serializable {
28+
public class WebHooks implements Serializable {
2929
private static final long serialVersionUID = -1;
3030

31-
Hook fail;
32-
Hook recover;
31+
WebHook fail;
32+
WebHook recover;
3333

34-
public void setFail(Hook fail) {
34+
public void setFail(WebHook fail) {
3535
this.fail = fail;
3636
}
3737

38-
public Hook getFail() { return fail; }
38+
public WebHook getFail() { return fail; }
3939

40-
public void setRecover(Hook recover) {
40+
public void setRecover(WebHook recover) {
4141
this.recover = recover;
4242
}
4343

44-
public Hook getRecover() { return recover; }
44+
public WebHook getRecover() { return recover; }
4545
}

plugins/test/opengrok/auth/plugin/configuration/ConfigurationTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
import java.util.LinkedList;
3333
import junit.framework.AssertionFailedError;
3434
import opengrok.auth.plugin.ldap.LdapServer;
35-
import opengrok.auth.plugin.util.Hook;
36-
import opengrok.auth.plugin.util.Hooks;
35+
import opengrok.auth.plugin.util.WebHook;
36+
import opengrok.auth.plugin.util.WebHooks;
3737
import org.junit.Test;
3838

3939
import static org.junit.Assert.assertEquals;
@@ -67,12 +67,12 @@ public void exceptionThrown(Exception e) {
6767
configuration1.setConnectTimeout(42);
6868
configuration1.setCountLimit(10);
6969
configuration1.setServers(new ArrayList<>(Arrays.asList(new LdapServer("http://server.com"))));
70-
Hooks hooks = new Hooks();
71-
Hook hook = new Hook();
70+
WebHooks webHooks = new WebHooks();
71+
WebHook hook = new WebHook();
7272
hook.setContent("foo");
7373
hook.setURI("http://localhost:8080/source/api/v1/messages");
74-
hooks.setFail(hook);
75-
configuration1.setHooks(hooks);
74+
webHooks.setFail(hook);
75+
configuration1.setWebHooks(webHooks);
7676

7777
enc.writeObject(configuration1);
7878
enc.close();

0 commit comments

Comments
 (0)