rasdaman complete source
Public Member Functions | List of all members
RpcClientComm Class Reference

#include <rpcclientcomm.hh>

Inheritance diagram for RpcClientComm:
ClientComm

Public Member Functions

 RpcClientComm (const char *rasmgrHost, int rasmgrPort=RASMGRPORT) throw ( r_Error )
 constructor getting the host name of the rasmgr host and it's listening port (default 7001). More...
 
 ~RpcClientComm () throw ()
 destructor (closes the connection and releases resources) More...
 
bool effectivTypeIsRNP () throw ()
 
unsigned long getClientID () const
 provides read access to my clientID More...
 
CLIENT * getBindingHandle () const
 provides read access to my binding handle More...
 
void setTimeoutInterval (int seconds)
 set and get communication timeout interval. Only RNP really uses it More...
 
int getTimeoutInterval ()
 
int openDB (const char *database)
 open database More...
 
int closeDB ()
 close current database More...
 
int createDB (const char *name) throw (r_Error)
 create a database More...
 
int destroyDB (const char *name) throw (r_Error)
 destroy a database More...
 
int openTA (unsigned short readOnly=0) throw (r_Error)
 begin transaction More...
 
int commitTA () throw (r_Error)
 commit current transaction More...
 
int abortTA ()
 abort current transaction More...
 
void insertMDD (const char *collName, r_GMarray *mar) throw ( r_Error )
 inserts a MDD object in an existing MDD collection on the server More...
 
r_Ref_Any getMDDByOId (const r_OId &oid) throw ( r_Error )
 gets MDD object by oid More...
 
void insertColl (const char *collName, const char *typeName, const r_OId &oid) throw ( r_Error )
 creates an empty MDD collection on the server More...
 
void deleteCollByName (const char *collName) throw ( r_Error )
 deletes an MDD collection by name More...
 
void deleteObjByOId (const r_OId &oid) throw ( r_Error )
 deletes an object by oid (right now, objects are collection only) More...
 
void removeObjFromColl (const char *name, const r_OId &oid) throw ( r_Error )
 removes an object from a collection More...
 
r_Ref_Any getCollByName (const char *name) throw ( r_Error )
 gets collection by name More...
 
r_Ref_Any getCollByOId (const r_OId &oid) throw ( r_Error )
 gets collection by oid More...
 
r_Ref_Any getCollOIdsByName (const char *name) throw ( r_Error )
 gets collection references by name More...
 
r_Ref_Any getCollOIdsByOId (const r_OId &oid) throw ( r_Error )
 gets collection references by oid More...
 
void executeQuery (const r_OQL_Query &query, r_Set< r_Ref_Any > &result) throw ( r_Error )
 query execution More...
 
void executeQuery (const r_OQL_Query &query) throw ( r_Error )
 update execution More...
 
r_OId getNewOId (unsigned short objType) throw (r_Error)
 get new oid More...
 
unsigned short getObjectType (const r_OId &oid) throw (r_Error)
 get oid type More...
 
char * getTypeStructure (const char *typeName, r_Type_Type typeType) throw (r_Error)
 get type structure dallocate using delete [] More...
 
void triggerAliveSignal ()
 triggers an alive signal More...
 
void sendAliveSignal ()
 send an alive signal if necessary and possible More...
 
int setTransferFormat (r_Data_Format format, const char *formatParams=NULL)
 set the preferred transfer format More...
 
int writeWholeMessage (int socket, char *destBuffer, int buffSize)
 
int readWholeMessage (int socket, char *destBuffer, int buffSize)
 
int setStorageFormat (r_Data_Format format, const char *formatParams=NULL)
 set the preferred storage format More...
 
void setRPCActive ()
 sets a mutex for RPC More...
 
void setRPCInactive ()
 frees the mutex for RPC and calls sendAliveSignal() for sending remaining signals More...
 
int checkRPCActive ()
 checks if an RPC is active More...
 
const char * getExtendedErrorInfo () throw (r_Error)
 get extended error information More...
 
const char * getServerName ()
 get real server name (the dinamic one, assigned by the RasMGR) More...
 
void setUserIdentification (const char *userName, const char *plainTextPassword)
 user identification for RasMGR More...
 
void setMaxRetry (unsigned int newMaxRetry)
 set maximum retry to get a server More...
 
unsigned int getMaxRetry ()
 get maximum retry to get a server More...
 
- Public Member Functions inherited from ClientComm
virtual ~ClientComm () throw ()
 destructor (closes the connection and releases resources) More...
 
const char * getServerName ()
 get real server name (the dinamic one, assigned by the RasMGR) More...
 

Additional Inherited Members

- Public Types inherited from ClientComm
enum  r_Type_Type { r_SetType_Type = 1, r_MDDType_Type = 2 }
 
- Static Public Member Functions inherited from ClientComm
static ClientCommcreateObject (const char *rasmgrName, int rasmgrPort)
 
static void useRNP () throw ()
 
static void useRPC () throw ()
 
static bool internalSettingIsRNP () throw ()
 
static int changeEndianness (r_GMarray *mdd, const r_Base_Type *bt=NULL)
 changes endianness of MDD data More...
 
static int changeEndianness (const r_GMarray *mdd, void *newData, const r_Base_Type *bt=NULL)
 changes the endianness of MDD data and keeps the original untouched More...
 
- Protected Member Functions inherited from ClientComm
 ClientComm () throw ( r_Error )
 constructor getting nothing More...
 

Constructor & Destructor Documentation

RpcClientComm::RpcClientComm ( const char *  rasmgrHost,
int  rasmgrPort = RASMGRPORT 
)
throw (r_Error
)

constructor getting the host name of the rasmgr host and it's listening port (default 7001).

RpcClientComm::~RpcClientComm ( )
throw (
)

destructor (closes the connection and releases resources)

Member Function Documentation

int RpcClientComm::abortTA ( )
virtual

abort current transaction

Implements ClientComm.

int RpcClientComm::checkRPCActive ( )

checks if an RPC is active

int RpcClientComm::closeDB ( )
virtual

close current database

Implements ClientComm.

int RpcClientComm::commitTA ( )
throw (r_Error
)
virtual

commit current transaction

Implements ClientComm.

int RpcClientComm::createDB ( const char *  name)
throw (r_Error
)
virtual

create a database

Implements ClientComm.

void RpcClientComm::deleteCollByName ( const char *  collName)
throw (r_Error
)
virtual

deletes an MDD collection by name

Implements ClientComm.

void RpcClientComm::deleteObjByOId ( const r_OId oid)
throw (r_Error
)
virtual

deletes an object by oid (right now, objects are collection only)

Implements ClientComm.

int RpcClientComm::destroyDB ( const char *  name)
throw (r_Error
)
virtual

destroy a database

Implements ClientComm.

bool RpcClientComm::effectivTypeIsRNP ( )
throw (
)
virtual

Implements ClientComm.

void RpcClientComm::executeQuery ( const r_OQL_Query query,
r_Set< r_Ref_Any > &  result 
)
throw (r_Error
)
virtual

query execution

Implements ClientComm.

void RpcClientComm::executeQuery ( const r_OQL_Query query)
throw (r_Error
)
virtual

update execution

Implements ClientComm.

CLIENT* RpcClientComm::getBindingHandle ( ) const
inline

provides read access to my binding handle

unsigned long RpcClientComm::getClientID ( ) const
inlinevirtual

provides read access to my clientID

Implements ClientComm.

r_Ref_Any RpcClientComm::getCollByName ( const char *  name)
throw (r_Error
)
virtual

gets collection by name

Implements ClientComm.

r_Ref_Any RpcClientComm::getCollByOId ( const r_OId oid)
throw (r_Error
)
virtual

gets collection by oid

Implements ClientComm.

r_Ref_Any RpcClientComm::getCollOIdsByName ( const char *  name)
throw (r_Error
)
virtual

gets collection references by name

Implements ClientComm.

r_Ref_Any RpcClientComm::getCollOIdsByOId ( const r_OId oid)
throw (r_Error
)
virtual

gets collection references by oid

Implements ClientComm.

const char* RpcClientComm::getExtendedErrorInfo ( )
throw (r_Error
)
virtual

get extended error information

Implements ClientComm.

unsigned int RpcClientComm::getMaxRetry ( )
virtual

get maximum retry to get a server

Implements ClientComm.

r_Ref_Any RpcClientComm::getMDDByOId ( const r_OId oid)
throw (r_Error
)
virtual

gets MDD object by oid

Implements ClientComm.

r_OId RpcClientComm::getNewOId ( unsigned short  objType)
throw (r_Error
)
virtual

get new oid

Implements ClientComm.

unsigned short RpcClientComm::getObjectType ( const r_OId oid)
throw (r_Error
)
virtual

get oid type

Implements ClientComm.

const char* RpcClientComm::getServerName ( )

get real server name (the dinamic one, assigned by the RasMGR)

int RpcClientComm::getTimeoutInterval ( )
virtual

Implements ClientComm.

char* RpcClientComm::getTypeStructure ( const char *  typeName,
r_Type_Type  typeType 
)
throw (r_Error
)
virtual

get type structure dallocate using delete []

Implements ClientComm.

void RpcClientComm::insertColl ( const char *  collName,
const char *  typeName,
const r_OId oid 
)
throw (r_Error
)
virtual

creates an empty MDD collection on the server

Implements ClientComm.

void RpcClientComm::insertMDD ( const char *  collName,
r_GMarray mar 
)
throw (r_Error
)
virtual

inserts a MDD object in an existing MDD collection on the server

Implements ClientComm.

int RpcClientComm::openDB ( const char *  database)
virtual

open database

Implements ClientComm.

int RpcClientComm::openTA ( unsigned short  readOnly = 0)
throw (r_Error
)
virtual

begin transaction

Implements ClientComm.

int RpcClientComm::readWholeMessage ( int  socket,
char *  destBuffer,
int  buffSize 
)
void RpcClientComm::removeObjFromColl ( const char *  name,
const r_OId oid 
)
throw (r_Error
)
virtual

removes an object from a collection

Implements ClientComm.

void RpcClientComm::sendAliveSignal ( )
virtual

send an alive signal if necessary and possible

First, it sets the switch { aliveSignalRemaining} saying that an alive signal should be send to the server. Then it calls { sendAliveSignal()} to send it immediately if possible.

Implements ClientComm.

void RpcClientComm::setMaxRetry ( unsigned int  newMaxRetry)
virtual

set maximum retry to get a server

Implements ClientComm.

void RpcClientComm::setRPCActive ( )

sets a mutex for RPC

void RpcClientComm::setRPCInactive ( )

frees the mutex for RPC and calls sendAliveSignal() for sending remaining signals

int RpcClientComm::setStorageFormat ( r_Data_Format  format,
const char *  formatParams = NULL 
)
virtual

set the preferred storage format

Implements ClientComm.

void RpcClientComm::setTimeoutInterval ( int  seconds)
virtual

set and get communication timeout interval. Only RNP really uses it

Implements ClientComm.

int RpcClientComm::setTransferFormat ( r_Data_Format  format,
const char *  formatParams = NULL 
)
virtual

set the preferred transfer format

Sends an alive signal to the server if the switch { aliveSignalRemaining} is set and no other RPC is active. If a signal can be sent, { aliveSignalRemaining} is set to 0 again.

Implements ClientComm.

void RpcClientComm::setUserIdentification ( const char *  userName,
const char *  plainTextPassword 
)
virtual

user identification for RasMGR

Implements ClientComm.

void RpcClientComm::triggerAliveSignal ( )
virtual

triggers an alive signal

Implements ClientComm.

int RpcClientComm::writeWholeMessage ( int  socket,
char *  destBuffer,
int  buffSize 
)

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