org.gcube.common.clients.config
Interface ProxyConfig<A,S>

Type Parameters:
A - the type of service addresses
S - 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
 void addProperty(Property<?> property)
          Adds a custom property to the configuration.
<T> void
addProperty(String name, T value)
          Adds a custom property to the configuration.
 boolean hasProperty(String property)
          Returns true if the configuration includes a given custom property.
 ProxyPlugin<A,S,?> plugin()
          Returns the ProxyPlugin.
<T> T
property(String property, Class<T> clazz)
          Returns the value of a given custom property.
 long timeout()
          Returns the timeout.
 

Method Detail

timeout

long timeout()
Returns the timeout.

Returns:
the timeout

plugin

ProxyPlugin<A,S,?> plugin()
Returns the ProxyPlugin.

Returns:
the plugin

addProperty

<T> void addProperty(String name,
                     T value)
Adds a custom property to the configuration.

Type Parameters:
T - the type of the property value
Parameters:
name - the name of the property
value - the value of the property

addProperty

void addProperty(Property<?> property)
Adds a custom property to the configuration.

Parameters:
property - the property

hasProperty

boolean hasProperty(String property)
Returns true if the configuration includes a given custom property.

Parameters:
property - the name of the property
Returns:

property

<T> T property(String property,
               Class<T> clazz)
           throws IllegalStateException,
                  IllegalArgumentException
Returns the value of a given custom property.

Parameters:
property - the name of the property
clazz - the type of the property value
Returns:
the property value
Throws:
IllegalStateException - if the property is not included in the configuration
IllegalArgumentException - if the property exists but its value has a different value * @param the type of the property value


Copyright © 2012. All Rights Reserved.