class FinderClient

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

Definition#include <finder_client.hh>
InheritsFinderClientXrlCommandInterface [public ], FinderMessengerManager [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

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 (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:
xrlXrl to be resolved.
qcbcallback to be dispatched when result is availble.

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.

inline OperationQueue&  todo_list ()

todo_list

Get list of operations pending.

inline 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.

inline XrlCmdMap&  commands ()

commands

Get the Xrl Commands implemented by the FinderClient.

inline bool  ready ()

ready

[const]

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

inline bool  connected ()

connected

[const]

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

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]

inline InstanceList::iterator  find_instance (const string& instance)

find_instance

[protected]

inline 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]


Generated by: pavlin on possum.icir.org on Mon Jun 9 13:23:50 2003, using kdoc 2.0a54+XORP.