Skip to content
Snippets Groups Projects
Verified Commit 37f6ba2d authored by Timm Fitschen's avatar Timm Fitschen
Browse files

STY: formatting

parent 3fed4cd3
No related branches found
No related tags found
3 merge requests!44Release 0.6,!43Merge f-GRPC-main to dev,!42DEPS: Update proto and fix breaking changes
Pipeline #15870 passed
......@@ -116,14 +116,18 @@ public class GRPCServer {
final List<ServerServiceDefinition> services = new LinkedList<>();
final GeneralInfoServiceImpl generalInfoService = new GeneralInfoServiceImpl();
services.add(ServerInterceptors.intercept(generalInfoService, loggingInterceptor, authInterceptor));
services.add(
ServerInterceptors.intercept(generalInfoService, loggingInterceptor, authInterceptor));
final FileTransmissionServiceImpl fileTransmissionService = new FileTransmissionServiceImpl();
services.add(ServerInterceptors.intercept(fileTransmissionService, loggingInterceptor, authInterceptor));
services.add(
ServerInterceptors.intercept(fileTransmissionService, loggingInterceptor, authInterceptor));
final EntityTransactionServiceImpl entityTransactionService =
new EntityTransactionServiceImpl(fileTransmissionService);
services.add(ServerInterceptors.intercept(entityTransactionService, loggingInterceptor, authInterceptor));
services.add(
ServerInterceptors.intercept(
entityTransactionService, loggingInterceptor, authInterceptor));
return services;
}
......
package org.caosdb.server.grpc;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.grpc.Context;
import io.grpc.Contexts;
import io.grpc.Metadata;
......@@ -9,15 +7,17 @@ import io.grpc.ServerCall;
import io.grpc.ServerCall.Listener;
import io.grpc.ServerCallHandler;
import io.grpc.ServerInterceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LoggingInterceptor implements ServerInterceptor {
private static final Logger logger = LoggerFactory.getLogger(LoggingInterceptor.class.getName());
@Override
public <ReqT, RespT> Listener<ReqT> interceptCall(
ServerCall<ReqT, RespT> call, Metadata headers, ServerCallHandler<ReqT, RespT> next) {
logger.info(call.getMethodDescriptor().getFullMethodName() + " - " + call.getAttributes());
return Contexts.interceptCall(Context.current(), call, headers, next);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment