1 5 package org.exoplatform.container.client.http; 6 7 import javax.servlet.http.HttpServletRequest ; 8 import org.exoplatform.container.client.ClientInfo; 9 14 public class HttpClientInfo implements ClientInfo { 15 final static public String STANDARD_BROWSER_TYPE = "standard-browser" ; 16 final static public String MOBILE_BROWSER_TYPE = "mobile-browser" ; 17 final static public String PDA_BROWSER_TYPE = "pda-browser" ; 18 19 private HttpClientType clientType_ ; 20 private String ipAddress_ ; 21 private String remoteUser_ ; 22 23 public HttpClientInfo(HttpServletRequest request) { 24 clientType_ = 25 ClientTypeMap.getInstance().findClient(request.getHeader("User-Agent")) ; 26 remoteUser_ = request.getRemoteUser() ; 27 ipAddress_ = request.getRemoteAddr() ; 28 } 29 30 public String getClientType() { return clientType_.getType() ; } 31 32 public String getRemoteUser() { return remoteUser_ ; } 33 34 public String getIpAddress() { return ipAddress_ ; } 35 36 public String getClientName() { return clientType_.getName() ; } 37 38 public String getPreferredMimeType() { return clientType_.getPreferredMimeType(); } 39 40 public String getUserAgentPattern() { return clientType_.getPreferredMimeType() ; } 41 } 42 | Popular Tags |