public class DBSynsactBuilder extends DATranscxt
DBSyntext
for handling database synchronization.Modifier and Type | Class and Description |
---|---|
static class |
DBSynsactBuilder.SynmanticsMap |
DATranscxt.SemanticsMap, DATranscxt.SmapFactory<M extends DATranscxt.SemanticsMap>
Modifier and Type | Field and Description |
---|---|
protected SynChangeMeta |
chgm |
static int |
leafmode |
protected HashMap<String,Nyquence> |
nyquvect
Nyquence vector [{synode, Nyquence}]
|
static int |
peermode |
protected PeersMeta |
pnvm |
protected SynSubsMeta |
subm |
protected SynodeMeta |
synm |
cfgroot, dummy, runtimepath, smtMaps
Constructor and Description |
---|
DBSynsactBuilder(String conn,
String synodeId,
String syndomain,
int nodemode) |
DBSynsactBuilder(String conn,
String synodeId,
String syndomain,
int nodemode,
SynChangeMeta chgm,
SynodeMeta synm) |
Modifier and Type | Method and Description |
---|---|
ChangeLogs |
ackExchange(ExchangeContext x,
ChangeLogs answer,
String sn)
Client node acknowledge destionation's response (from server),
i.e.
|
ChangeLogs |
addChild(ExchangeContext x,
String childId,
SynodeMode reqmode,
io.odysz.semantics.IUser robot,
String org,
String domain)
A
hub node uses this to setup change logs for joining nodes. |
HashMap<String,Nyquence> |
closeJoining(ExchangeContext x,
String sn,
HashMap<String,Nyquence> nv) |
HashMap<String,Nyquence> |
closexchange(ExchangeContext x,
String sn,
HashMap<String,Nyquence> nv) |
String |
domain() |
AnResultset |
entities(SyntityMeta phm,
String connId,
io.odysz.semantics.IUser usr) |
SyntityMeta |
getEntityMeta(String entbl) |
Nyquence |
incN0(long maxn)
this.n0++, this.n0 = max(n0, maxn)
|
Nyquence |
incN0(Nyquence n) |
DBSynsactBuilder |
incNyquence()
Inc my n0, then reload from DB.
|
protected ChangeLogs |
initChallenges(ExchangeContext x,
String peer) |
ChangeLogs |
initDomain(ExchangeContext x,
ChangeLogs domainstatus) |
<T extends SynEntity> |
initExchange(ExchangeContext x,
String target,
HashMap<String,Nyquence> nv)
Find if there are change logs such that chg.n > myvect[remote].n, to be exchanged.
|
io.odysz.semantics.ISemantext |
instancontxt(String conn,
io.odysz.semantics.IUser usr)
Create a new semantext instance with the static resources.
|
protected Nyquence |
n0() |
protected DBSynsactBuilder |
n0(Nyquence nyq) |
HashMap<String,Nyquence> |
onAck(ExchangeContext x,
ChangeLogs ack,
String target,
HashMap<String,Nyquence> srcnv,
SyntityMeta entm)
Commit buffered answer's changes as client node acknowledged the answers with
ack . |
void |
oncloseJoining(ExchangeContext x,
String sn,
HashMap<String,Nyquence> nv) |
void |
onclosexchange(ExchangeContext x,
String sn,
HashMap<String,Nyquence> nv) |
<T extends SynEntity> |
onExchange(ExchangeContext x,
String from,
HashMap<String,Nyquence> remotv,
ChangeLogs req) |
ChangeLogs |
onJoining(SynodeMode reqmode,
String joining,
String domain,
String org) |
DBSynsactBuilder |
registerEntity(String conn,
SyntityMeta m) |
String |
synconn()
Get synchronization meta connection id.
|
protected String |
synode() |
io.odysz.semantics.IUser |
synrobot() |
protected HashMap<String,Nyquence> |
synyquvectMax(String peer,
HashMap<String,Nyquence> nv,
HashMap<String,Nyquence> mynv) |
String |
updateEntity(String synoder,
String pid,
SyntityMeta entm,
Object... nvs)
Syntity table updating.
|
configRoot, delete, dummyUser, exists, findResulved, getBasicTrans, getHandler, getSysConnId, hasSemantics, initConfigs, insert, key, key, loadSemantics, now, quotation, select, tableMeta, update
protected SynodeMeta synm
protected SynSubsMeta subm
protected SynChangeMeta chgm
protected PeersMeta pnvm
public static final int peermode
public static final int leafmode
public DBSynsactBuilder(String conn, String synodeId, String syndomain, int nodemode) throws SQLException, SAXException, IOException, io.odysz.transact.x.TransException
SQLException
SAXException
IOException
io.odysz.transact.x.TransException
public DBSynsactBuilder(String conn, String synodeId, String syndomain, int nodemode, SynChangeMeta chgm, SynodeMeta synm) throws SQLException, SAXException, IOException, io.odysz.transact.x.TransException
SQLException
SAXException
IOException
io.odysz.transact.x.TransException
public String synconn()
protected String synode()
protected Nyquence n0()
protected DBSynsactBuilder n0(Nyquence nyq)
public String domain()
public io.odysz.semantics.IUser synrobot()
public DBSynsactBuilder incNyquence() throws io.odysz.transact.x.TransException, SQLException
io.odysz.transact.x.TransException
SQLException
public io.odysz.semantics.ISemantext instancontxt(String conn, io.odysz.semantics.IUser usr) throws io.odysz.transact.x.TransException
DATranscxt
Create a new semantext instance with the static resources.
DATranscxt
use a basic context (without semantics handler) for basic sql building.DASemantics
handling must use this to create a new context instance.instancontxt
in class DATranscxt
conn
- connection id usually mapped with client function uri, like: Connects.uri2conn(req.uri())io.odysz.transact.x.TransException
ISemantext
public AnResultset entities(SyntityMeta phm, String connId, io.odysz.semantics.IUser usr) throws io.odysz.transact.x.TransException, SQLException
io.odysz.transact.x.TransException
SQLException
public SyntityMeta getEntityMeta(String entbl) throws SemanticException
SemanticException
public DBSynsactBuilder registerEntity(String conn, SyntityMeta m) throws SemanticException, io.odysz.transact.x.TransException, SQLException
SemanticException
io.odysz.transact.x.TransException
SQLException
public Nyquence incN0(long maxn) throws io.odysz.transact.x.TransException, SQLException
maxn
- SQLException
io.odysz.transact.x.TransException
public Nyquence incN0(Nyquence n) throws io.odysz.transact.x.TransException, SQLException
io.odysz.transact.x.TransException
SQLException
public <T extends SynEntity> ChangeLogs initExchange(ExchangeContext x, String target, HashMap<String,Nyquence> nv) throws io.odysz.transact.x.TransException, SQLException
T
- cx
- target
- exchange target (server)nv
- nyquevect from targetSQLException
io.odysz.transact.x.TransException
protected ChangeLogs initChallenges(ExchangeContext x, String peer) throws SecurityException, io.odysz.transact.x.TransException, SQLException
SecurityException
io.odysz.transact.x.TransException
SQLException
public <T extends SynEntity> ChangeLogs onExchange(ExchangeContext x, String from, HashMap<String,Nyquence> remotv, ChangeLogs req) throws SQLException, io.odysz.transact.x.TransException
SQLException
io.odysz.transact.x.TransException
public ChangeLogs ackExchange(ExchangeContext x, ChangeLogs answer, String sn) throws SQLException, io.odysz.transact.x.TransException, IOException
x
- exchange execution instanceanswer
- sn
- SQLException
io.odysz.transact.x.TransException
IOException
public HashMap<String,Nyquence> onAck(ExchangeContext x, ChangeLogs ack, String target, HashMap<String,Nyquence> srcnv, SyntityMeta entm) throws SQLException, io.odysz.transact.x.TransException
ack
.x
- exchange execution's instanceack
- answer to previous challengetarget
- srcnv
- entm
- io.odysz.transact.x.TransException
SQLException
public HashMap<String,Nyquence> closexchange(ExchangeContext x, String sn, HashMap<String,Nyquence> nv) throws io.odysz.transact.x.TransException, SQLException
io.odysz.transact.x.TransException
SQLException
protected HashMap<String,Nyquence> synyquvectMax(String peer, HashMap<String,Nyquence> nv, HashMap<String,Nyquence> mynv) throws io.odysz.transact.x.TransException, SQLException
io.odysz.transact.x.TransException
SQLException
public HashMap<String,Nyquence> closeJoining(ExchangeContext x, String sn, HashMap<String,Nyquence> nv) throws io.odysz.transact.x.TransException, SQLException
io.odysz.transact.x.TransException
SQLException
public void onclosexchange(ExchangeContext x, String sn, HashMap<String,Nyquence> nv) throws SQLException, io.odysz.transact.x.TransException
SQLException
io.odysz.transact.x.TransException
public void oncloseJoining(ExchangeContext x, String sn, HashMap<String,Nyquence> nv) throws SQLException, io.odysz.transact.x.TransException
SQLException
io.odysz.transact.x.TransException
public ChangeLogs addChild(ExchangeContext x, String childId, SynodeMode reqmode, io.odysz.semantics.IUser robot, String org, String domain) throws io.odysz.transact.x.TransException, SQLException
hub
node uses this to setup change logs for joining nodes.x
- childId
- robot
- org
- domain
- io.odysz.transact.x.TransException
SQLException
public ChangeLogs onJoining(SynodeMode reqmode, String joining, String domain, String org) throws io.odysz.transact.x.TransException, SQLException
io.odysz.transact.x.TransException
SQLException
public ChangeLogs initDomain(ExchangeContext x, ChangeLogs domainstatus) throws SQLException, io.odysz.transact.x.TransException
SQLException
io.odysz.transact.x.TransException
public String updateEntity(String synoder, String pid, SyntityMeta entm, Object... nvs) throws io.odysz.transact.x.TransException, SQLException, io.odysz.anson.x.AnsonException, IOException
entm
- pid
- field
- nvs
- name-value pairsio.odysz.transact.x.TransException
SQLException
IOException
io.odysz.anson.x.AnsonException
Copyright © 2024. All rights reserved.