IBR-DTNSuite  0.8
dtn::api::ApiServer Class Reference

#include <ApiServer.h>

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

List of all members.

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::core::Event *evt)
void processIncomingBundle (const dtn::data::EID &source, dtn::data::Bundle &bundle)
RegistrationgetRegistration (const std::string &handle)
virtual size_t timeout (ibrcommon::Timer *)

Protected Member Functions

void __cancellation ()
virtual void connectionUp (ClientHandler *conn)
virtual void connectionDown (ClientHandler *conn)
void componentUp ()
void componentRun ()
void componentDown ()

Detailed Description

Definition at line 27 of file ApiServer.h.


Constructor & Destructor Documentation

Definition at line 33 of file ApiServer.cpp.

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

Definition at line 38 of file ApiServer.cpp.

References ibrcommon::tcpserver::bind().

Here is the call graph for this function:

Definition at line 44 of file ApiServer.cpp.

References ibrcommon::JoinableThread::join(), and ibrcommon::JoinableThread::stop().

Here is the call graph for this function:


Member Function Documentation

void dtn::api::ApiServer::__cancellation ( ) [protected, virtual]

Implements dtn::daemon::IndependentComponent.

Definition at line 51 of file ApiServer.cpp.

References ibrcommon::tcpserver::shutdown().

Here is the call graph for this function:

void dtn::api::ApiServer::connectionDown ( ClientHandler conn) [protected, virtual]

Implements dtn::api::ApiServerInterface.

Definition at line 266 of file ApiServer.cpp.

References IBRCOMMON_LOGGER_DEBUG, and IBRCOMMON_LOGGER_ENDL.

void dtn::api::ApiServer::connectionUp ( ClientHandler conn) [protected, virtual]

Implements dtn::api::ApiServerInterface.

Definition at line 260 of file ApiServer.cpp.

References IBRCOMMON_LOGGER_DEBUG, and IBRCOMMON_LOGGER_ENDL.

const std::string dtn::api::ApiServer::getName ( ) const [virtual]
See also:
Component::getName()

Implements dtn::daemon::Component.

Definition at line 255 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 206 of file ApiServer.cpp.

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

Implements ibrcommon::TimerCallback.

Definition at line 224 of file ApiServer.cpp.

References IBRCOMMON_LOGGER_DEBUG, and IBRCOMMON_LOGGER_ENDL.


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