Package com.carfey.ops.event.dispatch
Class RESTfulEventHook
- java.lang.Object
-
- com.carfey.ops.event.dispatch.RESTfulEventHook
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBASIC_AUTH_CONFIG_KEYstatic java.util.Set<Category>DEFAULT_CATEGORIESstatic java.util.Set<Level>DEFAULT_LEVELSstatic java.lang.StringURL_CONFIG_KEY
-
Constructor Summary
Constructors Constructor Description RESTfulEventHook(java.lang.String url, java.util.Set<Level> levels, java.util.Set<Category> categories)RESTfulEventHook(java.lang.String url, java.util.Set<Level> levels, java.util.Set<Category> categories, java.lang.String authorization)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispatch(Event event)This method is invoked for each event, regardless of level or category.booleanequals(java.lang.Object obj)java.util.Set<Category>getCategories()java.util.Set<Level>getLevels()inthashCode()protected voidpost(Event event)Override to change the actual call to the RESTful endpoint.protected booleanshouldPostEvent(Event event)Override to get custom behaviour on whether to post to the endpoint for a given event.java.lang.StringtoString()
-
-
-
Field Detail
-
URL_CONFIG_KEY
public static final java.lang.String URL_CONFIG_KEY
- See Also:
- Constant Field Values
-
BASIC_AUTH_CONFIG_KEY
public static final java.lang.String BASIC_AUTH_CONFIG_KEY
- See Also:
- Constant Field Values
-
DEFAULT_LEVELS
public static final java.util.Set<Level> DEFAULT_LEVELS
-
DEFAULT_CATEGORIES
public static final java.util.Set<Category> DEFAULT_CATEGORIES
-
-
Method Detail
-
dispatch
public void dispatch(Event event) throws java.lang.Exception
Description copied from interface:EventHook
-
post
protected void post(Event event) throws java.lang.Exception
Override to change the actual call to the RESTful endpoint.- Throws:
java.lang.Exception
-
shouldPostEvent
protected boolean shouldPostEvent(Event event)
Override to get custom behaviour on whether to post to the endpoint for a given event.- Returns:
- true if this event should be posted to the endpoint
-
getLevels
public java.util.Set<Level> getLevels()
-
getCategories
public java.util.Set<Category> getCategories()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-