- java.lang.Object
-
- io.helidon.grpc.server.ServiceDescriptor
-
public class ServiceDescriptor extends Object
Encapsulates all metadata necessary to create and deploy a gRPC service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceServiceDescriptor.AwareAllows users to specify that they would like to have access to aServiceDescriptorwithin theirServerInterceptorimplementation.static classServiceDescriptor.BuilderAServiceDescriptorbuilder.static interfaceServiceDescriptor.ConfigurerAn interface implemented by classs that can configure aServiceDescriptor.Rules.static interfaceServiceDescriptor.RulesFluent configuration interface for theServiceDescriptor.
-
Field Summary
Fields Modifier and Type Field Description static io.grpc.Context.Key<ServiceDescriptor>SERVICE_DESCRIPTOR_KEYTheContext.Keyto use to obtain theServiceDescriptor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ServiceDescriptor.Builderbuilder(io.grpc.BindableService service)Create aServiceDescriptor.Builder.static ServiceDescriptor.Builderbuilder(GrpcService service)Create aServiceDescriptor.Builder.static ServiceDescriptor.Builderbuilder(Class serviceClass, String name)Create aServiceDescriptor.Builder.Map<io.grpc.Context.Key<?>,Object>context()Return context map.booleanequals(Object o)StringfullName()Returns the service name prefixed with package directive if one exists.inthashCode()HealthCheckhealthCheck()Return aHealthCheckfor this service.PriorityBag<io.grpc.ServerInterceptor>interceptors()Return service interceptors.MethodDescriptormethod(String name)ReturnMethodDescriptorfor a specified method name.Collection<MethodDescriptor>methods()Return service methods.Stringname()Return service name.StringpackageName()Returns package name from proto file.com.google.protobuf.Descriptors.FileDescriptorproto()Return a proto file descriptor.StringtoString()
-
-
-
Field Detail
-
SERVICE_DESCRIPTOR_KEY
public static final io.grpc.Context.Key<ServiceDescriptor> SERVICE_DESCRIPTOR_KEY
TheContext.Keyto use to obtain theServiceDescriptor.
-
-
Method Detail
-
name
public String name()
Return service name.- Returns:
- service name
-
fullName
public String fullName()
Returns the service name prefixed with package directive if one exists.- Returns:
- service name prefixed with package directive if one exists.
-
packageName
public String packageName()
Returns package name from proto file.- Returns:
- package name from proto file
-
method
public MethodDescriptor method(String name)
ReturnMethodDescriptorfor a specified method name.- Parameters:
name- method name- Returns:
- method descriptor for the specified name
-
methods
public Collection<MethodDescriptor> methods()
Return service methods.- Returns:
- service methods
-
interceptors
public PriorityBag<io.grpc.ServerInterceptor> interceptors()
Return service interceptors.- Returns:
- service interceptors
-
context
public Map<io.grpc.Context.Key<?>,Object> context()
Return context map.- Returns:
- context map
-
healthCheck
public HealthCheck healthCheck()
Return aHealthCheckfor this service.- Returns:
- a health check
-
proto
public com.google.protobuf.Descriptors.FileDescriptor proto()
Return a proto file descriptor.- Returns:
- a proto file descriptor
-
builder
public static ServiceDescriptor.Builder builder(Class serviceClass, String name)
Create aServiceDescriptor.Builder.- Parameters:
serviceClass- theClassrepresenting the servicename- the name of the service- Returns:
- a
ServiceDescriptor.Builder
-
builder
public static ServiceDescriptor.Builder builder(GrpcService service)
Create aServiceDescriptor.Builder.- Parameters:
service- theGrpcServiceto use to initialise the builder- Returns:
- a
ServiceDescriptor.Builder
-
builder
public static ServiceDescriptor.Builder builder(io.grpc.BindableService service)
Create aServiceDescriptor.Builder.- Parameters:
service- theBindableServiceto use to initialise the builder- Returns:
- a
ServiceDescriptor.Builder
-
-