Class AbstractRequestHandler

    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
      • me

        protected final int me
      • session

        protected final int session
      • sequenceId

        protected final int sequenceId
      • operationId

        protected final int operationId
      • viewId

        protected final int viewId
      • replyQuorumSize

        protected final int replyQuorumSize
      • replySenders

        protected java.util.Set<java.lang.Integer> replySenders
    • Constructor Detail

      • AbstractRequestHandler

        public AbstractRequestHandler​(int me,
                                      int session,
                                      int sequenceId,
                                      int operationId,
                                      int viewId,
                                      TOMMessageType requestType,
                                      int timeout,
                                      int[] replicas,
                                      int replyQuorumSize)
    • Method Detail

      • createRequest

        public abstract TOMMessage createRequest​(byte[] request)
      • waitForResponse

        public void waitForResponse()
                             throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • getResponse

        public TOMMessage getResponse()
        This method returns the response. Call this method after calling waitForResponse() method.
        Returns:
        Response to the request
      • processReply

        public void processReply​(TOMMessage reply)
      • processReply

        public abstract TOMMessage processReply​(TOMMessage reply,
                                                int lastSenderIndex)
      • getSequenceId

        public int getSequenceId()
      • getNumberReceivedReplies

        public int getNumberReceivedReplies()
      • getReplyQuorumSize

        public int getReplyQuorumSize()
      • isRequestTimeout

        public boolean isRequestTimeout()
        Call this method after calling waitForResponse().
        Returns:
        true if request timeout or false otherwise.
      • printState

        public abstract void printState()