IBR-DTN  1.0.0
dtn::api::ApiServer Class Reference

#include <ApiServer.h>

Inheritance diagram for dtn::api::ApiServer:
Inheritance graph
Collaboration diagram for dtn::api::ApiServer:
Collaboration graph

Public Member Functions

 ApiServer (const ibrcommon::File &socket)
 
 ApiServer (const ibrcommon::vinterface &net, int port=4550)
 
virtual ~ApiServer ()
 
virtual const std::string getName () const
 
void freeRegistration (Registration &reg)
 
void raiseEvent (const dtn::routing::QueueBundleEvent &evt) throw ()
 
RegistrationgetRegistration (const std::string &handle)
 
virtual size_t timeout (ibrcommon::Timer *)
 
- Public Member Functions inherited from dtn::daemon::IndependentComponent
 IndependentComponent ()
 
virtual ~IndependentComponent ()
 
virtual void initialize () throw ()
 
virtual void startup () throw ()
 
virtual void terminate () throw ()
 
- Public Member Functions inherited from dtn::daemon::Component
virtual ~Component ()=0
 
- Public Member Functions inherited from dtn::core::EventReceiver< dtn::routing::QueueBundleEvent >
virtual ~EventReceiver ()
 
- Public Member Functions inherited from dtn::api::ApiServerInterface
virtual ~ApiServerInterface ()
 

Protected Member Functions

void __cancellation () throw ()
 
virtual void connectionUp (ClientHandler *conn)
 
virtual void connectionDown (ClientHandler *conn)
 
void componentUp () throw ()
 
void componentRun () throw ()
 
void componentDown () throw ()
 
- Protected Member Functions inherited from dtn::daemon::IndependentComponent
void run () throw ()
 

Detailed Description

Definition at line 43 of file ApiServer.h.

Constructor & Destructor Documentation

dtn::api::ApiServer::ApiServer ( const ibrcommon::File &  socket)

Definition at line 45 of file ApiServer.cpp.

dtn::api::ApiServer::ApiServer ( const ibrcommon::vinterface &  net,
int  port = 4550 
)

Definition at line 51 of file ApiServer.cpp.

dtn::api::ApiServer::~ApiServer ( )
virtual

Definition at line 96 of file ApiServer.cpp.

Member Function Documentation

void dtn::api::ApiServer::__cancellation ( )
throw (
)
protectedvirtual

This method is called after componentDown() and should should guarantee that blocking calls in componentRun() will unblock.

Implements dtn::daemon::IndependentComponent.

Definition at line 105 of file ApiServer.cpp.

void dtn::api::ApiServer::componentDown ( )
throw (
)
protectedvirtual

This method is called if the component should stop. Clean-up code should be inserted here.

Implements dtn::daemon::IndependentComponent.

Definition at line 216 of file ApiServer.cpp.

References dtn::core::EventDispatcher< E >::remove().

Here is the call graph for this function:

void dtn::api::ApiServer::componentRun ( )
throw (
)
protectedvirtual

This is the run method. The component should loop in there until componentDown() or __cancellation() is called.

Implements dtn::daemon::IndependentComponent.

Definition at line 125 of file ApiServer.cpp.

References dtn::api::Registration::getHandle(), dtn::daemon::Configuration::getInstance(), and dtn::daemon::Configuration::version().

Here is the call graph for this function:

void dtn::api::ApiServer::componentUp ( )
throw (
)
protectedvirtual

Is called in preparation of the component. Before componentRun() is called.

Implements dtn::daemon::IndependentComponent.

Definition at line 111 of file ApiServer.cpp.

References dtn::core::EventDispatcher< E >::add().

Here is the call graph for this function:

void dtn::api::ApiServer::connectionDown ( ClientHandler conn)
protectedvirtual

Implements dtn::api::ApiServerInterface.

Definition at line 309 of file ApiServer.cpp.

void dtn::api::ApiServer::connectionUp ( ClientHandler conn)
protectedvirtual

Implements dtn::api::ApiServerInterface.

Definition at line 303 of file ApiServer.cpp.

void dtn::api::ApiServer::freeRegistration ( Registration reg)
virtual

Implements dtn::api::ApiServerInterface.

Definition at line 327 of file ApiServer.cpp.

References dtn::api::Registration::detach(), dtn::api::Registration::getHandle(), and dtn::api::Registration::isPersistent().

Here is the call graph for this function:

const std::string dtn::api::ApiServer::getName ( ) const
virtual
See Also
Component::getName()

Implements dtn::daemon::Component.

Definition at line 298 of file ApiServer.cpp.

Registration & dtn::api::ApiServer::getRegistration ( const std::string &  handle)
virtual

retrieve a registration for a given handle from the ApiServers registration list the registration is automatically set into the attached state

Parameters
handlethe handle of the registration to return
Exceptions
Registration::AlreadyAttachedExceptionthe registration is already attached to a different client
Registration::NotFoundExceptionno registration was found for the given handle
Returns
the registration with the given handle

Implements dtn::api::ApiServerInterface.

Definition at line 244 of file ApiServer.cpp.

References dtn::api::Registration::attach(), and dtn::api::Registration::isPersistent().

Here is the call graph for this function:

void dtn::api::ApiServer::raiseEvent ( const dtn::routing::QueueBundleEvent evt)
throw (
)
virtual
size_t dtn::api::ApiServer::timeout ( ibrcommon::Timer *  )
virtual

Removes expired registrations.

Exceptions
ibrcommon::Timer::StopTimerExceptionthrown, if the GarbageCollector should be stopped
See Also
ibrcommon::TimerCallback::timeout(Timer*)
Returns
the seconds till the GarbageCollector should be triggered next

Definition at line 264 of file ApiServer.cpp.

References dtn::api::Registration::attach(), dtn::api::Registration::detach(), dtn::api::Registration::getHandle(), and dtn::api::Registration::isPersistent().

Here is the call graph for this function:


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