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.denonmarantz.internal.connector;
15 import java.util.concurrent.ScheduledExecutorService;
17 import org.eclipse.jetty.client.HttpClient;
18 import org.openhab.binding.denonmarantz.internal.DenonMarantzState;
19 import org.openhab.binding.denonmarantz.internal.config.DenonMarantzConfiguration;
20 import org.openhab.binding.denonmarantz.internal.connector.http.DenonMarantzHttpConnector;
21 import org.openhab.binding.denonmarantz.internal.connector.telnet.DenonMarantzTelnetConnector;
24 * Returns the connector based on the configuration.
25 * Currently there are 2 types: HTTP and Telnet
27 * @author Jan-Willem Veldhuis - Initial contribution
29 public class DenonMarantzConnectorFactory {
31 public DenonMarantzConnector getConnector(DenonMarantzConfiguration config, DenonMarantzState state,
32 ScheduledExecutorService scheduler, HttpClient httpClient, String thingUID) {
33 if (config.isTelnet()) {
34 return new DenonMarantzTelnetConnector(config, state, scheduler, thingUID);
36 return new DenonMarantzHttpConnector(config, state, scheduler, httpClient);