2 * Copyright (c) 2010-2024 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.salus.internal.handler;
15 import static org.openhab.binding.salus.internal.SalusBindingConstants.SalusCloud.DEFAULT_URL;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
20 * @author Martin GrzeĊlowski - Initial contribution
23 public class CloudBridgeConfig {
24 private String username = "";
25 private String password = "";
26 private String url = "";
27 private long refreshInterval = 30;
28 private long propertiesRefreshInterval = 5;
29 private int maxHttpRetries = 3;
31 public CloudBridgeConfig() {
34 public CloudBridgeConfig(String username, String password, String url, long refreshInterval,
35 long propertiesRefreshInterval) {
36 this.username = username;
37 this.password = password;
39 this.refreshInterval = refreshInterval;
40 this.propertiesRefreshInterval = propertiesRefreshInterval;
43 public String getUsername() {
47 public void setUsername(String username) {
48 this.username = username;
51 public String getPassword() {
55 public void setPassword(String password) {
56 this.password = password;
59 public String getUrl() {
66 public void setUrl(String url) {
70 public long getRefreshInterval() {
71 return refreshInterval;
74 public void setRefreshInterval(long refreshInterval) {
75 this.refreshInterval = refreshInterval;
78 public long getPropertiesRefreshInterval() {
79 return propertiesRefreshInterval;
82 public void setPropertiesRefreshInterval(long propertiesRefreshInterval) {
83 this.propertiesRefreshInterval = propertiesRefreshInterval;
86 public int getMaxHttpRetries() {
87 return maxHttpRetries;
90 public void setMaxHttpRetries(int maxHttpRetries) {
91 this.maxHttpRetries = maxHttpRetries;
94 public boolean isValid() {
95 return !username.isBlank() && !password.isBlank();
99 public String toString() {
100 return "CloudBridgeConfig{" + "username='" + username + '\'' + ", password='<SECRET>'" + ", url='" + url + '\''
101 + ", refreshInterval=" + refreshInterval + ", propertiesRefreshInterval=" + propertiesRefreshInterval