Class TransactionAwareResponseCmd

java.lang.Object
io.github.lunasaw.sip.common.transmit.TransactionAwareResponseCmd

public class TransactionAwareResponseCmd extends Object
事务感知的响应命令管理器 扩展原有ResponseCmd,提供事务上下文感知的响应发送能力
Author:
luna
  • Constructor Details

    • TransactionAwareResponseCmd

      public TransactionAwareResponseCmd()
  • Method Details

    • response

      public static TransactionAwareResponseCmd.TransactionAwareSipResponseBuilder response(int statusCode)
      创建事务感知的响应构建器
    • sendResponse

      public static void sendResponse(int statusCode)
      事务感知的快速响应发送(自动使用当前上下文)
    • sendResponse

      public static void sendResponse(int statusCode, String phrase)
      事务感知的快速响应发送(带短语)
    • sendResponse

      public static void sendResponse(int statusCode, String content, javax.sip.header.ContentTypeHeader contentTypeHeader)
      事务感知的快速响应发送(带内容)
    • sendResponseWithContext

      public static void sendResponseWithContext(int statusCode, String contextKey)
      使用指定上下文键发送响应
    • sendResponseWithContext

      public static void sendResponseWithContext(int statusCode, String phrase, String contextKey)
      使用指定上下文键发送带短语的响应
    • sendOK

      public static void sendOK()
      发送200 OK响应(事务感知)
    • sendBadRequest

      public static void sendBadRequest()
      发送400 Bad Request响应(事务感知)
    • sendInternalServerError

      public static void sendInternalServerError()
      发送500 Internal Server Error响应(事务感知)
    • sendResponseSafe

      public static void sendResponseSafe(int statusCode, javax.sip.RequestEvent requestEvent, javax.sip.ServerTransaction serverTransaction)
      兼容原有API的响应发送(增强版)
    • sendResponseSafe

      public static void sendResponseSafe(int statusCode, String phrase, javax.sip.RequestEvent requestEvent, javax.sip.ServerTransaction serverTransaction)
      兼容原有API的带短语响应发送(增强版)
    • hasValidTransactionContext

      public static boolean hasValidTransactionContext()
      检查当前线程是否有有效的事务上下文
    • getCurrentTransactionInfo

      public static String getCurrentTransactionInfo()
      获取当前事务上下文信息
    • refreshCurrentTransactionContext

      public static boolean refreshCurrentTransactionContext()
      强制刷新当前事务上下文状态