commit | author | age
|
933ccd
|
1 |
/* |
U |
2 |
Calypso - Media Player Remote Control via HTTP for Raspberry Pi |
|
3 |
Copyright (C) 2021-2023 Ulrich Hilger |
|
4 |
|
|
5 |
This program is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU Affero General Public License as |
|
7 |
published by the Free Software Foundation, either version 3 of the |
|
8 |
License, or (at your option) any later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
GNU Affero General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU Affero General Public License |
|
16 |
along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
|
929228
|
19 |
package de.uhilger.calypso.neu; |
U |
20 |
|
|
21 |
import java.io.IOException; |
|
22 |
import java.net.HttpURLConnection; |
|
23 |
import java.net.URL; |
|
24 |
import java.util.logging.Level; |
|
25 |
import java.util.logging.Logger; |
|
26 |
|
|
27 |
/** |
|
28 |
* |
|
29 |
* @author Ulrich Hilger |
|
30 |
*/ |
|
31 |
public class Rueckmelder implements ProzessLauscher { |
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
@Override |
|
36 |
public void prozessBeendet(String meldeUrlStr) { |
|
37 |
Logger logger = Logger.getLogger(de.uhilger.calypso.neu.http.ApiHandler.class.getName()); |
|
38 |
logger.log(Level.INFO, |
|
39 |
"Abspielen beendet, sende Meldung an {0}.", |
|
40 |
new Object[]{meldeUrlStr}); |
|
41 |
try { |
|
42 |
HttpURLConnection conn = (HttpURLConnection) new URL(meldeUrlStr).openConnection(); |
|
43 |
conn.setRequestMethod("GET"); |
|
44 |
conn.connect(); |
|
45 |
int status = conn.getResponseCode(); |
|
46 |
logger.log(Level.INFO, |
|
47 |
"Abspielen beendet, Meldung an {0} mit Statuscode {1} gesendet.", |
|
48 |
new Object[]{meldeUrlStr, status}); |
|
49 |
/* |
|
50 |
fuer den Fall, dass ein Stopp-Signal den Player nicht erreicht |
|
51 |
oder dort nicht funktioniert, gibt es keine Moeglichkeit festzustellen, |
|
52 |
dass der Player noch spielt. Damit in einem solchen Fall der Zeiger |
|
53 |
auf den Abspielprozess nicht verloren geht, wird der Zeiger nicht |
|
54 |
auf null gesetzt. |
|
55 |
*/ |
|
56 |
//App.setPlayerProcess(null); |
|
57 |
} catch (IOException ex) { |
|
58 |
logger.log(Level.INFO, ex.getMessage(), ex); |
|
59 |
} |
|
60 |
} |
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
} |