com.gridsystems.innergrid.kernel.genericutils
Class PagedRequestManager<E extends PagedRequest<?>>

java.lang.Object
  extended by com.gridsystems.innergrid.kernel.genericutils.PagedRequestManager<E>
Type Parameters:
E - Specific PagedRequest to manage

public final class PagedRequestManager<E extends PagedRequest<?>>
extends java.lang.Object

Centralized management for asynchronous requests being performed.

Version:
1.0
Author:
lgaspart, Xmas (generics), Rodrigo Ruiz (bug fixes)

Constructor Summary
PagedRequestManager()
          Private constructor.
 
Method Summary
 void addPagedRequest(E req)
          Adds a PagedRequest to the collection of the manager.
protected  void finalize()
          
 java.util.List<E> getAllPagedRequests()
          Gets all paged requests that are instances of the specified class.
 E getPagedRequest(long id)
          Obtains a PagedRequest from the managed pool.
 int getPagedRequestsSize()
          Gets the size of the collection of managed paged requests.
 void removeAllPagedRequest()
          Cancels and Removes all paged request from the collection of the manager.
 void removePagedRequest(long id)
          Removes a paged request from the collection of the manager, given its 'id'.
 java.lang.String toString()
          Gets a String representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PagedRequestManager

public PagedRequestManager()
Private constructor.

Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

addPagedRequest

public void addPagedRequest(E req)
                     throws org.apache.commons.lang.NullArgumentException
Adds a PagedRequest to the collection of the manager.

Parameters:
req - PagedRequest to be added
Throws:
org.apache.commons.lang.NullArgumentException - if req is null

getPagedRequest

public E getPagedRequest(long id)
                                          throws PagedRequestNotFoundException,
                                                 PagedRequestNotAllowedException
Obtains a PagedRequest from the managed pool.

Parameters:
id - Identifier of the asked for PagedRequest
Returns:
PagedRequest whose identifier matches 'id' parameter
Throws:
PagedRequestNotFoundException - if there is no PagedRequest with that id
PagedRequestNotAllowedException - if the current user did not create the request

getAllPagedRequests

public java.util.List<E> getAllPagedRequests()
Gets all paged requests that are instances of the specified class.

Returns:
A collection containing all selected paged requests

getPagedRequestsSize

public int getPagedRequestsSize()
Gets the size of the collection of managed paged requests.

Returns:
size of the collection of managed paged requests

removeAllPagedRequest

public void removeAllPagedRequest()
Cancels and Removes all paged request from the collection of the manager.


removePagedRequest

public void removePagedRequest(long id)
                        throws PagedRequestNotFoundException,
                               PagedRequestNotAllowedException
Removes a paged request from the collection of the manager, given its 'id'.

Parameters:
id - identifier of the paged request to be removed
Throws:
PagedRequestNotFoundException - if there is no request matching the id
PagedRequestNotAllowedException - if the current user did not create the request

toString

public java.lang.String toString()
Gets a String representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this object


Copyright © 2007-2008 Grid Systems, S.A.. All Rights Reserved.