Management (Mgmt) Comm using JSON format. Concerned with full/well formed Mgmt/JSON msg frames and forwards to any listeners via channels. More...
Public Member Functions | |
IMgmtMsgListenerChannels< String > | ChannelListenerJson () |
IMgmtMsgListenerChannels< MgmtMsg > | ChannelListenerMgmtMsg () |
JsonComm (IComm commToPtr) | |
Start a JSON communication using the connection passed in. More... | |
void | Send (String mgmtMsgToSend) |
Sends JSON mgmtMsgToSend using the connection that was passed in when object was created. More... | |
String | SendAndWaitForResponse (String mgmtMsg, int respTimeoutMs) |
Send JSON msg mgmtMsg and wait respTimeoutMs before returning response. If no response received after timeout, empty string "" returned. More... | |
void | Dispose () |
void | close () |
Static Public Member Functions | |
static String | ReplaceJsonArrayValues (String json) |
Protected Member Functions | |
void | Dispose (boolean disposing) |
void | finalize () throws Throwable |
Private Member Functions | |
void | Start () |
void | MsgFrameSplitterAsync () |
void | SendAndWaitForMsgFrame (byte[] outmsg, int responseStartTimeout, int responseEndTimeout) |
String | GetMsgFrame (StringBuilder strUnframed) |
Private Attributes | |
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 Private Attributes | |
static final Logger | LOGGER = Logger.getLogger(JsonComm.class.getName()) |
Management (Mgmt) Comm using JSON format. Concerned with full/well formed Mgmt/JSON msg frames and forwards to any listeners via channels.
Requires a communication connection for sending and listening for fully formed Mgmt messages.
This class also uses the communication connection to send and listen for JSON msgs.
Note that this class will read all data received from the communication connection as it is received in order to
listen and parse fully formed JSON messages.
com.UniPRT.Sdk.Json.JsonComm.JsonComm | ( | IComm | commToPtr | ) |
Start a JSON communication using the connection passed in.
Connection must be opened and maintained opened by caller/user.
References com.UniPRT.Sdk.Json.JsonComm.Start().
IMgmtMsgListenerChannels<String> com.UniPRT.Sdk.Json.JsonComm.ChannelListenerJson | ( | ) |
References com.UniPRT.Sdk.Json.JsonComm._listenersJsonChnls.
Referenced by com.UniPRT.Sdk.Mgmt.Messenger.Messenger(), com.UniPRT.Sdk.Json.OdvMonitor.MsgListenerCtrlRefresh(), com.UniPRT.Sdk.Json.RfidMonitor.MsgListenerCtrlRefresh(), com.UniPRT.Sdk.Json.PrinterMonitor.MsgListenerCtrlRefresh(), and com.UniPRT.Sdk.Json.JsonComm.SendAndWaitForResponse().
IMgmtMsgListenerChannels<MgmtMsg> com.UniPRT.Sdk.Json.JsonComm.ChannelListenerMgmtMsg | ( | ) |
References com.UniPRT.Sdk.Json.JsonComm._listenersMgmtMsgChnls.
Referenced by com.UniPRT.Sdk.Mgmt.Listener.ListenerChannelsConnectorGet().
void com.UniPRT.Sdk.Json.JsonComm.close | ( | ) |
void com.UniPRT.Sdk.Json.JsonComm.Dispose | ( | ) |
|
protected |
|
protected |
|
private |
Referenced by com.UniPRT.Sdk.Json.JsonComm.SendAndWaitForMsgFrame().
|
private |
|
static |
Referenced by com.UniPRT.Sdk.Json.JsonComm.SendAndWaitForResponse().
void com.UniPRT.Sdk.Json.JsonComm.Send | ( | String | mgmtMsgToSend | ) |
Sends JSON mgmtMsgToSend using the connection that was passed in when object was created.
References com.UniPRT.Sdk.Json.JsonComm._msgOut, com.UniPRT.Sdk.Json.JsonStringBuilder.DataPortPrefix, com.UniPRT.Sdk.Json.JsonStringBuilder.DataPortSuffix, and com.UniPRT.Sdk.Mgmt.Channel< T >.TryWrite().
Referenced by com.UniPRT.Sdk.Mgmt.Messenger.SendMsg(), and com.UniPRT.Sdk.Mgmt.Messenger.SendMsgRaw().
|
private |
References com.UniPRT.Sdk.Json.JsonComm._jsonComm, com.UniPRT.Sdk.Json.JsonComm._jsonReceived, com.UniPRT.Sdk.Json.JsonComm._listenersJsonChnls, com.UniPRT.Sdk.Json.JsonComm._listenersMgmtMsgChnls, com.UniPRT.Sdk.Comm.IComm.Connected(), com.UniPRT.Sdk.Json.JsonComm.GetMsgFrame(), com.UniPRT.Sdk.Json.JsonStringTokenizer.GetMsgId_Json(), com.UniPRT.Sdk.Mgmt.AMgmtListenerChannels< T >.ListenerMsgDeposit(), and com.UniPRT.Sdk.Comm.IComm.WriteAndWaitForResponse().
Referenced by com.UniPRT.Sdk.Json.JsonComm.MsgFrameSplitterAsync().
String com.UniPRT.Sdk.Json.JsonComm.SendAndWaitForResponse | ( | String | mgmtMsg, |
int | respTimeoutMs | ||
) |
Send JSON msg mgmtMsg and wait respTimeoutMs before returning response. If no response received after timeout, empty string "" returned.
References 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(), and com.UniPRT.Sdk.Mgmt.Channel< T >.Write().
Referenced by 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(), and com.UniPRT.Sdk.Json.SettingsReadWrite.SetValues().
|
private |
|
private |
|
private |
Referenced by com.UniPRT.Sdk.Json.JsonComm.Dispose(), and com.UniPRT.Sdk.Json.JsonComm.Start().
|
private |
|
private |
Referenced by com.UniPRT.Sdk.Json.JsonComm.SendAndWaitForMsgFrame().
|
private |
|
private |
|
private |
|
private |
|
staticprivate |