class FinderClient

Class that represents clients of the Finder. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Types

Public Methods

Public Members

Protected Methods

Protected Members


Detailed Description

The FinderClient class performs communication processing with the Finder on behalf of XORP processes. It handles XRL registration and resolution requests.

typedef XorpCallback2<void, const XrlError&, const FinderDBEntry*>::RefPtr QueryCallback

QueryCallback

typedef ref_ptr<FinderClientOp> Operation

Operation

typedef list<Operation> OperationQueue

OperationQueue

typedef map<string, FinderDBEntry> ResolvedTable

ResolvedTable

typedef map<string, string> LocalResolvedTable

LocalResolvedTable

typedef vector<InstanceInfo> InstanceList

InstanceList

 FinderClient ()

FinderClient

Constructor.

 ~FinderClient ()

~FinderClient

[virtual]

Destructor.

bool  register_xrl_target (const string& instance_name, const string& class_name, const XrlDispatcher* dispatcher)

register_xrl_target

Register an Xrl Target with the FinderClient and place request with Finder to perform registration. The request to the Finder is asynchronous and there is a delay between when the request is made when it is satisfied.

Parameters:

instance_namea unique name to be associated with the Target.
class_namethe class name that the Target is an instance of.
dispatcherpointer to Xrl dispatcher that can execute the command.

Returns: true on success, false if instance_name or class_name are empty.

bool  unregister_xrl_target (const string& instance_name)

unregister_xrl_target

Unregister Xrl Target with FinderClient and place a request with the Finder to remove registration. The request to the Finder is asynchronous and there is a delay between when the request is made when it is satisfied.

Parameters:

instance_nameunique name associated with Xrl Target.
bool  register_xrl (const string& instance_name, const string& xrl, const string& pf_name, const string& pf_args)

register_xrl

Register an Xrl with the Finder.

Parameters:

instance_nameunique name associated with Xrl Target and making the registration.
xrlstring representation of the Xrl.
pf_nameprotocol family name that implements Xrl.
pf_argsprotocol family arguments to locate dispatcher for registered Xrl.

Returns: true if registration request is successfully enqueued, false otherwise.

bool  enable_xrls (const string& instance_name)

enable_xrls

Request Finder advertise Xrls associated with an Xrl Target instance to other XORP Xrl targets. Until the Finder has satisfied this request the Xrl Target has no visibility in the Xrl universe.

Parameters:

instance_nameunique name associated with Xrl Target to be advertised.

Returns: true on success, false if instance_name has not previously been registered with FinderClient.

void  query (EventLoop& eventloop, const string& xrl, const QueryCallback& qcb)

query

Request resolution of an Xrl.

If the Xrl to be resolved in cache exists in the FinderClients cache, the callback provided as a function argument is invoked immediately. Otherwise the request is forwarded to the finder, the cache updated, and callback dispatched when the Finder answers the request.

Parameters:

eventloopthe event loop.
xrlXrl to be resolved.
qcbcallback to be dispatched when result is availble.
uint32_t  queries_pending ()

queries_pending

[const]

Get number of asynchonous queries pending resolution.

const FinderDBEntry*  query_cache (const string& xrl)

query_cache

[const]

Attempt to resolve Xrl from cache.

Parameters:

xrlXrl to be resolved.

Returns: pointer to cached entry on success, 0 otherwise.

void  uncache_result (const FinderDBEntry* dbe)

uncache_result

Remove an resolved entry from cache.

This method is typically called when the information provided has been useful to consumer. ie because the answer is found to be no longer valid.

bool  query_self (const string& incoming_xrl_command, string& local_xrl_command)

query_self

[const]

Resolve Xrl that an Xrl Target associated with the FinderClient registered.

Parameters:

incoming_xrl_commandthe command component of the Xrl being resolved.
local_xrl_commandthe local name of the Xrl command being resolved.

Returns: true and assign value to local_xrl_command on success, false on failure.

bool  forward_finder_xrl (const Xrl& x, const XrlPFSender::SendCallback& cb)

forward_finder_xrl

Send an Xrl for the Finder to dispatch. This is the mechanism that allows clients of the Finder to interrogate the Finder through an Xrl interface.

Parameters:

xXrl to be dispatched.
cbcallback to be called with dispatch result.

Returns: true on success.

FinderMessengerBase*  messenger ()

messenger

Accessor for Finder Messenger used by FinderClient instance.

OperationQueue&  todo_list ()

todo_list

Get list of operations pending.

OperationQueue&  done_list ()

done_list

Get List of operations done and are repeatable.

void  notify_done (const FinderClientOp* completed)

notify_done

Notify successful completion of an operation on the todo list.

void  notify_failed (const FinderClientOp* completed)

notify_failed

Notify failed completion of an operation on the todo list.

XrlCmdMap&  commands ()

commands

Get the Xrl Commands implemented by the FinderClient.

bool  ready ()

ready

[const]

Returns: true if FinderClient has registered Xrls and is considered operational.

bool  connected ()

connected

[const]

Returns: true if a connection is established with the Finder.

bool  attach_observer (FinderClientObserver* o)

attach_observer

Attach a FinderClientObserver instance to receive event notifications.

Parameters:

opointer to observer to receive notifications.

Returns: true on success, false if an observer is already present.

bool  detach_observer (FinderClientObserver* o)

detach_observer

Detach the FinderClientObserver instance.

Parameters:

opointer to the FinderClientObserver be removed.

Returns: true on success, false if the FinderClientObserver is not the current observer.

void  messenger_birth_event (FinderMessengerBase*)

messenger_birth_event

[protected]

Reimplemented from FinderMessengerManager.

void  messenger_death_event (FinderMessengerBase*)

messenger_death_event

[protected]

Reimplemented from FinderMessengerManager.

void  messenger_active_event (FinderMessengerBase*)

messenger_active_event

[protected]

Reimplemented from FinderMessengerManager.

void  messenger_inactive_event (FinderMessengerBase*)

messenger_inactive_event

[protected]

Reimplemented from FinderMessengerManager.

void  messenger_stopped_event (FinderMessengerBase*)

messenger_stopped_event

[protected]

Reimplemented from FinderMessengerManager.

bool  manages (const FinderMessengerBase*)

manages

[protected const]

Reimplemented from FinderMessengerManager.

void  uncache_xrl (const string& xrl)

uncache_xrl

[protected]

Reimplemented from FinderClientXrlCommandInterface.

void  uncache_xrls_from_target (const string& target)

uncache_xrls_from_target

[protected]

Reimplemented from FinderClientXrlCommandInterface.

XrlCmdError  dispatch_tunneled_xrl (const string& xrl)

dispatch_tunneled_xrl

[protected]

Reimplemented from FinderClientXrlCommandInterface.

void  crank ()

crank

[protected]

void  prepare_for_restart ()

prepare_for_restart

[protected]

InstanceList::iterator  find_instance (const string& instance)

find_instance

[protected]

InstanceList::const_iterator  find_instance (const string& instance)

find_instance

[protected const]

OperationQueue _todo_list

_todo_list

[protected]

OperationQueue _done_list

_done_list

[protected]

ResolvedTable _rt

_rt

[protected]

LocalResolvedTable _lrt

_lrt

[protected]

InstanceList _ids

_ids

[protected]

XrlCmdMap _commands

_commands

[protected]

FinderMessengerBase* _messenger

_messenger

[protected]

bool _pending_result

_pending_result

[protected]

bool _xrls_registered

_xrls_registered

[protected]

FinderClientObserver* _observer

_observer

[protected]


Generated by: pavlin on kobe.xorp.net on Wed Jan 7 19:10:45 2009, using kdoc 2.0a54+XORP.