|
| 1 | +/** |
| 2 | + * Copyright (c) 2010-2024 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.salus.internal.aws.handler; |
| 14 | + |
| 15 | +import org.eclipse.jdt.annotation.NonNullByDefault; |
| 16 | +import org.openhab.binding.salus.internal.handler.AbstractBridgeConfig; |
| 17 | + |
| 18 | +/** |
| 19 | + * @author Martin Grześlowski - Initial contribution |
| 20 | + */ |
| 21 | +@NonNullByDefault |
| 22 | +public class AwsCloudBridgeConfig extends AbstractBridgeConfig { |
| 23 | + private String userPoolId = "eu-central-1_XGRz3CgoY"; |
| 24 | + private String identityPoolId = "60912c00-287d-413b-a2c9-ece3ccef9230"; |
| 25 | + private String clientId = "4pk5efh3v84g5dav43imsv4fbj"; |
| 26 | + private String region = "eu-central-1"; |
| 27 | + private String companyCode = "salus-eu"; |
| 28 | + private String awsService = "a24u3z7zzwrtdl-ats"; |
| 29 | + |
| 30 | + public AwsCloudBridgeConfig() { |
| 31 | + setUrl("https://service-api.eu.premium.salusconnect.io"); |
| 32 | + } |
| 33 | + |
| 34 | + public AwsCloudBridgeConfig(String username, String password, String url, long refreshInterval, |
| 35 | + long propertiesRefreshInterval, int maxHttpRetries, String userPoolId, String identityPoolId, |
| 36 | + String clientId, String region, String companyCode, String awsService) { |
| 37 | + super(username, password, url, refreshInterval, propertiesRefreshInterval, maxHttpRetries); |
| 38 | + this.userPoolId = userPoolId; |
| 39 | + this.identityPoolId = identityPoolId; |
| 40 | + this.clientId = clientId; |
| 41 | + this.region = region; |
| 42 | + this.companyCode = companyCode; |
| 43 | + this.awsService = awsService; |
| 44 | + if (url.isBlank()) { |
| 45 | + setUrl("https://service-api.eu.premium.salusconnect.io"); |
| 46 | + } |
| 47 | + } |
| 48 | + |
| 49 | + public String getUserPoolId() { |
| 50 | + return userPoolId; |
| 51 | + } |
| 52 | + |
| 53 | + public void setUserPoolId(String userPoolId) { |
| 54 | + this.userPoolId = userPoolId; |
| 55 | + } |
| 56 | + |
| 57 | + public String getIdentityPoolId() { |
| 58 | + return identityPoolId; |
| 59 | + } |
| 60 | + |
| 61 | + public void setIdentityPoolId(String identityPoolId) { |
| 62 | + this.identityPoolId = identityPoolId; |
| 63 | + } |
| 64 | + |
| 65 | + public String getClientId() { |
| 66 | + return clientId; |
| 67 | + } |
| 68 | + |
| 69 | + public void setClientId(String clientId) { |
| 70 | + this.clientId = clientId; |
| 71 | + } |
| 72 | + |
| 73 | + public String getRegion() { |
| 74 | + return region; |
| 75 | + } |
| 76 | + |
| 77 | + public void setRegion(String region) { |
| 78 | + this.region = region; |
| 79 | + } |
| 80 | + |
| 81 | + public String getCompanyCode() { |
| 82 | + return companyCode; |
| 83 | + } |
| 84 | + |
| 85 | + public void setCompanyCode(String companyCode) { |
| 86 | + this.companyCode = companyCode; |
| 87 | + } |
| 88 | + |
| 89 | + public String getAwsService() { |
| 90 | + return awsService; |
| 91 | + } |
| 92 | + |
| 93 | + public void setAwsService(String awsService) { |
| 94 | + this.awsService = awsService; |
| 95 | + } |
| 96 | + |
| 97 | + @Override |
| 98 | + public boolean isValid() { |
| 99 | + return super.isValid() && !userPoolId.isBlank() && !identityPoolId.isBlank() && !clientId.isBlank() |
| 100 | + && !region.isBlank() && !companyCode.isBlank() && !awsService.isBlank(); |
| 101 | + } |
| 102 | + |
| 103 | + @Override |
| 104 | + public String toString() { |
| 105 | + return "AwsCloudBridgeConfig{" + // |
| 106 | + "userPoolId='" + userPoolId + '\'' + // |
| 107 | + "identityPoolId='" + identityPoolId + '\'' + // |
| 108 | + ", clientId='" + clientId + '\'' + // |
| 109 | + ", region='" + region + '\'' + // |
| 110 | + ", companyCode='" + companyCode + '\'' + // |
| 111 | + ", awsService='" + awsService + '\'' + // |
| 112 | + ", username='" + username + '\'' + // |
| 113 | + ", password='<SECRET>'" + // |
| 114 | + ", url='" + url + '\'' + // |
| 115 | + ", refreshInterval=" + refreshInterval + // |
| 116 | + ", propertiesRefreshInterval=" + propertiesRefreshInterval + // |
| 117 | + ", maxHttpRetries=" + maxHttpRetries + // |
| 118 | + '}'; |
| 119 | + } |
| 120 | +} |
0 commit comments