GNDMS 0.6.0
RESTful verison of GNDMS
Public Member Functions | Protected Member Functions | Private Attributes

de.zib.gndms.model.common.repository.QueuedDao< K, M, D > Class Reference

Inheritance diagram for de.zib.gndms.model.common.repository.QueuedDao< K, M, D >:
de.zib.gndms.model.common.repository.Dao< K, M, D > de.zib.gndms.model.common.repository.QueuedTransientDao< K, M, D >

List of all members.

Public Member Functions

get (K key) throws NoSuchElementException
 Used to retrive an model object form the dao.
void setLimit (int newLimit)
 Sets a new queue element limit.
int getLimit ()

Protected Member Functions

abstract M provideGet (K key)
 This should return new models or delegate calls to underlying daos.
void offer (K key)
 Inserts key into the queue.
void remove ()

Private Attributes

int limit
Queue< K > queue

Detailed Description

Author:
try ma ik jo rr a zib
Version:
$Id$

Date: 05.01.2011, Time: 17:46:12

This isn't a real dao yet but offers the functionality to maintain domain objects in a queue.


Member Function Documentation

M de.zib.gndms.model.common.repository.QueuedDao< K, M, D >.get ( key) throws NoSuchElementException

Used to retrive an model object form the dao.

Parameters:
keyThe key of the object.
Returns:

Implements de.zib.gndms.model.common.repository.Dao< K, M, D >.

                                                        {

        if( queue.size() == limit )
            queue.remove();

        offer( key );
        return provideGet( key );
    }
abstract M de.zib.gndms.model.common.repository.QueuedDao< K, M, D >.provideGet ( key) [protected, pure virtual]

This should return new models or delegate calls to underlying daos.

Parameters:
keyModel key if required for construction.
Returns:
A new model.

Note: when this method is called the model is allready inserted into the queue.

Implemented in de.zib.gndms.model.common.repository.QueuedTransientDao< K, M, D >.

void de.zib.gndms.model.common.repository.QueuedDao< K, M, D >.setLimit ( int  newLimit)

Sets a new queue element limit.

Parameters:
newLimitThe new limit.

Note: if newLimit < limit, Items will be removed from the queue until the queue size is equal to the limit.

                                         {

        while( newLimit < queue.size() )
            remove( );

        this.limit = newLimit;
    }

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables