org.gcube.data.streams.dsl.publish
Class PublishRsWithClause<E>

java.lang.Object
  extended by org.gcube.data.streams.dsl.StreamClause<E,PublishRsEnv<E>>
      extended by org.gcube.data.streams.dsl.publish.PublishRsWithClause<E>

public class PublishRsWithClause<E>
extends StreamClause<E,PublishRsEnv<E>>

The clause of publish sentences in which the output resultset is configured.

Author:
Fabio Simeoni

Field Summary
 
Fields inherited from class org.gcube.data.streams.dsl.StreamClause
env
 
Constructor Summary
PublishRsWithClause(PublishRsEnv<E> e)
          Creates an instance with the PublishRsEnv of the ongoing sentence.
 
Method Summary
 PublishRsWithClause<E> nonstop()
          Configures publication to continue consuming the input Stream after the expiry of the publishing timeout.
 URI with(FaultHandler handler)
          Configures a FaultHandler for publication and returns the locator of the resultset.
 PublishRsWithClause<E> with(ThreadProvider provider)
          Configures a ThreadProvider for the publishing thread.
 PublishRsWithClause<E> withBufferOf(int size)
          Configures the element capacity of the resultset buffer.
 URI withDefaults()
          Returns the locator of the resultset.
 PublishRsWithClause<E> withTimeoutOf(int timeout, TimeUnit unit)
          Configures the publishing timeout of the resultset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PublishRsWithClause

public PublishRsWithClause(PublishRsEnv<E> e)
Creates an instance with the PublishRsEnv of the ongoing sentence.

Parameters:
e - the environment
Method Detail

withBufferOf

public PublishRsWithClause<E> withBufferOf(int size)
Configures the element capacity of the resultset buffer.

Parameters:
size - the number of elements in the buffer
Returns:
this clause

withTimeoutOf

public PublishRsWithClause<E> withTimeoutOf(int timeout,
                                            TimeUnit unit)
Configures the publishing timeout of the resultset.

If the timeout expire, elements of the input Stream will no longer be published, though they may still be consumed if nonstop() has been invoked.

Parameters:
timeout - the timeout
unit - the time unit for the timeout
Returns:
this clause

nonstop

public PublishRsWithClause<E> nonstop()
Configures publication to continue consuming the input Stream after the expiry of the publishing timeout.

Typically used for the side-effects of publications.

Returns:
this clause

with

public PublishRsWithClause<E> with(ThreadProvider provider)
Configures a ThreadProvider for the publishing thread.

Publication occurs asynchronously and a thread provider may be required to make available thread-bound information in the publishing thread.

Parameters:
provider - the thread provider
Returns:
this clause

with

public URI with(FaultHandler handler)
Configures a FaultHandler for publication and returns the locator of the resultset.

Parameters:
handler - the handler
Returns:
the locator the locator

withDefaults

public URI withDefaults()
Returns the locator of the resultset.

Returns:
the locator.


Copyright © 2012. All Rights Reserved.