net.rim.device.api.browser.field
Class RequestedResource

java.lang.Object
  extended by net.rim.device.api.browser.field.RequestedResource

public final class RequestedResource
extends Object

Object to carry information about requested resource.

Requested resource objects get passed into a rendering application when the rendering session needs assistance in rendering an off-page resource (by invoking RenderingApplication.getResource(net.rim.device.api.browser.field.RequestedResource, net.rim.device.api.browser.field.BrowserContent) and passing in a requested resource object).

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

Constructor Summary
Category: Signed RequestedResource(String url)
          Creates new RequestedResource instance.
Category: Signed RequestedResource(String url, HttpHeaders requestHeaders, int flags)
          Creates new RequestedResource instance.
Category: Signed RequestedResource(String url, HttpHeaders requestHeaders, int flags, String requestMethod, byte[] requestData)
          Creates new RequestedResource instance.
 
Method Summary
Category: Signed  int getFlags()
          Retrieves the flags associated with this request.
Category: Signed  HttpConnection getHttpConnection()
          Retrieves the HTTP connection object for this request.
Category: Signed  InputConnection getInputConnection()
          Gets the input connection object for this request.
Category: Signed  String getPassword()
          The password credentials for the request.
Category: Signed  byte[] getRequestData()
          Retrieves the associated request data.
Category: Signed  HttpHeaders getRequestHeaders()
          Retrieves the request headers for this request.
Category: Signed  String getRequestMethod()
          Retrieves the associated request method.
Category: Signed  String getUrl()
          Retrieves the URL for this request.
Category: Signed  String getUsername()
          The username credentials for the request.
Category: Signed  boolean isCacheOnly()
          Returns true if this resource should only be retrieved from the cache.
Category: Signed  void setAuthentication(String username, String password)
          Specifies the credentials for the request if authentication is required.
Category: Signed  void setCacheOnly(boolean cacheOnly)
          Indicates whether the resource should only be retrieved from cache.
Category: Signed  void setHttpConnection(HttpConnection connection)
          Sets the HTTP connection object for this request.
Category: Signed  void setInputConnection(InputConnection connection)
          Sets the input connection object for this request.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

RequestedResource

public RequestedResource(String url)
Creates new RequestedResource instance.

Parameters:
url - URL of the resource.
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

RequestedResource

public RequestedResource(String url,
                         HttpHeaders requestHeaders,
                         int flags)
Creates new RequestedResource instance.

Parameters:
url - URL of the resource.
requestHeaders - Request Headers for this request.
flags - Flags for this request.
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

RequestedResource

public RequestedResource(String url,
                         HttpHeaders requestHeaders,
                         int flags,
                         String requestMethod,
                         byte[] requestData)
Creates new RequestedResource instance.

Parameters:
url - URL of the resource.
requestHeaders - Request Headers for this request.
flags - Flags for this request.
requestMethod - Request method for this request.
requestData - Request data for this request.
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.2.1


Method Detail

isCacheOnly

public boolean isCacheOnly()
Returns true if this resource should only be retrieved from the cache. Returns false if this resource may be retrieved from the network.

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

setCacheOnly

public void setCacheOnly(boolean cacheOnly)
Indicates whether the resource should only be retrieved from cache. If cacheOnly is true but the resource is not available in the cache, then getInputConnection and getHttpConnection will return null.

Parameters:
cacheOnly - true if the resource should only be retrieved from cache; false to allow loading the resource from the network
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

setAuthentication

public void setAuthentication(String username,
                              String password)
Specifies the credentials for the request if authentication is required.

Parameters:
username - The username to use.
password - The password to use.
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 5.0.0

getUsername

public String getUsername()
The username credentials for the request.

Returns:
Username for this request.
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 5.0.0

getPassword

public String getPassword()
The password credentials for the request.

Returns:
Password for this request.
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 5.0.0

getFlags

public int getFlags()
Retrieves the flags associated with this request.

Returns:
Flags for this request.
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

getRequestMethod

public String getRequestMethod()
Retrieves the associated request method.

Returns:
Method to be invoked on the request eg. for "HTTP", "GET", "HEAD", "PUT". If the requested method is specified as null in the constructor for this object, the return is then dependent on the requested data. If the requested data is specified as non-null in the constuctor, the return is "POST", while if the requested data is null, the return is "GET".
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.2.1

getRequestData

public byte[] getRequestData()
Retrieves the associated request data. The request headers should provide a content type for this data.

Returns:
Data to be sent on the requested resource.
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.2.1

getHttpConnection

public HttpConnection getHttpConnection()
Retrieves the HTTP connection object for this request.

Returns:
The HTTP connection for this request.
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

getUrl

public String getUrl()
Retrieves the URL for this request.

Returns:
URL for this request.
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

getRequestHeaders

public HttpHeaders getRequestHeaders()
Retrieves the request headers for this request.

Returns:
The requestHeaders for this request.
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

setHttpConnection

public void setHttpConnection(HttpConnection connection)
Sets the HTTP connection object for this request.

Parameters:
connection - Connection to be set for this request.
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

setInputConnection

public void setInputConnection(InputConnection connection)
Sets the input connection object for this request.

Parameters:
connection - Connection to be set for this request.
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.2.0

getInputConnection

public InputConnection getInputConnection()
Gets the input connection object for this request.

Returns:
Connection set for this request.
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.2.0





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.