Search in sources :

Example 1 with ResponseEntity

use of com.homeaway.datapullclient.data.ResponseEntity in project datapull by homeaway.

the class DataPullRequestHandler method startDataPull.

@Override
public ResponseEntity startDataPull(HttpEntity<String> inputJson) {
    if (log.isDebugEnabled())
        log.debug("startDataPull -> inputJson=" + inputJson);
    ResponseEntity entity = null;
    try {
        service.runDataPull(inputJson.getBody());
        entity = new ResponseEntity(HttpStatus.ACCEPTED.value(), "Request Succesfully registered : " + inputJson);
    } catch (ProcessingException e) {
        throw new InputException("DataPull application failed for inputJson : " + inputJson + " \n " + e.getMessage());
    }
    if (log.isDebugEnabled())
        log.debug("startDataPull <- return");
    return entity;
}
Also used : SimpleResponseEntity(com.homeaway.datapullclient.data.SimpleResponseEntity) ResponseEntity(com.homeaway.datapullclient.data.ResponseEntity) InputException(com.homeaway.datapullclient.exception.InputException) ProcessingException(com.homeaway.datapullclient.exception.ProcessingException)

Aggregations

ResponseEntity (com.homeaway.datapullclient.data.ResponseEntity)1 SimpleResponseEntity (com.homeaway.datapullclient.data.SimpleResponseEntity)1 InputException (com.homeaway.datapullclient.exception.InputException)1 ProcessingException (com.homeaway.datapullclient.exception.ProcessingException)1