in sdk/greengrass/event-stream-rpc-server/src/main/java/software/amazon/awssdk/eventstreamrpc/RpcServer.java [121:151]
private void validateServiceHandler() {
if (eventStreamRPCServiceHandler.getAuthenticationHandler() == null) {
throw new InvalidServiceConfigurationException(String.format("%s authentication handler is not set!",
eventStreamRPCServiceHandler.getServiceName()));
}
if (eventStreamRPCServiceHandler.getAuthorizationHandler() == null) {
throw new InvalidServiceConfigurationException(String.format("%s authorization handler is not set!",
eventStreamRPCServiceHandler.getServiceName()));
}
final EventStreamRPCServiceModel serviceModel = eventStreamRPCServiceHandler.getServiceModel();
if (serviceModel == null) {
throw new InvalidServiceConfigurationException("Handler must not have a null service model");
}
if (serviceModel.getServiceName() == null || serviceModel.getServiceName().isEmpty()) {
throw new InvalidServiceConfigurationException("Service model's name is null!");
}
final Set<String> unsetOperations = serviceModel.getAllOperations().stream().filter(operationName -> {
return serviceModel.getOperationModelContext(operationName) == null;
}).collect(Collectors.toSet());
if (!unsetOperations.isEmpty()) {
throw new InvalidServiceConfigurationException(String.format("Service has the following unset operations {%s}",
unsetOperations.stream().collect(Collectors.joining(", "))));
}
//validates all handlers are set
eventStreamRPCServiceHandler.validateAllOperationsSet();
}