]> git.basschouten.com Git - openhab-addons.git/blob
3a84eec097a62db0f0a8fd233056fbfe1d1f0cf2
[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.ihc.internal.ws.services;
14
15 import org.openhab.binding.ihc.internal.ws.datatypes.WSSystemInfo;
16 import org.openhab.binding.ihc.internal.ws.exeptions.IhcExecption;
17 import org.openhab.binding.ihc.internal.ws.http.IhcConnectionPool;
18
19 /**
20  * Class to handle IHC / ELKO LS Controller's configuration service.
21  *
22  * Controller service is used to fetch system information from the controller.
23  *
24  * @author Pauli Anttila - Initial contribution
25  */
26 public class IhcConfigurationService extends IhcBaseService {
27
28     public IhcConfigurationService(String host, int timeout, IhcConnectionPool ihcConnectionPool) {
29         super(ihcConnectionPool, timeout, host, "ConfigurationService");
30     }
31
32     /**
33      * Query system information from the controller.
34      *
35      * @return system information.
36      * @throws IhcExecption
37      */
38     public synchronized WSSystemInfo getSystemInfo() throws IhcExecption {
39         String response = sendSoapQuery("getSystemInfo", EMPTY_QUERY);
40         return new WSSystemInfo().parseXMLData(response);
41     }
42 }