Class AbstractSingletonBuilder<A,S,P>
java.lang.Object
org.gcube.common.clients.builders.AbstractBuilder<A,S,P>
org.gcube.common.clients.builders.AbstractSingletonBuilder<A,S,P>
- Type Parameters:
A- the type of service addressesS- the type of service stubsP- the type of service proxies
- All Implemented Interfaces:
SingletonBuilderAPI.Builder<A,,P> SingletonBuilderAPI.FinalClause<P>,SingletonBuilderAPI.SecondClause<P>
public abstract class AbstractSingletonBuilder<A,S,P>
extends AbstractBuilder<A,S,P>
implements SingletonBuilderAPI.Builder<A,P>, SingletonBuilderAPI.SecondClause<P>, SingletonBuilderAPI.FinalClause<P>
Partial implementation of proxy builders for singleton services, i.e. stateful services with a known single instance.
- Author:
- Fabio Simeoni
-
Field Summary
Fields inherited from class org.gcube.common.clients.builders.AbstractBuilder
defaultTimeout -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSingletonBuilder(ProxyPlugin<A, S, P> plugin, EndpointCache<A> cache, Property<?>... properties) Constructs an instance with a givenProxyPlugin, andEndpointCache, and zero or more defaultPropertys. -
Method Summary
Modifier and TypeMethodDescriptionConfigures the address of a given service instance.Configures the address of a given service endpoint.Configures the address of a given service endpoint.Configures a query for service instances.Set a configuration property for the proxy.Set a configuration property for the proxy.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, setTimeoutMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gcube.common.clients.builders.SingletonBuilderAPI.FinalClause
buildMethods inherited from interface org.gcube.common.clients.builders.SingletonBuilderAPI.SecondClause
build
-
Constructor Details
-
AbstractSingletonBuilder
protected AbstractSingletonBuilder(ProxyPlugin<A, S, P> plugin, EndpointCache<A> cache, Property<?>... properties) Constructs an instance with a givenProxyPlugin, andEndpointCache, and zero or more defaultPropertys.- Parameters:
plugin- the plugincache- the cacheproperties- the properties
-
-
Method Details
-
matching
Description copied from interface:SingletonBuilderAPI.BuilderConfigures a query for service instances.- Specified by:
matchingin interfaceSingletonBuilderAPI.Builder<A,S> - Parameters:
query- the query- Returns:
- further configuration options
-
at
Description copied from interface:SingletonBuilderAPI.BuilderConfigures the address of a given service instance.- Specified by:
atin interfaceSingletonBuilderAPI.Builder<A,S> - Parameters:
host- the host of the endpointport- the port of the endpoint- Returns:
- further configuration options
-
at
Description copied from interface:SingletonBuilderAPI.BuilderConfigures the address of a given service endpoint.- Specified by:
atin interfaceSingletonBuilderAPI.Builder<A,S> - Parameters:
address- the address of the endpoint- Returns:
- further configuration options
-
at
Description copied from interface:SingletonBuilderAPI.BuilderConfigures the address of a given service endpoint.- Specified by:
atin interfaceSingletonBuilderAPI.Builder<A,S> - Parameters:
address- the address of the endpoint- Returns:
- further configuration options
-
withTimeout
Description copied from interface:SingletonBuilderAPI.SecondClauseConfigures the timeout for the proxy.- Specified by:
withTimeoutin interfaceSingletonBuilderAPI.SecondClause<A>- Parameters:
duration- the duration of the timeoutunit- the time unit of the timeout- Returns:
- further configuration options
-
with
Description copied from interface:SingletonBuilderAPI.SecondClauseSet a configuration property for the proxy.- Specified by:
within interfaceSingletonBuilderAPI.SecondClause<A>- Parameters:
property- the property- Returns:
- further configuration options
-
with
Description copied from interface:SingletonBuilderAPI.SecondClauseSet a configuration property for the proxy.- Specified by:
within interfaceSingletonBuilderAPI.SecondClause<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
-