UniPRT SDK  v1.0.0.0
com.UniPRT.Sdk.Json.JsonComm 類別 參考文件

使用 JSON 格式的管理 (Mgmt) Comm。負責處理完整/格式良好的 Mgmt/JSON 訊息幀並通過通道轉發給任何聽眾。 更多...

類別com.UniPRT.Sdk.Json.JsonComm的繼承圖:

公開方法(Public Methods)

IMgmtMsgListenerChannels< String > ChannelListenerJson ()
 
IMgmtMsgListenerChannels< MgmtMsgChannelListenerMgmtMsg ()
 
 JsonComm (IComm commToPtr)
 使用傳入的連接啟動 JSON 通信。 更多...
 
void Send (String mgmtMsgToSend)
 使用創建對象時傳入的連接發送 JSON mgmtMsgToSend。 更多...
 
String SendAndWaitForResponse (String mgmtMsg, int respTimeoutMs)
 發送 JSON 訊息 mgmtMsg 並等待 respTimeoutMs 後返回響應。 如果超時後未接收到響應,返回空字串 ""。 更多...
 
void Dispose ()
 
void close ()
 

靜態公開方法(Static Public Methods)

static String ReplaceJsonArrayValues (String json)
 

保護方法(Protected Methods)

void Dispose (boolean disposing)
 
void finalize () throws Throwable
 

私有方法(Private Methods)

void Start ()
 
void MsgFrameSplitterAsync ()
 
void SendAndWaitForMsgFrame (byte[] outmsg, int responseStartTimeout, int responseEndTimeout)
 
String GetMsgFrame (StringBuilder strUnframed)
 

私有屬性

ListenerChannelsJson _listenersJsonChnls = new ListenerChannelsJson()
 
ListenerChannelsMgmtMsg _listenersMgmtMsgChnls = null
 
StringBuilder _jsonReceived = new StringBuilder()
 
IComm _jsonComm
 
ExecutorService _executor
 
Channel< String > _msgOut
 
boolean _usingDataPort = false
 
boolean _disposed = false
 

靜態私有屬性

static final Logger LOGGER = Logger.getLogger(JsonComm.class.getName())
 

詳細描述

使用 JSON 格式的管理 (Mgmt) Comm。負責處理完整/格式良好的 Mgmt/JSON 訊息幀並通過通道轉發給任何聽眾。

需要通信連接來發送和接收完整的管理訊息。
此類還使用通信連接發送和接收 JSON 訊息。
注意,此類將會在收到數據時讀取從通信連接接收的所有數據,以便於聆聽和解析完整的 JSON 訊息。

建構子與解構子說明文件

◆ JsonComm()

com.UniPRT.Sdk.Json.JsonComm.JsonComm ( IComm  commToPtr)

使用傳入的連接啟動 JSON 通信。

連接必須由呼叫者/使用者打開並保持打開狀態。

參考 com.UniPRT.Sdk.Json.JsonComm.Start().

函式成員說明文件

◆ ChannelListenerJson()

◆ ChannelListenerMgmtMsg()

◆ close()

◆ Dispose() [1/2]

◆ Dispose() [2/2]

◆ finalize()

void com.UniPRT.Sdk.Json.JsonComm.finalize ( ) throws Throwable
protected

◆ GetMsgFrame()

String com.UniPRT.Sdk.Json.JsonComm.GetMsgFrame ( StringBuilder  strUnframed)
private

◆ MsgFrameSplitterAsync()

◆ ReplaceJsonArrayValues()

static String com.UniPRT.Sdk.Json.JsonComm.ReplaceJsonArrayValues ( String  json)
static

◆ Send()

◆ SendAndWaitForMsgFrame()

◆ SendAndWaitForResponse()

String com.UniPRT.Sdk.Json.JsonComm.SendAndWaitForResponse ( String  mgmtMsg,
int  respTimeoutMs 
)

發送 JSON 訊息 mgmtMsg 並等待 respTimeoutMs 後返回響應。 如果超時後未接收到響應,返回空字串 ""。

參考 com.UniPRT.Sdk.Json.JsonComm._listenersJsonChnls, com.UniPRT.Sdk.Json.JsonComm._msgOut, com.UniPRT.Sdk.Mgmt.MgmtChannelFilterType.ALL_MSGS, com.UniPRT.Sdk.Json.JsonComm.ChannelListenerJson(), com.UniPRT.Sdk.Json.JsonStringBuilder.DataPortPrefix, com.UniPRT.Sdk.Json.JsonStringBuilder.DataPortSuffix, com.UniPRT.Sdk.Json.JsonStringTokenizer.GetMsgId_Json(), com.UniPRT.Sdk.Json.JsonStringTokenizer.GetMsgIdExpectedOnResponse_Json(), com.UniPRT.Sdk.Mgmt.AMgmtListenerChannels< T >.ListenerChannelGetNew(), com.UniPRT.Sdk.Json.JsonComm.LOGGER, com.UniPRT.Sdk.Mgmt.Channel< T >.Poll(), com.UniPRT.Sdk.Json.JsonComm.ReplaceJsonArrayValues(), 及 com.UniPRT.Sdk.Mgmt.Channel< T >.Write().

被參考於 com.UniPRT.Sdk.Json.SettingsReadWrite.GetAllProperties(), com.UniPRT.Sdk.Json.SettingsReadWrite.GetAllValues(), com.UniPRT.Sdk.Settings.Configs.GetConfig(), com.UniPRT.Sdk.Json.PrinterMonitor.GetEngineStatus(), com.UniPRT.Sdk.Json.PrinterMonitor.GetFaultStatus(), com.UniPRT.Sdk.Json.PrinterMonitor.GetPrinterInfo(), com.UniPRT.Sdk.Json.SettingsReadWrite.GetProperties(), com.UniPRT.Sdk.Json.SettingsReadWrite.GetValue(), com.UniPRT.Sdk.Json.SettingsReadWrite.GetValues(), com.UniPRT.Sdk.Json.PrinterMonitor.SetAlertStatusListening(), com.UniPRT.Sdk.Settings.Configs.SetConfig(), com.UniPRT.Sdk.Json.PrinterMonitor.SetDisplayStatusListening(), com.UniPRT.Sdk.Json.PrinterMonitor.SetEngineStatusListening(), com.UniPRT.Sdk.Json.OdvMonitor.SetOdvReportListening(), com.UniPRT.Sdk.Json.RfidMonitor.SetRfidReportListening(), com.UniPRT.Sdk.Json.SettingsReadWrite.SetValue(), 及 com.UniPRT.Sdk.Json.SettingsReadWrite.SetValues().

◆ Start()

資料成員說明文件

◆ _disposed

boolean com.UniPRT.Sdk.Json.JsonComm._disposed = false
private

◆ _executor

ExecutorService com.UniPRT.Sdk.Json.JsonComm._executor
private

◆ _jsonComm

IComm com.UniPRT.Sdk.Json.JsonComm._jsonComm
private

◆ _jsonReceived

StringBuilder com.UniPRT.Sdk.Json.JsonComm._jsonReceived = new StringBuilder()
private

◆ _listenersJsonChnls

◆ _listenersMgmtMsgChnls

ListenerChannelsMgmtMsg com.UniPRT.Sdk.Json.JsonComm._listenersMgmtMsgChnls = null
private

◆ _msgOut

◆ _usingDataPort

boolean com.UniPRT.Sdk.Json.JsonComm._usingDataPort = false
private

◆ LOGGER

final Logger com.UniPRT.Sdk.Json.JsonComm.LOGGER = Logger.getLogger(JsonComm.class.getName())
staticprivate

此類別(class) 文件是由下列檔案中產生: