|
From: Elmer G. <ega...@us...> - 2004-08-09 21:00:02
|
Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/remote In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24166/src/org/javaowl/models/remote Added Files: RemoteGraph.java RemoteGraphWrapper.java Log Message: Readded RemoteGraph. --- NEW FILE: RemoteGraphWrapper.java --- /* * RemoteGraphWrapper.java Copyright (C) 2004 Gerardo Horvilleur Martinez, Elmer * Garduno Hernandez * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.javaowl.models.remote; import java.rmi.RemoteException; import com.hp.hpl.jena.graph.BulkUpdateHandler; import com.hp.hpl.jena.graph.Capabilities; import com.hp.hpl.jena.graph.Graph; import com.hp.hpl.jena.graph.GraphEventManager; import com.hp.hpl.jena.graph.Node; import com.hp.hpl.jena.graph.Reifier; import com.hp.hpl.jena.graph.TransactionHandler; import com.hp.hpl.jena.graph.Triple; import com.hp.hpl.jena.graph.TripleMatch; 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; import com.hp.hpl.jena.util.iterator.ExtendedIterator; public class RemoteGraphWrapper implements Graph { private RemoteGraph remote; public void add(Triple triple) throws AddDeniedException{ try { remote.add(triple); } catch (RemoteException e) { throw new AddDeniedException(e.toString()); } } public void close() { try { remote.close(); } catch (RemoteException e) { throw new RuntimeException(e); } } public boolean contains(Node subject, Node predicate, Node object) { try { return remote.contains(subject, predicate, object); } catch (RemoteException e) { throw new RuntimeException(e); } } public boolean contains(Triple triple) { try { return remote.contains(triple); } catch (RemoteException e) { throw new RuntimeException(e); } } public void delete(Triple triple) throws DeleteDeniedException { try { remote.delete(triple); } catch (RemoteException e) { throw new DeleteDeniedException(e.toString()); } } public boolean dependsOn(Graph graph) { try { return remote.dependsOn(graph); } catch (RemoteException e) { throw new RuntimeException(e); } } public ExtendedIterator find(Node subject, Node predicate, Node object) { try { return remote.find(subject, predicate, object); } catch (RemoteException e) { throw new RuntimeException(e); } } public ExtendedIterator find(TripleMatch tripleMatch) { try { return remote.find(tripleMatch); } catch (RemoteException e) { throw new RuntimeException(e); } } public BulkUpdateHandler getBulkUpdateHandler() { try { return remote.getBulkUpdateHandler(); } catch (RemoteException e) { throw new RuntimeException(e); } } public Capabilities getCapabilities() { try { return remote.getCapabilities(); } catch (RemoteException e) { throw new RuntimeException(e); } } public GraphEventManager getEventManager() { try { return remote.getEventManager(); } catch (RemoteException e) { throw new RuntimeException(e); } } public PrefixMapping getPrefixMapping() { try { return remote.getPrefixMapping(); } catch (RemoteException e) { throw new RuntimeException(e); } } public Reifier getReifier() { try { return remote.getReifier(); } catch (RemoteException e) { throw new RuntimeException(e); } } public TransactionHandler getTransactionHandler() { try { return remote.getTransactionHandler(); } catch (RemoteException e) { throw new RuntimeException(e); } } public boolean isEmpty() { try { return remote.isEmpty(); } catch (RemoteException e) { throw new RuntimeException(e); } } public boolean isIsomorphicWith(Graph graph) { try { return remote.isIsomorphicWith(graph); } catch (RemoteException e) { throw new RuntimeException(e); } } public QueryHandler queryHandler() { try { return remote.queryHandler(); } catch (RemoteException e) { throw new RuntimeException(e); } } public int size() { try { return remote.size(); } catch (RemoteException e) { throw new RuntimeException(e); } } } --- NEW FILE: RemoteGraph.java --- /* * RemoteGraph.java Copyright (C) 2004 Gerardo Horvilleur Martinez, Elmer * Garduno Hernandez * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.javaowl.models.remote; import java.rmi.Remote; import java.rmi.RemoteException; import com.hp.hpl.jena.graph.BulkUpdateHandler; import com.hp.hpl.jena.graph.Capabilities; import com.hp.hpl.jena.graph.Graph; import com.hp.hpl.jena.graph.GraphEventManager; import com.hp.hpl.jena.graph.Node; import com.hp.hpl.jena.graph.Reifier; import com.hp.hpl.jena.graph.TransactionHandler; import com.hp.hpl.jena.graph.Triple; import com.hp.hpl.jena.graph.TripleMatch; import com.hp.hpl.jena.graph.query.QueryHandler; import com.hp.hpl.jena.shared.PrefixMapping; import com.hp.hpl.jena.util.iterator.ExtendedIterator; public interface RemoteGraph extends Remote { public boolean dependsOn(Graph graph) throws RemoteException; public QueryHandler queryHandler() throws RemoteException; public TransactionHandler getTransactionHandler() throws RemoteException; public BulkUpdateHandler getBulkUpdateHandler() throws RemoteException; public Capabilities getCapabilities() throws RemoteException; public GraphEventManager getEventManager() throws RemoteException; public Reifier getReifier() throws RemoteException; public PrefixMapping getPrefixMapping() throws RemoteException; public void delete(Triple triple) throws RemoteException; public ExtendedIterator find(TripleMatch tripleMatch) throws RemoteException; public ExtendedIterator find(Node subject, Node predicate, Node object) throws RemoteException; public boolean isIsomorphicWith(Graph graph) throws RemoteException; public boolean contains(Node subject, Node predicate, Node object) throws RemoteException; public boolean contains(Triple triple) throws RemoteException; public void close() throws RemoteException; public boolean isEmpty() throws RemoteException; public int size() throws RemoteException; public void add(Triple triple) throws RemoteException; } |