rasdaman complete source
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
RasServerEntry Class Reference

#include <rasserver_entry.hh>

Inheritance diagram for RasServerEntry:
HttpServer ServerComm

Public Member Functions

 ~RasServerEntry ()
 
void startRpcServer () throw ( r_Error )
 forces the server to listen for client calls More...
 
void stopRpcServer ()
 stops the server More...
 
void compat_connectToDBMS () throw ( r_Error )
 
void compat_connectNewClient (const char *capability)
 
ClientTblElt * getClientContext (unsigned long ClientId)
 returns a pointer to the context of the calling client, 0 it there is no context More...
 
void compat_disconnectClient ()
 
void compat_openDB (const char *databaseName)
 
void compat_closeDB ()
 
void compat_beginTA (bool rw)
 
void compat_commitTA ()
 
void compat_abortTA ()
 
bool compat_isOpenTA ()
 
int compat_executeQueryHttp (const char *httpParams, int httpParamsLen, char *&resultBuffer)
 
r_OId compat_getNewOId (unsigned short objType)
 
int compat_executeQueryRpc (const char *query, ExecuteQueryRes &queryResult)
 
int compat_getNextElement (char *&buffer, unsigned int &bufferSize)
 
int compat_endTransfer ()
 
int compat_getNextMDD (r_Minterval &mddDomain, char *&typeName, char *&typeStructure, r_OId &oid, unsigned short &currentFormat)
 
int compat_getNextTile (RPCMarray **rpcMarray)
 
int compat_ExecuteUpdateQuery (const char *query, ExecuteUpdateRes &returnStructure)
 
int compat_InitUpdate ()
 
int compat_StartInsertTransMDD (const char *domain, int typeLength, const char *typeName)
 
int compat_InsertTile (int persistent, RPCMarray *)
 
int compat_EndInsertMDD (int persistent)
 
int compat_GetTypeStructure (const char *typeName, int typeType, char *&typeStructure)
 
int compat_StartInsertPersMDD (const char *collName, r_Minterval &mddDomain, int typeLength, const char *typeName, r_OId &oid)
 
int compat_InsertMDD (const char *collName, RPCMarray *rpcMarray, const char *typeName, r_OId &oid)
 
int compat_InsertCollection (const char *collName, const char *typeName, r_OId &oid)
 
int compat_DeleteCollByName (const char *collName)
 
int compat_DeleteObjByOId (r_OId &oid)
 
int compat_RemoveObjFromColl (const char *collName, r_OId &oid)
 
int compat_GetCollectionByName (const char *collName, char *&typeName, char *&typeStructure, r_OId &oid)
 
int compat_GetCollectionByName (r_OId oid, char *&typeName, char *&typeStructure, char *&collName)
 
int compat_GetCollectionOidsByName (const char *collName, char *&typeName, char *&typeStructure, r_OId &oid, RPCOIdEntry *&oidTable, unsigned int &oidTableSize)
 
int compat_GetCollectionOidsByOId (r_OId oid, char *&typeName, char *&typeStructure, RPCOIdEntry *&oidTable, unsigned int &oidTableSize, char *&collName)
 
int compat_GetObjectType (r_OId &oid, unsigned short &objType)
 
int compat_SetTransferFormat (int format, const char *params)
 
int compat_SetStorageFormat (int format, const char *params)
 
r_OId createCollection (const char *collName, const char *collTypeName)
 
r_OId createMDD (const char *collName, const char *mddTypeName, const char *definitionDomain, const char *tileDomain, bool rcindex)
 
void extendMDD (r_OId mddOId, const char *stripeDomain, const char *tileDomain)
 
vector< r_MintervalgetTileDomains (r_OId mddOId, const char *stripeDomain)
 
- Public Member Functions inherited from HttpServer
 HttpServer ()
 default constructor More...
 
 HttpServer (unsigned long timeOut, unsigned long managementInterval, unsigned long listenPort, char *rasmgrHost, unsigned int rasmgrPort, char *serverName)
 
virtual ~HttpServer ()
 destructor More...
 
virtual void printServerStatus (ostream &s=cout)
 print server status to { s} More...
 
virtual long processRequest (unsigned long callingClientId, char *baseName, int rascommand, char *query, int binDataSize, char *binData, int Endianess, char *&result, char *capability)
 Executes a retrieval query and prepare the result for HTTP transer. More...
 
- Public Member Functions inherited from ServerComm
 ServerComm ()
 default constructor More...
 
 ServerComm (unsigned long timeOut, unsigned long managementInterval, unsigned long listenPort, char *rasmgrHost, unsigned int rasmgrPort, char *serverName)
 constructor getting the client time out and the time interval for management routines, together with listen port, rasmgr host and port and the server name More...
 
virtual ~ServerComm ()
 destructor More...
 
void informRasMGR (int)
 
void addClientTblEntry (ClientTblElt *context) throw ( r_Error )
 adds an entry to the client table (used in RasServerEntry) More...
 
unsigned short deleteClientTblEntry (unsigned long ClientId)
 deletes an entry of the client table (must be public because it is used in the global garbage collection function) More...
 
void abortEveryThingNow ()
 
virtual void getServerStatus (ServerStatRes &returnStruct)
 get server status More...
 
const char * getExtendedErrorInfo ()
 
void setExtendedErrorInfo (const char *)
 
void clearExtendedErrorInfo ()
 
void clientEndRequest ()
 
virtual unsigned short aliveSignal (unsigned long client)
 process the client's alive signal More...
 
virtual unsigned short openDB (unsigned long callingClientId, const char *dbName, const char *userName)
 open database More...
 
virtual unsigned short closeDB (unsigned long callingClientId)
 close current database More...
 
virtual unsigned short createDB (char *name)
 create a database More...
 
virtual unsigned short destroyDB (char *name)
 destroy a database More...
 
virtual unsigned short beginTA (unsigned long callingClientId, unsigned short readOnly=0)
 open transaction More...
 
virtual unsigned short commitTA (unsigned long callingClientId)
 commit current transaction More...
 
virtual unsigned short abortTA (unsigned long callingClientId)
 abort current transaction More...
 
virtual bool isTAOpen (unsigned long callingClientId)
 is transaction open currently? More...
 
virtual unsigned short executeQuery (unsigned long callingClientId, const char *query, ExecuteQueryRes &returnStructure)
 executes a retrieval query and prepares the result for transfer with {getNextMDD}. More...
 
virtual unsigned short getNextMDD (unsigned long callingClientId, r_Minterval &mddDomain, char *&typeName, char *&typeStructure, r_OId &oid, unsigned short &currentFormat)
 get the domain of the next MDD of the actual transfer collection More...
 
virtual unsigned short getNextElement (unsigned long callingClientId, char *&buffer, unsigned int &bufferSize)
 get the next scalar element in the actual transfer collection. More...
 
virtual unsigned short getMDDByOId (unsigned long callingClientId, r_OId &oid, r_Minterval &mddDomain, char *&typeName, char *&typeStructure, unsigned short &currentFormat)
 get an MDD by OId More...
 
virtual unsigned short getNextTile (unsigned long callingClientId, RPCMarray **rpcMarray)
 get next tile of the actual MDD of the actual transfer collection More...
 
virtual unsigned short endTransfer (unsigned long client)
 process the client's alive signal More...
 
virtual unsigned short initExecuteUpdate (unsigned long callingClientId)
 prepares transfer of MDD constants and execution of update query More...
 
virtual unsigned short executeUpdate (unsigned long callingClientId, const char *query, ExecuteUpdateRes &returnStructure)
 executes an update query More...
 
virtual unsigned short startInsertTransMDD (unsigned long callingClientId, r_Minterval &domain, unsigned long typeLength, const char *typeName)
 prepares an MDD (transient) for transfer of tiles More...
 
virtual unsigned short startInsertPersMDD (unsigned long callingClientId, const char *collName, r_Minterval &domain, unsigned long typeLength, const char *typeName, r_OId &oid)
 create a new persistent MDD object for tile based transfers More...
 
virtual unsigned short insertTile (unsigned long callingClientId, int isPersistent, RPCMarray *rpcMarray)
 insert a tile into a persistent MDD object More...
 
virtual unsigned short insertTileSplitted (unsigned long callingClientId, int isPersistent, RPCMarray *rpcMarray, r_Minterval *tileSize)
 
virtual unsigned short endInsertMDD (unsigned long callingClientId, int isPersistent)
 finnishes the MDD creation and inserts the MDD into the collection More...
 
virtual unsigned short insertMDD (unsigned long callingClientId, const char *collName, RPCMarray *rpcMarray, const char *typeName, r_OId &oid)
 insert object into collection More...
 
virtual unsigned short getCollByName (unsigned long callingClientId, const char *collName, char *&typeName, char *&typeStructure, r_OId &oid)
 prepare an MDD collection for transfer with getNextMDD() More...
 
virtual unsigned short getCollByOId (unsigned long callingClientId, r_OId &oid, char *&typeName, char *&typeStructure, char *&collName)
 prepare an MDD collection for transfer with getNextMDD() More...
 
virtual unsigned short getCollOIdsByName (unsigned long callingClientId, const char *collName, char *&typeName, char *&typeStructure, r_OId &oid, RPCOIdEntry *&oidTable, unsigned int &oidTableSize)
 gets oids of the collection specified by name More...
 
virtual unsigned short getCollOIdsByOId (unsigned long callingClientId, r_OId &oid, char *&typeName, char *&typeStructure, RPCOIdEntry *&oidTable, unsigned int &oidTableSize, char *&collName)
 gets oids of the collection specified by name More...
 
virtual unsigned short insertColl (unsigned long callingClientId, const char *collName, const char *typeName, r_OId &oid)
 create new MDD collection More...
 
virtual unsigned short deleteCollByName (unsigned long callingClientId, const char *collName)
 delete MDD collection More...
 
virtual unsigned short deleteObjByOId (unsigned long callingClientId, r_OId &oid)
 delete object by oid More...
 
virtual unsigned short removeObjFromColl (unsigned long callingClientId, const char *collName, r_OId &oid)
 remove object specified by oid from collection specified by name More...
 
virtual unsigned short getNewOId (unsigned long callingClientId, unsigned short objType, r_OId &oid)
 get new object identifier More...
 
virtual unsigned short getObjectType (unsigned long callingClientId, r_OId &oid, unsigned short &objType)
 get type of object by oid More...
 
virtual unsigned short getTypeStructure (unsigned long callingClientId, const char *typeName, unsigned short typeType, char *&typeStructure)
 get type structure of a type name More...
 
virtual unsigned short setTransferMode (unsigned long callingClientId, unsigned short format, const char *formatParams)
 set the data format used for transferring data to the client More...
 
virtual unsigned short setStorageMode (unsigned long callingClientId, unsigned short format, const char *formatParams)
 set the data format for storing data into the database More...
 

Static Public Member Functions

static RasServerEntrygetInstance ()
 

Public Attributes

unsigned long currentClientIdx
 
ClientTblElt * currentClientContext
 
- Public Attributes inherited from ServerComm
const unsigned long clientTimeout
 inactivity timeout in seconds after which pending client data is deleted More...
 
const unsigned long garbageCollectionInterval
 do a garbage collection every { garbageCollectionInterval} seconds (ONC RPC only) More...
 
unsigned long transactionActive
 flag for active o2 transaction (stores the clientID of the owner of the active transaction, or 0 if none open) More...
 
long memUsed
 memory used by malloc in ordinary blocks (set in dumpClientTable) More...
 
CallBackManager callback_mgr
 

Additional Inherited Members

- Static Public Attributes inherited from HttpServer
static HttpServeractual_httpserver
 stores a pointer to the actual servercomm object, only one can exist at a time More...
 
- Static Public Attributes inherited from ServerComm
static std::list< ClientTblElt * > clientTbl
 the client table which holds information about the calling clients More...
 
static unsigned long clientCount
 last used client ID (this is increased by one to get the clientId for the next client) More...
 
static ServerCommactual_servercomm
 stores a pointer to the actual servercomm object, only one can exist at a time More...
 
static const char * HTTPCLIENT
 
- Static Protected Member Functions inherited from ServerComm
static int ensureTileFormat (r_Data_Format &hasFmt, r_Data_Format needFmt, const r_Minterval &dom, const BaseType *type, char *&data, unsigned long &size, int repack, int owner, const char *params=NULL)
 make sure a tile has the correct data format, converting if necessary More...
 
- Protected Attributes inherited from ServerComm
AdminIfadmin
 pointer to the actual administration interface object More...
 
char * errorText
 
unsigned long listenPort
 
char * rasmgrHost
 
unsigned int rasmgrPort
 
char * serverName
 
bool isHttpServer
 
- Static Protected Attributes inherited from ServerComm
static const int ENSURE_TILE_FORMAT_OK
 returns the following: More...
 
static const int ENSURE_TILE_FORMAT_BAD
 

Constructor & Destructor Documentation

RasServerEntry::~RasServerEntry ( )

Member Function Documentation

void RasServerEntry::compat_abortTA ( )
void RasServerEntry::compat_beginTA ( bool  rw)
void RasServerEntry::compat_closeDB ( )
void RasServerEntry::compat_commitTA ( )
void RasServerEntry::compat_connectNewClient ( const char *  capability)
void RasServerEntry::compat_connectToDBMS ( )
throw (r_Error
)
int RasServerEntry::compat_DeleteCollByName ( const char *  collName)
int RasServerEntry::compat_DeleteObjByOId ( r_OId oid)
void RasServerEntry::compat_disconnectClient ( )
int RasServerEntry::compat_EndInsertMDD ( int  persistent)
int RasServerEntry::compat_endTransfer ( )
int RasServerEntry::compat_executeQueryHttp ( const char *  httpParams,
int  httpParamsLen,
char *&  resultBuffer 
)
int RasServerEntry::compat_executeQueryRpc ( const char *  query,
ExecuteQueryRes queryResult 
)
int RasServerEntry::compat_ExecuteUpdateQuery ( const char *  query,
ExecuteUpdateRes returnStructure 
)
int RasServerEntry::compat_GetCollectionByName ( const char *  collName,
char *&  typeName,
char *&  typeStructure,
r_OId oid 
)
int RasServerEntry::compat_GetCollectionByName ( r_OId  oid,
char *&  typeName,
char *&  typeStructure,
char *&  collName 
)
int RasServerEntry::compat_GetCollectionOidsByName ( const char *  collName,
char *&  typeName,
char *&  typeStructure,
r_OId oid,
RPCOIdEntry *&  oidTable,
unsigned int &  oidTableSize 
)
int RasServerEntry::compat_GetCollectionOidsByOId ( r_OId  oid,
char *&  typeName,
char *&  typeStructure,
RPCOIdEntry *&  oidTable,
unsigned int &  oidTableSize,
char *&  collName 
)
r_OId RasServerEntry::compat_getNewOId ( unsigned short  objType)
int RasServerEntry::compat_getNextElement ( char *&  buffer,
unsigned int &  bufferSize 
)
int RasServerEntry::compat_getNextMDD ( r_Minterval mddDomain,
char *&  typeName,
char *&  typeStructure,
r_OId oid,
unsigned short &  currentFormat 
)
int RasServerEntry::compat_getNextTile ( RPCMarray **  rpcMarray)
int RasServerEntry::compat_GetObjectType ( r_OId oid,
unsigned short &  objType 
)
int RasServerEntry::compat_GetTypeStructure ( const char *  typeName,
int  typeType,
char *&  typeStructure 
)
int RasServerEntry::compat_InitUpdate ( )
int RasServerEntry::compat_InsertCollection ( const char *  collName,
const char *  typeName,
r_OId oid 
)
int RasServerEntry::compat_InsertMDD ( const char *  collName,
RPCMarray rpcMarray,
const char *  typeName,
r_OId oid 
)
int RasServerEntry::compat_InsertTile ( int  persistent,
RPCMarray  
)
bool RasServerEntry::compat_isOpenTA ( )
void RasServerEntry::compat_openDB ( const char *  databaseName)
int RasServerEntry::compat_RemoveObjFromColl ( const char *  collName,
r_OId oid 
)
int RasServerEntry::compat_SetStorageFormat ( int  format,
const char *  params 
)
int RasServerEntry::compat_SetTransferFormat ( int  format,
const char *  params 
)
int RasServerEntry::compat_StartInsertPersMDD ( const char *  collName,
r_Minterval mddDomain,
int  typeLength,
const char *  typeName,
r_OId oid 
)
int RasServerEntry::compat_StartInsertTransMDD ( const char *  domain,
int  typeLength,
const char *  typeName 
)
r_OId RasServerEntry::createCollection ( const char *  collName,
const char *  collTypeName 
)
r_OId RasServerEntry::createMDD ( const char *  collName,
const char *  mddTypeName,
const char *  definitionDomain,
const char *  tileDomain,
bool  rcindex 
)
void RasServerEntry::extendMDD ( r_OId  mddOId,
const char *  stripeDomain,
const char *  tileDomain 
)
ClientTblElt* RasServerEntry::getClientContext ( unsigned long  ClientId)
virtual

returns a pointer to the context of the calling client, 0 it there is no context

Executes a query and prepares the complete result for transfer via HTTP. The length of the result is returned. The first parameter is the unique client id for which the query should be executed. The second parameter The third parameter is the query itself represented as a string. { result} will contain a pointer to the result as needed for HTTP transfer. This pointer has to be freed by the caller using free.

Return values on Error: {tabular}{lll} -1 && parse errror\ -2 && execution error\ -3 && unknown error\ {tabular}

Question: How to transfer the result?

Reimplemented from HttpServer.

static RasServerEntry& RasServerEntry::getInstance ( )
static
vector<r_Minterval> RasServerEntry::getTileDomains ( r_OId  mddOId,
const char *  stripeDomain 
)
void RasServerEntry::startRpcServer ( )
throw (r_Error
)
virtual

forces the server to listen for client calls

Reimplemented from HttpServer.

void RasServerEntry::stopRpcServer ( )
virtual

stops the server

Reimplemented from HttpServer.

Member Data Documentation

ClientTblElt* RasServerEntry::currentClientContext
unsigned long RasServerEntry::currentClientIdx

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