1 /*
2    Copyright (c) 2009, 2021, Oracle and/or its affiliates.
3 
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License, version 2.0,
6    as published by the Free Software Foundation.
7 
8    This program is also distributed with certain software (including
9    but not limited to OpenSSL) that is licensed under separate terms,
10    as designated in a particular file or component or in included license
11    documentation.  The authors of MySQL hereby grant you an additional
12    permission to link the program and your derivative works with the
13    separately licensed software that they have included with MySQL.
14 
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License, version 2.0, for more details.
19 
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
23 */
24 
25 package com.mysql.clusterj.core.spi;
26 
27 import com.mysql.clusterj.Session;
28 import com.mysql.clusterj.core.store.Dictionary;
29 import com.mysql.clusterj.core.store.Index;
30 import com.mysql.clusterj.core.store.IndexOperation;
31 import com.mysql.clusterj.core.store.IndexScanOperation;
32 import com.mysql.clusterj.core.store.Operation;
33 import com.mysql.clusterj.core.store.ResultData;
34 import com.mysql.clusterj.core.store.ScanOperation;
35 import com.mysql.clusterj.core.store.Table;
36 import com.mysql.clusterj.query.QueryDomainType;
37 
38 import java.util.BitSet;
39 
40 /**
41  *
42  */
43 public interface SessionSPI extends Session {
44 
initializeFromDatabase( DomainTypeHandler<T> domainTypeHandler, T object, ValueHandler valueHandler, ValueHandler createKeyValueHandler)45     <T> T initializeFromDatabase(
46             DomainTypeHandler<T> domainTypeHandler, T object,
47             ValueHandler valueHandler, ValueHandler createKeyValueHandler);
48 
selectUnique(DomainTypeHandler<?> domainTypeHandler, ValueHandler keyHandler, BitSet fields)49     public ResultData selectUnique(DomainTypeHandler<?> domainTypeHandler,
50             ValueHandler keyHandler, BitSet fields);
51 
insert(DomainTypeHandler<?> domainTypeHandler, ValueHandler valueHandler)52     Operation insert(DomainTypeHandler<?> domainTypeHandler, ValueHandler valueHandler);
53 
update(DomainTypeHandler<?> domainTypeHandler, ValueHandler valueHandler)54     Operation update(DomainTypeHandler<?> domainTypeHandler, ValueHandler valueHandler);
55 
delete(DomainTypeHandler<?> domainTypeHandler, ValueHandler valueHandler)56     Operation delete(DomainTypeHandler<?> domainTypeHandler, ValueHandler valueHandler);
57 
deletePersistentAll(DomainTypeHandler<?> domainTypeHandler)58     int deletePersistentAll(DomainTypeHandler<?> domainTypeHandler);
59 
deletePersistentAll(ScanOperation op, boolean abort)60     int deletePersistentAll(ScanOperation op, boolean abort);
61 
begin()62     void begin();
63 
commit()64     void commit();
65 
rollback()66     void rollback();
67 
setRollbackOnly()68     void setRollbackOnly();
69 
getRollbackOnly()70     boolean getRollbackOnly();
71 
startAutoTransaction()72     void startAutoTransaction();
73 
endAutoTransaction()74     void endAutoTransaction();
75 
failAutoTransaction()76     void failAutoTransaction();
77 
executeNoCommit()78     void executeNoCommit();
79 
executeNoCommit(boolean abort, boolean force)80     void executeNoCommit(boolean abort, boolean force);
81 
getSelectOperation(Table storeTable)82     Operation getSelectOperation(Table storeTable);
83 
getDeleteOperation(Table storeTable)84     Operation getDeleteOperation(Table storeTable);
85 
getUpdateOperation(Table storeTable)86     Operation getUpdateOperation(Table storeTable);
87 
getUniqueIndexOperation(Index storeIndex, Table storeTable)88     IndexOperation getUniqueIndexOperation(Index storeIndex, Table storeTable);
89 
getUniqueIndexDeleteOperation(Index storeIndex, Table storeTable)90     IndexOperation getUniqueIndexDeleteOperation(Index storeIndex, Table storeTable);
91 
getUniqueIndexUpdateOperation(Index storeIndex, Table storeTable)92     IndexOperation getUniqueIndexUpdateOperation(Index storeIndex, Table storeTable);
93 
getIndexScanOperation(Index storeIndex, Table storeTable)94     IndexScanOperation getIndexScanOperation(Index storeIndex, Table storeTable);
95 
getIndexScanDeleteOperation(Index storeIndex, Table storeTable)96     IndexScanOperation getIndexScanDeleteOperation(Index storeIndex, Table storeTable);
97 
getIndexScanOperationMultiRange(Index storeIndex, Table storeTable)98     IndexScanOperation getIndexScanOperationMultiRange(Index storeIndex, Table storeTable);
99 
getTableScanOperation(Table storeTable)100     ScanOperation getTableScanOperation(Table storeTable);
101 
getTableScanDeleteOperation(Table storeTable)102     ScanOperation getTableScanDeleteOperation(Table storeTable);
103 
getDictionary()104     Dictionary getDictionary();
105 
createQueryDomainType(DomainTypeHandler<T> handler)106     <T> QueryDomainType<T> createQueryDomainType(DomainTypeHandler<T> handler);
107 
newInstance(ResultData resultData, DomainTypeHandler<T> domainTypeHandler)108     <T> T newInstance(ResultData resultData, DomainTypeHandler<T> domainTypeHandler);
109 
getCoordinatedTransactionId()110     String getCoordinatedTransactionId();
111 
setCoordinatedTransactionId(String coordinatedTransactionId)112     void setCoordinatedTransactionId(String coordinatedTransactionId);
113 
isEnlisted()114     boolean isEnlisted();
115 
116 }
117