Index: jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerQuery.java =================================================================== *** jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerQuery.java (revision 1032558) --- jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerQuery.java (working copy) *************** *** 19,24 **** --- 19,25 ---- import java.rmi.RemoteException; import javax.jcr.RepositoryException; + import javax.jcr.Value; import javax.jcr.query.Query; import org.apache.jackrabbit.rmi.remote.RemoteQuery; *************** *** 80,83 **** --- 81,104 ---- return getRemoteNode(query.storeAsNode(absPath)); } + /** {@inheritDoc} */ + public void bindValue(String varName, Value value) throws RepositoryException, RemoteException { + query.bindValue(varName, value); + } + + /** {@inheritDoc} */ + public String[] getBindVariableNames() throws RepositoryException, RemoteException { + return getBindVariableNames(); + } + + /** {@inheritDoc} */ + public void setLimit(long limit) throws RemoteException { + query.setLimit(limit); + } + + /** {@inheritDoc} */ + public void setOffset(long offset) throws RemoteException { + query.setOffset(offset); + } + } Index: jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteQuery.java =================================================================== *** jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteQuery.java (revision 1032558) --- jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteQuery.java (working copy) *************** *** 20,25 **** --- 20,26 ---- import java.rmi.RemoteException; import javax.jcr.RepositoryException; + import javax.jcr.Value; /** * Remote version of the JCR {@link javax.jcr.query.Query Query} interface. *************** *** 79,82 **** --- 80,119 ---- */ RemoteNode storeAsNode(String absPath) throws RepositoryException, RemoteException; + /** + * @see javax.jcr.query.Query#bindValue(String,Value) + * + * @param varName the free variable in the query for which to bind a value + * @param value the value to bind the variable to + * @throws RepositoryException on repository errors + * @throws RemoteException on RMI errors + */ + public void bindValue(String varName, Value value) throws RepositoryException, RemoteException; + + /** + * @see javax.jcr.query.Query#getBindVariableNames() + * + * @return an array of variable names that can be used as first arguments in calls to bindValue + * @throws RepositoryException on repository errors + * @throws RemoteException on RMI errors + */ + public String[] getBindVariableNames() throws RepositoryException, RemoteException; + + /** + * @see javax.jcr.query.Query#setLimit(long) + * + * @param limit the search result will be limited to this amount of results + * @throws RepositoryException on repository errors + * @throws RemoteException on RMI errors + */ + public void setLimit(long limit) throws RemoteException; + + /** + * @see javax.jcr.query.Query#setOffset(long) + * + * @param offset the result set will be offset from this amount of search results + * @throws RepositoryException on repository errors + * @throws RemoteException on RMI errors + */ + public void setOffset(long offset) throws RemoteException; } Index: jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientQuery.java =================================================================== *** jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientQuery.java (revision 1032558) --- jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientQuery.java (working copy) *************** *** 104,124 **** } } public void bindValue(String varName, Value value) throws RepositoryException { ! throw new UnsupportedRepositoryOperationException("TODO: JCRRMI-26"); } public String[] getBindVariableNames() throws RepositoryException { ! throw new UnsupportedRepositoryOperationException("TODO: JCRRMI-26"); } public void setLimit(long limit) { ! throw new RuntimeException("TODO: JCRRMI-26"); } public void setOffset(long offset) { ! throw new RuntimeException("TODO: JCRRMI-26"); } - } --- 104,143 ---- } } + /** {@inheritDoc} */ public void bindValue(String varName, Value value) throws RepositoryException { ! try { ! remote.bindValue(varName, value); ! } catch (RemoteException ex) { ! throw new RemoteRepositoryException(ex); ! } } + /** {@inheritDoc} */ public String[] getBindVariableNames() throws RepositoryException { ! try { ! return remote.getBindVariableNames(); ! } catch (RemoteException ex) { ! throw new RemoteRepositoryException(ex); ! } } + /** {@inheritDoc} */ public void setLimit(long limit) { ! try { ! remote.setLimit(limit); ! } catch (RemoteException ex) { ! // this is in case of a connection problem, the actual call to execute() will fail next ! } } + /** {@inheritDoc} */ public void setOffset(long offset){ ! try { ! remote.setOffset(offset); ! } catch (RemoteException ex) { ! // this is in case of a connection problem, the actual call to execute() will fail next ! } } }