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.tivo.internal.service;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
19 * The Class {@link TivoConfigData} stores the dynamic configuration parameters used within the {@link TiVoHandler} and
20 * {@link TivoStatusProvider}.
22 * @author Jayson Kubilis (DigitalBytes) - Initial contribution
23 * @author Andrew Black (AndyXMB) - minor updates, removal of unused DiscoveryService functionality.
24 * @author Michael Lobstein - Updated for OH3
28 public class TivoConfigData {
29 private @Nullable String host = null;
30 private int tcpPort = 31339;
31 private int numRetry = 0;
32 private int pollInterval = 30;
33 private boolean pollForChanges = false;
34 private boolean keepConActive = false;
35 private int cmdWaitInterval = 0;
36 private String cfgIdentifier = "";
39 * {@link toString} returns each of the configuration items as a single concatenated string.
42 * @see java.lang.Object#toString()
45 public String toString() {
46 return "TivoConfigData [host=" + host + ", tcpPort=" + tcpPort + ", numRetry=" + numRetry + ", pollInterval="
47 + pollInterval + ", pollForChanges=" + pollForChanges + ", keepConActive=" + keepConActive
48 + ", cmdWaitInterval=" + cmdWaitInterval + ", cfgIdentifier=" + cfgIdentifier + "]";
52 * Gets the cfgIdentifier representing the thing name of the TiVo device.
54 * @return the cfgIdentifier
56 public String getCfgIdentifier() {
57 return this.cfgIdentifier;
61 * Sets the cfgIdentifier representing the thing name of the TiVo device.
63 * @param cfgIdentifier the cfgIdentifier to set
65 public void setCfgIdentifier(String cfgIdentifier) {
66 this.cfgIdentifier = cfgIdentifier;
70 * Gets the host representing the host name or IP address of the device.
74 public @Nullable String getHost() {
79 * the host representing the host name or IP address of the device.
81 * @param host the host to set
83 public void setHost(String host) {
88 * Gets the cfgTcp representing the IP port of the Remote Control Protocol service on the device.
92 public int getTcpPort() {
97 * Sets the cfgTcp representing the IP port of the Remote Control Protocol service on the device (31339).
99 * @param tcpPort the tcpPort to set
101 public void setTcpPort(int tcpPort) {
102 this.tcpPort = tcpPort;
106 * Gets the numRetry value. This determines the number of connection attempts made to the IP/Port of the
107 * service and the number of read attempts that are made when a command is submitted to the device, separated by
109 * interval specified in the Command Wait Interval.
111 * @return the numRetry
113 public int getNumRetry() {
118 * Sets the numRetry value. This determines the number of connection attempts made to the IP/Port of the
119 * service and the number of read attempts that are made when a command is submitted to the device, separated by
121 * interval specified in the Command Wait Interval.
123 * @param numRetry the numRetry to set
125 public void setNumRetry(int numRetry) {
126 this.numRetry = numRetry;
130 * Gets the pollInterval representing the interval in seconds between polling attempts to collect any updated
131 * status information.
133 * @return the pollInterval
135 public int getPollInterval() {
140 * Sets the pollInterval representing the interval in seconds between polling attempts to collect any updated
141 * status information.
143 * @param pollInterval the pollInterval to set
145 public void setPollInterval(int pollInterval) {
146 this.pollInterval = pollInterval;
150 * Checks if is cfg poll changes.
152 * @return the pollForChanges
154 public boolean doPollChanges() {
155 return pollForChanges;
159 * Sets the cfg poll changes.
161 * @param pollForChanges the pollForChanges to set
163 public void setPollForChanges(boolean pollForChanges) {
164 this.pollForChanges = pollForChanges;
168 * Checks if is cfg keep conn open.
170 * @return the keepConActive
172 public boolean isKeepConnActive() {
173 return keepConActive;
177 * Sets the cfg keep conn open.
179 * @param keepConActive the keepConActive to set
181 public void setKeepConnActive(boolean keepConActive) {
182 this.keepConActive = keepConActive;
186 * Gets the cfg cmd wait.
188 * @return the cmdWaitInterval
190 public int getCmdWaitInterval() {
191 return cmdWaitInterval;
195 * Sets the cfg cmd wait.
197 * @param cmdWaitInterval the cmdWaitInterval to set
199 public void setCmdWaitInterval(int cmdWaitInterval) {
200 this.cmdWaitInterval = cmdWaitInterval;