public static Map<String, String> getRequestContext(HttpServletRequest request) {
Map<String, String> requestContext = new HashMap<String, String>();
if (request != null) {
Map<String, String[]> params = request.getParameterMap();
ConversationSet realConversationNames = ConversationSet.get();
for (Entry<String, String[]> param : params.entrySet()) {
String candidateConversationName = param.getKey();
String candidateConversationId = param.getValue()[0];
if (realConversationNames.contains(candidateConversationName)) {
requestContext.put(candidateConversationName, candidateConversationId);
}
}
}