Class ClientData

java.lang.Object
  extended byClientData

public class ClientData
extends java.lang.Object


Field Summary
 double am_time_stamp
           
 double am_time_stamp_1
           
 java.util.ArrayList anti_message_field
           
 boolean comm_ready
           
 java.io.FileWriter fwInQ
           
 java.io.FileWriter fwOutQ
           
 java.io.FileWriter fwSim
           
 java.io.FileWriter fwTraf
           
 java.io.FileWriter fwVis
           
 java.util.ArrayList input_queue
           
 boolean last_time
           
 boolean order_am
           
 boolean order_am_ack
           
 boolean order_am_all
           
 boolean order_am_all_ack
           
 boolean order_am_all_exec
           
 boolean order_am_exec
           
 boolean order_cexit
           
 boolean order_cexit_ack
           
 boolean order_cexit_exec
           
 boolean order_go
           
 boolean order_go_ack
           
 boolean order_go_all
           
 boolean order_go_all_ack
           
 boolean order_go_all_exec
           
 boolean order_go_exec
           
 boolean order_last_event_deadlock
           
 boolean order_lt
           
 boolean order_lt_exec
           
 boolean order_sim_over
           
 boolean order_so
           
 boolean order_so_ack
           
 boolean order_so_exec
           
 boolean order_stop
           
 boolean order_stop_ack
           
 boolean order_stop_all
           
 boolean order_stop_all_ack
           
 boolean order_stop_all_exec
           
 boolean order_stop_exec
           
 java.util.ArrayList output_queue
           
 int outputStatus
           
 boolean pause
           
 java.util.ArrayList ref_field
           
 java.util.ArrayList sender_field
           
 SimulationData simData
           
 java.lang.StringBuffer simName
           
 cz.zcu.fav.kiv.jsim.JSimSimulation simulation
           
 int simulationStatus
           
 java.util.ArrayList user_list
           
 
Constructor Summary
ClientData(cz.zcu.fav.kiv.jsim.JSimSimulation sim)
           
 
Method Summary
 void addAntiMessage(double ParAntiMessageStamp, java.lang.String ParReiceiver)
          This method store anti-message
to field


PAR: (double) .. anti-mesage time stamp
(string) .. this AM is for this receiver
 void addGeneratorRef(cz.zcu.fav.kiv.jsim.JSimProcess ParGenReferen)
          This method store referencis of generating item in simulation
to field


PAR: (JSimProcess) .. reference of generator
 void addSenderName(java.lang.String ParSender)
          This method store sender name to field, that is nessary dou to
GTV computing


PAR:
(string) .. sender name
 void addServerAndQueueRef(cz.zcu.fav.kiv.jsim.JSimProcess ParServerRef, cz.zcu.fav.kiv.jsim.JSimHead ParQueueRef)
           
 boolean anyNotExecutedEvent()
          are in input queue any not executed events in
input queue

RV: (boolean) true .. yes there are
false .. no one
 boolean anyNotSendedEvent()
          are in output queue any not sended events in

RV: (boolean) true .. yes there are
false .. no one
 int clearAllLinks()
          Delete all links in queues
 int CloseFile()
          Close server login file

RV: (int) 1 .. file closed succefully
-1 ..
 int CreateFile()
          Create file for saving of all server trafic

RV: (int) 1 .. file created succefully
-1 ..
 int deleteRolledEvents(double ParTimeStamp)
          This method delete Events from input queue with time
stamp greater then time stamp of strangler message
and from simulation whitch can by rolled back

PAR: (double) ..
 int eraseAntiMessageField()
          This method is call when all AM are sended and now are erase
from field

RV: (int) .. number of erased anti messages
 int eraseRolledEvent(double ParNewSimTime)
          erase all events with time stamp greater then time stamp
of strangler message as not procesed

PAR: (double) ..
 int eraseSimItem(double ParNewSimTime)
          erase all incorect processed items from simulation

PAR: (double) ..
 int eraseUndedEvent(double ParNewSimTime)
          erase all events with time stamp greater then time stamp
of strangler message as not procesed

PAR: (double) ..
protected  void finalize()
           
 AntiMessageItem getAntiMessage()
          This method get one anti-message
from field


RV: (AntiMessageItem) .. anti-mesage object
else null if there no more AM in Field
 int getCountOfUser()
          This method return count of user in field
RV: (int) count of user
 double getCreationTime(double ParCurentTime)
          get value of creation Time of Event with TimeStamp

PAR: (double) .. time stamp of events

RV: (double) ..
 MessageItem getFromInputQueue()
          get incoming events from input queue

RV: (MessageItem) event
 MessageItem getFromOutputQueue()
          take event from output queue with lowest time

RV: (MessageItem)
item with event

 int getIndexInQ()
          get index of item with lowest time stamp and not executed
 int getIndexOutQ()
          get index of item with lowest time stamp and not sended
 double getLBTS()
          this method compute LBTS

RV: (double) ..
 double getPredEvent(double ParTimeStamp)
          This method return time stamp of Event that is queue
before antimessage

PAR: (double) ..
 java.lang.String getServerAddress()
          This method get server ip if this method isnt called
server adres is local host

RV: (String) ..
 TimeItem getSimItem(cz.zcu.fav.kiv.jsim.JSimProcess ParProcess)
          restore all components in simulation to stable state

PAR: (double) ..
 java.lang.String getUserName(int ParIndex)
          get user (simulation) name
PAR: (int) ParIndex
RV: (String) ParUserName .. user name
 int checkOutGoingMessages(double ParTimeStemp)
          Are There any incorect sended messages to other
client

PAR : (double) ..
 void insertLBTS(java.lang.String ParSender, double ParTimeStamp)
          this method add time stamp to user field its nessary duo to
computing GTV

PAR: (string) sender name
(double) time stamp
 int mustGetAntiMessageIndex(double ParTimeStemp)
          This methor return index of message from output queue
with creation time lower then time stamp of strangler
message

PAR : (double) ..
 int putToInputQueue(MessageItem par_item)
          Store incoming message's to input queue

PAR : (client_message_item) parsed message

RETURN VALUE: (int)
1 ..
 int putToOutputQueue(double par_message_1, double par_message_2, java.lang.String ParRecvName, int ParGate)
          put incoming Event from simulation to output queue

PAR :
(double) .. time stamp of event
(double) .. time of creation of event
(String) .. name of receiver of event
(int) .. number of gate in simulation

RETURN VALUE: (int)
1 ..
 int putToOutputQueue(java.lang.String par_message)
          Store incoming orders from simulation

PAR : (String) .. order

RETURN VALUE: (int) 1.. known order
-1 .. uknown order
 int setNotExecuted(double ParNewSimTime)
          Set all events with time stamp greater then time stamp
of strangler message as not procesed

PAR: (double) ..
 void setOutputStatus(int ParOutputStatus)
          Method set output status

PAR: (int) .. 1 Output on screen
2 Output on screen + to file
3 Output to file
 void setReceiverName(java.lang.String ParUserName)
          Add receiver(simulation) name to field
Par: (String) ParUserName .. user name
 void setServerAddress(java.lang.String ParServerIP)
          This method set server ip if this method isnt called
server adres is local host

Par: (String) ..
 void setSimulationName(java.lang.String ParUserName)
          Set user (simulation) name
Par: (String) ParUserName .. user name
 void setSimulationStatus(int ParSimStatus)
          Method set simulation status

PAR: (int) .. 1 this simulation can't by rooled back
2 this simulation can by rooled back

 void thread_sleep(int par_time_to_sleep)
           
 void undo()
           
 void unlock()
          Free locked simulation thread
 void unLockPause()
           
 void WriteInQToFile()
          Write-in to client file InputQueue

 void WriteOutQToFile()
          Write-in to client file InputQueue

 void WriteToFile(java.lang.String ParLine)
          Write-in to client login file

Par: (String) ParLine ..
 void WriteToSimFile(java.lang.String ParLine)
          Write output to simulation trafic file

Par: (String) ParLine ..
 void WriteToVisFile(java.lang.String ParLine)
          Write-in to visulal login file

Par: (String) ParLine ..
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

order_cexit

public boolean order_cexit

order_sim_over

public boolean order_sim_over

order_stop_all

public boolean order_stop_all

order_stop_all_ack

public boolean order_stop_all_ack

order_stop_all_exec

public boolean order_stop_all_exec

order_stop

public boolean order_stop

order_stop_ack

public boolean order_stop_ack

order_stop_exec

public boolean order_stop_exec

order_go_all

public boolean order_go_all

order_go_all_ack

public boolean order_go_all_ack

order_go_all_exec

public boolean order_go_all_exec

order_go

public boolean order_go

order_go_ack

public boolean order_go_ack

order_go_exec

public boolean order_go_exec

order_am_all

public boolean order_am_all

order_am_all_ack

public boolean order_am_all_ack

order_am_all_exec

public boolean order_am_all_exec

order_am

public boolean order_am

order_am_exec

public boolean order_am_exec

order_am_ack

public boolean order_am_ack

order_lt

public boolean order_lt

order_lt_exec

public boolean order_lt_exec

order_so

public boolean order_so

order_so_exec

public boolean order_so_exec

order_so_ack

public boolean order_so_ack

order_cexit_exec

public boolean order_cexit_exec

order_cexit_ack

public boolean order_cexit_ack

order_last_event_deadlock

public boolean order_last_event_deadlock

pause

public boolean pause

comm_ready

public boolean comm_ready

last_time

public boolean last_time

am_time_stamp

public double am_time_stamp

am_time_stamp_1

public double am_time_stamp_1

simName

public java.lang.StringBuffer simName

simData

public SimulationData simData

user_list

public java.util.ArrayList user_list

input_queue

public java.util.ArrayList input_queue

output_queue

public java.util.ArrayList output_queue

ref_field

public java.util.ArrayList ref_field

sender_field

public java.util.ArrayList sender_field

anti_message_field

public java.util.ArrayList anti_message_field

simulation

public cz.zcu.fav.kiv.jsim.JSimSimulation simulation

fwInQ

public java.io.FileWriter fwInQ

fwOutQ

public java.io.FileWriter fwOutQ

fwTraf

public java.io.FileWriter fwTraf

fwVis

public java.io.FileWriter fwVis

fwSim

public java.io.FileWriter fwSim

outputStatus

public int outputStatus

simulationStatus

public int simulationStatus
Constructor Detail

ClientData

public ClientData(cz.zcu.fav.kiv.jsim.JSimSimulation sim)
Method Detail

setServerAddress

public void setServerAddress(java.lang.String ParServerIP)
This method set server ip if this method isnt called
server adres is local host

Par: (String) .. Server IP adress


getServerAddress

public java.lang.String getServerAddress()
This method get server ip if this method isnt called
server adres is local host

RV: (String) .. Server IP adress


getLBTS

public double getLBTS()
this method compute LBTS

RV: (double) .. Lower Bound of Time Stamp


insertLBTS

public void insertLBTS(java.lang.String ParSender,
                       double ParTimeStamp)
this method add time stamp to user field its nessary duo to
computing GTV

PAR: (string) sender name
(double) time stamp


addSenderName

public void addSenderName(java.lang.String ParSender)
This method store sender name to field, that is nessary dou to
GTV computing


PAR:
(string) .. sender name


setSimulationStatus

public void setSimulationStatus(int ParSimStatus)
Method set simulation status

PAR: (int) .. 1 this simulation can't by rooled back
2 this simulation can by rooled back


setOutputStatus

public void setOutputStatus(int ParOutputStatus)
Method set output status

PAR: (int) .. 1 Output on screen
2 Output on screen + to file
3 Output to file


mustGetAntiMessageIndex

public int mustGetAntiMessageIndex(double ParTimeStemp)
This methor return index of message from output queue
with creation time lower then time stamp of strangler
message

PAR : (double) .. Time when Strangler message comin

RV : (int) .. Index of item from output Queue
else -1 if there no incorect sended messages


checkOutGoingMessages

public int checkOutGoingMessages(double ParTimeStemp)
Are There any incorect sended messages to other
client

PAR : (double) .. Time when Strangler message comin


eraseUndedEvent

public int eraseUndedEvent(double ParNewSimTime)
erase all events with time stamp greater then time stamp
of strangler message as not procesed

PAR: (double) .. Time stamp of Stagler m.

RV: (int).. number of incorrect procesed events
-1 no incorrect event found


getPredEvent

public double getPredEvent(double ParTimeStamp)
This method return time stamp of Event that is queue
before antimessage

PAR: (double) .. Time stamp if anti-message

RV: (double) .. Time stamp of pred message in inputQueue


addServerAndQueueRef

public void addServerAndQueueRef(cz.zcu.fav.kiv.jsim.JSimProcess ParServerRef,
                                 cz.zcu.fav.kiv.jsim.JSimHead ParQueueRef)

addAntiMessage

public void addAntiMessage(double ParAntiMessageStamp,
                           java.lang.String ParReiceiver)
This method store anti-message
to field


PAR: (double) .. anti-mesage time stamp
(string) .. this AM is for this receiver


getAntiMessage

public AntiMessageItem getAntiMessage()
This method get one anti-message
from field


RV: (AntiMessageItem) .. anti-mesage object
else null if there no more AM in Field


eraseAntiMessageField

public int eraseAntiMessageField()
This method is call when all AM are sended and now are erase
from field

RV: (int) .. number of erased anti messages


addGeneratorRef

public void addGeneratorRef(cz.zcu.fav.kiv.jsim.JSimProcess ParGenReferen)
This method store referencis of generating item in simulation
to field


PAR: (JSimProcess) .. reference of generator


CreateFile

public int CreateFile()
Create file for saving of all server trafic

RV: (int) 1 .. file created succefully
-1 .. can't created file


CloseFile

public int CloseFile()
Close server login file

RV: (int) 1 .. file closed succefully
-1 .. can't close file


WriteToVisFile

public void WriteToVisFile(java.lang.String ParLine)
Write-in to visulal login file

Par: (String) ParLine .. Input text


WriteToSimFile

public void WriteToSimFile(java.lang.String ParLine)
Write output to simulation trafic file

Par: (String) ParLine .. Input text


WriteToFile

public void WriteToFile(java.lang.String ParLine)
Write-in to client login file

Par: (String) ParLine .. Input text


WriteInQToFile

public void WriteInQToFile()
Write-in to client file InputQueue


WriteOutQToFile

public void WriteOutQToFile()
Write-in to client file InputQueue


getIndexOutQ

public int getIndexOutQ()
get index of item with lowest time stamp and not sended


anyNotSendedEvent

public boolean anyNotSendedEvent()
are in output queue any not sended events in

RV: (boolean) true .. yes there are
false .. no one


setNotExecuted

public int setNotExecuted(double ParNewSimTime)
Set all events with time stamp greater then time stamp
of strangler message as not procesed

PAR: (double) .. Time stamp of Stagler m.

RV: (int).. number of incorrect procesed events
-1 no incorrect event found


deleteRolledEvents

public int deleteRolledEvents(double ParTimeStamp)
This method delete Events from input queue with time
stamp greater then time stamp of strangler message
and from simulation whitch can by rolled back

PAR: (double) .. Strangler Time Stamp

RV : (int) .. count erased events


eraseRolledEvent

public int eraseRolledEvent(double ParNewSimTime)
erase all events with time stamp greater then time stamp
of strangler message as not procesed

PAR: (double) .. Time stamp of Stagler m.

RV: (int).. number of incorrect procesed events
-1 no incorrect event found


getSimItem

public TimeItem getSimItem(cz.zcu.fav.kiv.jsim.JSimProcess ParProcess)
restore all components in simulation to stable state

PAR: (double) .. Time stamp of Strangler message

RV: (int) .. Count of restored components item


eraseSimItem

public int eraseSimItem(double ParNewSimTime)
erase all incorect processed items from simulation

PAR: (double) .. Time stamp of Strangler message

RV: (int) .. Count of removed time item


clearAllLinks

public int clearAllLinks()
Delete all links in queues


getCreationTime

public double getCreationTime(double ParCurentTime)
get value of creation Time of Event with TimeStamp

PAR: (double) .. time stamp of events

RV: (double) .. Time of creation this event
-1.0 if this event not found


getIndexInQ

public int getIndexInQ()
get index of item with lowest time stamp and not executed


anyNotExecutedEvent

public boolean anyNotExecutedEvent()
are in input queue any not executed events in
input queue

RV: (boolean) true .. yes there are
false .. no one


setSimulationName

public void setSimulationName(java.lang.String ParUserName)
Set user (simulation) name
Par: (String) ParUserName .. user name


setReceiverName

public void setReceiverName(java.lang.String ParUserName)
Add receiver(simulation) name to field
Par: (String) ParUserName .. user name


getCountOfUser

public int getCountOfUser()
This method return count of user in field
RV: (int) count of user


getUserName

public java.lang.String getUserName(int ParIndex)
get user (simulation) name
PAR: (int) ParIndex
RV: (String) ParUserName .. user name


putToInputQueue

public int putToInputQueue(MessageItem par_item)
Store incoming message's to input queue

PAR : (client_message_item) parsed message

RETURN VALUE: (int)
1 .. Stored suceffuly


getFromInputQueue

public MessageItem getFromInputQueue()
get incoming events from input queue

RV: (MessageItem) event


putToOutputQueue

public int putToOutputQueue(java.lang.String par_message)
Store incoming orders from simulation

PAR : (String) .. order

RETURN VALUE: (int) 1.. known order
-1 .. uknown order


undo

public void undo()

thread_sleep

public void thread_sleep(int par_time_to_sleep)

putToOutputQueue

public int putToOutputQueue(double par_message_1,
                            double par_message_2,
                            java.lang.String ParRecvName,
                            int ParGate)
put incoming Event from simulation to output queue

PAR :
(double) .. time stamp of event
(double) .. time of creation of event
(String) .. name of receiver of event
(int) .. number of gate in simulation

RETURN VALUE: (int)
1 .. Stored suceffuly


getFromOutputQueue

public MessageItem getFromOutputQueue()
take event from output queue with lowest time

RV: (MessageItem)
item with event


unlock

public void unlock()
Free locked simulation thread


unLockPause

public void unLockPause()

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable