Class DefaultFlowContext

java.lang.Object
com.iohao.net.framework.core.flow.DefaultFlowContext
All Implemented Interfaces:
BroadcastMulticastCommunicationDecorator, BroadcastUserCommunicationDecorator, BroadcastUserListCommunicationDecorator, CommonDecorator, ExternalCommunicationDecorator, LogicCallCollectCommunicationDecorator, LogicCallCommunicationDecorator, LogicCommunicationDecorator, LogicSendCommunicationDecorator, FlowAttachmentCommunication, FlowBindingLogicServerCommunication, FlowBroadcastCommunication, FlowCommon, FlowCommunicationEventBus, FlowContext, FlowExternalCommunication, FlowExternalWriteCommunication, FlowLogicCallCollectCommunication, FlowLogicCallCommunication, FlowLogicSendCommunication, FLowUserIdSettingCommunication

public class DefaultFlowContext extends Object implements FlowContext
Default implementation of FlowContext with Lombok-generated getters and setters.
Since:
25.1
Author:
渔民小镇
date:
2025-10-09
  • Constructor Details

    • DefaultFlowContext

      public DefaultFlowContext()
  • Method Details

    • getNanoTime

      public long getNanoTime()
      Description copied from interface: FlowContext
      Get the nano time when this flow context was created.
      Specified by:
      getNanoTime in interface FlowContext
      Returns:
      creation timestamp in nanoseconds
    • ofRequestMessage

      public RequestMessage ofRequestMessage(CmdInfo cmdInfo, byte[] dataBytes)
      Create a new RequestMessage for cross-logic-server calls, copying routing fields from the current request.
      Specified by:
      ofRequestMessage in interface LogicCommunicationDecorator
      Parameters:
      cmdInfo - the target command routing info
      dataBytes - the serialized request payload
      Returns:
      a new request message with source server and net ID populated
    • setUserId

      public void setUserId(long userId)
      When verifyIdentity is False, this value represents the userChannelId.
      Specified by:
      setUserId in interface FlowCommon
      Specified by:
      setUserId in interface FlowContext
      Parameters:
      userId - the user ID
    • setBarSkeleton

      public void setBarSkeleton(BarSkeleton barSkeleton)
      Description copied from interface: FlowContext
      Set the BarSkeleton for this flow.
      Specified by:
      setBarSkeleton in interface FlowContext
      Parameters:
      barSkeleton - the bar skeleton instance
    • setActionCommand

      public void setActionCommand(ActionCommand actionCommand)
      Description copied from interface: FlowContext
      Set the action command metadata.
      Specified by:
      setActionCommand in interface FlowContext
      Parameters:
      actionCommand - the action command
    • setActionController

      public void setActionController(Object actionController)
      Description copied from interface: FlowContext
      Set the action controller instance.
      Specified by:
      setActionController in interface FlowContext
      Parameters:
      actionController - the controller instance
    • setRequest

      public void setRequest(Request request)
      Description copied from interface: FlowContext
      Set the request message.
      Specified by:
      setRequest in interface FlowContext
      Parameters:
      request - the request
    • setMethodResult

      public void setMethodResult(Object methodResult)
      Description copied from interface: FlowContext
      Set the action method result.
      Specified by:
      setMethodResult in interface FlowCommon
      Specified by:
      setMethodResult in interface FlowContext
      Parameters:
      methodResult - the method result
    • setOriginalMethodResult

      public void setOriginalMethodResult(Object originalMethodResult)
      Description copied from interface: FlowContext
      Set the original action method result.
      Specified by:
      setOriginalMethodResult in interface FlowContext
      Parameters:
      originalMethodResult - the original method result
    • setCommunicationType

      public void setCommunicationType(CommunicationType communicationType)
      Description copied from interface: FlowContext
      Set the communication type.
      Specified by:
      setCommunicationType in interface FlowContext
      Parameters:
      communicationType - the communication type
    • setErrorCode

      public void setErrorCode(int errorCode)
      Description copied from interface: FlowContext
      Set the error code.
      Specified by:
      setErrorCode in interface FlowContext
      Parameters:
      errorCode - the error code
    • setErrorMessage

      public void setErrorMessage(String errorMessage)
      Description copied from interface: FlowContext
      Set the error message.
      Specified by:
      setErrorMessage in interface FlowContext
      Parameters:
      errorMessage - the error message
    • setCommunicationAggregation

      public void setCommunicationAggregation(CommunicationAggregation communicationAggregation)
      Description copied from interface: FlowContext
      Set the communication aggregation.
      Specified by:
      setCommunicationAggregation in interface FlowContext
      Parameters:
      communicationAggregation - the communication aggregation
    • setNanoTime

      public void setNanoTime(long nanoTime)
    • setDataParam

      public void setDataParam(Object dataParam)
      Description copied from interface: FlowContext
      Set the request data parameter.
      Specified by:
      setDataParam in interface FlowContext
      Parameters:
      dataParam - the data parameter
    • setCmdInfo

      public void setCmdInfo(CmdInfo cmdInfo)
      Description copied from interface: FlowContext
      Set the command info.
      Specified by:
      setCmdInfo in interface FlowContext
      Parameters:
      cmdInfo - the command info
    • setCurrentThreadExecutor

      public void setCurrentThreadExecutor(ThreadExecutor currentThreadExecutor)
      Description copied from interface: FlowContext
      Set the thread executor for this flow.
      Specified by:
      setCurrentThreadExecutor in interface FlowContext
      Parameters:
      currentThreadExecutor - the thread executor
    • getUserId

      public long getUserId()
      When verifyIdentity is False, this value represents the userChannelId.
      Specified by:
      getUserId in interface FlowCommon
      Specified by:
      getUserId in interface FlowContext
      Returns:
      the user ID
    • getBarSkeleton

      public BarSkeleton getBarSkeleton()
      Description copied from interface: FlowContext
      Get the BarSkeleton that is processing this flow.
      Specified by:
      getBarSkeleton in interface FlowCommon
      Specified by:
      getBarSkeleton in interface FlowContext
      Returns:
      the bar skeleton instance
    • getActionCommand

      public ActionCommand getActionCommand()
      Description copied from interface: FlowContext
      Get the action command metadata for the current request.
      Specified by:
      getActionCommand in interface FlowContext
      Returns:
      the action command
    • getActionController

      public Object getActionController()
      Description copied from interface: FlowContext
      Get the action controller instance handling this request.
      Specified by:
      getActionController in interface FlowContext
      Returns:
      the controller instance
    • getRequest

      public Request getRequest()
      Description copied from interface: FlowContext
      Get the request message.
      Specified by:
      getRequest in interface FlowCommon
      Specified by:
      getRequest in interface FlowContext
      Returns:
      the request
    • getMethodResult

      public Object getMethodResult()
      Description copied from interface: FlowContext
      Get the result returned by the action method.
      Specified by:
      getMethodResult in interface FlowContext
      Returns:
      the method result
    • getOriginalMethodResult

      public Object getOriginalMethodResult()
      Description copied from interface: FlowContext
      Get the original unprocessed result from the action method.
      Specified by:
      getOriginalMethodResult in interface FlowContext
      Returns:
      the original method result
    • getCommunicationType

      public CommunicationType getCommunicationType()
      Description copied from interface: FlowContext
      Get the communication type for this flow.
      Specified by:
      getCommunicationType in interface FlowCommon
      Specified by:
      getCommunicationType in interface FlowContext
      Returns:
      the communication type
    • getErrorCode

      public int getErrorCode()
      Description copied from interface: FlowContext
      Get the error code, 0 means no error.
      Specified by:
      getErrorCode in interface FlowContext
      Returns:
      the error code
    • getErrorMessage

      public String getErrorMessage()
      Description copied from interface: FlowContext
      Get the error message.
      Specified by:
      getErrorMessage in interface FlowContext
      Returns:
      the error message, or null if none
    • getCommunicationAggregation

      public CommunicationAggregation getCommunicationAggregation()
      Description copied from interface: FlowContext
      Get the communication aggregation for cross-service calls.
      Specified by:
      getCommunicationAggregation in interface CommonDecorator
      Specified by:
      getCommunicationAggregation in interface FlowContext
      Returns:
      the communication aggregation
    • getDataParam

      public Object getDataParam()
      Description copied from interface: FlowContext
      Get the deserialized request data parameter.
      Specified by:
      getDataParam in interface FlowContext
      Returns:
      the data parameter
    • getCmdInfo

      public CmdInfo getCmdInfo()
      Description copied from interface: FlowContext
      Get the command info (cmd, subCmd) for this request.
      Specified by:
      getCmdInfo in interface FlowCommon
      Specified by:
      getCmdInfo in interface FlowContext
      Returns:
      the command info
    • getCurrentThreadExecutor

      public ThreadExecutor getCurrentThreadExecutor()
      Description copied from interface: FlowContext
      Get the thread executor assigned to this flow.
      Specified by:
      getCurrentThreadExecutor in interface FlowCommon
      Specified by:
      getCurrentThreadExecutor in interface FlowContext
      Returns:
      the thread executor