Class ReplicatedStateMachineClient

java.lang.Object
org.jgroups.raft.client.ReplicatedStateMachineClient
All Implemented Interfaces:
org.jgroups.blocks.cs.ConnectionListener, org.jgroups.blocks.cs.Receiver

public class ReplicatedStateMachineClient extends Object implements org.jgroups.blocks.cs.Receiver, org.jgroups.blocks.cs.ConnectionListener
Client connecting to a remote ReplicatedStateMachineDemo.
Since:
1.0.0
Author:
Bela Ban
  • Field Details

    • client

      protected org.jgroups.blocks.cs.TcpClient client
    • running

      protected volatile boolean running
    • verbose

      protected volatile boolean verbose
    • SHOW_ALL_CMD

      protected static final byte[] SHOW_ALL_CMD
    • DUMP_CMD

      protected static final byte[] DUMP_CMD
    • SNAPSHOT_CMD

      protected static final byte[] SNAPSHOT_CMD
    • GET_VIEW_CMD

      protected static final byte[] GET_VIEW_CMD
  • Constructor Details

    • ReplicatedStateMachineClient

      public ReplicatedStateMachineClient(boolean verbose)
  • Method Details

    • start

      public void start(InetAddress host, int port) throws Exception
      Throws:
      Exception
    • receive

      public void receive(org.jgroups.Address sender, byte[] buf, int offset, int length)
      Specified by:
      receive in interface org.jgroups.blocks.cs.Receiver
    • receive

      public void receive(org.jgroups.Address sender, ByteBuffer buf)
      Specified by:
      receive in interface org.jgroups.blocks.cs.Receiver
    • receive

      public void receive(org.jgroups.Address sender, DataInput in) throws Exception
      Specified by:
      receive in interface org.jgroups.blocks.cs.Receiver
      Throws:
      Exception
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception
    • connectionClosed

      public void connectionClosed(org.jgroups.blocks.cs.Connection conn)
      Specified by:
      connectionClosed in interface org.jgroups.blocks.cs.ConnectionListener
    • connectionEstablished

      public void connectionEstablished(org.jgroups.blocks.cs.Connection conn)
      Specified by:
      connectionEstablished in interface org.jgroups.blocks.cs.ConnectionListener
    • eventLoop

      protected void eventLoop() throws Exception
      Throws:
      Exception
    • put

      protected void put(String key, String value) throws Exception
      Throws:
      Exception
    • get

      protected void get(String key) throws Exception
      Throws:
      Exception
    • remove

      protected void remove(String key) throws Exception
      Throws:
      Exception
    • showAll

      protected void showAll() throws Exception
      Throws:
      Exception
    • dumpLog

      protected void dumpLog() throws Exception
      Throws:
      Exception
    • snapshot

      protected void snapshot() throws Exception
      Throws:
      Exception
    • getView

      protected void getView() throws Exception
      Throws:
      Exception
    • read

      protected static String read(String name)