Class AbstractBuilder<A,S,P>
- java.lang.Object
-
- org.gcube.common.clients.builders.AbstractBuilder<A,S,P>
-
- Type Parameters:
A- the type of service addressesS- the type of service stubsP- the type of service proxies
- Direct Known Subclasses:
AbstractSingletonBuilder,AbstractStatefulBuilder,AbstractStatelessBuilder
public abstract class AbstractBuilder<A,S,P> extends Object
Partial implementation of proxy builders.- Author:
- Fabio Simeoni
-
-
Field Summary
Fields Modifier and Type Field Description static intdefaultTimeoutDefault proxy timeout.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractBuilder(ProxyPlugin<A,S,P> plugin, EndpointCache<A> cache, Property<?>... properties)Constructs an instance with a givenProxyPlugin, andEndpointCache, and zero or more defaultPropertys.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddProperty(Property<?> property)Adds a custom property.Pbuild()protected abstract StringcontextPath()protected abstract AconvertAddress(W3CEndpointReference address)Converts aW3CEndpointReferencein a service address.protected ProxyPlugin<A,S,P>plugin()Returns theProxyPlugin.protected voidsetAddress(W3CEndpointReference address)Sets the address.protected voidsetQuery(Query<A> query)Sets the query.protected voidsetTimeout(int timeout)Sets the timeout.
-
-
-
Constructor Detail
-
AbstractBuilder
protected AbstractBuilder(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 Detail
-
plugin
protected ProxyPlugin<A,S,P> plugin()
Returns theProxyPlugin.- Returns:
- the plugin
-
setTimeout
protected void setTimeout(int timeout)
Sets the timeout.- Parameters:
timeout- the timout
-
setAddress
protected void setAddress(W3CEndpointReference address)
Sets the address.- Parameters:
address- the address
-
addProperty
protected void addProperty(Property<?> property)
Adds a custom property.- Parameters:
property- the property
-
build
public P build()
-
convertAddress
protected abstract A convertAddress(W3CEndpointReference address)
Converts aW3CEndpointReferencein a service address.- Parameters:
address- the address as aW3CEndpointReference- Returns:
- the converted address
-
contextPath
protected abstract String contextPath()
-
-