View Javadoc
1   package de.dlr.shepard.context.semantic;
2   
3   import io.quarkus.logging.Log;
4   import jakarta.enterprise.context.RequestScoped;
5   
6   @RequestScoped
7   public class SemanticRepositoryConnectorFactory {
8   
9     @SuppressWarnings("PMD.TooFewBranchesForSwitch") // Allow small switch to indicate plan to extend this
10    public ISemanticRepositoryConnector getRepositoryService(SemanticRepositoryType type, String endpoint) {
11      return switch (type) {
12        case SPARQL -> new SparqlConnector(endpoint);
13        default -> {
14          Log.errorf("Missing implementation of type: %s", type);
15          throw new UnsupportedOperationException("Repository Type " + type + "is not yet implemented");
16        }
17      };
18    }
19  }