]> git.basschouten.com Git - openhab-addons.git/blob
cb2a39fa4fd1e00b62366ee1f8a4c384ee86a931
[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     public 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     public 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     public 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     public SVDRPEpgEvent getEpgEvent(SVDRPEpgEvent.TYPE type)
60             throws SVDRPConnectionException, SVDRPParseResponseException;
61
62     /**
63      * Retrieve current volume from SVDRP Client
64      *
65      * @return SVDRP Volume Object
66      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
67      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
68      */
69     public SVDRPVolume getSVDRPVolume() throws SVDRPConnectionException, SVDRPParseResponseException;
70
71     /**
72      * Set volume on SVDRP Client
73      *
74      * @param newVolume Volume in Percent
75      * @return SVDRP Volume Object
76      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
77      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
78      */
79     public SVDRPVolume setSVDRPVolume(int newVolume) throws SVDRPConnectionException, SVDRPParseResponseException;
80
81     /**
82      * Send Key command to SVDRP Client
83      *
84      * @param key Key Command to send
85      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
86      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
87      */
88     public void sendSVDRPKey(String key) throws SVDRPConnectionException, SVDRPParseResponseException;
89
90     /**
91      * Send Message to SVDRP Client
92      *
93      * @param message Message to send
94      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
95      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
96      */
97     public void sendSVDRPMessage(String message) throws SVDRPConnectionException, SVDRPParseResponseException;
98
99     /**
100      * Retrieve current Channel from SVDRP Client
101      *
102      * @return SVDRPChannel object
103      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
104      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
105      */
106     public SVDRPChannel getCurrentSVDRPChannel() throws SVDRPConnectionException, SVDRPParseResponseException;
107
108     /**
109      * Change current Channel on SVDRP Client
110      *
111      * @param number Channel to be set
112      * @return SVDRPChannel object
113      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
114      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
115      */
116     public SVDRPChannel setSVDRPChannel(int number) throws SVDRPConnectionException, SVDRPParseResponseException;
117
118     /**
119      * Retrieve from SVDRP Client if a recording is currently active
120      *
121      * @return is currently a recording active
122      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
123      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
124      */
125     public boolean isRecordingActive() throws SVDRPConnectionException, SVDRPParseResponseException;
126
127     /**
128      * Retrieve VDR Version from SVDRP Client
129      *
130      * @return VDR Version
131      * @throws SVDRPConnectionException thrown if connection to VDR failed or was not possible
132      * @throws SVDRPParseResponseException thrown if something's not OK with SVDRP response
133      */
134     public String getSVDRPVersion();
135 }