Search in sources :

Example 1 with InputException

use of com.homeaway.datapullclient.exception.InputException 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)

Example 2 with InputException

use of com.homeaway.datapullclient.exception.InputException in project datapull by homeaway.

the class DataPullRequestHandler method startSimpleDataPull.

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

Aggregations

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