rasdaman complete source
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
rnp::RnpServerJob Class Reference

#include <rnpcommunication.hh>

Inheritance diagram for rnp::RnpServerJob:
akg::NbServerJob akg::NbJob RnpRasserverJob

Public Member Functions

 RnpServerJob () throw ()
 Default constructor. More...
 
void init (RnpBaseServerComm *) throw ()
 
void processRequest () throw ()
 Calls the 'RnpBaseServerComm->processRequest()' and than initiates the transmission. More...
 
- Public Member Functions inherited from akg::NbServerJob
 NbServerJob () throw ()
 Default constructor. More...
 
void initOnAttach (Selector *pselector) throw ()
 
acceptStatus acceptConnection (ListenSocket &listenSocket) throw ()
 
SocketAddress getClientSocketAddress () throw ()
 Returns the SocketAddress of the client. More...
 
HostAddress getClientHostAddress () throw ()
 Returns the HostAddress of the client. More...
 
- Public Member Functions inherited from akg::NbJob
virtual ~NbJob () throw ()
 
workingStatus getStatus () throw ()
 Returns the working status. More...
 
bool isOperationPending () throw ()
 
bool isAccepting () throw ()
 Returns true if the job is ready to accept a connection. More...
 
bool isReading () throw ()
 Returns true if the job is reading data. More...
 
bool isWriting () throw ()
 Returns true if the job is writing data. More...
 
bool isProcessing () throw ()
 Returns true if the job is processing. More...
 
bool readPartialMessage () throw ()
 
bool writePartialMessage () throw ()
 
void clearConnection () throw ()
 Clears the connection - closes the socket and removes it from the Selector. More...
 
int getSocket () throw ()
 Returns the OS file descriptor for the socket. More...
 
int getErrno () throw ()
 Returns the errno of the last socket operation. More...
 
virtual bool cleanUpIfTimeout () throw ()
 

Protected Member Functions

bool validateMessage () throw ()
 (See explanations from NbJob) More...
 
void executeOnAccept () throw ()
 called when client is accepted, default does nothing More...
 
void executeOnWriteReady () throw ()
 called when message is written More...
 
void specificCleanUpOnTimeout () throw ()
 called when timeout, it has to set the status apropriate and do other cleanup More...
 
void executeOnReadError () throw ()
 called when a read error occurs, usual a message and clean up More...
 
void executeOnWriteError () throw ()
 called when a write error occurs, usual a message and clean up More...
 
void resetJob () throw ()
 
- Protected Member Functions inherited from akg::NbServerJob
void readyToWriteAnswer () throw ()
 helper function, call it in "processRequest" to switch to writing More...
 
- Protected Member Functions inherited from akg::NbJob
 NbJob (FileDescriptor &) throw ()
 Protected constructor, taking a FileDescriptor, usually a Socket. More...
 
bool setReading () throw ()
 Helper function for setting the job in read modus. More...
 
bool setWriting () throw ()
 Helper function for setting the job in write modus. More...
 
void action () throw ()
 Helper function which marks the current moment, so timeout counter is reset. More...
 

Protected Attributes

RnpBaseServerCommserverCommPtr
 
RnpReceiver rnpReceiver
 
CommBuffer transmiterBuffer
 
- Protected Attributes inherited from akg::NbServerJob
ServerSocket serverSocket
 
- Protected Attributes inherited from akg::NbJob
workingStatus status
 
FileDescriptorfdRef
 
SelectorselectorPtr
 
CommBuffercurrentBufferPtr
 
time_t lastActionTime
 

Additional Inherited Members

- Public Types inherited from akg::NbJob
enum  acceptStatus { acs_nopending = 0, acs_Iambusy = 1, acs_accepted = 2 }
 Status regarding accepting a new job. More...
 
enum  workingStatus {
  wks_notdefined = 0, wks_accepting = 1, wks_reading = 2, wks_writing = 3,
  wks_processing = 4
}
 Status during the lifetime of a job. More...
 
- Static Public Member Functions inherited from akg::NbJob
static void setCurrentTime () throw ()
 
static void setTimeoutInterval (time_t x) throw ()
 
static time_t getTimeoutInterval () throw ()
 Returns the timeout interval set for the jobs. More...
 
- Static Protected Attributes inherited from akg::NbJob
static time_t timeOutInterv
 
static time_t currentTime
 

Detailed Description

This class represents the RNP server job. It receives the request, sends it to 'RnpBaseServerComm' for processing and gets from there the answer which it transmittes to the client

Constructor & Destructor Documentation

rnp::RnpServerJob::RnpServerJob ( )
throw (
)

Default constructor.

Member Function Documentation

void rnp::RnpServerJob::executeOnAccept ( )
throw (
)
protectedvirtual

called when client is accepted, default does nothing

Reimplemented from akg::NbJob.

void rnp::RnpServerJob::executeOnReadError ( )
throw (
)
protectedvirtual

called when a read error occurs, usual a message and clean up

Implements akg::NbJob.

void rnp::RnpServerJob::executeOnWriteError ( )
throw (
)
protectedvirtual

called when a write error occurs, usual a message and clean up

Implements akg::NbJob.

void rnp::RnpServerJob::executeOnWriteReady ( )
throw (
)
protectedvirtual

called when message is written

Implements akg::NbJob.

void rnp::RnpServerJob::init ( RnpBaseServerComm )
throw (
)

Initialization: it connects to the given 'RnpBaseServerComm' Assert: theServerComm != 0

void rnp::RnpServerJob::processRequest ( )
throw (
)
virtual

Calls the 'RnpBaseServerComm->processRequest()' and than initiates the transmission.

Implements akg::NbJob.

void rnp::RnpServerJob::resetJob ( )
throw (
)
protected
void rnp::RnpServerJob::specificCleanUpOnTimeout ( )
throw (
)
protectedvirtual

called when timeout, it has to set the status apropriate and do other cleanup

Implements akg::NbJob.

bool rnp::RnpServerJob::validateMessage ( )
throw (
)
protectedvirtual

(See explanations from NbJob)

Implements akg::NbJob.

Member Data Documentation

RnpReceiver rnp::RnpServerJob::rnpReceiver
protected
RnpBaseServerComm* rnp::RnpServerJob::serverCommPtr
protected
CommBuffer rnp::RnpServerJob::transmiterBuffer
protected

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