mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-26 15:21:41 +01:00
[dscalarm] Add details in bridge handler error log to help find the problem (#17051)
* [dscalarm] Add details in bridge handler error log to help find the problem Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
This commit is contained in:
parent
b58580a566
commit
6d63e8c37e
@ -96,7 +96,7 @@ public class DSCAlarmMessage {
|
|||||||
data = message.substring(3);
|
data = message.substring(3);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("processDSCAlarmMessage(): Error processing message: ({}) ", message, e);
|
logger.warn("processDSCAlarmMessage(): Error processing message: ({}) ", message, e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public class DSCAlarmBridgeDiscovery extends AbstractDiscoveryService {
|
|||||||
|
|
||||||
logger.trace("addBridge(): '{}' was added to inbox.", thingUID);
|
logger.trace("addBridge(): '{}' was added to inbox.", thingUID);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("addBridge(): Error", e);
|
logger.warn("addBridge(): Error", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,10 +71,10 @@ public class EnvisalinkBridgeDiscovery {
|
|||||||
lowIP = convertIPToNumber(subnetInfo.getLowAddress());
|
lowIP = convertIPToNumber(subnetInfo.getLowAddress());
|
||||||
highIP = convertIPToNumber(subnetInfo.getHighAddress());
|
highIP = convertIPToNumber(subnetInfo.getHighAddress());
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
logger.error("discoverBridge(): Illegal Argument Exception - {}", e.toString());
|
logger.warn("discoverBridge(): Illegal Argument Exception - {}", e.toString());
|
||||||
return;
|
return;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("discoverBridge(): Error - Unable to get Subnet Information! {}", e.toString());
|
logger.warn("discoverBridge(): Error - Unable to get Subnet Information! {}", e.toString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ public abstract class DSCAlarmBaseBridgeHandler extends BaseBridgeHandler {
|
|||||||
sendCommand(DSCAlarmCode.StatusReport);
|
sendCommand(DSCAlarmCode.StatusReport);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.error("Not Connected to the DSC Alarm!");
|
logger.warn("Not Connected to the DSC Alarm!");
|
||||||
connect();
|
connect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -380,7 +380,7 @@ public abstract class DSCAlarmBaseBridgeHandler extends BaseBridgeHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
logger.error("checkThings(): Thing handler not found!");
|
logger.warn("checkThings(): Thing handler not found! Thing: {}", thing.getUID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -648,7 +648,7 @@ public abstract class DSCAlarmBaseBridgeHandler extends BaseBridgeHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (password == null) {
|
if (password == null) {
|
||||||
logger.error("sendCommand(): No password!");
|
logger.warn("sendCommand(): No password!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
data = password;
|
data = password;
|
||||||
@ -669,14 +669,14 @@ public abstract class DSCAlarmBaseBridgeHandler extends BaseBridgeHandler {
|
|||||||
break;
|
break;
|
||||||
case CommandOutputControl: /* 020 */
|
case CommandOutputControl: /* 020 */
|
||||||
if (dscAlarmData[0] == null || !dscAlarmData[0].matches("[1-8]")) {
|
if (dscAlarmData[0] == null || !dscAlarmData[0].matches("[1-8]")) {
|
||||||
logger.error(
|
logger.warn(
|
||||||
"sendCommand(): Partition number must be a single character string from 1 to 8, it was: {}",
|
"sendCommand(): Partition number must be a single character string from 1 to 8, it was: {}",
|
||||||
dscAlarmData[0]);
|
dscAlarmData[0]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dscAlarmData[1] == null || !dscAlarmData[1].matches("[1-4]")) {
|
if (dscAlarmData[1] == null || !dscAlarmData[1].matches("[1-4]")) {
|
||||||
logger.error(
|
logger.warn(
|
||||||
"sendCommand(): Output number must be a single character string from 1 to 4, it was: {}",
|
"sendCommand(): Output number must be a single character string from 1 to 4, it was: {}",
|
||||||
dscAlarmData[1]);
|
dscAlarmData[1]);
|
||||||
break;
|
break;
|
||||||
@ -693,7 +693,7 @@ public abstract class DSCAlarmBaseBridgeHandler extends BaseBridgeHandler {
|
|||||||
case PartitionArmControlStay: /* 031 */
|
case PartitionArmControlStay: /* 031 */
|
||||||
case PartitionArmControlZeroEntryDelay: /* 032 */
|
case PartitionArmControlZeroEntryDelay: /* 032 */
|
||||||
if (dscAlarmData[0] == null || !dscAlarmData[0].matches("[1-8]")) {
|
if (dscAlarmData[0] == null || !dscAlarmData[0].matches("[1-8]")) {
|
||||||
logger.error(
|
logger.warn(
|
||||||
"sendCommand(): Partition number must be a single character string from 1 to 8, it was: {}",
|
"sendCommand(): Partition number must be a single character string from 1 to 8, it was: {}",
|
||||||
dscAlarmData[0]);
|
dscAlarmData[0]);
|
||||||
break;
|
break;
|
||||||
@ -704,14 +704,14 @@ public abstract class DSCAlarmBaseBridgeHandler extends BaseBridgeHandler {
|
|||||||
case PartitionArmControlWithUserCode: /* 033 */
|
case PartitionArmControlWithUserCode: /* 033 */
|
||||||
case PartitionDisarmControl: /* 040 */
|
case PartitionDisarmControl: /* 040 */
|
||||||
if (dscAlarmData[0] == null || !dscAlarmData[0].matches("[1-8]")) {
|
if (dscAlarmData[0] == null || !dscAlarmData[0].matches("[1-8]")) {
|
||||||
logger.error(
|
logger.warn(
|
||||||
"sendCommand(): Partition number must be a single character string from 1 to 8, it was: {}",
|
"sendCommand(): Partition number must be a single character string from 1 to 8, it was: {}",
|
||||||
dscAlarmData[0]);
|
dscAlarmData[0]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userCode == null || userCode.length() < 4 || userCode.length() > 6) {
|
if (userCode == null || userCode.length() < 4 || userCode.length() > 6) {
|
||||||
logger.error("sendCommand(): User Code is invalid, must be between 4 and 6 chars");
|
logger.warn("sendCommand(): User Code is invalid, must be between 4 and 6 chars");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -732,7 +732,7 @@ public abstract class DSCAlarmBaseBridgeHandler extends BaseBridgeHandler {
|
|||||||
case TimeDateBroadcastControl: /* 056 */
|
case TimeDateBroadcastControl: /* 056 */
|
||||||
case TemperatureBroadcastControl: /* 057 */
|
case TemperatureBroadcastControl: /* 057 */
|
||||||
if (dscAlarmData[0] == null || !dscAlarmData[0].matches("[0-1]")) {
|
if (dscAlarmData[0] == null || !dscAlarmData[0].matches("[0-1]")) {
|
||||||
logger.error("sendCommand(): Value must be a single character string of 0 or 1: {}",
|
logger.warn("sendCommand(): Value must be a single character string of 0 or 1: {}",
|
||||||
dscAlarmData[0]);
|
dscAlarmData[0]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -741,7 +741,7 @@ public abstract class DSCAlarmBaseBridgeHandler extends BaseBridgeHandler {
|
|||||||
break;
|
break;
|
||||||
case TriggerPanicAlarm: /* 060 */
|
case TriggerPanicAlarm: /* 060 */
|
||||||
if (dscAlarmData[0] == null || !dscAlarmData[0].matches("[1-3]")) {
|
if (dscAlarmData[0] == null || !dscAlarmData[0].matches("[1-3]")) {
|
||||||
logger.error("sendCommand(): FAPcode must be a single character string from 1 to 3, it was: {}",
|
logger.warn("sendCommand(): FAPcode must be a single character string from 1 to 3, it was: {}",
|
||||||
dscAlarmData[1]);
|
dscAlarmData[1]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -752,7 +752,7 @@ public abstract class DSCAlarmBaseBridgeHandler extends BaseBridgeHandler {
|
|||||||
if (dscAlarmProtocol.equals(DSCAlarmProtocol.ENVISALINK_TPI)) {
|
if (dscAlarmProtocol.equals(DSCAlarmProtocol.ENVISALINK_TPI)) {
|
||||||
if (dscAlarmData[0] == null || dscAlarmData[0].length() != 1
|
if (dscAlarmData[0] == null || dscAlarmData[0].length() != 1
|
||||||
|| !dscAlarmData[0].matches("[0-9]|A|#|\\*")) {
|
|| !dscAlarmData[0].matches("[0-9]|A|#|\\*")) {
|
||||||
logger.error(
|
logger.warn(
|
||||||
"sendCommand(): \'keystroke\' must be a single character string from 0 to 9, *, #, or A, it was: {}",
|
"sendCommand(): \'keystroke\' must be a single character string from 0 to 9, *, #, or A, it was: {}",
|
||||||
dscAlarmData[0]);
|
dscAlarmData[0]);
|
||||||
break;
|
break;
|
||||||
@ -760,7 +760,7 @@ public abstract class DSCAlarmBaseBridgeHandler extends BaseBridgeHandler {
|
|||||||
} else if (dscAlarmProtocol.equals(DSCAlarmProtocol.IT100_API)) {
|
} else if (dscAlarmProtocol.equals(DSCAlarmProtocol.IT100_API)) {
|
||||||
if (dscAlarmData[0] == null || dscAlarmData[0].length() != 1
|
if (dscAlarmData[0] == null || dscAlarmData[0].length() != 1
|
||||||
|| !dscAlarmData[0].matches("[0-9]|\\*|#|F|A|P|[a-e]|<|>|=|\\^|L")) {
|
|| !dscAlarmData[0].matches("[0-9]|\\*|#|F|A|P|[a-e]|<|>|=|\\^|L")) {
|
||||||
logger.error(
|
logger.warn(
|
||||||
"sendCommand(): \'keystroke\' must be a single character string from 0 to 9, *, #, F, A, P, a to e, <, >, =, or ^, it was: {}",
|
"sendCommand(): \'keystroke\' must be a single character string from 0 to 9, *, #, F, A, P, a to e, <, >, =, or ^, it was: {}",
|
||||||
dscAlarmData[0]);
|
dscAlarmData[0]);
|
||||||
break;
|
break;
|
||||||
@ -771,7 +771,7 @@ public abstract class DSCAlarmBaseBridgeHandler extends BaseBridgeHandler {
|
|||||||
validCommand = true;
|
validCommand = true;
|
||||||
break;
|
break;
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
logger.error("sendCommand(): \'keystroke\': Error with Long Key Press!");
|
logger.warn("sendCommand(): \'keystroke\': Error with Long Key Press!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -789,7 +789,7 @@ public abstract class DSCAlarmBaseBridgeHandler extends BaseBridgeHandler {
|
|||||||
|
|
||||||
if (dscAlarmData[0] == null || dscAlarmData[0].length() > 6
|
if (dscAlarmData[0] == null || dscAlarmData[0].length() > 6
|
||||||
|| !dscAlarmData[0].matches("(\\d|#|\\*)+")) {
|
|| !dscAlarmData[0].matches("(\\d|#|\\*)+")) {
|
||||||
logger.error(
|
logger.warn(
|
||||||
"sendCommand(): \'keysequence\' must be a string of up to 6 characters consiting of 0 to 9, *, or #, it was: {}",
|
"sendCommand(): \'keysequence\' must be a string of up to 6 characters consiting of 0 to 9, *, or #, it was: {}",
|
||||||
dscAlarmData[0]);
|
dscAlarmData[0]);
|
||||||
break;
|
break;
|
||||||
@ -799,7 +799,7 @@ public abstract class DSCAlarmBaseBridgeHandler extends BaseBridgeHandler {
|
|||||||
break;
|
break;
|
||||||
case CodeSend: /* 200 */
|
case CodeSend: /* 200 */
|
||||||
if (userCode == null || userCode.length() < 4 || userCode.length() > 6) {
|
if (userCode == null || userCode.length() < 4 || userCode.length() > 6) {
|
||||||
logger.error("sendCommand(): Access Code is invalid, must be between 4 and 6 chars");
|
logger.warn("sendCommand(): Access Code is invalid, must be between 4 and 6 chars");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -820,7 +820,7 @@ public abstract class DSCAlarmBaseBridgeHandler extends BaseBridgeHandler {
|
|||||||
successful = true;
|
successful = true;
|
||||||
logger.debug("sendCommand(): '{}' Command Sent - {}", dscAlarmCode, confidentialData ? "***" : cmd);
|
logger.debug("sendCommand(): '{}' Command Sent - {}", dscAlarmCode, confidentialData ? "***" : cmd);
|
||||||
} else {
|
} else {
|
||||||
logger.error("sendCommand(): Command '{}' Not Sent - Invalid!", dscAlarmCode);
|
logger.warn("sendCommand(): Command '{}' Not Sent - Invalid!", dscAlarmCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
return successful;
|
return successful;
|
||||||
|
@ -104,16 +104,16 @@ public class EnvisalinkBridgeHandler extends DSCAlarmBaseBridgeHandler {
|
|||||||
|
|
||||||
setConnected(true);
|
setConnected(true);
|
||||||
} catch (UnknownHostException unknownHostException) {
|
} catch (UnknownHostException unknownHostException) {
|
||||||
logger.error("openConnection(): Unknown Host Exception: {}", unknownHostException.getMessage());
|
logger.warn("openConnection(): Unknown Host Exception: {}", unknownHostException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
} catch (SocketException socketException) {
|
} catch (SocketException socketException) {
|
||||||
logger.error("openConnection(): Socket Exception: {}", socketException.getMessage());
|
logger.warn("openConnection(): Socket Exception: {}", socketException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
logger.error("openConnection(): IO Exception: {}", ioException.getMessage());
|
logger.warn("openConnection(): IO Exception: {}", ioException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
logger.error("openConnection(): Unable to open a connection: {} ", exception.getMessage(), exception);
|
logger.warn("openConnection(): Unable to open a connection: {} ", exception.getMessage(), exception);
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -125,10 +125,10 @@ public class EnvisalinkBridgeHandler extends DSCAlarmBaseBridgeHandler {
|
|||||||
tcpOutput.write(writeString);
|
tcpOutput.write(writeString);
|
||||||
tcpOutput.flush();
|
tcpOutput.flush();
|
||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
logger.error("write(): {}", ioException.getMessage());
|
logger.warn("write(): {}", ioException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
logger.error("write(): Unable to write to socket: {} ", exception.getMessage(), exception);
|
logger.warn("write(): Unable to write to socket: {} ", exception.getMessage(), exception);
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -141,10 +141,10 @@ public class EnvisalinkBridgeHandler extends DSCAlarmBaseBridgeHandler {
|
|||||||
message = tcpInput.readLine();
|
message = tcpInput.readLine();
|
||||||
logger.debug("read(): Message Received: {}", message);
|
logger.debug("read(): Message Received: {}", message);
|
||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
logger.error("read(): IO Exception: {}", ioException.getMessage());
|
logger.warn("read(): IO Exception: {}", ioException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
logger.error("read(): Exception: {} ", exception.getMessage(), exception);
|
logger.warn("read(): Exception: {} ", exception.getMessage(), exception);
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,9 +164,9 @@ public class EnvisalinkBridgeHandler extends DSCAlarmBaseBridgeHandler {
|
|||||||
setConnected(false);
|
setConnected(false);
|
||||||
logger.debug("closeConnection(): Closed TCP Connection!");
|
logger.debug("closeConnection(): Closed TCP Connection!");
|
||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
logger.error("closeConnection(): Unable to close connection - {}", ioException.getMessage());
|
logger.warn("closeConnection(): Unable to close connection - {}", ioException.getMessage());
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
logger.error("closeConnection(): Error closing connection - {}", exception.getMessage());
|
logger.warn("closeConnection(): Error closing connection - {}", exception.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,14 +198,14 @@ public class EnvisalinkBridgeHandler extends DSCAlarmBaseBridgeHandler {
|
|||||||
try {
|
try {
|
||||||
handleIncomingMessage(messageLine);
|
handleIncomingMessage(messageLine);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("TCPListener(): Message not handled by bridge: {}", e.getMessage());
|
logger.warn("TCPListener(): Message not handled by bridge: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("TCPListener(): Unable to read message: {} ", e.getMessage(), e);
|
logger.warn("TCPListener(): Unable to read message: {} ", e.getMessage(), e);
|
||||||
closeConnection();
|
closeConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ public class IT100BridgeHandler extends DSCAlarmBaseBridgeHandler implements Ser
|
|||||||
|
|
||||||
SerialPortIdentifier portIdentifier = serialPortManager.getIdentifier(serialPortName);
|
SerialPortIdentifier portIdentifier = serialPortManager.getIdentifier(serialPortName);
|
||||||
if (portIdentifier == null) {
|
if (portIdentifier == null) {
|
||||||
logger.error("openConnection(): No Such Port: {}", serialPort);
|
logger.warn("openConnection(): No Such Port: {}", serialPort);
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -106,18 +106,18 @@ public class IT100BridgeHandler extends DSCAlarmBaseBridgeHandler implements Ser
|
|||||||
|
|
||||||
setConnected(true);
|
setConnected(true);
|
||||||
} catch (PortInUseException portInUseException) {
|
} catch (PortInUseException portInUseException) {
|
||||||
logger.error("openConnection(): Port in Use Exception: {}", portInUseException.getMessage());
|
logger.warn("openConnection(): Port in Use Exception: {}", portInUseException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
} catch (UnsupportedCommOperationException unsupportedCommOperationException) {
|
} catch (UnsupportedCommOperationException unsupportedCommOperationException) {
|
||||||
logger.error("openConnection(): Unsupported Comm Operation Exception: {}",
|
logger.warn("openConnection(): Unsupported Comm Operation Exception: {}",
|
||||||
unsupportedCommOperationException.getMessage());
|
unsupportedCommOperationException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
} catch (UnsupportedEncodingException unsupportedEncodingException) {
|
} catch (UnsupportedEncodingException unsupportedEncodingException) {
|
||||||
logger.error("openConnection(): Unsupported Encoding Exception: {}",
|
logger.warn("openConnection(): Unsupported Encoding Exception: {}",
|
||||||
unsupportedEncodingException.getMessage());
|
unsupportedEncodingException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
logger.error("openConnection(): IO Exception: {}", ioException.getMessage());
|
logger.warn("openConnection(): IO Exception: {}", ioException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,10 +129,10 @@ public class IT100BridgeHandler extends DSCAlarmBaseBridgeHandler implements Ser
|
|||||||
serialOutput.flush();
|
serialOutput.flush();
|
||||||
logger.debug("write(): Message Sent: {}", doNotLog ? "***" : writeString);
|
logger.debug("write(): Message Sent: {}", doNotLog ? "***" : writeString);
|
||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
logger.error("write(): {}", ioException.getMessage());
|
logger.warn("write(): {}", ioException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
logger.error("write(): Unable to write to serial port: {} ", exception.getMessage(), exception);
|
logger.warn("write(): Unable to write to serial port: {} ", exception.getMessage(), exception);
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -145,10 +145,10 @@ public class IT100BridgeHandler extends DSCAlarmBaseBridgeHandler implements Ser
|
|||||||
message = readLine();
|
message = readLine();
|
||||||
logger.debug("read(): Message Received: {}", message);
|
logger.debug("read(): Message Received: {}", message);
|
||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
logger.error("read(): IO Exception: {} ", ioException.getMessage());
|
logger.warn("read(): IO Exception: {} ", ioException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
logger.error("read(): Exception: {} ", exception.getMessage(), exception);
|
logger.warn("read(): Exception: {} ", exception.getMessage(), exception);
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +222,7 @@ public class IT100BridgeHandler extends DSCAlarmBaseBridgeHandler implements Ser
|
|||||||
String messageLine = serialInput.readLine();
|
String messageLine = serialInput.readLine();
|
||||||
handleIncomingMessage(messageLine);
|
handleIncomingMessage(messageLine);
|
||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
logger.error("serialEvent(): IO Exception: {}", ioException.getMessage());
|
logger.warn("serialEvent(): IO Exception: {}", ioException.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -238,7 +238,7 @@ public class IT100BridgeHandler extends DSCAlarmBaseBridgeHandler implements Ser
|
|||||||
serialPort.addEventListener(serialPortEventListenser);
|
serialPort.addEventListener(serialPortEventListenser);
|
||||||
serialPort.notifyOnDataAvailable(true);
|
serialPort.notifyOnDataAvailable(true);
|
||||||
} catch (TooManyListenersException tooManyListenersException) {
|
} catch (TooManyListenersException tooManyListenersException) {
|
||||||
logger.error("setSerialEventHandler(): Too Many Listeners Exception: {}",
|
logger.warn("setSerialEventHandler(): Too Many Listeners Exception: {}",
|
||||||
tooManyListenersException.getMessage());
|
tooManyListenersException.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,16 +111,16 @@ public class TCPServerBridgeHandler extends DSCAlarmBaseBridgeHandler {
|
|||||||
|
|
||||||
setConnected(true);
|
setConnected(true);
|
||||||
} catch (UnknownHostException unknownHostException) {
|
} catch (UnknownHostException unknownHostException) {
|
||||||
logger.error("openConnection(): Unknown Host Exception: {}", unknownHostException.getMessage());
|
logger.warn("openConnection(): Unknown Host Exception: {}", unknownHostException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
} catch (SocketException socketException) {
|
} catch (SocketException socketException) {
|
||||||
logger.error("openConnection(): Socket Exception: {}", socketException.getMessage());
|
logger.warn("openConnection(): Socket Exception: {}", socketException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
logger.error("openConnection(): IO Exception: {}", ioException.getMessage());
|
logger.warn("openConnection(): IO Exception: {}", ioException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
logger.error("openConnection(): Unable to open a connection: {} ", exception.getMessage(), exception);
|
logger.warn("openConnection(): Unable to open a connection: {} ", exception.getMessage(), exception);
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -132,10 +132,10 @@ public class TCPServerBridgeHandler extends DSCAlarmBaseBridgeHandler {
|
|||||||
tcpOutput.flush();
|
tcpOutput.flush();
|
||||||
logger.debug("write(): Message Sent: {}", doNotLog ? "***" : writeString);
|
logger.debug("write(): Message Sent: {}", doNotLog ? "***" : writeString);
|
||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
logger.error("write(): {}", ioException.getMessage());
|
logger.warn("write(): {}", ioException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
logger.error("write(): Unable to write to socket: {} ", exception.getMessage(), exception);
|
logger.warn("write(): Unable to write to socket: {} ", exception.getMessage(), exception);
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -148,10 +148,10 @@ public class TCPServerBridgeHandler extends DSCAlarmBaseBridgeHandler {
|
|||||||
message = tcpInput.readLine();
|
message = tcpInput.readLine();
|
||||||
logger.debug("read(): Message Received: {}", message);
|
logger.debug("read(): Message Received: {}", message);
|
||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
logger.error("read(): IO Exception: {}", ioException.getMessage());
|
logger.warn("read(): IO Exception: {}", ioException.getMessage());
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
logger.error("read(): Exception: {} ", exception.getMessage(), exception);
|
logger.warn("read(): Exception: {} ", exception.getMessage(), exception);
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,9 +170,9 @@ public class TCPServerBridgeHandler extends DSCAlarmBaseBridgeHandler {
|
|||||||
setConnected(false);
|
setConnected(false);
|
||||||
logger.debug("closeConnection(): Closed TCP Connection!");
|
logger.debug("closeConnection(): Closed TCP Connection!");
|
||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
logger.error("closeConnection(): Unable to close connection - {}", ioException.getMessage());
|
logger.warn("closeConnection(): Unable to close connection - {}", ioException.getMessage());
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
logger.error("closeConnection(): Error closing connection - {}", exception.getMessage());
|
logger.warn("closeConnection(): Error closing connection - {}", exception.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,14 +195,14 @@ public class TCPServerBridgeHandler extends DSCAlarmBaseBridgeHandler {
|
|||||||
try {
|
try {
|
||||||
handleIncomingMessage(messageLine);
|
handleIncomingMessage(messageLine);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("TCPListener(): Message not handled by bridge: {}", e.getMessage());
|
logger.warn("TCPListener(): Message not handled by bridge: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("TCPListener(): Unable to read message: {} ", e.getMessage(), e);
|
logger.warn("TCPListener(): Unable to read message: {} ", e.getMessage(), e);
|
||||||
closeConnection();
|
closeConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user