]> git.basschouten.com Git - openhab-addons.git/blob
1adc468e63b8f503b66cd5f0ea8cf26efb4f6a4c
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.globalcache.internal.command;
14
15 import java.util.concurrent.LinkedBlockingQueue;
16
17 import org.openhab.binding.globalcache.internal.GlobalCacheBindingConstants.CommandType;
18 import org.openhab.core.thing.Thing;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
21
22 /**
23  * The {@link CommandGetdevices} class implements the GlobalCache getdevices command.
24  *
25  * @author Mark Hilbush - Initial contribution
26  */
27 public class CommandGetdevices extends AbstractCommand {
28
29     private final Logger logger = LoggerFactory.getLogger(CommandGetdevices.class);
30
31     public CommandGetdevices(Thing thing, LinkedBlockingQueue<RequestMessage> requestQueue) {
32         super(thing, requestQueue, "getdevices", CommandType.COMMAND);
33         deviceCommand = "getdevices";
34     }
35
36     @Override
37     public void parseSuccessfulReply() {
38         if (deviceReply == null) {
39             return;
40         }
41         // decode response
42     }
43
44     @Override
45     public void logSuccess() {
46         logger.debug("Execute '{}' succeeded on thing {} at {}", commandName, thing.getUID().getId(), ipAddress);
47     }
48
49     @Override
50     public void logFailure() {
51         logger.error("Execute '{}' failed for thing {} at {}, errorCode={}, errorMessage={}", commandName,
52                 thing.getUID().getId(), ipAddress, errorCode, errorMessage);
53     }
54 }