com.atlassian.jira.util
Class UnsupportedBrowserManager

java.lang.Object
  extended by com.atlassian.jira.util.UnsupportedBrowserManager

public class UnsupportedBrowserManager
extends java.lang.Object

Contains a map of unsupported browsers and error message keys. It also provides helper methods to access and manipulate this map.

Since:
v4.2

Constructor Summary
UnsupportedBrowserManager(ApplicationProperties properties)
           
 
Method Summary
 void addUnsupportedBrowser(UserAgentUtil.Browser browser, java.lang.String message)
           
 UserAgentUtil.Browser getBrowser(javax.servlet.http.HttpServletRequest request)
           
 java.lang.String getMessageKey(javax.servlet.http.HttpServletRequest request)
           
 java.lang.String getMessageKey(UserAgentUtil.Browser browser)
           
 java.util.Map<UserAgentUtil.Browser,java.lang.String> getUnsupportedBrowsers()
           
 boolean isCheckEnabled()
           
 boolean isHandledCookiePresent(javax.servlet.http.HttpServletRequest request)
           
 boolean isUnsupportedBrowser(javax.servlet.http.HttpServletRequest request)
           
 boolean isUnsupportedBrowser(UserAgentUtil.Browser browser)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnsupportedBrowserManager

public UnsupportedBrowserManager(ApplicationProperties properties)
Method Detail

getUnsupportedBrowsers

public java.util.Map<UserAgentUtil.Browser,java.lang.String> getUnsupportedBrowsers()

addUnsupportedBrowser

public void addUnsupportedBrowser(UserAgentUtil.Browser browser,
                                  java.lang.String message)
Parameters:
browser - The UserAgentUtil.Browser that is to be marked as unsupported
message - The error message which should be stored in JiraWebActionSupport.properties

isUnsupportedBrowser

public boolean isUnsupportedBrowser(UserAgentUtil.Browser browser)
Parameters:
browser - The UserAgentUtil.Browser that is to tested
Returns:
Whether the browser is unsupported

isUnsupportedBrowser

public boolean isUnsupportedBrowser(javax.servlet.http.HttpServletRequest request)
Parameters:
request - The HttpServletRequest to extract the user agent from
Returns:
whether the browser retrieved from the user agent in the current request is unsupported

getMessageKey

public java.lang.String getMessageKey(UserAgentUtil.Browser browser)
Parameters:
browser - The UserAgentUtil.Browser
Returns:
the message key stored in the map for a specific unsupported browser, null if the browser is supported

getMessageKey

public java.lang.String getMessageKey(javax.servlet.http.HttpServletRequest request)
Parameters:
request - The HttpServletRequest to extract the user agent from
Returns:
the message key stored in the map for the browser retrieved from the user agent in the current request, null if the client browser is supported

isCheckEnabled

public boolean isCheckEnabled()
Returns:
true if the jira.browser.unsupported.warnings.disabled property is false

isHandledCookiePresent

public boolean isHandledCookiePresent(javax.servlet.http.HttpServletRequest request)
Parameters:
request - The HttpServletRequest to extract the cookie from
Returns:
wheteher the client has saved an UNSUPPORTED_BROWSER_WARNING cookie in the current request headers

getBrowser

public UserAgentUtil.Browser getBrowser(javax.servlet.http.HttpServletRequest request)
Parameters:
request - The HttpServletRequest to extract the user agent from
Returns:
The UserAgentUtil.Browser that is deduced from the user agent header in the request


Copyright © 2002-2010 Atlassian. All Rights Reserved.