Class RequestProtocol

java.lang.Object
dev.agenor.runtime.dialogue.protocol.RequestProtocol
All Implemented Interfaces:
Protocol

public class RequestProtocol extends Object implements Protocol
Request protocol for action execution.

Flow:


 Initiator                    Participant
     |                             |
     |-------- REQUEST ----------->|
     |                             |
     |<------- AGREE/REFUSE -------|
     |                             |
     |<------- INFORM/FAILURE -----|
     |                             |
 
Since:
0.5.0
  • Field Details

  • Constructor Details

    • RequestProtocol

      public RequestProtocol()
  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in interface Protocol
      Returns:
      unique identifier for this protocol
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface Protocol
      Returns:
      human-readable name for display
    • getInitialState

      public ProtocolState getInitialState()
      Specified by:
      getInitialState in interface Protocol
      Returns:
      the initial state when a conversation starts
    • nextState

      public ProtocolState nextState(ProtocolState current, Performative received, boolean isInitiator)
      Description copied from interface: Protocol
      Computes the next state given a performative.
      Specified by:
      nextState in interface Protocol
      Parameters:
      current - the current state
      received - the received performative
      isInitiator - true if this agent initiated the protocol
      Returns:
      the next state
    • allowedPerformatives

      public Set<Performative> allowedPerformatives(ProtocolState state, boolean isInitiator)
      Description copied from interface: Protocol
      Gets the set of allowed performatives in a given state.
      Specified by:
      allowedPerformatives in interface Protocol
      Parameters:
      state - the current state
      isInitiator - true if this agent initiated the protocol
      Returns:
      set of valid performatives