]> git.basschouten.com Git - openhab-addons.git/blob
6c34e0993da2eb9dd1a21737670706a46ced7d7e
[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.vdr.internal.svdrp;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * The {@link SVDRPClient} encapsulates all calls to the SVDRP interface of a VDR
19  *
20  * @author Matthias Klocke - Initial contribution
21  */
22 @NonNullByDefault
23 public interface SVDRPClient {
24
25     /**
26      *
27      * Open VDR Socket Connection
28      *
29      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
30      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
31      */
32     void openConnection() throws SVDRPConnectionException, SVDRPParseResponseException;
33
34     /**
35      * Close VDR Socket Connection
36      *
37      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
38      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
39      */
40     void closeConnection() throws SVDRPConnectionException, SVDRPParseResponseException;
41
42     /**
43      * Retrieve Disk Status from SVDRP Client
44      *
45      * @return SVDRP Disk Status
46      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
47      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
48      */
49     SVDRPDiskStatus getDiskStatus() throws SVDRPConnectionException, SVDRPParseResponseException;
50
51     /**
52      * Retrieve EPG Event from SVDRPClient
53      *
54      * @param type Type of EPG Event (now, next)
55      * @return SVDRP EPG Event
56      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
57      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
58      */
59     SVDRPEpgEvent getEpgEvent(SVDRPEpgEvent.TYPE type) throws SVDRPConnectionException, SVDRPParseResponseException;
60
61     /**
62      * Retrieve current volume from SVDRP Client
63      *
64      * @return SVDRP Volume Object
65      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
66      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
67      */
68     SVDRPVolume getSVDRPVolume() throws SVDRPConnectionException, SVDRPParseResponseException;
69
70     /**
71      * Set volume on SVDRP Client
72      *
73      * @param newVolume Volume in Percent
74      * @return SVDRP Volume Object
75      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
76      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
77      */
78     SVDRPVolume setSVDRPVolume(int newVolume) throws SVDRPConnectionException, SVDRPParseResponseException;
79
80     /**
81      * Send Key command to SVDRP Client
82      *
83      * @param key Key Command to send
84      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
85      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
86      */
87     void sendSVDRPKey(String key) throws SVDRPConnectionException, SVDRPParseResponseException;
88
89     /**
90      * Send Message to SVDRP Client
91      *
92      * @param message Message to send
93      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
94      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
95      */
96     void sendSVDRPMessage(String message) throws SVDRPConnectionException, SVDRPParseResponseException;
97
98     /**
99      * Retrieve current Channel from SVDRP Client
100      *
101      * @return SVDRPChannel object
102      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
103      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
104      */
105     SVDRPChannel getCurrentSVDRPChannel() throws SVDRPConnectionException, SVDRPParseResponseException;
106
107     /**
108      * Change current Channel on SVDRP Client
109      *
110      * @param number Channel to be set
111      * @return SVDRPChannel object
112      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
113      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
114      */
115     SVDRPChannel setSVDRPChannel(int number) throws SVDRPConnectionException, SVDRPParseResponseException;
116
117     /**
118      * Retrieve from SVDRP Client if a recording is currently active
119      *
120      * @return is currently a recording active
121      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
122      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
123      */
124     boolean isRecordingActive() throws SVDRPConnectionException, SVDRPParseResponseException;
125
126     /**
127      * Retrieve VDR Version from SVDRP Client
128      *
129      * @return VDR Version
130      */
131     String getSVDRPVersion();
132 }