Search in sources :

Example 1 with SingletonWriter

use of com.linkedin.entitystream.SingletonWriter in project rest.li by linkedin.

the class UnstructuredDataReactiveCollectionResource method get.

@Override
public void get(String key, @CallbackParam Callback<UnstructuredDataReactiveResult> callback) {
    Writer<ByteString> writer = new SingletonWriter<>(ByteString.copy(UNSTRUCTURED_DATA_BYTES));
    UnstructuredDataReactiveResult result = new UnstructuredDataReactiveResult(EntityStreams.newEntityStream(writer), MIME_TYPE);
    callback.onSuccess(result);
}
Also used : ByteString(com.linkedin.data.ByteString) UnstructuredDataReactiveResult(com.linkedin.restli.server.UnstructuredDataReactiveResult) SingletonWriter(com.linkedin.entitystream.SingletonWriter)

Example 2 with SingletonWriter

use of com.linkedin.entitystream.SingletonWriter in project rest.li by linkedin.

the class GreetingUnstructuredDataAssociationResourceReactive method get.

@Override
public void get(CompoundKey key, @CallbackParam Callback<UnstructuredDataReactiveResult> callback) {
    Writer<ByteString> writer = new SingletonWriter<>(ByteString.copy(UNSTRUCTURED_DATA_BYTES));
    callback.onSuccess(new UnstructuredDataReactiveResult(EntityStreams.newEntityStream(writer), MIME_TYPE));
}
Also used : ByteString(com.linkedin.data.ByteString) UnstructuredDataReactiveResult(com.linkedin.restli.server.UnstructuredDataReactiveResult) SingletonWriter(com.linkedin.entitystream.SingletonWriter)

Example 3 with SingletonWriter

use of com.linkedin.entitystream.SingletonWriter in project rest.li by linkedin.

the class GreetingUnstructuredDataSimpleResourceReactive method get.

@Override
public void get(@CallbackParam Callback<UnstructuredDataReactiveResult> callback) {
    Writer<ByteString> writer = new SingletonWriter<>(ByteString.copy(UNSTRUCTURED_DATA_BYTES));
    callback.onSuccess(new UnstructuredDataReactiveResult(EntityStreams.newEntityStream(writer), MIME_TYPE));
}
Also used : ByteString(com.linkedin.data.ByteString) UnstructuredDataReactiveResult(com.linkedin.restli.server.UnstructuredDataReactiveResult) SingletonWriter(com.linkedin.entitystream.SingletonWriter)

Aggregations

ByteString (com.linkedin.data.ByteString)3 SingletonWriter (com.linkedin.entitystream.SingletonWriter)3 UnstructuredDataReactiveResult (com.linkedin.restli.server.UnstructuredDataReactiveResult)3