Class AbstractStatelessBuilder<A,S,P>
- java.lang.Object
-
- org.gcube.common.clients.builders.AbstractBuilder<A,S,P>
-
- org.gcube.common.clients.builders.AbstractStatelessBuilder<A,S,P>
-
- Type Parameters:
A- the type of service addressesS- the type of service stubsP- the type of service proxies
- All Implemented Interfaces:
StatelessBuilderAPI.Builder<P>,StatelessBuilderAPI.FinalClause<P>,StatelessBuilderAPI.SecondClause<P>
public abstract class AbstractStatelessBuilder<A,S,P> extends AbstractBuilder<A,S,P> implements StatelessBuilderAPI.Builder<P>, StatelessBuilderAPI.SecondClause<P>, StatelessBuilderAPI.FinalClause<P>
Partial implementation of proxy builders for stateless services.- Author:
- Fabio Simeoni
-
-
Field Summary
-
Fields inherited from class org.gcube.common.clients.builders.AbstractBuilder
defaultTimeout
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractStatelessBuilder(ProxyPlugin<A,S,P> plugin, EndpointCache<A> cache, Query<A> query, Property<?>... properties)Constructs an instance with a givenProxyPlugin, anEndpointCache, aQuery, and zero or more defaultPropertys.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StatelessBuilderAPI.SecondClause<P>at(String host, int port)Configures the address of a given service instance.StatelessBuilderAPI.SecondClause<P>at(URI address)Configures the address of a given service endpoint.StatelessBuilderAPI.SecondClause<P>at(URL address)Configures the address of a given service endpoint.<T> StatelessBuilderAPI.Builder<P>with(String name, T value)Set a configuration property for the proxy.StatelessBuilderAPI.Builder<P>with(Property<?> property)Set a configuration property for the proxy.StatelessBuilderAPI.FinalClause<P>withTimeout(int duration, TimeUnit unit)Configures the timeout for the proxy.-
Methods inherited from class org.gcube.common.clients.builders.AbstractBuilder
addProperty, build, contextPath, convertAddress, plugin, setAddress, setQuery, setTimeout
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.gcube.common.clients.builders.StatelessBuilderAPI.Builder
build
-
Methods inherited from interface org.gcube.common.clients.builders.StatelessBuilderAPI.FinalClause
build
-
Methods inherited from interface org.gcube.common.clients.builders.StatelessBuilderAPI.SecondClause
build
-
-
-
-
Constructor Detail
-
AbstractStatelessBuilder
protected AbstractStatelessBuilder(ProxyPlugin<A,S,P> plugin, EndpointCache<A> cache, Query<A> query, Property<?>... properties)
Constructs an instance with a givenProxyPlugin, anEndpointCache, aQuery, and zero or more defaultPropertys.- Parameters:
plugin- the pluginthe- cachequery- the queryproperties- the properties
-
-
Method Detail
-
at
public StatelessBuilderAPI.SecondClause<P> at(String host, int port)
Description copied from interface:StatelessBuilderAPI.BuilderConfigures the address of a given service instance.- Specified by:
atin interfaceStatelessBuilderAPI.Builder<A>- Returns:
- further configuration options
-
at
public StatelessBuilderAPI.SecondClause<P> at(URL address)
Description copied from interface:StatelessBuilderAPI.BuilderConfigures the address of a given service endpoint.- Specified by:
atin interfaceStatelessBuilderAPI.Builder<A>- Parameters:
address- the address of the endpoint- Returns:
- further configuration options
-
at
public StatelessBuilderAPI.SecondClause<P> at(URI address)
Description copied from interface:StatelessBuilderAPI.BuilderConfigures the address of a given service endpoint.- Specified by:
atin interfaceStatelessBuilderAPI.Builder<A>- Parameters:
address- the address of the endpoint- Returns:
- further configuration options
-
withTimeout
public StatelessBuilderAPI.FinalClause<P> withTimeout(int duration, TimeUnit unit)
Description copied from interface:StatelessBuilderAPI.BuilderConfigures the timeout for the proxy.- Specified by:
withTimeoutin interfaceStatelessBuilderAPI.Builder<A>- Specified by:
withTimeoutin interfaceStatelessBuilderAPI.SecondClause<A>- Parameters:
duration- the duration of the timeoutunit- the time unit of the timeout- Returns:
- further configuration options
-
with
public StatelessBuilderAPI.Builder<P> with(Property<?> property)
Description copied from interface:StatelessBuilderAPI.BuilderSet a configuration property for the proxy.- Specified by:
within interfaceStatelessBuilderAPI.Builder<A>- Returns:
- further configuration options
-
with
public <T> StatelessBuilderAPI.Builder<P> with(String name, T value)
Description copied from interface:StatelessBuilderAPI.BuilderSet a configuration property for the proxy.- Specified by:
within interfaceStatelessBuilderAPI.Builder<A>- Type Parameters:
T- the type of the property value- Parameters:
name- the name of the propertyvalue- the value of the property- Returns:
- further configuration options
-
-