Permalink
Browse files

add unsupported operation exceptions for api methods that are not sup…

…ported in m2.
  • Loading branch information...
Bill Millar
Bill Millar committed Dec 15, 2009
1 parent be4b3c3 commit eff6cd6c764da31df68650fe3f571cfe36fff478
@@ -26,7 +26,6 @@
import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.graph.TripleMatch;
import com.hp.hpl.jena.graph.impl.GraphBase;
-import com.hp.hpl.jena.graph.query.QueryHandler;
import com.hp.hpl.jena.shared.AddDeniedException;
import com.hp.hpl.jena.shared.DeleteDeniedException;
import com.hp.hpl.jena.shared.PrefixMapping;
@@ -71,100 +70,21 @@ AGRepositoryConnection getConnection() {
public void close() {
}
- /*
- * @Override public boolean contains(Triple t) { // TODO Auto-generated
- * method stub return false; }
- *
- * @Override public boolean contains(Node s, Node p, Node o) { // TODO
- * Auto-generated method stub return false; }
- */
-
- /*
- * @Override public void delete(Triple t) throws DeleteDeniedException { try
- * { conn.remove(vf.asResource(t.getSubject()), vf.asURI(t.getPredicate()),
- * vf.asValue(t.getObject()), context); } catch (UnauthorizedException e) {
- * throw new DeleteDeniedException(e.getMessage()); } catch
- * (RepositoryException e) { throw new RuntimeException(e); } }
- *
- * @Override public boolean dependsOn(Graph other) { // TODO Auto-generated
- * method stub return false; }
- *
- * @Override public ExtendedIterator<Triple> find(TripleMatch m) { return
- * find(m.getMatchSubject(),m.getMatchPredicate(),m.getMatchObject()); }
- *
- * @Override public ExtendedIterator<Triple> find(Node s, Node p, Node o) {
- * RepositoryResult<Statement> result; try { result =
- * conn.getStatements(vf.asResource(s), vf.asURI(p), vf.asValue(o), false,
- * context); } catch (RepositoryException e) { throw new
- * RuntimeException(e); } return new AGTripleIterator(result); }
- */
-
@Override
public BulkUpdateHandler getBulkUpdateHandler() {
return new AGBulkUpdateHandler(this);
}
- /*
- * @Override public Capabilities getCapabilities() { // TODO Auto-generated
- * method stub return null; }
- *
- * @Override public GraphEventManager getEventManager() { // TODO
- * Auto-generated method stub return null; }
- */
-
@Override
public PrefixMapping getPrefixMapping() {
return new AGPrefixMapping(this);
}
- /*
- * @Override public Reifier getReifier() { return reifier; }
- *
- * @Override public GraphStatisticsHandler getStatisticsHandler() { // TODO
- * Auto-generated method stub return null; }
- */
-
@Override
public TransactionHandler getTransactionHandler() {
return new AGTransactionHandler(this);
}
- /*
- * @Override public boolean isClosed() { // TODO Auto-generated method stub
- * return false; }
- *
- * @Override public boolean isEmpty() { // TODO Auto-generated method stub
- * return false; }
- *
- * @Override public boolean isIsomorphicWith(Graph g) { // TODO
- * Auto-generated method stub return false; }
- */
-
- @Override
- public QueryHandler queryHandler() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * @Override public int size() { // TODO deal with graphs bigger than int's.
- * int size; try { size = (int)conn.size(context); } catch
- * (RepositoryException e) { // TODO: proper exception to throw? throw new
- * RuntimeException(e); } return size; }
- *
-
- @Override
- public void add(Triple t) throws AddDeniedException {
- try {
- conn.add(vf.asResource(t.getSubject()), vf.asURI(t.getPredicate()),
- vf.asValue(t.getObject()), context);
- } catch (UnauthorizedException e) {
- throw new AddDeniedException(e.getMessage());
- } catch (RepositoryException e) {
- throw new RuntimeException(e);
- }
- }*/
-
@Override
public String toString() {
if (graphNode == null)
@@ -41,8 +41,7 @@ public AGGraph getGraph() {
@Override
public AGGraph createGraph() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
@@ -58,26 +57,22 @@ public AGGraph createGraph(String uri, boolean strict) {
@Override
public ReificationStyle getReificationStyle() {
- // TODO Auto-generated method stub
- return null;
+ return ReificationStyle.Minimal;
}
@Override
public boolean hasGraph(String name) {
- // TODO Auto-generated method stub
- return false;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public ExtendedIterator<String> listGraphs() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public AGGraph openGraph() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
@@ -93,8 +88,7 @@ public AGGraph openGraph(String uri, boolean strict) {
@Override
public void removeGraph(String name) {
- // TODO Auto-generated method stub
-
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
}
@@ -34,26 +34,22 @@
@Override
public ExtendedIterator<Triple> find(Node subject, Node property,
Node object, Graph param) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public Graph getDeductionsGraph() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public Iterator<Derivation> getDerivation(Triple triple) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public Node getGlobalProperty(Node property) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
@@ -68,44 +64,33 @@ public Reasoner getReasoner() {
@Override
public void prepare() {
- // TODO Auto-generated method stub
-
}
@Override
public void rebind() {
- // TODO Auto-generated method stub
-
}
@Override
public void rebind(Graph data) {
- // TODO Auto-generated method stub
-
}
@Override
public void reset() {
- // TODO Auto-generated method stub
-
}
@Override
public void setDerivationLogging(boolean logOn) {
- // TODO Auto-generated method stub
-
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public boolean testGlobalProperty(Node property) {
- // TODO Auto-generated method stub
- return false;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public ValidityReport validate() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@@ -34,14 +34,12 @@ public AGInfModel(AGReasoner reasoner, AGModel baseModel) {
@Override
public Model getDeductionsModel() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public Iterator<Derivation> getDerivation(Statement statement) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
@@ -51,45 +49,35 @@ public Model getRawModel() {
@Override
public Reasoner getReasoner() {
- // TODO Auto-generated method stub
return reasoner;
}
@Override
public StmtIterator listStatements(Resource subject, Property predicate,
RDFNode object, Model posit) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public void prepare() {
- // TODO Auto-generated method stub
-
}
@Override
public void rebind() {
- // TODO Auto-generated method stub
-
}
@Override
public void reset() {
- // TODO Auto-generated method stub
-
}
@Override
public void setDerivationLogging(boolean logOn) {
- // TODO Auto-generated method stub
-
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public ValidityReport validate() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@@ -31,8 +31,7 @@ AGGraph getGraph() {
@Override
public String expandPrefix(String prefixed) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
@@ -81,26 +80,22 @@ public String getNsURIPrefix(String uri) {
@Override
public PrefixMapping lock() {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public String qnameFor(String uri) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public PrefixMapping removeNsPrefix(String prefix) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public boolean samePrefixMappingAs(PrefixMapping other) {
- // TODO Auto-generated method stub
- return false;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
@@ -115,26 +110,23 @@ public PrefixMapping setNsPrefix(String prefix, String uri) {
@Override
public PrefixMapping setNsPrefixes(PrefixMapping other) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public PrefixMapping setNsPrefixes(Map<String, String> map) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public String shortForm(String uri) {
- // TODO Auto-generated method stub
- return null;
+ throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
@Override
public PrefixMapping withDefaultMappings(PrefixMapping map) {
- // TODO Auto-generated method stub
return null;
+ //throw new UnsupportedOperationException(AGUnsupportedOperation.message);
}
}
Oops, something went wrong.

0 comments on commit eff6cd6

Please sign in to comment.