treqs::QueuesController Class Reference

The controller for Queue objects. More...

#include <QueuesController.h>

Collaboration diagram for treqs::QueuesController:
Collaboration graph
[legend]

List of all members.

Public Member Functions

treqs::Queuecreate (string s, int p)
 Create a new Queue.
bool exists (string t)
 Test if there is a queue for this tape name.
Queueexists (string t, QueueStatus qs)
 Find the unique queue in a given state for a given tape.
bool remove (string)
 Remove a queue from the list of queues.
QueueaddFilePositionOnTape (FilePositionOnTape *f, int r, int pvr)
 Add a file in the correct queue.
pair< multimap< string, Queue >
::iterator, multimap< string,
Queue >::iterator > 
getMapIterators ()
 Provide a way to iterate through the queues.
pair< multimap< string, Queue >
::iterator, multimap< string,
Queue >::iterator > 
getQueuesOnTape (std::string t)
 Get all queues on a given tape.
int cleanDoneQueues ()
 Do house cleaning on done queues.
void updateSuspendTime (int t)
 Update the SuspendTime of all the queues. Sets the localSuspendTime.

Static Public Member Functions

static QueuesControllergetInstance ()
 Provide access to the singleton.

Protected Member Functions

 QueuesController ()
 Constructor.
 ~QueuesController ()
 Destructor.

Private Attributes

multimap< string, QueueQueuesMap
 The list of queues.
int SuspendTime
 Time laps a queue is suspended when it has to.

Static Private Attributes

static QueuesController_instance = 0
 Pointer to the singleton instance.
static LoggerPtr logger
 The LOG4CXX logger.

Detailed Description

The controller for Queue objects.

The Queues Controller provides an interface to create new queues, get the queues from a name, remove queues from a name, test existance

The Queues are organized in a multimap, the key being the name of the queue (typically the tape name).


Constructor & Destructor Documentation

treqs::QueuesController::QueuesController (  )  [protected]

Constructor.

Here is the caller graph for this function:

treqs::QueuesController::~QueuesController (  )  [protected]

Destructor.


Member Function Documentation

treqs::Queue * treqs::QueuesController::addFilePositionOnTape ( treqs::FilePositionOnTape f,
int  r,
int  pvr 
)

Add a file in the correct queue.

Based on the tape referenced by the file, the correct queue is found. Based on the file's position, insert the file in the activated queue or in the created queue We also ask the FilePositionOnTapesController to register the returned instance.

Parameters:
f the file to insert
r the retry number
pvr the PVR Id for the queue
Returns:
a pointer to the queue which registered the file.

Here is the call graph for this function:

Here is the caller graph for this function:

int treqs::QueuesController::cleanDoneQueues (  ) 

Do house cleaning on done queues.

Iterate on the queues map and clean the done queues

Here is the caller graph for this function:

treqs::Queue * treqs::QueuesController::create ( string  s,
int  p 
)

Create a new Queue.

Create a new Queue and insert the instance in the multimap

Parameters:
s the name of the queue (aka the name of the tape)
p the pvrid
Returns:
a pointer to the new queue (or the already existing queue) addFile(File*) does all the Job

Here is the call graph for this function:

Here is the caller graph for this function:

treqs::Queue * treqs::QueuesController::exists ( string  t,
treqs::QueueStatus  qs 
)

Find the unique queue in a given state for a given tape.

Parameters:
t the tape name
qs the queue status
Returns:
a pointer to the queue, NULL if no queue was found.
bool treqs::QueuesController::exists ( string  t  ) 

Test if there is a queue for this tape name.

Parameters:
t the tape name
Returns:
true if at least one queue exists

Here is the caller graph for this function:

treqs::QueuesController * treqs::QueuesController::getInstance (  )  [static]

Provide access to the singleton.

Returns:
a pointer to the QueuesController singleton

Here is the call graph for this function:

Here is the caller graph for this function:

pair< multimap< string, treqs::Queue >::iterator, multimap< string, treqs::Queue >::iterator > treqs::QueuesController::getMapIterators (  ) 

Provide a way to iterate through the queues.

Returns:
A pair of iterators (begin and end) of the queue map

Here is the caller graph for this function:

pair< multimap< string, treqs::Queue >::iterator, multimap< string, treqs::Queue >::iterator > treqs::QueuesController::getQueuesOnTape ( std::string  t  ) 

Get all queues on a given tape.

Parameters:
t the tape to search for
Returns:
the bounds of a range that includes all the queues on tape t.
bool treqs::QueuesController::remove ( string  s  ) 

Remove a queue from the list of queues.

call the Queue's destructor TODO : Not implemented yet.

Parameters:
s the name of the queue
Returns:
true if removal succeeded. False otherwise.
void treqs::QueuesController::updateSuspendTime ( int  t  ) 

Update the SuspendTime of all the queues. Sets the localSuspendTime.

Parameters:
t the time in second for queue suspension

Member Data Documentation

Pointer to the singleton instance.

LoggerPtr treqs::QueuesController::logger [static, private]

The LOG4CXX logger.

multimap<string, Queue> treqs::QueuesController::QueuesMap [private]

The list of queues.

Non-Unique key of the multimap is the Queue's name.

Time laps a queue is suspended when it has to.


The documentation for this class was generated from the following files:

Generated on 4 Mar 2010 for TReqS by  doxygen 1.6.1