Add javadocs

This commit is contained in:
Tadgh 2020-09-14 13:28:36 -04:00
parent 2e1f2a662a
commit 3e324355f2
1 changed files with 11 additions and 1 deletions

View File

@ -8,6 +8,12 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* This class is for holding headers for BaseJsonMessages. Any serializable data can be thrown into
* the header map. There are also three special headers, defined by the constants in this class, which are for use
* in message handling retrying. There are also matching helper functions for fetching those special variables; however
* they can also be accessed in standard map fashion with a `get` on the map.
*/
public class HapiMessageHeaders implements Map<String, Object>, IModelJson {
public static String RETRY_COUNT_HEADER = "retryCount";
public static String FIRST_FAILURE_HEADER = "firstFailure";
@ -100,6 +106,10 @@ public class HapiMessageHeaders implements Map<String, Object>, IModelJson {
public Map<String, Object> getHeaders() {
return this.headers;
}
/**
* Sets deffault values for the special headers that HAPI cares about during retry.
*/
public void initializeDefaultRetryValues() {
headers.put(RETRY_COUNT_HEADER, 0);
headers.put(FIRST_FAILURE_HEADER, null);