java.lang.Objectcom.cyscape.browserhawk.ExtendedOptions
Class to control the behavior of
BrowserHawk.getExtendedBrowserInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, ExtendedOptions).
| Field Summary | |
static int |
REQUEST_TYPE_AUTO
This setting instructs BrowserHawk to choose the most appropriate requestType for you, given the content in which your page is running. |
static int |
REQUEST_TYPE_COOKIE
This setting instructs BrowserHawk to have the test results passed from the browser back to BrowserHawk via a temporary session cookie. |
static int |
REQUEST_TYPE_POST
This setting instructs BrowserHawk to have the test results passed from the browser back to BrowserHawk via the POST method. |
static int |
REQUEST_TYPE_QUERY_STRING
This setting instructs BrowserHawk to have the test results passed from the browser back to BrowserHawk via the query string. |
| Constructor Summary | |
ExtendedOptions()
Constructs an instance of the ExtendedOptions class with the default properties. |
|
ExtendedOptions(long props)
Deprecated. Due to 64-bit limitations please use the String-based property names instead |
|
ExtendedOptions(java.lang.String props)
Constructs an instance of the ExtendedOptions class with a shortcut to set the specified properties, taking a comma-separated list. |
|
| Method Summary | |
void |
addProperties(java.lang.String props)
Adds the given properties to the current property list. |
void |
addProperty(long prop)
Deprecated. Due to 64-bit limitations please use the String-based property names instead |
void |
addProperty(java.lang.String prop)
Adds the given property to the current property list. |
void |
addQueryStringParam(java.lang.String name,
java.lang.String value)
Adds a parameter with the given name and value to the query string of the URL used during the extended detection redirect. |
java.lang.Object |
clone()
|
int |
getBackDelay()
Returns the configured back delay |
java.lang.String |
getBodyTag()
Returns the congifured body tag |
java.lang.String |
getBroadbandImageURL()
Returns the currently set broadband image URL. |
int |
getBroadbandMaxWait()
Returns the currently assigned broadband wait period, indicating the amount of time to wait before determining that the 50k of data should have loaded in order for the connection to be considered broadband. |
java.lang.String |
getBrwsURL()
Returns the current BrowserHawk Reports Web Service URL. |
java.lang.String |
getBrwsURLComplete()
Returns the current BrowserHawk Reports Web Service Complete URL. |
java.lang.String |
getCookieDomain()
Returns the configured cookie domain |
int |
getCookieDuration()
Returns the current value of the cookie duration property. |
long |
getFirewallTimeout()
Returns the firewall timeout, in millis |
java.lang.String |
getFontsToCheck()
Returns the fonts to check |
java.lang.String |
getJVMCodeBase()
Returns the configured Java CODEBASE |
java.lang.String |
getPageMessage()
Returns the configured page message |
java.lang.String |
getPageTitle()
Returns the configured page title |
java.lang.String |
getPluginCustomID()
Returns the custom plugin ID search string |
java.lang.String |
getPopupFileName()
Returns the currently set popup file name, or empty string by default which indicates the current URI should be used. |
int |
getPopupTimeout()
Returns the currently assigned popup timeout, indicating how long to wait for a popup window before determining it was blocked. |
java.lang.String |
getPopupWindowFeatures()
Returns the currently assigned window features string. |
java.lang.String |
getPopupWindowName()
Returns the currently assigned popup window name, or the empty string by default. |
java.lang.String |
getPortCheckResource()
Returns the resource for running the open port check |
java.lang.String |
getPortCheckURL()
Returns the URL for running the open port check |
java.lang.String |
getPortsToCheck()
Returns the ports to check for being open |
int |
getRequestType()
Returns the configured request type |
java.lang.String |
getServerURL()
Returns the currently set server URL, or null if none. |
java.lang.String |
getServerURLComplete()
Returns the currently set full server URL, or null if none. |
long |
getSpeedCheckAdjustment()
Returns the multiplier for speed check adjustments, where "2" means to send double the normal data size, "1" means to send the normal data size (recommended), and "0" is a special case meaning to send just half. |
java.lang.String |
getSSLCheckResource()
Returns the resource for running an SSL check |
java.lang.String |
getSSLCheckURL()
Returns the URL for running an SSL check |
boolean |
getSuppressOriginalQueryString()
Returns the present value of the suppress original query string flag. |
int |
getTimeout()
Returns the configured timeout |
void |
removeProperties(java.lang.String props)
Removes the given properties from the current property list. |
void |
removeProperty(long prop)
Deprecated. Due to 64-bit limitations please use the String-based property names instead |
void |
removeProperty(java.lang.String prop)
Removes the given property from the current property list. |
void |
setBackDelay(int delay)
This property instructs BrowserHawk to wait the number of milliseconds as specified by this property value after the page loads before the test functions should begin. |
void |
setBodyTag(java.lang.String tag)
A body tag is used to tell BrowserHawk to add additional HTML to the tag which it sends as part of the test page it loads to detect the special properties. |
void |
setBroadbandImageURL(java.lang.String url)
Provides a location override for where to fetch the broadband image data. |
void |
setBroadbandMaxWait(int wait)
Used in the broadband test as the amount of time to wait before determining that the 50k of data should have loaded in order for the connection to be considered broadband. |
void |
setBrwsURL(java.lang.String url)
Specifies the URL where the BrowserHawk Reports Web Service resides. |
void |
setBrwsURLComplete(java.lang.String url)
Sets the full server URL where the BrowserHawk Reports Web Service resides. |
void |
setCacheForceRefresh(boolean forceRefresh)
Used in conjunction with setCacheToken(String), setting this value
to true indicates that even if an existing value is found cached under the
given token, it should be refreshed by performing another test. |
void |
setCacheToken(java.lang.String token)
Indicates that the ExtendedBrowserInfo result should be cached for this user under the token specified. |
void |
setCookieDomain(java.lang.String domain)
This property is used to specify the domain of the cookies used by BrowserHawk. |
void |
setCookieDuration(int days)
Sets the max age (in days) for the test cookie used to test permanant cookies. |
void |
setFirewallTimeout(long timeout)
Sets the time, in milliseconds, on which to wait for requests to go through the firewall during a firewall test. |
void |
setFontsToCheck(java.lang.String fonts)
Sets the fonts to check for installation on the client, as a comma-delimited list. |
void |
setHighSecurityLink(java.lang.String link)
This setting is for power-users only. |
void |
setHighSecurityMessage(java.lang.String msg)
This setting is for power-users only. |
void |
setJVMCodeBase(java.lang.String codebase)
This property is used to specify the virtual directory that contains the cyScape supplied JVMDetector.class file used when testing the JavaVersion, JavaVendor, OSName, OSVersion, or OSArch properties. |
void |
setPageMessage(java.lang.String message)
A page message is used to display a message in the user's browser while the extended properties are detected. |
void |
setPageTitle(java.lang.String title)
A page title is used to tell BrowserHawk what text to insert in between the <TITLE> tags used by the test page it loads to detect the special properties. |
void |
setPluginCustomID(java.lang.String id)
Sets the custom plugin to test. |
void |
setPopupFileName(java.lang.String filename)
Allows the use of a separate popup file for popup testing. |
void |
setPopupTimeout(int millis)
Sets the timehow for how long (in milliseconds) to wait before concluding the popup window is not reachable because popups are blocked. |
void |
setPopupWindowFeatures(java.lang.String features)
Allows the assignment of specific features to the popup window being tested. |
void |
setPopupWindowName(java.lang.String windowName)
Allows the assignment of a specific name for the popup window. |
void |
setPortCheckResource(java.lang.String resource)
Sets the server-side resource name that will aid in the OpenPorts and ImagesEnabled checks. |
void |
setPortCheckURL(java.lang.String url)
Sets the URL of the server-side component to aid in the OpenPorts and ImagesEnabled checks. |
void |
setPortsToCheck(java.lang.String ports)
Sets the ports to check for being open, as a comma-delimited list. |
void |
setProperties(long props)
Deprecated. Due to 64-bit limitations please use the String-based property names instead |
void |
setProperties(java.lang.String props)
This method is used to tell BrowserHawk which tests you want it to execute when you call the BrowserHawk.getExtendedBrowserInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, long) method, using String
mneumonics. |
void |
setRequestType(int type)
BrowserHawk communicates directly with the browser in order to collect the test results from the BrowserHawk.getExtendedBrowserInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, long) method. |
void |
setServerURL(java.lang.String url)
Sets a server base URL to use on self-redirects. |
void |
setServerURLComplete(java.lang.String url)
Sets the full server URL to use on the extended property redirection. |
void |
setSpeedCheckAdjustment(long adj)
Sets a multiplier for the speed test so that fast connections can be more accurately timed. |
void |
setSSLCheckResource(java.lang.String resource)
Sets the server-side resource name that will be used to aid in the SSL check. |
void |
setSSLCheckURL(java.lang.String url)
Sets the URL of the server-side component to aid in the SSL check. |
void |
setSuppressOriginalQueryString(boolean suppress)
BrowserHawk by default attempts to preserve the original query string during the extended detection redirect. |
void |
setTimeout(int timeout)
This property is used to set how many seconds BrowserHawk.getExtendedBrowserInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, long)
should wait before the test times out due to JavaScript being disabled. |
void |
setTrueRequestType(int type)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int REQUEST_TYPE_AUTO
public static final int REQUEST_TYPE_COOKIE
If the user has session cookies disabled, or chooses not to accept the cookie (if their browser is set to prompt before accepting cookies), then BrowserHawk automatically downgrades itself on-the-fly to use REQUEST_TYPE_QUERY_STRING.
If using the BrowserHawk.getExtendedBrowserInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, long) method from a script accessed
via the GET method, this requestType is highly recommended and the most
efficient. This approach gives you the best of both worlds - for users
with cookies enabled, the test is completely silent and transparent and
there is only one small token added to the query string regardless of
how many properties you are checking. Yet at the same time, if the user
has disabled their cookies, BrowserHawk adjusts this for you and falls
back on the query string method.
Advantages / Disadvantages of this requestType:
Advantages:
Disadvantages:
public static final int REQUEST_TYPE_QUERY_STRING
Unlike previous versions of BrowserHawk, only the specific test results you ask for are adding to the query string. This helps to make the changes to the query string minimal. For example, if you just ask BrowserHawk to check the version of Flash installed, only one name/value pair is added to the query string.
Unless you have a specific reason why you want the results passed in the query string, we recommend that you use REQUEST_TYPE_COOKIE for a cookie-based test instead. In the event the user has cookies disabled, BrowserHawk automatically falls back to using this requestType so you will be covered either way.
Advantages / Disadvantages of this requestType
Advantages:
Disadvantages:
public static final int REQUEST_TYPE_POST
This method is only recommended if you need to use the
BrowserHawk.getExtendedBrowserInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, long) method from a page that is posted to, and you
have no opportunity to execute the test in a page prior to the POST
(for example if another web site or application is posting results to
your page).
If it is possible to run the BrowserHawk.getExtendedBrowserInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, long) method from the page
displayed prior to where the post occurs, it is recommend you perform
the test on a prior page. For example, perform the
BrowserHawk.getExtendedBrowserInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, long)
method call from the page which displays the form fields, and set the
results to hidden form fields. Then in your page that does the post
processing, simply get the values from the hidden form field.
Note: If you are using this requestType and the user has JavaScript disabled, BrowserHawk will not be able to POST the results to the destination script. This is because JavaScript is required to perform the post. However, BrowserHawk wisely detects if this condition occurs, and passes in all posted values via the query string as a GET request if so.
Advantages / Disadvantages of this requestType
Advantages:
BrowserHawk.getExtendedBrowserInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, long) from scripts which
perform POST processing.
BrowserHawk.getExtendedBrowserInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, long) is
accessed via a POST (such as the target of a form submission), the user
will receive a message from the browser saying that the page has expired
if they press their back button.
BrowserHawk.getExtendedBrowserInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, long) is
accessed
via a GET instead of a POST, the user will bounce the user right back to
the current page. This effectively renders the back button useless. You
can however use the setBackDelay(int) property to add enough of a delay
to allow users to press the back button a second time to break out of
the loop.
| Constructor Detail |
public ExtendedOptions()
public ExtendedOptions(long props)
public ExtendedOptions(java.lang.String props)
throws java.lang.IllegalArgumentException
setProperties(String) for a list of keywords.
Throws an IllegalArgumentException if any name in the list is illegal.
| Method Detail |
public java.lang.String getBodyTag()
public java.lang.String getPageTitle()
public java.lang.String getPageMessage()
public int getTimeout()
public int getBackDelay()
public java.lang.String getJVMCodeBase()
public java.lang.String getCookieDomain()
public int getRequestType()
public java.lang.String getPortsToCheck()
public long getFirewallTimeout()
public java.lang.String getPluginCustomID()
public java.lang.String getSSLCheckURL()
public java.lang.String getPortCheckURL()
public java.lang.String getSSLCheckResource()
public java.lang.String getPortCheckResource()
public long getSpeedCheckAdjustment()
public java.lang.String getServerURL()
public java.lang.String getServerURLComplete()
public java.lang.String getPopupFileName()
public java.lang.String getPopupWindowName()
public java.lang.String getPopupWindowFeatures()
public int getPopupTimeout()
public java.lang.String getFontsToCheck()
public void setProperties(long props)
BrowserHawk.getExtendedBrowserInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, long) method, using the constant
long values. Since this method can detect
dozens of advanced properties, it is important to use this feature so
that you can select only the tests you are interested in. For example,
if you wish to detect the user's screen size, connection speed, and
installed flash version, you pass the following:
setProperties(ExtendedBrowserInfo.WIDTH | ExtendedBrowserInfo.HEIGHT |
ExtendedBrowserInfo.CONNECTIONSPEED |
ExtendedBrowserInfo.PLUGINFLASHVEREX);
The possible constant values are found in ExtendedBrowserInfo.
public void setProperties(java.lang.String props)
throws java.lang.IllegalArgumentException
BrowserHawk.getExtendedBrowserInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, long) method, using String
mneumonics. Since this method can detect
dozens of advanced properties, it is important to use this feature so
that you can select only the tests you are interested in. For example, if
you wish to detect the user's screen size, connection speed, and
installed flash version, you pass the following:
setProperties("screensize, connectionspeed, pluginflashverex");
Possible keywords are: plugin_citrix, width, plugin_svgviewer, javaversion, fontsmoothing, activexenabled, msxml, plugin_mediaplayerverex, heightavail, netmeetingbuild, plugin_director, imagesenabled, textsize, browserdatetimems, connectiontype, cookie_perm, connectionspeed, plugin_flash, vbscriptbuild, plugin_crystalreports, plugin_acrobatverex, popupsblocked, plugin_flashverex, referrer, javaenabled, plugin_authorware, plugin_ipixviewer, plugin_directorverex, plugin_mapguide, vbscriptenabled, firewall, plugin_viewpoint, plugin_mediaplayer, javavendor, plugin_quicktime, plugin_realplayer, colordepth, plugin_custom, cookie_both, languser, height, plugin_realplayerbuild, javascriptbuild, fontsinstalled, plugin_acrobat, sslkeysize, widthavail, timezonediff, langsystem, sslenabled, servicepack, browserbuild, cookie_sess, plugin_javaver, openports, msjvmbuild, plugin_quicktimeverex, browserdatetime, javascriptenabled, highsecurity, cookiesenabled, browsersize, screensize, referer, all, plugin_default, plugin_all, plugin_netmeetingbuild, osname, osversion, osarch, containerbrowser, containerversion, containerfullversion, displayxdpiactual, displayydpiactual, displayxdpilogical, displayydpilogical, persistentcookies, sessioncookies, broadband, and plugin_flip4mac.
java.lang.IllegalArgumentExceptionpublic void setBodyTag(java.lang.String tag)
public void setPageTitle(java.lang.String title)
public void setPageMessage(java.lang.String message)
public void setTimeout(int timeout)
BrowserHawk.getExtendedBrowserInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, long)
should wait before the test times out due to JavaScript being disabled.
This property is only needed for IE Mac browsers. In this case BrowserHawk
uses a default of 5 seconds for IE Mac if you do not perform the speed
detection, and 15 seconds if you do perform speed detection. For all
other browsers, BrowserHawk users a value of 0 so that disabled
JavaScript is detected instantly (this is not possible under IE/Mac,
hence the purpose of this property is to give you control, should you
need it, for IE/Mac over the cyScape chosen defaults). Remember BH
automatically uses 0 for all browsers except IE Mac. However if you
manually set this property BH will use that for all browsers. Therefore
if you want to control the setting just for a particular browser type
(such as IE/Mac) you should test to see if it is that browser prior to
setting this property.
Why is all this important? On IE Mac the only way for BrowserHawk to detect whether JavaScript is disabled is based on how much time has elapsed since the test started. If it goes too long without the test finishing, BrowserHawk must assume its because JavaScript is disabled. The problem, however, that depending on the amount of testing you are performing, its difficult for BrowserHawk to know where to draw the line between a test that's taking a long time to execute, and a test that is not executing at all because JavaScript is disabled. In most cases you should find cyScape's default settings appropriate. If you receive reports from IE Mac users stating that their JavaScript as being detected as disabled when indeed it is enabled, then you should use this property to increase the timeout period.
Tip: In just about all circumstances the cyScape default settings should be sufficient. We only recommend you change this property if Mac IE users report incorrect JavaScript settings as mentioned above due to extensive testing you may be performing.
public void setBackDelay(int delay)
public void setJVMCodeBase(java.lang.String codebase)
public void setCookieDomain(java.lang.String domain)
public void setRequestType(int type)
BrowserHawk.getExtendedBrowserInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, long) method. You can
control the way in which this communication is performed by setting the
requestType to either REQUEST_TYPE_AUTO, REQUEST_TYPE_COOKIE,
REQUEST_TYPE_QUERY_STRING, or REQUEST_TYPE_POST. If no value
is specified, a default of 0 is used.
public void setTrueRequestType(int type)
public void addProperty(long prop)
setProperties(long) for details.
public void addProperty(java.lang.String prop)
addProperties(java.lang.String) for multiple.
public void addProperties(java.lang.String props)
setProperties(String) except this is additive to the pre-existing state.
public void removeProperty(long prop)
public void removeProperty(java.lang.String prop)
removeProperties(java.lang.String) for
multiple.
public void removeProperties(java.lang.String props)
public void setPortsToCheck(java.lang.String ports)
public void setFirewallTimeout(long timeout)
public void setPluginCustomID(java.lang.String id)
public void setSSLCheckURL(java.lang.String url)
public void setPortCheckURL(java.lang.String url)
public void setSSLCheckResource(java.lang.String resource)
public void setPortCheckResource(java.lang.String resource)
public void setSpeedCheckAdjustment(long adj)
public void setServerURL(java.lang.String url)
setServerURLComplete(java.lang.String) provides the ability to set a full
URL including the path to override the automatic URI path detection also.
public void setServerURLComplete(java.lang.String url)
setServerURL(java.lang.String) except this method accepts a full
URI for the redirect including the path. Use this method when a complex nested
forward or internal server redirect causes BrowserHawk to auto-detect the wrong
redirect path. This property can only be set dynamically.
public void setPopupFileName(java.lang.String filename)
<script>
<!--
function bhcheck() { }
// -->
</script>
If setting this property, you should also look at setting the window name
and features to control its name and placement.
This file name is used as the first argument to the JavaScript
window.open() call with ?bhspc=1 appended to indicate it's a popup test.
public void setPopupWindowName(java.lang.String windowName)
setPopupFileName(java.lang.String).
This value is passed directly as the second argument to the JavaScript
window.open() call.
public void setPopupWindowFeatures(java.lang.String features)
public void setPopupTimeout(int millis)
public void setFontsToCheck(java.lang.String fonts)
ExtendedBrowserInfo.getFontsInstalled() method.
You can then also use the ExtendedBrowserInfo.getFontInstalled(java.lang.String) method to test
whether a particular font is installed. To obtain a list of all
fonts installed, pass in "ALL" for this property.
public int getCookieDuration()
public void setCookieDuration(int days)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic java.lang.String getBrwsURL()
public java.lang.String getBrwsURLComplete()
public void setBrwsURL(java.lang.String url)
setBrwsURLComplete(java.lang.String) provides the ability to set a full
URL including the scheme (http or https) to override the automatic scheme detection.
public void setBrwsURLComplete(java.lang.String url)
setBrwsURL(java.lang.String) except this method accepts a
full URL for the service including the scheme (http or https). Use this
method when you don't want automatic http/https alteration. This property
can only be set dynamically.
public void setHighSecurityMessage(java.lang.String msg)
setHighSecurityLink(String).
The default high security message text is simply, "Please click here to continue."
If you override this text you have the option to include HTML tags in your message.
You don't have to include an HTML link, but if you do, you should call
setHighSecurityLink(String) and pass a null value so your high security
message won't be made into a link.
public void setHighSecurityLink(java.lang.String link)
setHighSecurityMessage(String) text must be written. The default
high security link is dynamically calculated to redirect back to the
server using a special "bhjs=-1" argument to indicate the high security
state. Using this method you can instead point the user to a static page
explaining they aren't able to continue with the site. Assigning a null
or empty string value means to not make the high security message into a
link. Note that
if you provide your own link to a page running BrowserHawk, the link
should include bhjs=-1 to indicate to BrowserHawk that the test was
completed.
public void setCacheToken(java.lang.String token)
public void setCacheForceRefresh(boolean forceRefresh)
setCacheToken(String), setting this value
to true indicates that even if an existing value is found cached under the
given token, it should be refreshed by performing another test. This is
useful if you believe the client may have changed in the time since the
last cached test (such as during testing).
public void setBroadbandMaxWait(int wait)
wait - public int getBroadbandMaxWait()
public void setBroadbandImageURL(java.lang.String url)
public java.lang.String getBroadbandImageURL()
public void addQueryStringParam(java.lang.String name,
java.lang.String value)
public boolean getSuppressOriginalQueryString()
public void setSuppressOriginalQueryString(boolean suppress)
addQueryStringParam(String, String)
or setServerURLComplete(String).
public java.lang.Object clone()
public java.lang.String toString()