Class GrpcUtils

java.lang.Object
net.devh.boot.grpc.common.util.GrpcUtils

public final class GrpcUtils extends Object
Utility class that contains methods to extract some information from grpc classes.
  • Field Details

    • DOMAIN_SOCKET_ADDRESS_SCHEME

      public static final String DOMAIN_SOCKET_ADDRESS_SCHEME
      A constant that defines, the scheme of a Unix domain socket address.
      See Also:
    • DOMAIN_SOCKET_ADDRESS_PREFIX

      public static final String DOMAIN_SOCKET_ADDRESS_PREFIX
      A constant that defines, the scheme prefix of a Unix domain socket address.
      See Also:
    • CLOUD_DISCOVERY_METADATA_PORT

      public static final String CLOUD_DISCOVERY_METADATA_PORT
      The cloud discovery metadata key used to identify the grpc port.
      See Also:
    • INTER_PROCESS_DISABLE

      public static final int INTER_PROCESS_DISABLE
      The constant for the grpc server port, -1 represents don't start an inter process server.
      See Also:
  • Method Details

    • extractDomainSocketAddressPath

      public static String extractDomainSocketAddressPath(String address)
      Extracts the domain socket address specific path from the given full address. The address must fulfill the requirements as specified by grpc.
      Parameters:
      address - The address to extract it from.
      Returns:
      The extracted domain socket address specific path.
      Throws:
      IllegalArgumentException - If the given address is not a valid address.
    • extractServiceName

      public static String extractServiceName(MethodDescriptor<?,?> method)
      Extracts the service name from the given method.
      Parameters:
      method - The method to get the service name from.
      Returns:
      The extracted service name.
      See Also:
    • extractMethodName

      public static String extractMethodName(MethodDescriptor<?,?> method)
      Extracts the method name from the given method.
      Parameters:
      method - The method to get the method name from.
      Returns:
      The extracted method name.
      See Also: