2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.globalcache.internal.command;
15 import java.util.concurrent.LinkedBlockingQueue;
17 import org.openhab.binding.globalcache.internal.GlobalCacheBindingConstants.CommandType;
20 * The {@link RequestMessage} class is responsible for storing the command to be sent to the GlobalCache
21 * device and for storing whether the command is serial or not.
23 * @author Mark Hilbush - Initial contribution
25 public class RequestMessage {
26 private LinkedBlockingQueue<ResponseMessage> rcvQueue;
27 private String deviceCommand;
28 private CommandType commandType;
29 private String commandName;
31 public RequestMessage(String commandName, CommandType commandType, String deviceCommand,
32 LinkedBlockingQueue<ResponseMessage> rcvQueue) {
33 this.commandName = commandName;
34 this.commandType = commandType;
35 this.deviceCommand = deviceCommand;
36 this.rcvQueue = rcvQueue;
39 public String getDeviceCommand() {
43 public String getCommandName() {
47 public CommandType getCommandType() {
51 public boolean isCommand() {
52 return commandType == CommandType.COMMAND;
55 public boolean isSerial() {
56 return commandType == CommandType.SERIAL1 || commandType == CommandType.SERIAL2;
59 public boolean isSerial1() {
60 return commandType == CommandType.SERIAL1;
63 public boolean isSerial2() {
64 return commandType == CommandType.SERIAL2;
67 public LinkedBlockingQueue<ResponseMessage> getReceiveQueue() {