rasdaman client API 10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
clientcomm.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 /
18rasdaman GmbH.
19*
20* For more information please see <http://www.rasdaman.org>
21* or contact Peter Baumann via <baumann@rasdaman.com>.
22*/
23
24#ifndef CLIENTCOMM_HH_
25#define CLIENTCOMM_HH_
26
27#include "raslib/mddtypes.hh"
28
29class r_Database;
30class r_Transaction;
31class r_OId;
32class r_OQL_Query;
33class r_GMarray;
34template <class T>
35class r_Set;
36class r_Ref_Any;
37class r_Base_Type;
38class r_Parse_Params;
39
51{
52public:
54 virtual ~ClientComm() = default;
55
59
61 virtual int openDB(const char *database) = 0;
63 virtual int closeDB() = 0;
65 virtual int createDB(const char *name) = 0;
67 virtual int destroyDB(const char *name) = 0;
68
71
75
77 virtual int openTA(unsigned short readOnly = 0) = 0;
79 virtual int commitTA() = 0;
81 virtual int abortTA() = 0;
82
85
89
91 virtual void insertMDD(const char *collName, r_GMarray *mar) = 0;
93 virtual r_Ref_Any getMDDByOId(const r_OId &oid) = 0;
94
97
101
103 virtual void insertColl(const char *collName, const char *typeName, const r_OId &oid) = 0;
105 virtual void deleteCollByName(const char *collName) = 0;
107 virtual void deleteObjByOId(const r_OId &oid) = 0;
109 virtual void removeObjFromColl(const char *name, const r_OId &oid) = 0;
111 virtual r_Ref_Any getCollByName(const char *name) = 0;
113 virtual r_Ref_Any getCollByOId(const r_OId &oid) = 0;
115 virtual r_Ref_Any getCollOIdsByName(const char *name) = 0;
117 virtual r_Ref_Any getCollOIdsByOId(const r_OId &oid) = 0;
118
121
125
129 virtual void executeQuery(const r_OQL_Query &query, r_Set<r_Ref_Any> &result) = 0;
130
132 virtual void executeQuery(const r_OQL_Query &query) = 0;
133
137 virtual void executeQuery(const r_OQL_Query &query, r_Set<r_Ref_Any> &result, int dummy) = 0;
138
141
145
147 virtual r_OId getNewOId(unsigned short objType) = 0;
148
150 virtual unsigned short getObjectType(const r_OId &oid) = 0;
151
157
160 virtual char *getTypeStructure(const char *typeName, r_Type_Type typeType) = 0;
161
164
167
169 virtual int setTransferFormat(r_Data_Format format, const char *formatParams = NULL) = 0;
170
172 virtual int setStorageFormat(r_Data_Format format, const char *formatParams = NULL) = 0;
173
175 virtual void setUserIdentification(const char *userName, const char *plainTextPassword) = 0;
176
178 virtual void setMaxRetry(unsigned int newMaxRetry) = 0;
180 virtual unsigned int getMaxRetry() = 0;
181
183 virtual void setTimeoutInterval(int seconds) = 0;
185 virtual int getTimeoutInterval() = 0;
186
192 virtual void updateTransaction();
193
196
197protected:
199 ClientComm() = default;
200
203
206};
207
209
210#endif
The class ClientComm represents one connection between one client entity (for example an object of cl...
Definition clientcomm.hh:51
virtual void insertMDD(const char *collName, r_GMarray *mar)=0
MDD methods.
virtual void executeQuery(const r_OQL_Query &query, r_Set< r_Ref_Any > &result, int dummy)=0
Executes an insert query of type r_OQL_Query, returning the OId of the inserted array.
virtual void setUserIdentification(const char *userName, const char *plainTextPassword)=0
user identification for RasMGR
virtual int openDB(const char *database)=0
Database methods.
r_Database * database
reference to the database that created this client communicator
Definition clientcomm.hh:202
r_Transaction * transaction
reference to the transaction being used by this client communicator
Definition clientcomm.hh:205
virtual unsigned int getMaxRetry()=0
get maximum retry to get a server
virtual int setStorageFormat(r_Data_Format format, const char *formatParams=NULL)=0
set the preferred storage format
virtual void deleteObjByOId(const r_OId &oid)=0
deletes an object by oid (right now, objects are collection only)
virtual int abortTA()=0
abort current transaction
virtual int commitTA()=0
commit current transaction
virtual int getTimeoutInterval()=0
get communication timeout interval in seconds.
virtual r_OId getNewOId(unsigned short objType)=0
System methods.
virtual void insertColl(const char *collName, const char *typeName, const r_OId &oid)=0
Collection methods.
virtual r_Ref_Any getCollByOId(const r_OId &oid)=0
gets collection by oid
ClientComm()=default
constructor getting nothing
virtual r_Ref_Any getCollOIdsByName(const char *name)=0
gets collection references by name
virtual void removeObjFromColl(const char *name, const r_OId &oid)=0
removes an object from a collection
virtual void updateTransaction()
resets to the global r_Transaction::actual_transaction if necessary
virtual void setTimeoutInterval(int seconds)=0
set communication timeout interval in seconds.
virtual int setTransferFormat(r_Data_Format format, const char *formatParams=NULL)=0
Configuration methods.
virtual int openTA(unsigned short readOnly=0)=0
Transaction methods.
r_Type_Type
Definition clientcomm.hh:153
@ r_MDDType_Type
Definition clientcomm.hh:155
@ r_SetType_Type
Definition clientcomm.hh:154
virtual void executeQuery(const r_OQL_Query &query, r_Set< r_Ref_Any > &result)=0
Query methods.
virtual int createDB(const char *name)=0
create a database
virtual char * getTypeStructure(const char *typeName, r_Type_Type typeType)=0
get type structure deallocate using delete []
virtual unsigned short getObjectType(const r_OId &oid)=0
get oid type
virtual void deleteCollByName(const char *collName)=0
deletes an MDD collection by name
virtual void executeQuery(const r_OQL_Query &query)=0
Executes an update query of type r_OQL_Query.
virtual int closeDB()=0
close current database
virtual ~ClientComm()=default
destructor (closes the connection and releases resources)
virtual void setMaxRetry(unsigned int newMaxRetry)=0
set maximum retry to get a server
void setDatabase(r_Database *database)
sets the database that is using this client communicator
void setTransaction(r_Transaction *transaction)
sets the transaction that is using this client communicator
virtual r_Ref_Any getCollByName(const char *name)=0
gets collection by name
virtual r_Ref_Any getCollOIdsByOId(const r_OId &oid)=0
gets collection references by oid
virtual r_Ref_Any getMDDByOId(const r_OId &oid)=0
gets MDD object by oid
virtual int destroyDB(const char *name)=0
destroy a database
This class is the superclass of the types r_Structure_Type and r_Primitive_Type in the representation...
Definition basetype.hh:40
A database object must be instantiated and opened before starting any transaction which uses the data...
Definition database.hh:60
The class represents a generic MDD in the sense that it is independent of the cell base type.
Definition gmarray.hh:66
Class r_OId represents an object identifier.
Definition oid.hh:39
The global function r_oql_execute() is used to invoke RasML queries.
Definition oqlquery.hh:71
Class for parsing a string consisting of key=value pairs separated by ",".
Definition parseparams.hh:40
The class r_Ref_Any is defined to support a reference to any type.
Definition ref.hh:65
The class implements a set container.
Definition set.hh:42
Transactions can be started, committed, aborted, and checkpointed.
Definition transaction.hh:50
r_Data_Format
\begin{tabular}{ll} <tt>r_Array</tt> && no compression, row-major memory representation\...
Definition mddtypes.hh:94