Package org.gcube.common.clients.config
Interface ProxyConfig<A,S>
- Type Parameters:
A- the type of service addressesS- the type of service stubs
- All Known Implementing Classes:
AbstractConfig,DiscoveryConfig,EndpointConfig
public interface ProxyConfig<A,S>
The configuration of service proxies.
- Author:
- Fabio Simeoni
-
Method Summary
Modifier and TypeMethodDescription<T> voidaddProperty(String name, T value) Adds a custom property to the configuration.voidaddProperty(Property<?> property) Adds a custom property to the configuration.booleanhasProperty(String property) Returnstrueif the configuration includes a given custom property.ProxyPlugin<A,S, ?> plugin()Returns theProxyPlugin.<T> TReturns the value of a given custom property.longtimeout()Returns the timeout.
-
Method Details
-
timeout
long timeout()Returns the timeout.- Returns:
- the timeout
-
plugin
ProxyPlugin<A,S, plugin()?> Returns theProxyPlugin.- Returns:
- the plugin
-
addProperty
Adds a custom property to the configuration.- Type Parameters:
T- the type of the property value- Parameters:
name- the name of the propertyvalue- the value of the property
-
addProperty
Adds a custom property to the configuration.- Parameters:
property- the property
-
hasProperty
Returnstrueif the configuration includes a given custom property.- Parameters:
property- the name of the property- Returns:
trueif the configuration has the property,falseotherwise
-
property
<T> T property(String property, Class<T> clazz) throws IllegalStateException, IllegalArgumentException Returns the value of a given custom property.- Type Parameters:
T- the type of the property value- Parameters:
property- the name of the propertyclazz- the type of the property value- Returns:
- the property value
- Throws:
IllegalStateException- if the property is not included in the configurationIllegalArgumentException- if the property exists but its value has a different value
-