Package io.grpc

Class NameResolver.ServiceConfigParser

  • Enclosing class:
    NameResolver

    @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1770")
    public abstract static class NameResolver.ServiceConfigParser
    extends Object
    Parses and validates service configuration.
    Since:
    1.21.0
    • Constructor Detail

      • ServiceConfigParser

        public ServiceConfigParser()
    • Method Detail

      • parseServiceConfig

        public abstract NameResolver.ConfigOrError parseServiceConfig​(Map<String,​?> rawServiceConfig)
        Parses and validates the service configuration chosen by the name resolver. This will return a NameResolver.ConfigOrError which contains either the successfully parsed config, or the Status representing the failure to parse. Implementations are expected to not throw exceptions but return a Status representing the failure. The value inside the NameResolver.ConfigOrError should implement equals() and hashCode().
        Parameters:
        rawServiceConfig - The Map representation of the service config
        Returns:
        a tuple of the fully parsed and validated channel configuration, else the Status.
        Since:
        1.21.0