seek eingebaut, Objekthierarchie Handler
| | |
| | | import de.uhilger.avdirektor.handler.CmdHandler; |
| | | import de.uhilger.avdirektor.handler.PingHandler; |
| | | import de.uhilger.avdirektor.handler.PlayHandler; |
| | | import de.uhilger.avdirektor.handler.SeekHandler; |
| | | import de.uhilger.avdirektor.handler.StopServerHandler; |
| | | import java.io.IOException; |
| | | import java.util.logging.Logger; |
| | |
| | | |
| | | HttpServer server = HttpServer.create(new InetSocketAddress(port), 0); |
| | | server.createContext("/avd/play", new PlayHandler("play")); |
| | | server.createContext("/avd/seek", new SeekHandler("seek")); |
| | | server.createContext("/avd/stop", new CmdHandler(App.CMD_STOP)); |
| | | server.createContext("/avd/pause", new CmdHandler(App.CMD_PAUSE_RESUME)); |
| | | server.createContext("/avd/ping", new PingHandler()); |
| | |
| | | super(cmd); |
| | | } |
| | | |
| | | /* |
| | | @Override |
| | | public void handle(HttpExchange t) throws IOException { |
| | | logger.log(Level.FINE, "RequestURI: {0}", t.getRequestURI().toString()); |
| | |
| | | os.write(response.getBytes()); |
| | | os.close(); |
| | | } |
| | | */ |
| | | |
| | | @Override |
| | | protected String process(HttpExchange t, String params) { |
| | |
| | | protected StringBuilder buildParams(HttpExchange t) { |
| | | StringBuilder params = super.buildParams(t); |
| | | params.append(" --pos "); |
| | | params.append(getParam(map, "p")); |
| | | params.append(getParam(map, "pos")); |
| | | return params; |
| | | } |
| | | |