View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership. The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License. You may obtain a copy of the License at
9    * 
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   * 
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.river.outrigger.proxy;
19   
20  import org.apache.river.admin.DestroyAdmin;
21  import net.jini.id.Uuid;
22  
23  import java.rmi.Remote;
24  import java.rmi.RemoteException;
25  
26  import net.jini.admin.JoinAdmin;
27  import net.jini.core.transaction.Transaction;
28  import net.jini.core.transaction.TransactionException;
29  import net.jini.space.JavaSpace;
30  
31  /**
32   * The interface that is used by the <code>AdminProxy</code> to talk
33   * to the server.  In other words, this is the server's analog to the
34   * <code>JavaSpaceAdmin</code> interface.
35   *
36   * @author Sun Microsystems, Inc.
37   *
38   */
39  // @see OutriggerServerImpl#AdminProxy
40  public interface OutriggerAdmin  extends Remote, DestroyAdmin, JoinAdmin {
41      /** Return the space administered by this object. 
42       * @return JavaSpace administered by this object.
43       * @throws RemoteException if a communication related exception occurs.
44       */
45      JavaSpace space() throws RemoteException;
46      
47      /**
48       * Return the remote iterator object needed by
49       * <code>JavaSpaceAdmin.contents</code>.
50       * @param tmpl EntryRep
51       * @param txn Transaction
52       * @throws TransactionException if transaction not active or other transaction related problem occurs. 
53       * @throws RemoteException if a communication related exception occurs.
54       * @return Uuid of the Iterator.
55       */
56      Uuid contents(EntryRep tmpl, Transaction txn)
57  	throws TransactionException, RemoteException;
58  
59      /** 
60       * Fetch up to <code>max</code> <code>EntryRep</code> objects from
61       * the specified iteration.
62       * 
63       * @param iterationUuid The <code>Uuid</code> of the iteration
64       *            to fetch entries from.
65       * @param max Advice on the number of entries to return
66       * @param entryUuid <code>Uuid</code> of the last entry received by the
67       *            caller.  If this does not match the ID of the last
68       *            entry sent by the iterator will re-send that last
69       *            batch in place of a new batch.  May be
70       *            <code>null</code> in which case a new batch will be
71       *            sent.  The first call to <code>next()</code> should
72       *            have <code>id</code> set to <code>null</code>
73       * @return an EntryRep array.
74       * @throws RemoteException if a communication related Exception occurs.
75       */
76      EntryRep[] nextReps(Uuid iterationUuid, int max, 
77  			Uuid entryUuid) 
78  	throws RemoteException;
79  
80      /** 
81       * Delete the given entry if the given iteration is still 
82       * valid and the entry was retured by the last call to 
83       * <code>nextReps</code>.
84       * @param iterationUuid The <code>Uuid</code> of a valid 
85       *            iteration.
86       * @param entryUuid the <code>Uuid</code> of the entry
87       *            to be deleted.
88       * @throws RemoteException if a communication problem occurs.
89       */
90      void delete(Uuid iterationUuid, Uuid entryUuid) throws RemoteException;
91  
92      /** 
93       * Forget about the indicated iteration 
94       * @param iterationUuid The <code>Uuid</code> iteration to close.
95       * @throws RemoteException if a communication problem occurs.
96       */
97      void close(Uuid iterationUuid) throws RemoteException;
98  }
99