* @param sessionID the session id of the response
* @param name the name of the response
* @return response for ID
*/
private static ERXKeepAliveResponse responseForSessionIDNamed(String sessionID, String name) {
ERXKeepAliveResponse response = null;
if (sessionID != null) {
if(name == null) {
name = "";
}
ConcurrentHashMap<String, ERXKeepAliveResponse> sessionResponses = responses.get(sessionID);
if (sessionResponses == null) {
ConcurrentHashMap<String, ERXKeepAliveResponse> newSessionResponses = new ConcurrentHashMap<String, ERXKeepAliveResponse>();
ConcurrentHashMap<String, ERXKeepAliveResponse> prevSessionResponses = responses.putIfAbsent(sessionID, newSessionResponses);
sessionResponses = (prevSessionResponses == null) ? newSessionResponses : prevSessionResponses;
}
response = sessionResponses.get(name);
if (response == null) {
ERXKeepAliveResponse newResponse = new ERXKeepAliveResponse();
ERXKeepAliveResponse prevResponse = sessionResponses.putIfAbsent(name, newResponse);
response = (prevResponse == null) ? newResponse : prevResponse;
}
}
return response;
}