|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.data.streams.publishers.RsPublisher<E>
E - the type of stream elementpublic class RsPublisher<E>
Publishes Streams as resultsets.
| Constructor Summary | |
|---|---|
RsPublisher(Stream<E> stream,
Generator<E,String> serialiser)
Creates an instance for a given Stream and with a given element serialiser. |
|
RsPublisher(Stream<E> stream,
RecordFactory<E> factory)
Creates an instance for a given Stream and with a given RecordFactory. |
|
| Method Summary | |
|---|---|
URI |
publish()
Publishes the stream and returns its address. |
void |
setBufferSize(int size)
Sets the size of the write buffer. |
void |
setFaultHandler(FaultHandler handler)
Sets the FaultHandler for reading and writing failures. |
void |
setOnDemand(boolean onDemand)
Sets the production mode of the publiher |
void |
setThreadProvider(ThreadProvider provider)
Sets the ThreadProvider used to populate the resultset. |
void |
setTimeout(long timeout,
TimeUnit timeoutUnit)
Sets the time to wait on a full write buffer. |
void |
setTransport(RsTransport transport)
Sets the resultset transport. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RsPublisher(Stream<E> stream,
Generator<E,String> serialiser)
Stream and with a given element serialiser.
stream - the streamserialiser - the serialiser
public RsPublisher(Stream<E> stream,
RecordFactory<E> factory)
Stream and with a given RecordFactory.
stream - the streamfactory - the factory| Method Detail |
|---|
public void setBufferSize(int size)
throws IllegalArgumentException
size - the size in bytes.
IllegalArgumentException - if the size is not a positive number
public void setTimeout(long timeout,
TimeUnit timeoutUnit)
throws IllegalArgumentException
timeout - the timeouttimeoutUnit - the timeout unit
IllegalArgumentException - if the timeout is not a positive number or the timeout unit is nullpublic void setTransport(RsTransport transport)
transport - the transport
IllegalArgumentException - if the transport is nullpublic void setOnDemand(boolean onDemand)
onDemand - true if the stream ought to be consumed only when clients require it,
false if it should be consumed continuously.public void setThreadProvider(ThreadProvider provider)
ThreadProvider used to populate the resultset.
provider - the provider
IllegalArgumentException - if the provider is null.public void setFaultHandler(FaultHandler handler)
FaultHandler for reading and writing failures.
handler - the handler
IllegalArgumentException - if the handler is null
public URI publish()
throws StreamPublishException
StreamPublisher
publish in interface StreamPublisherStreamPublishException - if the stream cannot be published
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||