Package org.swisspush.gateleen.hook
Class Listener
- java.lang.Object
-
- org.swisspush.gateleen.hook.Listener
-
public class Listener extends Object
Represents a listener.- Author:
- https://github.com/ljucam [Mario Ljuca]
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegergetExpireAfter()Returns the expire after time, for the request header.HttpHookgetHook()Returns the hook of this listener.StringgetListener()Returns the listener segment of the url.StringgetListenerId()Returns the listener id (eg.StringgetMonitoredUrl()Returns the url the listener is hooked up.voidsetExpireAfter(Integer expireAfter)Sets the expire after time, for the request header.voidsetHook(HttpHook hook)Sets the hook of this listener.voidsetListener(String listener)Sets the listener segment of the url.voidsetListenerId(String listenerId)Sets the listener id (eg.voidsetMonitoredUrl(String monitoredUrl)Sets the url the listener is hooked up.
-
-
-
Constructor Detail
-
Listener
public Listener(String listenerId, String monitoredUrl, String listener, HttpHook hook)
Creates a new instance of a HookListener.- Parameters:
listenerId- - id of the listener eg. "http/colin/12345678".monitoredUrl- - URL segment before "/hooks/v1/listeners/", eg. for "PUT http://bus.local/gps/v1/_hooks/listeners/http/colin/12345678" it is "http://bus.local/gps/v1".listener- - URL segment after the monitoredUrl "http://bus.local/gps/v1" and without the hook area. eg. for "PUT http://bus.local/gps/v1/_hooks/listeners/http/colin/12345678" it is "http/colin/12345678". If it's a local listener, this can also be the target url.hook- - the hook of this listener
-
-
Method Detail
-
getListener
public String getListener()
Returns the listener segment of the url.- Returns:
- String
-
setListener
public void setListener(String listener)
Sets the listener segment of the url.- Parameters:
listener- listener
-
getMonitoredUrl
public String getMonitoredUrl()
Returns the url the listener is hooked up.- Returns:
- String
-
setMonitoredUrl
public void setMonitoredUrl(String monitoredUrl)
Sets the url the listener is hooked up.- Parameters:
monitoredUrl- monitoredUrl
-
getListenerId
public String getListenerId()
Returns the listener id (eg. http/colin/123)- Returns:
- id of the listener
-
setListenerId
public void setListenerId(String listenerId)
Sets the listener id (eg. http/colin/123).- Parameters:
listenerId- listenerId
-
getExpireAfter
public Integer getExpireAfter()
Returns the expire after time, for the request header. Can benullif not set.- Returns:
- expire after time
-
setExpireAfter
public void setExpireAfter(Integer expireAfter)
Sets the expire after time, for the request header. Can benullif not set.- Parameters:
expireAfter- expireAfter
-
getHook
public HttpHook getHook()
Returns the hook of this listener.- Returns:
- the hook
-
setHook
public void setHook(HttpHook hook)
Sets the hook of this listener.- Parameters:
hook- hook
-
-