237 #define SERVER_DOWN 0
238 #define SERVER_AVAILABLE 1
241 #define SERVER_REGULARSIG 3
298 virtual unsigned short aliveSignal(
unsigned long client );
309 virtual unsigned short openDB(
unsigned long callingClientId,
const char* dbName,
const char* userName );
323 virtual unsigned short closeDB(
unsigned long callingClientId );
333 virtual unsigned short createDB(
char* name );
337 virtual unsigned short destroyDB(
char* name );
341 virtual unsigned short beginTA(
unsigned long callingClientId,
unsigned short readOnly=0 );
352 virtual unsigned short commitTA(
unsigned long callingClientId );
363 virtual unsigned short abortTA(
unsigned long callingClientId );
382 virtual bool isTAOpen(
unsigned long callingClientId );
422 virtual unsigned short getNextMDD(
unsigned long callingClientId,
427 char* &typeStructure,
429 unsigned short ¤tFormat );
445 virtual unsigned short getNextElement(
unsigned long callingClientId,
448 unsigned int &bufferSize );
463 virtual unsigned short getMDDByOId(
unsigned long callingClientId,
468 char* &typeStructure,
469 unsigned short ¤tFormat );
494 virtual unsigned short getNextTile(
unsigned long callingClientId,
543 virtual unsigned short endTransfer(
unsigned long client );
601 unsigned long typeLength,
602 const char* typeName );
623 const char* collName,
625 unsigned long typeLength,
626 const char* typeName,
662 virtual unsigned short insertTile(
unsigned long callingClientId,
711 virtual unsigned short endInsertMDD(
unsigned long callingClientId,
722 virtual unsigned short insertMDD(
unsigned long callingClientId,
725 const char* collName,
727 const char* typeName,
r_OId& oid );
752 virtual unsigned short getCollByName(
unsigned long callingClientId,
755 const char* collName,
757 char* &typeStructure,
787 virtual unsigned short getCollByOId(
unsigned long callingClientId,
791 char* &typeStructure,
819 const char* collName,
821 char* &typeStructure,
824 unsigned int &oidTableSize );
852 char* &typeStructure,
854 unsigned int &oidTableSize,
879 virtual unsigned short insertColl(
unsigned long callingClientId,
882 const char* collName,
883 const char* typeName,
908 const char* collName );
940 const char* collName,
r_OId& oid );
954 virtual unsigned short getNewOId(
unsigned long callingClientId,
957 unsigned short objType,
r_OId& oid );
971 virtual unsigned short getObjectType(
unsigned long callingClientId,
973 r_OId& oid,
unsigned short &objType );
988 const char* typeName,
989 unsigned short typeType,
990 char* &typeStructure);
1004 virtual unsigned short setTransferMode(
unsigned long callingClientId,
1006 unsigned short format,
const char* formatParams );
1019 virtual unsigned short setStorageMode(
unsigned long callingClientId,
1021 unsigned short format,
const char *formatParams );
1059 char *&data,
unsigned long &size,
int repack,
1060 int owner,
const char *params = NULL);
1108 int messageDigest(
const char *input,
char *output,
const char *mdName);
1110 char serverName[100];
1118 #include "servercomm.icc"
Definition: databaseif.hh:66
Definition: servercomm.hh:1090
const char * getExtendedErrorInfo()
virtual unsigned short beginTA(unsigned long callingClientId, unsigned short readOnly=0)
open transaction
Definition: adminif.hh:81
std::vector< QtData * > * transferData
pointer to the query result which is currently in transfer
Definition: servercomm.hh:164
virtual ~ServerComm()
destructor
virtual unsigned short initExecuteUpdate(unsigned long callingClientId)
prepares transfer of MDD constants and execution of update query
MDDObj * assembleMDD
pointer to a persistent MDD object for tile based transfers
Definition: servercomm.hh:173
char * userName
Name of the client user name (if available)
Definition: servercomm.hh:127
unsigned long clientId
unique client identification assigned by the server
Definition: servercomm.hh:118
MDDCollIter * transferCollIter
pointer to an iterator for collection transferColl
Definition: servercomm.hh:161
virtual unsigned short getNextElement(unsigned long callingClientId, char *&buffer, unsigned int &bufferSize)
get the next scalar element in the actual transfer collection.
TransactionIf transaction
object representing the actual transaction (only one at a time possible)
Definition: servercomm.hh:201
void addClientTblEntry(ClientTblElt *context)
adds an entry to the client table (used in RasServerEntry)
void release()
release client context
void releaseTransferStructures()
releases transfer collection/iterator
MDDObj * transferMDD
pointer to an MDD object for tile base transfer
Definition: servercomm.hh:176
char * transferFormatParams
Definition: servercomm.hh:140
virtual unsigned short endInsertMDD(unsigned long callingClientId, int isPersistent)
finnishes the MDD creation and inserts the MDD into the collection
r_Data_Format transferFormat
convert raw array data to this data format before transfer
Definition: servercomm.hh:139
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()
virtual unsigned short aliveSignal(unsigned long client)
process the client's alive signal
int crunchCapability(const char *)
RMTimer * evaluationTimer
pointer to a timer for recording evaluation time
Definition: servercomm.hh:210
std::vector< QtData * >::iterator * transferDataIter
point to an iterator for transfer data
Definition: servercomm.hh:170
unsigned long encodedSize
Definition: servercomm.hh:149
void initSyncro(const char *)
char * serverName
Definition: servercomm.hh:1073
Definition: mddcolliter.hh:60
char * storageFormatParams
Definition: servercomm.hh:145
char * clientIdText
binding information about the client (IP address and TCP port number)
Definition: servercomm.hh:124
virtual unsigned short setStorageMode(unsigned long callingClientId, unsigned short format, const char *formatParams)
set the data format for storing data into the database
long memUsed
memory used by malloc in ordinary blocks (set in dumpClientTable)
Definition: servercomm.hh:282
bool isHttpServer
Definition: servercomm.hh:1075
const unsigned long clientTimeout
inactivity timeout in seconds after which pending client data is deleted
Definition: servercomm.hh:273
virtual unsigned short destroyDB(char *name)
destroy a database
const unsigned long garbageCollectionInterval
do a garbage collection every { garbageCollectionInterval} seconds (ONC RPC only) ...
Definition: servercomm.hh:276
the class defines an entry of the client table
Definition: servercomm.hh:86
virtual unsigned short getObjectType(unsigned long callingClientId, r_OId &oid, unsigned short &objType)
get type of object by oid
DatabaseIf database
object representing the actual database
Definition: servercomm.hh:198
virtual unsigned short getCollByOId(unsigned long callingClientId, r_OId &oid, char *&typeName, char *&typeStructure, char *&collName)
prepare an MDD collection for transfer with getNextMDD()
virtual unsigned short endTransfer(unsigned long client)
process the client's alive signal
r_Data_Format storageFormat
store array data in this data format in the database
Definition: servercomm.hh:144
Definition: callbackmgr.hh:50
void setServerName(const char *serverName)
virtual unsigned short setTransferMode(unsigned long callingClientId, unsigned short format, const char *formatParams)
set the data format used for transferring data to the client
virtual void getServerStatus(ServerStatRes &returnStruct)
get server status
virtual unsigned short getNextTile(unsigned long callingClientId, RPCMarray **rpcMarray)
get next tile of the actual MDD of the actual transfer collection
virtual void startRpcServer()
forces the server to listen for client calls
char * errorText
Definition: servercomm.hh:1068
virtual unsigned short executeUpdate(unsigned long callingClientId, const char *query, ExecuteUpdateRes &returnStructure)
executes an update query
void abortEveryThingNow()
virtual unsigned short getNewOId(unsigned long callingClientId, unsigned short objType, r_OId &oid)
get new object identifier
Definition: transactionif.hh:52
virtual ClientTblElt * getClientContext(unsigned long ClientId)
returns a pointer to the context of the calling client, 0 it there is no context
std::vector< MDDColl * > * persMDDCollections
std::vector of persistent MDD collections in use
Definition: servercomm.hh:195
virtual unsigned short deleteCollByName(unsigned long callingClientId, const char *collName)
delete MDD collection
virtual unsigned short getNextMDD(unsigned long callingClientId, r_Minterval &mddDomain, char *&typeName, char *&typeStructure, r_OId &oid, unsigned short ¤tFormat)
get the domain of the next MDD of the actual transfer collection
r_Data_Format
Definition: mddtypes.hh:133
CallBackManager callback_mgr
Definition: servercomm.hh:291
virtual unsigned short getTypeStructure(unsigned long callingClientId, const char *typeName, unsigned short typeType, char *&typeStructure)
get type structure of a type name
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
virtual unsigned short abortTA(unsigned long callingClientId)
abort current transaction
RMTimer * transferTimer
pointer to a timer for recording transfer time
Definition: servercomm.hh:207
unsigned long totalTransferedSize
Definition: servercomm.hh:152
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
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
virtual unsigned short executeQuery(unsigned long callingClientId, const char *query, ExecuteQueryRes &returnStructure)
executes a retrieval query and prepares the result for transfer with {getNextMDD}.
static unsigned long clientCount
last used client ID (this is increased by one to get the clientId for the next client) ...
Definition: servercomm.hh:270
void rpcif_1_caller(struct svc_req *rqstp, SVCXPRT *transp)
indirect caller for rpcif_1
static ServerComm * actual_servercomm
stores a pointer to the actual servercomm object, only one can exist at a time
Definition: servercomm.hh:285
void setExtendedErrorInfo(const char *)
~ClientTblElt()
destructor
static const char * HTTPCLIENT
Definition: servercomm.hh:1049
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
char * rasmgrHost
Definition: servercomm.hh:1071
r_Parse_Params * clientParams
parameter object
Definition: servercomm.hh:213
unsigned long listenPort
Definition: servercomm.hh:1070
virtual unsigned short insertColl(unsigned long callingClientId, const char *collName, const char *typeName, r_OId &oid)
create new MDD collection
virtual bool isTAOpen(unsigned long callingClientId)
is transaction open currently?
MDDColl * transferColl
pointer to an MDD collection
Definition: servercomm.hh:155
void * encodedData
the tile data converted into the transfer format, if required
Definition: servercomm.hh:148
Definition: parseparams.hh:44
unsigned int rasmgrPort
Definition: servercomm.hh:1072
char * baseName
Name of the actual database (if one is open)
Definition: servercomm.hh:130
static const int ENSURE_TILE_FORMAT_BAD
Definition: servercomm.hh:1063
static const int ENSURE_TILE_FORMAT_OK
returns the following:
Definition: servercomm.hh:1062
Definition: mddcoll.hh:98
RMTimer * taTimer
pointer to a timer for recording transaction time
Definition: servercomm.hh:204
unsigned long lastActionTime
time of the client's last action (for garbage collection purposes)
Definition: servercomm.hh:136
std::vector< Tile * > * deletableTiles
std::vector storing pointers to transient tiles
Definition: servercomm.hh:185
Definition: relcatalogif/basetype.hh:66
virtual unsigned short createDB(char *name)
create a database
unsigned int currentUsers
counter indicating the number of current users
Definition: servercomm.hh:121
virtual unsigned short openDB(unsigned long callingClientId, const char *dbName, const char *userName)
open database
std::vector< Tile * > * transTiles
std::vector storing tiles of actual MDD for transfer
Definition: servercomm.hh:179
static std::list< ClientTblElt * > clientTbl
the client table which holds information about the calling clients
Definition: servercomm.hh:267
virtual unsigned short closeDB(unsigned long callingClientId)
close current database
virtual unsigned short commitTA(unsigned long callingClientId)
commit current transaction
unsigned short deleteClientTblEntry(unsigned long ClientId)
deletes an entry of the client table (must be public because it is used in the global garbage collect...
Module: { raslib}.
Definition: rmdebug.hh:298
virtual unsigned short insertTile(unsigned long callingClientId, int isPersistent, RPCMarray *rpcMarray)
insert a tile into a persistent MDD object
virtual unsigned short startInsertTransMDD(unsigned long callingClientId, r_Minterval &domain, unsigned long typeLength, const char *typeName)
prepares an MDD (transient) for transfer of tiles
virtual void stopRpcServer()
stops the server
Definition: servercomm.hh:81
int exactFormat
send data to client in the exact transfer format
Definition: servercomm.hh:142
ClientTblElt(const char *clientIdText, unsigned long clientId)
default constructor
unsigned long bytesToTransfer
bytes to transfer in actual tile (valid only if tile is larger than { MAXTRANSBYTES}) ...
Definition: servercomm.hh:192
ServerComm()
default constructor
AdminIf * admin
pointer to the actual administration interface object
Definition: servercomm.hh:1066
virtual unsigned short insertTileSplitted(unsigned long callingClientId, int isPersistent, RPCMarray *rpcMarray, r_Minterval *tileSize)
virtual void printServerStatus(ostream &s=cout)
print server status with client table content to { s}
virtual unsigned short removeObjFromColl(unsigned long callingClientId, const char *collName, r_OId &oid)
remove object specified by oid from collection specified by name
unsigned long totalRawSize
for establishing the compression ratio
Definition: servercomm.hh:151
unsigned long creationTime
time when the database was opened (for curiosity purposes)
Definition: servercomm.hh:133
std::vector< Tile * >::iterator * tileIter
iterator for the std::vector above
Definition: servercomm.hh:182
virtual unsigned short insertMDD(unsigned long callingClientId, const char *collName, RPCMarray *rpcMarray, const char *typeName, r_OId &oid)
insert object into collection
unsigned long transactionActive
flag for active o2 transaction (stores the clientID of the owner of the active transaction, or 0 if none open)
Definition: servercomm.hh:279
void clearExtendedErrorInfo()
virtual unsigned short deleteObjByOId(unsigned long callingClientId, r_OId &oid)
delete object by oid
Definition: minterval.hh:249
virtual unsigned short getMDDByOId(unsigned long callingClientId, r_OId &oid, r_Minterval &mddDomain, char *&typeName, char *&typeStructure, unsigned short ¤tFormat)
get an MDD by OId
AccessControl accessControl