rasdaman complete source
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
ClientComm Class Referenceabstract

#include <clientcomm.hh>

Inheritance diagram for ClientComm:
RnpClientComm RpcClientComm

Public Member Functions

virtual ~ClientComm () throw ()
 destructor (closes the connection and releases resources) More...
 
virtual bool effectivTypeIsRNP ()=0 throw ()
 
virtual unsigned long getClientID () const =0
 provides read access to my clientID More...
 
virtual int openDB (const char *database)=0
 open database More...
 
virtual int closeDB ()=0
 close current database More...
 
virtual int createDB (const char *name)=0 throw (r_Error)
 create a database More...
 
virtual int destroyDB (const char *name)=0 throw (r_Error)
 destroy a database More...
 
virtual int openTA (unsigned short readOnly=0)=0 throw (r_Error)
 begin transaction More...
 
virtual int commitTA ()=0 throw (r_Error)
 commit current transaction More...
 
virtual int abortTA ()=0
 abort current transaction More...
 
virtual void insertMDD (const char *collName, r_GMarray *mar)=0 throw ( r_Error )
 inserts a MDD object in an existing MDD collection on the server More...
 
virtual r_Ref_Any getMDDByOId (const r_OId &oid)=0 throw ( r_Error )
 gets MDD object by oid More...
 
virtual void insertColl (const char *collName, const char *typeName, const r_OId &oid)=0 throw ( r_Error )
 creates an empty MDD collection on the server More...
 
virtual void deleteCollByName (const char *collName)=0 throw ( r_Error )
 deletes an MDD collection by name More...
 
virtual void deleteObjByOId (const r_OId &oid)=0 throw ( r_Error )
 deletes an object by oid (right now, objects are collection only) More...
 
virtual void removeObjFromColl (const char *name, const r_OId &oid)=0 throw ( r_Error )
 removes an object from a collection More...
 
virtual r_Ref_Any getCollByName (const char *name)=0 throw ( r_Error )
 gets collection by name More...
 
virtual r_Ref_Any getCollByOId (const r_OId &oid)=0 throw ( r_Error )
 gets collection by oid More...
 
virtual r_Ref_Any getCollOIdsByName (const char *name)=0 throw ( r_Error )
 gets collection references by name More...
 
virtual r_Ref_Any getCollOIdsByOId (const r_OId &oid)=0 throw ( r_Error )
 gets collection references by oid More...
 
virtual void executeQuery (const r_OQL_Query &query, r_Set< r_Ref_Any > &result)=0 throw ( r_Error )
 query execution More...
 
virtual void executeQuery (const r_OQL_Query &query)=0 throw ( r_Error )
 update execution More...
 
virtual void triggerAliveSignal ()=0
 triggers an alive signal More...
 
virtual void sendAliveSignal ()=0
 send an alive signal if necessary and possible More...
 
virtual int setTransferFormat (r_Data_Format format, const char *formatParams=NULL)=0
 set the preferred transfer format More...
 
virtual int setStorageFormat (r_Data_Format format, const char *formatParams=NULL)=0
 set the preferred storage format More...
 
virtual const char * getExtendedErrorInfo ()=0 throw (r_Error)
 get extended error information More...
 
const char * getServerName ()
 get real server name (the dinamic one, assigned by the RasMGR) More...
 
virtual void setUserIdentification (const char *userName, const char *plainTextPassword)=0
 user identification for RasMGR More...
 
virtual void setMaxRetry (unsigned int newMaxRetry)=0
 set maximum retry to get a server More...
 
virtual unsigned int getMaxRetry ()=0
 get maximum retry to get a server More...
 
virtual void setTimeoutInterval (int seconds)=0
 set and get communication timeout interval. Only RNP really uses it More...
 
virtual int getTimeoutInterval ()=0
 

Static Public Member Functions

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

 ClientComm () throw ( r_Error )
 constructor getting nothing More...
 
enum  r_Type_Type { r_SetType_Type = 1, r_MDDType_Type = 2 }
 
virtual r_OId getNewOId (unsigned short objType)=0 throw (r_Error)
 get new oid More...
 
virtual unsigned short getObjectType (const r_OId &oid)=0 throw (r_Error)
 get oid type More...
 
virtual char * getTypeStructure (const char *typeName, r_Type_Type typeType)=0 throw (r_Error)
 get type structure deallocate using delete [] More...
 

Member Enumeration Documentation

Enumerator
r_SetType_Type 
r_MDDType_Type 

Constructor & Destructor Documentation

virtual ClientComm::~ClientComm ( )
throw (
)
virtual

destructor (closes the connection and releases resources)

ClientComm::ClientComm ( )
throw (r_Error
)
protected

constructor getting nothing

Member Function Documentation

virtual int ClientComm::abortTA ( )
pure virtual

abort current transaction

Implemented in RpcClientComm, and RnpClientComm.

static int ClientComm::changeEndianness ( r_GMarray mdd,
const r_Base_Type bt = NULL 
)
static

changes endianness of MDD data

static int ClientComm::changeEndianness ( const r_GMarray mdd,
void *  newData,
const r_Base_Type bt = NULL 
)
static

changes the endianness of MDD data and keeps the original untouched

virtual int ClientComm::closeDB ( )
pure virtual

close current database

Implemented in RpcClientComm, and RnpClientComm.

virtual int ClientComm::commitTA ( )
throw (r_Error
)
pure virtual

commit current transaction

Implemented in RpcClientComm, and RnpClientComm.

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

create a database

Implemented in RpcClientComm, and RnpClientComm.

static ClientComm* ClientComm::createObject ( const char *  rasmgrName,
int  rasmgrPort 
)
static
virtual void ClientComm::deleteCollByName ( const char *  collName)
throw (r_Error
)
pure virtual

deletes an MDD collection by name

Implemented in RpcClientComm, and RnpClientComm.

virtual void ClientComm::deleteObjByOId ( const r_OId oid)
throw (r_Error
)
pure virtual

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

Implemented in RpcClientComm, and RnpClientComm.

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

destroy a database

Implemented in RpcClientComm, and RnpClientComm.

virtual bool ClientComm::effectivTypeIsRNP ( )
throw (
)
pure virtual

Implemented in RpcClientComm, and RnpClientComm.

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

query execution

Implemented in RpcClientComm, and RnpClientComm.

virtual void ClientComm::executeQuery ( const r_OQL_Query query)
throw (r_Error
)
pure virtual

update execution

Implemented in RpcClientComm, and RnpClientComm.

virtual unsigned long ClientComm::getClientID ( ) const
pure virtual

provides read access to my clientID

Implemented in RpcClientComm, and RnpClientComm.

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

gets collection by name

Implemented in RpcClientComm, and RnpClientComm.

virtual r_Ref_Any ClientComm::getCollByOId ( const r_OId oid)
throw (r_Error
)
pure virtual

gets collection by oid

Implemented in RpcClientComm, and RnpClientComm.

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

gets collection references by name

Implemented in RpcClientComm, and RnpClientComm.

virtual r_Ref_Any ClientComm::getCollOIdsByOId ( const r_OId oid)
throw (r_Error
)
pure virtual

gets collection references by oid

Implemented in RpcClientComm, and RnpClientComm.

virtual const char* ClientComm::getExtendedErrorInfo ( )
throw (r_Error
)
pure virtual

get extended error information

Implemented in RpcClientComm, and RnpClientComm.

virtual unsigned int ClientComm::getMaxRetry ( )
pure virtual

get maximum retry to get a server

Implemented in RpcClientComm, and RnpClientComm.

virtual r_Ref_Any ClientComm::getMDDByOId ( const r_OId oid)
throw (r_Error
)
pure virtual

gets MDD object by oid

Implemented in RpcClientComm, and RnpClientComm.

virtual r_OId ClientComm::getNewOId ( unsigned short  objType)
throw (r_Error
)
pure virtual

get new oid

Implemented in RpcClientComm, and RnpClientComm.

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

get oid type

Implemented in RpcClientComm, and RnpClientComm.

const char* ClientComm::getServerName ( )

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

virtual int ClientComm::getTimeoutInterval ( )
pure virtual

Implemented in RpcClientComm, and RnpClientComm.

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

get type structure deallocate using delete []

Implemented in RpcClientComm, and RnpClientComm.

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

creates an empty MDD collection on the server

Implemented in RpcClientComm, and RnpClientComm.

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

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

Implemented in RpcClientComm, and RnpClientComm.

static bool ClientComm::internalSettingIsRNP ( )
throw (
)
static
virtual int ClientComm::openDB ( const char *  database)
pure virtual

open database

Implemented in RpcClientComm, and RnpClientComm.

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

begin transaction

Implemented in RpcClientComm, and RnpClientComm.

virtual void ClientComm::removeObjFromColl ( const char *  name,
const r_OId oid 
)
throw (r_Error
)
pure virtual

removes an object from a collection

Implemented in RpcClientComm, and RnpClientComm.

virtual void ClientComm::sendAliveSignal ( )
pure 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.

Implemented in RpcClientComm, and RnpClientComm.

virtual void ClientComm::setMaxRetry ( unsigned int  newMaxRetry)
pure virtual

set maximum retry to get a server

Implemented in RpcClientComm, and RnpClientComm.

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

set the preferred storage format

Implemented in RpcClientComm, and RnpClientComm.

virtual void ClientComm::setTimeoutInterval ( int  seconds)
pure virtual

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

Implemented in RpcClientComm, and RnpClientComm.

virtual int ClientComm::setTransferFormat ( r_Data_Format  format,
const char *  formatParams = NULL 
)
pure 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.

Implemented in RpcClientComm, and RnpClientComm.

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

user identification for RasMGR

Implemented in RpcClientComm, and RnpClientComm.

virtual void ClientComm::triggerAliveSignal ( )
pure virtual

triggers an alive signal

Implemented in RpcClientComm, and RnpClientComm.

static void ClientComm::useRNP ( )
throw (
)
static

Methods for setting the protocol. Default will be RNP, but until release 5.2 it is RPC, unless you compile with -DDEFAULTRNP Also, if the environment variable RMANPROTOCOL is set, it's value is used to set the protocol and the 'in-code' setting is ignored RMANPROTOCOL can be:

  • RNP -> RNP is used
  • COMPAT -> raslib uses RPC, rasj uses HTTP
  • RPC -> raslib uses RPC, rasj uses RNP
  • HTTP -> raslib uses RNP, rasj uses HTTP every other value is ignored and the 'in-code' setting is used

NOTE: This methods will be removed in the next version

static void ClientComm::useRPC ( )
throw (
)
static

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