Package org.openmuc.jship.state.smehello
Class SmeHelloState
- java.lang.Object
-
- org.openmuc.jship.state.State
-
- org.openmuc.jship.state.smehello.SmeHelloState
-
public class SmeHelloState extends State
-
-
Field Summary
Fields Modifier and Type Field Description protected TrustCheckCallBack
trustCB
-
Fields inherited from class org.openmuc.jship.state.State
changeStateCB, checkTimeoutExecs, config, log, logPrefix, receivedMsg, shipConnCB, stateCB, stateTransCBList
-
-
Constructor Summary
Constructors Constructor Description SmeHelloState(ShipConnCallBack shipConnCB, Configuration config, java.lang.String logPrefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
calculateWFRLeft(long waitForReadyElapsed)
helper method, calculates how much time is left until the waitForReady-timer times out, for "hello"-messagesvoid
commonAbort()
protected void
deactivateAllTimers()
void
deactivateTimer(TimeoutTimer timeoutTimer)
int
getAcceptedProlongationRequests()
HelloMsg
getLastReceivedMsg()
TimeoutTimer
getProlongationReqReply()
TimeoutTimer
getSendProlongationReq()
SmeHelloSubState
getSubState()
int
getT_hello_inc()
int
getT_hello_init()
int
getT_hello_prolong_min()
int
getT_hello_prolong_thr_inc()
int
getT_hello_prolong_waiting_gap()
TimeoutTimer
getWaitForReady()
void
incomingProlongReq()
void
init()
protected void
nextState()
void
processMsg(byte[] msg)
void
setLastReceivedMsg(HelloMsg lastReceivedMsg)
void
setSubState(SubState subState)
void
setWaitForReady(TimeoutTimer waitForReady)
void
startProlongationReqReplyTimer()
void
startSendProlongationReqTimer(int timeout)
void
startWFRTimer()
void
switchToReady()
switch from basic state PENDING to READY.protected void
timedOut(TimeoutTimer timeoutTimer)
on timeout set timeout state depending on current phase and do the timeout procedure.java.lang.String
toString()
-
Methods inherited from class org.openmuc.jship.state.State
addStateTransitionCB, checkTimeout, getConfig, getLogPrefix, next, peekReceivedMsg, pollReceivedMsg, receivedMsg, removeStateTransitionCB, sendMsg, setReceivedMsg, setStateTransCBList, shutDownExecutors
-
-
-
-
Field Detail
-
trustCB
protected TrustCheckCallBack trustCB
-
-
Constructor Detail
-
SmeHelloState
public SmeHelloState(ShipConnCallBack shipConnCB, Configuration config, java.lang.String logPrefix)
-
-
Method Detail
-
startWFRTimer
public void startWFRTimer()
-
startSendProlongationReqTimer
public void startSendProlongationReqTimer(int timeout)
-
startProlongationReqReplyTimer
public void startProlongationReqReplyTimer()
-
getWaitForReady
public TimeoutTimer getWaitForReady()
-
setWaitForReady
public void setWaitForReady(TimeoutTimer waitForReady)
-
getSendProlongationReq
public TimeoutTimer getSendProlongationReq()
-
getProlongationReqReply
public TimeoutTimer getProlongationReqReply()
-
deactivateTimer
public void deactivateTimer(TimeoutTimer timeoutTimer)
-
processMsg
public void processMsg(byte[] msg)
- Specified by:
processMsg
in classState
-
getSubState
public SmeHelloSubState getSubState()
- Specified by:
getSubState
in classState
-
setSubState
public void setSubState(SubState subState)
- Specified by:
setSubState
in classState
-
deactivateAllTimers
protected void deactivateAllTimers()
- Specified by:
deactivateAllTimers
in classState
-
timedOut
protected void timedOut(TimeoutTimer timeoutTimer)
on timeout set timeout state depending on current phase and do the timeout procedure.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
commonAbort
public void commonAbort()
-
incomingProlongReq
public void incomingProlongReq()
-
calculateWFRLeft
protected int calculateWFRLeft(long waitForReadyElapsed)
helper method, calculates how much time is left until the waitForReady-timer times out, for "hello"-messages- Parameters:
waitForReadyElapsed
- the elapsed time of the waitForReady-timer in millis- Returns:
- T_hello_inc-value in millis minus waitForReadyElapsed
-
switchToReady
public void switchToReady()
switch from basic state PENDING to READY. Should only be used right after authentication of communication partner.
-
getLastReceivedMsg
public HelloMsg getLastReceivedMsg()
-
setLastReceivedMsg
public void setLastReceivedMsg(HelloMsg lastReceivedMsg)
-
getAcceptedProlongationRequests
public int getAcceptedProlongationRequests()
-
getT_hello_init
public int getT_hello_init()
-
getT_hello_inc
public int getT_hello_inc()
-
getT_hello_prolong_thr_inc
public int getT_hello_prolong_thr_inc()
-
getT_hello_prolong_waiting_gap
public int getT_hello_prolong_waiting_gap()
-
getT_hello_prolong_min
public int getT_hello_prolong_min()
-
-