forked from indeedeng/ttorrent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TrackerController.java
37 lines (32 loc) · 1.12 KB
/
TrackerController.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.turn.ttorrent.tracker.spring;
import com.turn.ttorrent.protocol.tracker.TrackerMessage;
import com.turn.ttorrent.tracker.servlet.ServletTrackerService;
import java.io.IOException;
import javax.annotation.Nonnull;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
/**
*
* @author shevek
*/
@RequestMapping("/announce")
public class TrackerController {
private final ServletTrackerService service;
@Autowired
public TrackerController(@Nonnull ServletTrackerService service) {
this.service = service;
}
@RequestMapping(value = "/")
public void request(
@Nonnull HttpServletRequest request,
@Nonnull HttpServletResponse response) throws ServletException, IOException, TrackerMessage.MessageValidationException {
service.process(request, response);
}
}