Update project template for Auction House
This commit is contained in:
		| @@ -11,10 +11,9 @@ import org.springframework.web.bind.annotation.PathVariable; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
|  | ||||
| /* | ||||
|     THIS CLASS WILL BE PROVIDED ONLY AS A TEMPLATE; POINT OUT THE API NEEDS TO BE DEFINED | ||||
| /** | ||||
|  * Template for receiving an executor added event via HTTP | ||||
|  */ | ||||
|  | ||||
| @RestController | ||||
| public class ExecutorAddedEventListenerHttpAdapter { | ||||
|  | ||||
|   | ||||
| @@ -7,6 +7,8 @@ import ch.unisg.tapas.auctionhouse.domain.ExecutorRegistry; | ||||
| import com.fasterxml.jackson.core.JsonProcessingException; | ||||
| import com.fasterxml.jackson.databind.JsonNode; | ||||
| import com.fasterxml.jackson.databind.ObjectMapper; | ||||
| import org.apache.logging.log4j.LogManager; | ||||
| import org.apache.logging.log4j.Logger; | ||||
| import org.eclipse.paho.client.mqttv3.MqttMessage; | ||||
|  | ||||
| /** | ||||
| @@ -15,6 +17,7 @@ import org.eclipse.paho.client.mqttv3.MqttMessage; | ||||
|  * This class is only provided as an example to help you bootstrap the project. | ||||
|  */ | ||||
| public class ExecutorAddedEventListenerMqttAdapter extends AuctionEventMqttListener { | ||||
|     private static final Logger LOGGER = LogManager.getLogger(ExecutorAddedEventListenerMqttAdapter.class); | ||||
|  | ||||
|     @Override | ||||
|     public boolean handleEvent(MqttMessage message) { | ||||
| @@ -36,8 +39,7 @@ public class ExecutorAddedEventListenerMqttAdapter extends AuctionEventMqttListe | ||||
|             ExecutorAddedHandler newExecutorHandler = new ExecutorAddedHandler(); | ||||
|             newExecutorHandler.handleNewExecutorEvent(executorAddedEvent); | ||||
|         } catch (JsonProcessingException | NullPointerException e) { | ||||
|             // TODO: refactor logging | ||||
|             e.printStackTrace(); | ||||
|             LOGGER.error(e.getMessage(), e); | ||||
|             return false; | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -53,10 +53,6 @@ public class RetrieveOpenAuctionsWebController { | ||||
|         HttpHeaders responseHeaders = new HttpHeaders(); | ||||
|         responseHeaders.add(HttpHeaders.CONTENT_TYPE, "application/json"); | ||||
|  | ||||
|         // TODO before providing to students: remove hub links | ||||
|         responseHeaders.add(HttpHeaders.LINK, "<https://pubsubhubbub.appspot.com/>; rel=\"hub\""); | ||||
|         responseHeaders.add(HttpHeaders.LINK, "<http://example.org/auctions/>; rel=\"self\""); | ||||
|  | ||||
|         return new ResponseEntity<>(array.toString(), responseHeaders, HttpStatus.OK); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user