rasdaman complete source
rasserver_entry.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 */
23 #ifndef RASSERVER_ENTRY_HH
24 #define RASSERVER_ENTRY_HH
25 
26 /*
27  This class is the entry point of the rasdaman server. It's the interface of the server to the outside world
28  It's functions are called by the communication level.
29 
30  For now the class inherites HttpServer which inherites ServerComm, but only to have nice acces to the stuff
31  found there. Later we will drop both of them and make the life easier.
32 */
33 
34 #include "servercomm/httpserver.hh"
35 
36 
40 class RasServerEntry : public HttpServer
41 {
42 private:
44  static RasServerEntry* myself;
45 public:
46  static RasServerEntry& getInstance();
47 
49 
50  //### inherited stuff - we have to keep them for now
51  void startRpcServer() throw( r_Error );
52  void stopRpcServer();
53  //###
54 
55  void compat_connectToDBMS() throw( r_Error );
56 
57  // All "compat_" functions use old ServerComm and HttpServer stuff to do their job
58  // Later, the new functions will do the job proper and this old functions will be dropped!
59  void compat_connectNewClient(const char *capability);
60  unsigned long currentClientIdx;
61  ClientTblElt* getClientContext( unsigned long ClientId ); // inherited...
62  ClientTblElt* currentClientContext;
63 
65 
66  void compat_openDB(const char* databaseName);
67 
68  void compat_closeDB();
69 
70  void compat_beginTA(bool rw);
71 
72  void compat_commitTA();
73 
74  void compat_abortTA();
75 
76  bool compat_isOpenTA();
77 
78  // provided for temporary compatibility with the encoding of the java interface
79  // resultBuffer will be allocated and it's address stored in the given pointer
80  // result is the length of the result
81  int compat_executeQueryHttp(const char* httpParams, int httpParamsLen, char*& resultBuffer);
82 
83  r_OId compat_getNewOId(unsigned short objType); // 1 - mddType, 2 -collType
84 
85  int compat_executeQueryRpc(const char* query, ExecuteQueryRes &queryResult);
86 
87  int compat_getNextElement(char* &buffer, unsigned int &bufferSize );
88 
89  int compat_endTransfer();
90 
91  int compat_getNextMDD(r_Minterval &mddDomain, char* &typeName, char* &typeStructure, r_OId &oid,unsigned short &currentFormat);
92 
93  int compat_getNextTile(RPCMarray** rpcMarray);
94 
95  int compat_ExecuteUpdateQuery(const char *query, ExecuteUpdateRes &returnStructure);
96 
97  int compat_InitUpdate();
98 
99  int compat_StartInsertTransMDD(const char *domain, int typeLength, const char *typeName);
100 
101  int compat_InsertTile(int persistent, RPCMarray*);
102 
103  int compat_EndInsertMDD(int persistent);
104 
105  int compat_GetTypeStructure(const char *typeName, int typeType, char* &typeStructure);
106 
107  int compat_StartInsertPersMDD(const char *collName, r_Minterval &mddDomain, int typeLength, const char *typeName, r_OId &oid);
108 
109  int compat_InsertMDD(const char *collName, RPCMarray *rpcMarray, const char *typeName, r_OId &oid);
110 
111  int compat_InsertCollection(const char *collName, const char *typeName, r_OId &oid);
112 
113  int compat_DeleteCollByName(const char *collName);
114 
115  int compat_DeleteObjByOId(r_OId &oid);
116 
117  int compat_RemoveObjFromColl(const char *collName, r_OId &oid);
118 
119  int compat_GetCollectionByName(const char* collName, char* &typeName, char* &typeStructure, r_OId &oid);
120 
121  int compat_GetCollectionByName(r_OId oid, char* &typeName, char* &typeStructure, char* &collName);
122 
123  int compat_GetCollectionOidsByName(const char* collName, char* &typeName, char* &typeStructure, r_OId &oid, RPCOIdEntry* &oidTable, unsigned int &oidTableSize);
124 
125  int compat_GetCollectionOidsByOId(r_OId oid, char* &typeName, char* &typeStructure, RPCOIdEntry* &oidTable, unsigned int &oidTableSize, char* &collName);
126 
127  int compat_GetObjectType(r_OId &oid, unsigned short &objType);
128 
129  int compat_SetTransferFormat(int format, const char* params);
130 
131  int compat_SetStorageFormat(int format, const char* params);
132 
133 
134  r_OId createCollection(const char* collName, const char* collTypeName);
135 
136  r_OId createMDD(const char* collName, const char* mddTypeName, const char* definitionDomain, const char* tileDomain, bool rcindex);
137 
138  void extendMDD(r_OId mddOId, const char *stripeDomain, const char* tileDomain);
139 
140  vector<r_Minterval> getTileDomains(r_OId mddOId, const char *stripeDomain);
141 
142 };
143 #endif
int compat_InsertMDD(const char *collName, RPCMarray *rpcMarray, const char *typeName, r_OId &oid)
int compat_SetStorageFormat(int format, const char *params)
int compat_endTransfer()
int compat_GetCollectionOidsByName(const char *collName, char *&typeName, char *&typeStructure, r_OId &oid, RPCOIdEntry *&oidTable, unsigned int &oidTableSize)
void compat_connectToDBMS()
int compat_getNextElement(char *&buffer, unsigned int &bufferSize)
r_OId createCollection(const char *collName, const char *collTypeName)
void stopRpcServer()
int compat_InsertTile(int persistent, RPCMarray *)
Definition: rpcif.h:22
void compat_abortTA()
int compat_InitUpdate()
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)
void compat_connectNewClient(const char *capability)
ClientTblElt * currentClientContext
Definition: rasserver_entry.hh:62
int compat_DeleteCollByName(const char *collName)
unsigned long currentClientIdx
Definition: rasserver_entry.hh:60
int compat_DeleteObjByOId(r_OId &oid)
void compat_beginTA(bool rw)
int compat_executeQueryRpc(const char *query, ExecuteQueryRes &queryResult)
int compat_EndInsertMDD(int persistent)
int compat_InsertCollection(const char *collName, const char *typeName, r_OId &oid)
r_OId compat_getNewOId(unsigned short objType)
vector< r_Minterval > getTileDomains(r_OId mddOId, const char *stripeDomain)
static RasServerEntry & getInstance()
int compat_GetCollectionOidsByOId(r_OId oid, char *&typeName, char *&typeStructure, RPCOIdEntry *&oidTable, unsigned int &oidTableSize, char *&collName)
int compat_GetCollectionByName(const char *collName, char *&typeName, char *&typeStructure, r_OId &oid)
int compat_GetTypeStructure(const char *typeName, int typeType, char *&typeStructure)
Definition: rpcif.h:79
void compat_closeDB()
Definition: rasserver_entry.hh:40
int compat_executeQueryHttp(const char *httpParams, int httpParamsLen, char *&resultBuffer)
int compat_getNextMDD(r_Minterval &mddDomain, char *&typeName, char *&typeStructure, r_OId &oid, unsigned short &currentFormat)
void compat_commitTA()
int compat_SetTransferFormat(int format, const char *params)
int compat_StartInsertPersMDD(const char *collName, r_Minterval &mddDomain, int typeLength, const char *typeName, r_OId &oid)
void compat_openDB(const char *databaseName)
int compat_StartInsertTransMDD(const char *domain, int typeLength, const char *typeName)
int compat_ExecuteUpdateQuery(const char *query, ExecuteUpdateRes &returnStructure)
int compat_RemoveObjFromColl(const char *collName, r_OId &oid)
void compat_disconnectClient()
int compat_GetObjectType(r_OId &oid, unsigned short &objType)
Definition: rpcif.h:90
bool compat_isOpenTA()
void startRpcServer()
Definition: rpcif.h:48
ClientTblElt * getClientContext(unsigned long ClientId)
int compat_getNextTile(RPCMarray **rpcMarray)