xorp

IfMgrXrlReplicator Class Reference

Class that sends a configuration information to a remote mirror of IfMgr configuration state. More...

#include <ifmgr_xrl_replicator.hh>

Inheritance diagram for IfMgrXrlReplicator:
IfMgrCommandSinkBase CallbackSafeObject NONCOPYABLE IfMgrManagedXrlReplicator

List of all members.

Public Types

typedef IfMgrCommandSinkBase::Cmd Cmd

Public Member Functions

 IfMgrXrlReplicator (XrlSender &sender, const string &xrl_target_name)
 Constructor.
void push (const Cmd &cmd)
 Add a command to be sent as an Xrl to the remote target.
void crank_replicator ()
 Schedule the next Xrl dispatch.
const string & xrl_target_name () const
 Accessor for xrl target name.
bool is_empty_queue () const
 Test whether the queue with the commands is empty.

Protected Member Functions

virtual void crank_manager ()
 Method invoked when it is time to schedule the next Xrl dispatch.
virtual void crank_manager_cb ()
 Method invoked when the previous Xrl dispatch has completed.
virtual void push_manager_queue ()
 Method invoked when a command should be added to the manager's queue.
virtual void xrl_error_event (const XrlError &e)
 Method invoked when an Xrl dispatch fails.
 IfMgrXrlReplicator ()
 Not implemented.
 IfMgrXrlReplicator (const IfMgrXrlReplicator &)
 Not implemented.
IfMgrXrlReplicatoroperator= (const IfMgrXrlReplicator &)
 Not implemented.

Protected Attributes

XrlSender_s
string _tgt
IfMgrCommandFifoQueue _queue
bool _pending

Private Member Functions

void xrl_cb (const XrlError &e)

Detailed Description

Class that sends a configuration information to a remote mirror of IfMgr configuration state.

The IfMgrXrlReplicator contains an IfMgrCommandFifoQueue and adds commands to it when IfMgrXrlReplicator::push is called. Invoking push also cranks the queue if an Xrl dispatch is not in progress. Cranking causes the Xrl at the head of the queue to be dispatched.

On the successful dispatch of an Xrl, the next command ready for dispatching as an Xrl is taken from the queue and dispatched if available. If no command is available, processing stops. If an Xrl dispatch fails, the overrideable method IfMgrXrlReplicator::xrl_error_event is called. After an error, the queue processing stops and the IfMgrXrlReplicator instance should in most cases be destructed.


Member Function Documentation

bool IfMgrXrlReplicator::is_empty_queue ( ) const [inline]

Test whether the queue with the commands is empty.

Returns:
trie if the queue with the commans is empty, otherwise false.

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