Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion smart-connector-rest-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</dependency>
<dependency>
<groupId>eu.knowledge.engine</groupId>
<artifactId>smart-connector-api</artifactId>
<artifactId>smart-connector</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -24,7 +23,6 @@

import org.apache.jena.rdf.model.Resource;
import org.apache.jena.rdf.model.ResourceFactory;
import org.apache.jena.reasoner.rulesys.Rule.ParserException;
import org.apache.jena.shared.PrefixMapping;
import org.apache.jena.sparql.graph.PrefixMappingMem;
import org.apache.jena.sparql.graph.PrefixMappingZero;
Expand Down Expand Up @@ -56,8 +54,8 @@
import eu.knowledge.engine.smartconnector.api.ReactKnowledgeInteraction;
import eu.knowledge.engine.smartconnector.api.RecipientSelector;
import eu.knowledge.engine.smartconnector.api.SmartConnector;
import eu.knowledge.engine.smartconnector.api.SmartConnectorProvider;
import eu.knowledge.engine.smartconnector.api.SmartConnectorSPI;
import eu.knowledge.engine.smartconnector.impl.SmartConnectorBuilder;
import eu.knowledge.engine.smartconnector.impl.SmartConnectorImpl;
import jakarta.ws.rs.container.AsyncResponse;
import jakarta.ws.rs.core.Response;

Expand All @@ -66,23 +64,6 @@ public class RestKnowledgeBase implements KnowledgeBase {

public static int INACTIVITY_TIMEOUT_SECONDS = 60;

/**
* A way to allow the RestServer to use different versions of the Smart
* Connector (typically v1 and v2). We assume there is only a single provider on
* the classpath.
*/
private static SmartConnectorProvider smartConnectorProvider = null;

static {
Iterator<SmartConnectorProvider> iter = SmartConnectorSPI.providers(true);
if (iter.hasNext()) {
smartConnectorProvider = iter.next();
} else {
LOG.error(
"SmartConnectorProvider not initialized. Make sure there is a SmartConnectorProvider implementation registered on the classpath.");
}
}

private String knowledgeBaseId;
private String knowledgeBaseName;
private String knowledgeBaseDescription;
Expand Down Expand Up @@ -249,11 +230,7 @@ protected boolean removeEldestEntry(Map.Entry<Integer, HandleRequest> eldest) {
this.lease = null;
}

if (smartConnectorProvider == null) {
throw new IllegalStateException(
"SmartConnectorProvider not initialized. Make sure there is a SmartConnectorProvider implementation registered on the classpath.");
}
this.sc = smartConnectorProvider.create(this);
this.sc = SmartConnectorBuilder.newSmartConnector(this).create();

if (scModel.getReasonerLevel() != null)
this.sc.setReasonerLevel(scModel.getReasonerLevel());
Expand Down

This file was deleted.