Class GrpcChannelsProperties

java.lang.Object
net.devh.boot.grpc.client.config.GrpcChannelsProperties

@ConfigurationProperties("grpc") public class GrpcChannelsProperties extends Object
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 Details

    • GLOBAL_PROPERTIES_KEY

      public static final String GLOBAL_PROPERTIES_KEY
      The key that will be used for the GLOBAL properties.
      See Also:
  • Constructor Details

    • GrpcChannelsProperties

      public GrpcChannelsProperties()
  • Method Details

    • getClient

      public final Map<String,GrpcChannelProperties> getClient()
      Gets the configuration mapping for each client.
      Returns:
      The client configuration mappings.
    • getChannel

      public GrpcChannelProperties getChannel(String name)
      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

      public final GrpcChannelProperties 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

      public String 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

      public void setDefaultScheme(String defaultScheme)
      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 the NameResolver.Factory. Examples: dns, discovery.
      Parameters:
      defaultScheme - The default scheme to use or null.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object