Package org.swisspush.gateleen.core.util
Class StatusCodeTranslator
- java.lang.Object
-
- org.swisspush.gateleen.core.util.StatusCodeTranslator
-
public class StatusCodeTranslator extends Object
Helps to translate status codes.- Author:
- https://github.com/ljucam [Mario Aerni]
-
-
Constructor Summary
Constructors Constructor Description StatusCodeTranslator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.vertx.core.MultiMapgetTranslateFreeHeaders(io.vertx.core.MultiMap headers)Creates a new MultiMap based on the given headers but without any 'x-translate-status-xxx' entries.static inttranslateStatusCode(int statusCode, io.vertx.core.MultiMap headers)Checks if there exists a handling for the givenstatusCodein the headers of the request.
-
-
-
Method Detail
-
translateStatusCode
public static int translateStatusCode(int statusCode, io.vertx.core.MultiMap headers)Checks if there exists a handling for the givenstatusCodein the headers of the request. The header is checked for a pattern matchingx-translate-status-and the givenstatusCode.- Parameters:
statusCode- the original status codeheaders- the headers of the request- Returns:
- the translated status or if no translation was carried out the original status code.
-
getTranslateFreeHeaders
public static io.vertx.core.MultiMap getTranslateFreeHeaders(io.vertx.core.MultiMap headers)
Creates a new MultiMap based on the given headers but without any 'x-translate-status-xxx' entries.- Parameters:
headers- original headers- Returns:
- a copy of the original headers without any translate headers
-
-