net.rim.device.api.io.http
Class HttpFilterRegistry

java.lang.Object
  extended by net.rim.device.api.io.http.HttpFilterRegistry

public final class HttpFilterRegistry
extends Object

Houses protocol filters associated with fully qualified domain names.

Sample code

 // 2 methods to register an FQDN with a package name:
 HttpFilterRegistry.registerFilter("www.blackberry.com", "com.rim.samples.device.httpfilterdemo.filter");
 HttpFilterRegistry.registerFilter("content.blackberry.com", "com.rim.samples.device.httpfilterdemo.precanned", true);
 
 // To retrieve a previously registered package :
 String protocol = HttpFilterRegistry.getFilter(fqdn);
 if (protocol != null) 
 {
   ...    
 }
 
What Is - A ControlledAccessException is thrown when using the HttpFilterRegistry
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/796557/800332/800440/ What_Is_-_A_ControlledAccessException_is_thrown_when_using_the_HttpFilterRegistry.html?nodeid=827033&vernum=0

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0

Method Summary
Category: Signed static void deregisterFilter(String fqdn)
          Deregisters a previously registered filter.
Category: Signed static String getFilter(String fqdn)
          Retrieves a previously registered package by fully qualified domain name.
Category: Signed static boolean isLocalFilter(String fqdn)
          Retrieves whether an associated filter is defined to have local access.
Category: Signed static void registerFilter(String fqdn, String protocolPackage)
          Registers a new fully qualified domain name (FQDN) with a package name.
Category: Signed static void registerFilter(String fqdn, String protocolPackage, boolean isLocal)
          Registers a new fully qualified domain name (FQDN) with a package name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

registerFilter

public static void registerFilter(String fqdn,
                                  String protocolPackage)
Registers a new fully qualified domain name (FQDN) with a package name.

Parameters:
fqdn - Fully qualified domain name (eg. www.blackberry.com).
protocolPackage - The java package where the Protocol.java class will be found. (eg. com.yourcompany.somepackage); the package name must have a Protocol java class inside of the package for instantiation. NOTE: The package name MUST include at least one dot ('.').
Throws:
ControlledAccessException - if the calling application is not allowed according to Application Control by the IT Administrator for the device to register a filter. Note that by default all applications are not allowed to register filters. This functionality must be turned on by the IT administrator.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0

registerFilter

public static void registerFilter(String fqdn,
                                  String protocolPackage,
                                  boolean isLocal)
Registers a new fully qualified domain name (FQDN) with a package name.

Parameters:
fqdn - Fully qualified domain name (eg. www.blackberry.com).
protocolPackage - The java package where the Protocol.java class will be found. (eg. com.yourcompany.somepackage); the package name must have a Protocol java class inside of the package for instantiation. NOTE: The package name MUST include at least one dot ('.').
isLocal - Whether or not this filter will do network access in any way. The browser can check this value and allow access to local filters when the radio is off or the device is out of coverage.
Throws:
ControlledAccessException - if the calling application is not allowed according to Application Control by the IT Administrator for the device to register a filter. Note that by default all applications are not allowed to register filters. This functionality must be turned on by the IT administrator.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

deregisterFilter

public static void deregisterFilter(String fqdn)
Deregisters a previously registered filter.

Parameters:
fqdn - Fully qualified domain name (eg. www.blackberry.com)
Throws:
ControlledAccessException - if the calling application is not allowed according to Application Control by the IT Administrator for the device to deregister a filter. Note that by default all applications are not allowed to deregister filters. This functionality must be turned on by the IT administrator.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0

getFilter

public static String getFilter(String fqdn)
Retrieves a previously registered package by fully qualified domain name.

Parameters:
fqdn - Fully qualified domain name (eg. www.blackberry.com).
Returns:
Name of package registered for FQDN.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0

isLocalFilter

public static boolean isLocalFilter(String fqdn)
Retrieves whether an associated filter is defined to have local access.

Parameters:
fqdn - Fully qualified domain name (eg. www.blackberry.com).
Returns:
Whether or not a filter has local access only.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.