Package io.grpc.protobuf.services
Class ProtoReflectionServiceV1.FileDescriptorIndex
- java.lang.Object
-
- io.grpc.protobuf.services.ProtoReflectionServiceV1.FileDescriptorIndex
-
- Enclosing class:
- ProtoReflectionServiceV1
private static final class ProtoReflectionServiceV1.FileDescriptorIndex extends java.lang.Object
Provides a set of methods for answering reflection queries for the file descriptors underlying a set of services. Used byProtoReflectionServiceV1.ServerReflectionIndex
to separately index immutable and mutable services.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.util.Map<java.lang.Integer,com.google.protobuf.Descriptors.FileDescriptor>>
fileDescriptorsByExtensionAndNumber
private java.util.Map<java.lang.String,com.google.protobuf.Descriptors.FileDescriptor>
fileDescriptorsByName
private java.util.Map<java.lang.String,com.google.protobuf.Descriptors.FileDescriptor>
fileDescriptorsBySymbol
private java.util.Set<com.google.protobuf.Descriptors.FileDescriptor>
serviceFileDescriptors
private java.util.Set<java.lang.String>
serviceNames
-
Constructor Summary
Constructors Constructor Description FileDescriptorIndex(java.util.List<ServerServiceDefinition> services)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.Set<java.lang.Integer>
getExtensionNumbersOfType(java.lang.String type)
private com.google.protobuf.Descriptors.FileDescriptor
getFileDescriptorByExtensionAndNumber(java.lang.String type, int number)
private com.google.protobuf.Descriptors.FileDescriptor
getFileDescriptorByName(java.lang.String name)
private com.google.protobuf.Descriptors.FileDescriptor
getFileDescriptorBySymbol(java.lang.String symbol)
private java.util.Set<com.google.protobuf.Descriptors.FileDescriptor>
getServiceFileDescriptors()
Returns the file descriptors for the indexed services, but not their dependencies.private java.util.Set<java.lang.String>
getServiceNames()
private void
processExtension(com.google.protobuf.Descriptors.FieldDescriptor extension, com.google.protobuf.Descriptors.FileDescriptor fd)
private void
processFileDescriptor(com.google.protobuf.Descriptors.FileDescriptor fd)
private void
processService(com.google.protobuf.Descriptors.ServiceDescriptor service, com.google.protobuf.Descriptors.FileDescriptor fd)
private void
processType(com.google.protobuf.Descriptors.Descriptor type, com.google.protobuf.Descriptors.FileDescriptor fd)
-
-
-
Field Detail
-
serviceNames
private final java.util.Set<java.lang.String> serviceNames
-
serviceFileDescriptors
private final java.util.Set<com.google.protobuf.Descriptors.FileDescriptor> serviceFileDescriptors
-
fileDescriptorsByName
private final java.util.Map<java.lang.String,com.google.protobuf.Descriptors.FileDescriptor> fileDescriptorsByName
-
fileDescriptorsBySymbol
private final java.util.Map<java.lang.String,com.google.protobuf.Descriptors.FileDescriptor> fileDescriptorsBySymbol
-
fileDescriptorsByExtensionAndNumber
private final java.util.Map<java.lang.String,java.util.Map<java.lang.Integer,com.google.protobuf.Descriptors.FileDescriptor>> fileDescriptorsByExtensionAndNumber
-
-
Constructor Detail
-
FileDescriptorIndex
FileDescriptorIndex(java.util.List<ServerServiceDefinition> services)
-
-
Method Detail
-
getServiceFileDescriptors
private java.util.Set<com.google.protobuf.Descriptors.FileDescriptor> getServiceFileDescriptors()
Returns the file descriptors for the indexed services, but not their dependencies. This is used to check if the server's mutable services have changed.
-
getServiceNames
private java.util.Set<java.lang.String> getServiceNames()
-
getFileDescriptorByName
@Nullable private com.google.protobuf.Descriptors.FileDescriptor getFileDescriptorByName(java.lang.String name)
-
getFileDescriptorBySymbol
@Nullable private com.google.protobuf.Descriptors.FileDescriptor getFileDescriptorBySymbol(java.lang.String symbol)
-
getFileDescriptorByExtensionAndNumber
@Nullable private com.google.protobuf.Descriptors.FileDescriptor getFileDescriptorByExtensionAndNumber(java.lang.String type, int number)
-
getExtensionNumbersOfType
@Nullable private java.util.Set<java.lang.Integer> getExtensionNumbersOfType(java.lang.String type)
-
processFileDescriptor
private void processFileDescriptor(com.google.protobuf.Descriptors.FileDescriptor fd)
-
processService
private void processService(com.google.protobuf.Descriptors.ServiceDescriptor service, com.google.protobuf.Descriptors.FileDescriptor fd)
-
processType
private void processType(com.google.protobuf.Descriptors.Descriptor type, com.google.protobuf.Descriptors.FileDescriptor fd)
-
processExtension
private void processExtension(com.google.protobuf.Descriptors.FieldDescriptor extension, com.google.protobuf.Descriptors.FileDescriptor fd)
-
-