use of com.linkedin.data.transform.DataProcessingException in project rest.li by linkedin.
the class AnnotatedComplexKeysResource method update.
@RestMethod.PartialUpdate
public Promise<UpdateResponse> update(final ComplexResourceKey<TwoPartKey, TwoPartKey> key, final PatchRequest<Message> patch) {
final SettablePromise<UpdateResponse> result = Promises.settable();
final Runnable requestHandler = new Runnable() {
public void run() {
try {
_dataProvider.partialUpdate(key, patch);
result.done(new UpdateResponse(HttpStatus.S_204_NO_CONTENT));
} catch (DataProcessingException e) {
result.done(new UpdateResponse(HttpStatus.S_400_BAD_REQUEST));
}
}
};
_scheduler.schedule(requestHandler, DELAY, TimeUnit.MILLISECONDS);
return result;
}
Aggregations