Package io.odysz.semantic.syn
Class ExessionPersist
java.lang.Object
io.odysz.semantic.syn.ExessionPersist
Persisting exchange session with remote node, using temporary tables.
This is a session context, and different from
DBSynmantext
which
is used for handling local data integration and database semantics.- Author:
- Ody
-
Field Summary
-
Constructor Summary
ConstructorDescriptionExessionPersist
(DBSyntableBuilder tb, String target) Create context at client side.ExessionPersist
(DBSyntableBuilder tb, String peer, ExchangeBlock ini) Create context at server side. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
entities
(String tbl, AnResultset ents) expect
(ExchangeBlock req) exstat()
int
exstate()
exstate
(int state) boolean
Has another page inSynchangeBuffMeta
.tbl to be send to.init()
Setup exchange buffer table.n0()
onInit
(ExchangeBlock ini) insert into exchanges select * from change_logs where n > nyquvect[sx.peer].nint
pages()
peer()
update syn_node set session = {session, challengeSeq, answers, ...}persistarting
(String peer) Save starting session.Retry last pagesession()
Create a signing up request.stamp()
-
Field Details
-
trb
-
totalChallenges
public int totalChallengesCounted when ininit()
, and not correct afterDBSyntableBuilder.cleanStale(HashMap, String)
has been called. -
expAnswerSeq
public int expAnswerSeq -
challengeSeq
public int challengeSeqChallenging sequence number, i. e. current page -
chsize
protected int chsizechallenge page size -
answerSeq
public int answerSeq -
ssinf
Information used by upper level, such as semantic.jser.
-
-
Constructor Details
-
ExessionPersist
Create context at client side.- Parameters:
tb
-target
-
-
ExessionPersist
Create context at server side.- Parameters:
tb
-
-
-
Method Details
-
peer
-
signup
Create a signing up request.- Parameters:
admin
-- Returns:
- the request
- Throws:
SQLException
io.odysz.transact.x.TransException
-
init
Setup exchange buffer table.exstate.state = init; expAnswerSeq = 0; challengeSeq = 0; answerSeq = 0;
- Throws:
io.odysz.transact.x.TransException
SQLException
-
onInit
public ExchangeBlock onInit(ExchangeBlock ini) throws io.odysz.transact.x.TransException, SQLException insert into exchanges select * from change_logs where n > nyquvect[sx.peer].n- Parameters:
ini
-- Returns:
- new message
- Throws:
io.odysz.transact.x.TransException
SQLException
-
clear
public void clear() -
session
-
exstate
public int exstate() -
exstate
-
exstat
-
hasNextChpages
public boolean hasNextChpages(DBSyntableBuilder b) throws SQLException, io.odysz.transact.x.TransException Has another page inSynchangeBuffMeta
.tbl to be send to.- Parameters:
b
- synchronizing transaction builder- Returns:
- true if has another page
- Throws:
SQLException
io.odysz.transact.x.TransException
-
expect
- Throws:
ExchangeException
-
nextExchange
public ExchangeBlock nextExchange(ExchangeBlock rep) throws SQLException, io.odysz.transact.x.TransException - Throws:
SQLException
io.odysz.transact.x.TransException
-
closexchange
- Throws:
ExchangeException
-
abortExchange
-
retryLast
Retry last page- Parameters:
peer
-- Returns:
- request message
- Throws:
SQLException
io.odysz.transact.x.TransException
-
n0
-
entities
-
pages
public int pages() -
persisession
update syn_node set session = {session, challengeSeq, answers, ...}- Returns:
- this
- Throws:
SQLException
io.odysz.transact.x.TransException
-
persistarting
public ExessionPersist persistarting(String peer) throws io.odysz.transact.x.TransException, SQLException Save starting session.- Parameters:
peer
-- Returns:
- this
- Throws:
io.odysz.transact.x.TransException
SQLException
-
stamp
-