Package net.devh.boot.grpc.client.config
Class GrpcChannelsProperties
java.lang.Object
net.devh.boot.grpc.client.config.GrpcChannelsProperties
A container for named channel properties. Each channel has its own configuration. If you try to get a channel that
does not have a configuration yet, it will be created. If something is not configured in the channel properties, it
will be copied from the global config during the first retrieval. If some property is configured in neither the
channel properties nor the global properties then a default value will be used.
- Since:
- 5/17/16
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The key that will be used for theGLOBAL
properties. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
getChannel
(String name) Gets the properties for the given channel.final Map<String,
GrpcChannelProperties> Gets the configuration mapping for each client.Get the default scheme that should be used, if the client doesn't specify a scheme/address.final GrpcChannelProperties
Gets the global channel properties.int
hashCode()
void
setDefaultScheme
(String defaultScheme) Sets the default scheme to use, if the client doesn't specify a scheme/address.toString()
-
Field Details
-
GLOBAL_PROPERTIES_KEY
The key that will be used for theGLOBAL
properties.- See Also:
-
-
Constructor Details
-
GrpcChannelsProperties
public GrpcChannelsProperties()
-
-
Method Details
-
getClient
Gets the configuration mapping for each client.- Returns:
- The client configuration mappings.
-
getChannel
Gets the properties for the given channel. If the properties for the specified channel name do not yet exist, they are created automatically. Before the instance is returned, the unset values are filled with values from the global properties.- Parameters:
name
- The name of the channel to get the properties for.- Returns:
- The properties for the given channel name.
-
getGlobalChannel
Gets the global channel properties. Global properties are used, if the channel properties don't overwrite them. If neither the global nor the per client properties are set then default values will be used.- Returns:
- The global channel properties.
-
getDefaultScheme
Get the default scheme that should be used, if the client doesn't specify a scheme/address.- Returns:
- The default scheme to use or null.
- See Also:
-
setDefaultScheme
Sets the default scheme to use, if the client doesn't specify a scheme/address. If not specified it will default to the default scheme of theNameResolver.Factory
. Examples:dns
,discovery
.- Parameters:
defaultScheme
- The default scheme to use or null.
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-