Package com.networknt.router.middleware
Class HandlerUtils
- java.lang.Object
-
- com.networknt.router.middleware.HandlerUtils
-
public class HandlerUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringDELIMITORprotected static StringINTERNAL_KEY_FORMAT
-
Constructor Summary
Constructors Constructor Description HandlerUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String[]findServiceEntry(String searchKey, Map<String,String> mapping)Looks up the appropriate serviceId for a given requestPath taken directly from exchange.static StringnormalisePath(String requestPath)static StringtoInternalKey(String key)static StringtoInternalKey(String method, String path)
-
-
-
Field Detail
-
DELIMITOR
public static final String DELIMITOR
- See Also:
- Constant Field Values
-
INTERNAL_KEY_FORMAT
protected static final String INTERNAL_KEY_FORMAT
- See Also:
- Constant Field Values
-
-
Method Detail
-
findServiceEntry
public static String[] findServiceEntry(String searchKey, Map<String,String> mapping)
Looks up the appropriate serviceId for a given requestPath taken directly from exchange. Returns null if the path does not map to a configured service, otherwise, an array will be returned with the first element the path prefix and the second element the serviceId.- Parameters:
searchKey- search keymapping- a map of prefix and service id- Returns:
- pathPrefix and serviceId in an array that is found
-
-