UniPRT SDK  v1.0.0.0
com.UniPRT.Sdk.Json.JsonComm类 参考

使用 JSON 格式的管理 (Mgmt) Comm。负责处理完整/格式良好的 Mgmt/JSON 讯息帧并通过通道转发给任何监听器。 更多...

类 com.UniPRT.Sdk.Json.JsonComm 继承关系图:

Public 成员函数

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 ()
 

静态 Public 成员函数

static String ReplaceJsonArrayValues (String json)
 

Protected 成员函数

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

Private 成员函数

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

Private 属性

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

静态 Private 属性

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()

IMgmtMsgListenerChannels<MgmtMsg> com.UniPRT.Sdk.Json.JsonComm.ChannelListenerMgmtMsg ( )

◆ close()

◆ Dispose() [1/2]

void com.UniPRT.Sdk.Json.JsonComm.Dispose ( )

◆ Dispose() [2/2]

void com.UniPRT.Sdk.Json.JsonComm.Dispose ( boolean  disposing)
protected

◆ 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()

void com.UniPRT.Sdk.Json.JsonComm.Send ( String  mgmtMsgToSend)

◆ 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()

void com.UniPRT.Sdk.Json.JsonComm.Start ( )
private

类成员变量说明

◆ _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

该类的文档由以下文件生成: