Skip to content

Commit

Permalink
Removed *registerClientPattern methods.
Browse files Browse the repository at this point in the history
They weren't implemented anyway.
  • Loading branch information
Ferada committed Sep 11, 2011
1 parent c39e769 commit 7e176be
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 23 deletions.
22 changes: 7 additions & 15 deletions src/board/Board.java
@@ -1,6 +1,7 @@
package board;

import com.hp.hpl.jena.query.*;
import com.hp.hpl.jena.shared.*;
import com.hp.hpl.jena.rdf.model.*;

import java.util.*;
Expand All @@ -11,27 +12,16 @@
*/
public interface Board {
/**
* Registers the pattern with the given client. Patterns are matched
* when a client posts an update, regardless whether it is a sensor or
* a regular client. There is no order enforced by this interface for
* matching the patterns. One client may only register one pattern;
* if a client has already registered a pattern, it is overwritten.
* @param pattern A SPARQL query.
* @param client The associated client.
* Adds a client to the list of registered clients.
* @see Client#postUpdate
*/
public void registerClientPattern (String pattern, Client client);
public void registerClient (Client client);

/**
* Drops the client from the registered pattern list. If the client
* hasn't registered a pattern nothing happens.
* @param pattern A SPARQL query. Has to be the same (though doesn't
* have to share the identity) as during registration.
* @param client The associated client (in case more than one client
* registered the pattern).
* Removes a client from the list of registered clients.
* @see #registerClientPattern
*/
public void unregisterClientPattern (String pattern, Client client);
public void unregisterClient (Client client);

/**
* Merges the given values with the world model.
Expand Down Expand Up @@ -66,4 +56,6 @@ public interface Board {
* @param klass The type information for the example object.
*/
public List<Model> matching (Model test, Resource marker, MateClass klass);

public PrefixMapping getDefaultPrefixMapping ();
}
18 changes: 10 additions & 8 deletions src/board/Whiteboard.java
Expand Up @@ -19,6 +19,7 @@
import com.hp.hpl.jena.sparql.modify.request.*;

import com.hp.hpl.jena.vocabulary.RDF;
import com.hp.hpl.jena.vocabulary.RDFS;
import com.hp.hpl.jena.vocabulary.XSD;
import com.hp.hpl.jena.vocabulary.OWL;

Expand Down Expand Up @@ -143,10 +144,12 @@ public Whiteboard (Options options) throws FileNotFoundException {
public void reset (Options options) throws FileNotFoundException {
prefixes = PrefixMapping.Factory.create ();
prefixes.setNsPrefix ("rdf", RDF.getURI ());
prefixes.setNsPrefix ("rdfs", RDFS.getURI ());
prefixes.setNsPrefix ("xsd", XSD.getURI ());
prefixes.setNsPrefix ("owl", OWL.getURI ());
prefixes.setNsPrefix ("mate", Mate.prefix);
prefixes.setNsPrefix ("sensors", Sensors.prefix);
prefixes.setNsPrefix ("legacy", Legacy.prefix);
ModelFactory.setDefaultModelPrefixes (prefixes);

worldModel = ModelFactory.createDefaultModel ();
Expand Down Expand Up @@ -234,6 +237,7 @@ else if (string.equals ("none"))

/* Set up the ModelD2RQ using a mapping file */
legacyModel = new ModelD2RQ ("file:d2rq.n3");
legacyModel.setNsPrefixes (worldModel);

try {
runWebServer ();
Expand Down Expand Up @@ -360,6 +364,8 @@ private void runWebServer () throws Exception {
context.addServlet (new ServletHolder (new ModelServlet (worldModel)), "/world/*");
context.addServlet (new ServletHolder (new ModelServlet (sensorValues)), "/sensors/*");
context.addServlet (new ServletHolder (new ModelServlet (historyValues)), "/history/*");
context.addServlet (new ServletHolder (new ModelServlet (legacyModel)), "/legacy/*");
context.addServlet (new ServletHolder (new QueryServlet (this)), "/query/*");

server.start ();

Expand Down Expand Up @@ -405,14 +411,6 @@ private GraphStore getPrivateStore (Client client) {
return result;
}

public void registerClientPattern (String pattern, Client client) {

}

public void unregisterClientPattern (String pattern, Client client) {

}

/**
* Checks whether a model is consistent with respect to the given
* ontology.
Expand Down Expand Up @@ -918,6 +916,10 @@ public QueryExecution query (String query) {
return query (QueryFactory.create (query));
}

public PrefixMapping getDefaultPrefixMapping () {
return prefixes;
}

public static String writeToString (Model model) {
return writeToString (model, "N3");
}
Expand Down

0 comments on commit 7e176be

Please sign in to comment.