net.sf.tacos.ajax.impl
Class AjaxWebRequestImpl

java.lang.Object
  extended bynet.sf.tacos.ajax.impl.AjaxWebRequestImpl
All Implemented Interfaces:
AjaxWebRequest

public class AjaxWebRequestImpl
extends Object
implements AjaxWebRequest

Implementation of AjaxWebRequest.

Author:
jkuhnert

Field Summary
protected  boolean directUpdate
          Whether or not is directly updating components
protected  ResponseBuilder responseBuilder
          Component update invoker
protected  String type
          Type of request
protected  List updateBlocks
          Update blocks
protected  List updateComponents
          Update components
protected  String version
          Version of client library request
 
Fields inherited from interface net.sf.tacos.ajax.AjaxWebRequest
AJAX_REQUEST_TYPE, PROTOTYPE_VERSION_HEADER, REQUEST_TYPE_HEADER
 
Constructor Summary
AjaxWebRequestImpl()
          Default constructor
 
Method Summary
 boolean containsComponentId(String id)
          Checks if this request contains the specified component id.
 ResponseBuilder getResponseBuilder()
          The class responsible for invoking and rendering the responses received from components.
 String getType()
          The type of ajax request made, which should be AjaxWebRequest.AJAX_REQUEST_TYPE in all cases for now.
 List getUpdateBlocks()
          Optional list of html block id's that were specified in the AjaxDirectLink request.

Example:

 
 List getUpdateComponents()
          List of unique component id's that will have their contents refreshed on this request.
 String getVersion()
          The version of the ajax client library that was used to invoke the ajax cycle.
 boolean isDirectUpdate()
          Whether or not this request expects components to be updated directly, without requiring that the entire page be rendered.
 boolean isValidRequest()
          For instances where an ajax request link was setup, but the client invocation of that link could not create a valid ajax request for one reason or another. If this is true the response will be rendered back to the client in text/html mode as a normal request.
 void setDirectUpdate(boolean directUpdate)
          Sets whether or not this request should directly update components.
 void setResponseBuilder(ResponseBuilder responseBuilder)
          Sets the response builder.
 void setType(String type)
          Sets the type of ajax request.
 void setVersion(String version)
          Sets the request version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

protected String type
Type of request


version

protected String version
Version of client library request


updateComponents

protected List updateComponents
Update components


updateBlocks

protected List updateBlocks
Update blocks


directUpdate

protected boolean directUpdate
Whether or not is directly updating components


responseBuilder

protected ResponseBuilder responseBuilder
Component update invoker

Constructor Detail

AjaxWebRequestImpl

public AjaxWebRequestImpl()
Default constructor

Method Detail

getType

public String getType()
The type of ajax request made, which should be AjaxWebRequest.AJAX_REQUEST_TYPE in all cases for now.

Specified by:
getType in interface AjaxWebRequest
Returns:
The string found in header for AjaxWebRequest.REQUEST_TYPE_HEADER.

setType

public void setType(String type)
Sets the type of ajax request.

Specified by:
setType in interface AjaxWebRequest
Parameters:
type -

getVersion

public String getVersion()
The version of the ajax client library that was used to invoke the ajax cycle.

Specified by:
getVersion in interface AjaxWebRequest
Returns:
Currently the value of AjaxWebRequest.PROTOTYPE_VERSION_HEADER header.

setVersion

public void setVersion(String version)
Sets the request version.

Specified by:
setVersion in interface AjaxWebRequest
Parameters:
version -

isValidRequest

public boolean isValidRequest()
For instances where an ajax request link was setup, but the client invocation of that link could not create a valid ajax request for one reason or another. If this is true the response will be rendered back to the client in text/html mode as a normal request.

Specified by:
isValidRequest in interface AjaxWebRequest
Returns:

getUpdateBlocks

public List getUpdateBlocks()
Optional list of html block id's that were specified in the AjaxDirectLink request.

Example:

 

Specified by:
getUpdateBlocks in interface AjaxWebRequest
Returns:

getUpdateComponents

public List getUpdateComponents()
List of unique component id's that will have their contents refreshed on this request.

Specified by:
getUpdateComponents in interface AjaxWebRequest
Returns:

isDirectUpdate

public boolean isDirectUpdate()
Whether or not this request expects components to be updated directly, without requiring that the entire page be rendered.

Specified by:
isDirectUpdate in interface AjaxWebRequest
Returns:
True if components are updated directly, false otherwise.

setDirectUpdate

public void setDirectUpdate(boolean directUpdate)
Sets whether or not this request should directly update components.

Specified by:
setDirectUpdate in interface AjaxWebRequest
Parameters:
directUpdate -

getResponseBuilder

public ResponseBuilder getResponseBuilder()
The class responsible for invoking and rendering the responses received from components.

Specified by:
getResponseBuilder in interface AjaxWebRequest
Returns:

setResponseBuilder

public void setResponseBuilder(ResponseBuilder responseBuilder)
Sets the response builder.

Specified by:
setResponseBuilder in interface AjaxWebRequest

containsComponentId

public boolean containsComponentId(String id)
Checks if this request contains the specified component id.

Specified by:
containsComponentId in interface AjaxWebRequest
Parameters:
id - Id returned by invoking IComponent#getId().
Returns:
True if request contains update request for specified component.