-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Beacon gathering and sending
- Loading branch information
Showing
4 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
...end/src/main/java/edu/internet2/tier/shibboleth/admin/ui/controller/BeaconController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,34 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.controller; | ||
|
|
||
| import com.fasterxml.jackson.core.JsonProcessingException; | ||
| import edu.internet2.tier.shibboleth.admin.ui.scheduled.BeaconReportingTask; | ||
| import edu.internet2.tier.shibboleth.admin.ui.service.IBeaconDataService; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
| import org.springframework.context.annotation.Profile; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.PostMapping; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @Profile({"dev", "very-dangerous"}) | ||
| @RestController | ||
| @RequestMapping(value = "/api/beacon") | ||
| public class BeaconController { | ||
| @Autowired | ||
| BeaconReportingTask beaconReporter; | ||
|
|
||
| @Autowired | ||
| private IBeaconDataService service; | ||
|
|
||
|
|
||
| @GetMapping(value = "/detail") | ||
| public ResponseEntity<?> getDetail() throws JsonProcessingException { | ||
| return ResponseEntity.ok(service.getBeaconData()); | ||
| } | ||
|
|
||
| @PostMapping("/send") | ||
| public ResponseEntity<?> forceSendBeaconData() { | ||
| beaconReporter.sendBeaconData(); | ||
| return ResponseEntity.ok("Manual push of beacon data completed"); | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters