default Promise<Void> get(@UnstructuredDataWriterParam UnstructuredDataWriter writer) { throw new RoutingException("'get' is not implemented", 400); } }
default Task<Void> get(K key, @UnstructuredDataWriterParam UnstructuredDataWriter writer) { throw new RoutingException("'get' is not implemented", 400); } }
default Task<Void> get(@UnstructuredDataWriterParam UnstructuredDataWriter writer) { throw new RoutingException("'get' is not implemented", 400); } }
default void get(CompoundKey key, @UnstructuredDataWriterParam UnstructuredDataWriter writer, Callback<Void> callback) { throw new RoutingException("'get' is not implemented", 400); } }
@Override public void get(@UnstructuredDataWriterParam UnstructuredDataWriter writer) { respondGoodUnstructuredData(writer); } }
default Promise<Void> get(K key, @UnstructuredDataWriterParam UnstructuredDataWriter writer) { throw new RoutingException("'get' is not implemented", 400); } }
default Promise<Void> get(CompoundKey key, @UnstructuredDataWriterParam UnstructuredDataWriter writer) { throw new RoutingException("'get' is not implemented", 400); } }
default void get(K key, @UnstructuredDataWriterParam UnstructuredDataWriter writer, Callback<Void> callback) { throw new RoutingException("'get' is not implemented", 400); } }
/** * Return a unstructured data response. * * Before returning from this method, the data content must be fully written to the * {@link UnstructuredDataWriter#getOutputStream()} or it could result in incomplete or empty response. * * @param writer The response writer */ default void get(@UnstructuredDataWriterParam UnstructuredDataWriter writer) { throw new RoutingException("'get' is not implemented", 400); } }
default Task<Void> get(CompoundKey key, @UnstructuredDataWriterParam UnstructuredDataWriter writer) { throw new RoutingException("'get' is not implemented", 400); } }
default void get(@UnstructuredDataWriterParam UnstructuredDataWriter writer, Callback<Void> callback) { throw new RoutingException("'get' is not implemented", 400); } }
/** * Return a unstructured data response. * * Before returning from this method, the data content must be fully written to the * {@link UnstructuredDataWriter#getOutputStream()} or it could result in an incomplete or empty response. * * @param key The key of the unstructured data * @param writer The unstructured data response writer */ default void get(K key, @UnstructuredDataWriterParam UnstructuredDataWriter writer) { throw new RoutingException("'get' is not implemented", 400); } }
/** * Return a unstructured data response. * * Before returning from this method, the data content must be fully written to the * {@link UnstructuredDataWriter#getOutputStream()} or it could result in incomplete or empty response. * * @param key The key of the unstructured data * @param writer The unstructured data response writer */ default void get(CompoundKey key, @UnstructuredDataWriterParam UnstructuredDataWriter writer) { throw new RoutingException("'get' is not implemented", 400); } }
@Override public Task<Void> get(String key, final @UnstructuredDataWriterParam UnstructuredDataWriter writer) { return Task.blocking("fetchBytes", () -> { GreetingUnstructuredDataUtils.respondGoodUnstructuredData(writer); return null; }, _scheduler); } }
@RestMethod.Get public void get(String key, @UnstructuredDataWriterParam UnstructuredDataWriter writer) { respondGoodUnstructuredData(writer); } }
@Override public void get(CompoundKey key, @UnstructuredDataWriterParam UnstructuredDataWriter writer, @CallbackParam Callback<Void> callback) { _scheduler.schedule(() -> { try { GreetingUnstructuredDataUtils.respondGoodUnstructuredData(writer); callback.onSuccess(null); } catch (final Throwable throwable) { callback.onError(throwable); } }, DELAY, TimeUnit.MILLISECONDS); } }
@Override public void get(@UnstructuredDataWriterParam UnstructuredDataWriter writer, @CallbackParam Callback<Void> callback) { _scheduler.schedule(() -> { try { GreetingUnstructuredDataUtils.respondGoodUnstructuredData(writer); callback.onSuccess(null); } catch (final Throwable throwable) { callback.onError(throwable); } }, DELAY, TimeUnit.MILLISECONDS); } }
@Override public void get(String key, @UnstructuredDataWriterParam UnstructuredDataWriter writer, @CallbackParam Callback<Void> callback) { _scheduler.schedule(() -> { try { GreetingUnstructuredDataUtils.respondGoodUnstructuredData(writer); callback.onSuccess(null); } catch (final Throwable throwable) { callback.onError(throwable); } }, DELAY, TimeUnit.MILLISECONDS); } }
@Override public Promise<Void> get(String key, @UnstructuredDataWriterParam UnstructuredDataWriter writer) { final SettablePromise<Void> result = Promises.settable(); _scheduler.schedule(() -> { try { GreetingUnstructuredDataUtils.respondGoodUnstructuredData(writer); result.done(null); } catch (final Throwable throwable) { result.fail(throwable); } }, DELAY, TimeUnit.MILLISECONDS); return result; } }
@Override public void get(String key, @UnstructuredDataWriterParam UnstructuredDataWriter writer) { switch (key) { case "good": respondGoodUnstructuredData(writer); break; case "goodInline": getContext().setResponseHeader(HEADER_CONTENT_DISPOSITION, CONTENT_DISPOSITION_VALUE); respondGoodUnstructuredData(writer); break; case "missingHeaders": respondBadUnstructuredData(writer); break; case "exception": throw new RestLiServiceException(HttpStatus.S_500_INTERNAL_SERVER_ERROR, "internal service exception"); default: throw new RestLiServiceException(HttpStatus.S_503_SERVICE_UNAVAILABLE, "unexpected unstructured data key, something wrong with the test."); } } }