Interface GrpcServiceName


public interface GrpcServiceName

Represents a gRPC service name.

A gRPC service is uniquely identified by its fully qualified name composed of a package and a service name: <package>.<service_name>.

Since:
1.9
Author:
Jeremy Kuhn
  • Method Details

    • of

      static GrpcServiceName of(String fullyQualifiedName) throws IllegalArgumentException

      Creates a gRPC service name from the specified fully qualified name.

      Parameters:
      fullyQualifiedName - a fully qualified name
      Returns:
      a gRPC service name
      Throws:
      IllegalArgumentException - if the specified name is not valid gRPC full identifier
    • of

      static GrpcServiceName of(String packageName, String serviceName) throws IllegalArgumentException

      Creates a gRPC service name from the specified package and service names.

      Parameters:
      packageName - the package name
      serviceName - the service name
      Returns:
      a gRPC service name
      Throws:
      IllegalArgumentException - if the specified names are not valid gRPC identifier
    • getServiceName

      String getServiceName()

      Returns the name of the service.

      Returns:
      the service name
    • getPackageName

      String getPackageName()

      Returns the package of the service.

      Returns:
      the package name
    • getFullyQualifiedName

      String getFullyQualifiedName()

      Returns the fully qualified name of the service.

      Returns:
      the service fully qualified name
    • methodPath

      String methodPath(String method)

      Returns the path to the specified service method.

      The path to a service method is always absolute and obtained from the service fully qualified name and the method name: /<package>.<service_name>/<method_name>.

      Parameters:
      method - a service method
      Returns:
      a path to a service method