- 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 interface
ServiceDescriptor.Aware
Allows users to specify that they would like to have access to aServiceDescriptor
within theirServerInterceptor
implementation.static class
ServiceDescriptor.Builder
AServiceDescriptor
builder.static interface
ServiceDescriptor.Configurer
An interface implemented by classs that can configure aServiceDescriptor.Rules
.static interface
ServiceDescriptor.Rules
Fluent configuration interface for theServiceDescriptor
.
-
Field Summary
Fields Modifier and Type Field Description static io.grpc.Context.Key<ServiceDescriptor>
SERVICE_DESCRIPTOR_KEY
TheContext.Key
to use to obtain theServiceDescriptor
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ServiceDescriptor.Builder
builder(io.grpc.BindableService service)
Create aServiceDescriptor.Builder
.static ServiceDescriptor.Builder
builder(GrpcService service)
Create aServiceDescriptor.Builder
.static ServiceDescriptor.Builder
builder(Class serviceClass, String name)
Create aServiceDescriptor.Builder
.Map<io.grpc.Context.Key<?>,Object>
context()
Return context map.boolean
equals(Object o)
String
fullName()
Returns the service name prefixed with package directive if one exists.int
hashCode()
HealthCheck
healthCheck()
Return aHealthCheck
for this service.PriorityBag<io.grpc.ServerInterceptor>
interceptors()
Return service interceptors.MethodDescriptor
method(String name)
ReturnMethodDescriptor
for a specified method name.Collection<MethodDescriptor>
methods()
Return service methods.String
name()
Return service name.String
packageName()
Returns package name from proto file.com.google.protobuf.Descriptors.FileDescriptor
proto()
Return a proto file descriptor.String
toString()
-
-
-
Field Detail
-
SERVICE_DESCRIPTOR_KEY
public static final io.grpc.Context.Key<ServiceDescriptor> SERVICE_DESCRIPTOR_KEY
TheContext.Key
to 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)
ReturnMethodDescriptor
for 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 aHealthCheck
for 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
- theClass
representing the servicename
- the name of the service- Returns:
- a
ServiceDescriptor.Builder
-
builder
public static ServiceDescriptor.Builder builder(GrpcService service)
Create aServiceDescriptor.Builder
.- Parameters:
service
- theGrpcService
to use to initialise the builder- Returns:
- a
ServiceDescriptor.Builder
-
builder
public static ServiceDescriptor.Builder builder(io.grpc.BindableService service)
Create aServiceDescriptor.Builder
.- Parameters:
service
- theBindableService
to use to initialise the builder- Returns:
- a
ServiceDescriptor.Builder
-
-