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 java.rmi.RemoteException; 21 import net.jini.core.entry.Entry; 22 import net.jini.core.transaction.Transaction; 23 import net.jini.core.transaction.TransactionException; 24 import net.jini.core.constraint.MethodConstraints; 25 import net.jini.space.JavaSpace05; 26 import org.apache.river.admin.AdminIterator; 27 import org.apache.river.admin.JavaSpaceAdmin; 28 29 /** 30 * Sub-interface of <code>JavaSpaceAdmin</code> that 31 * adds a method that allows iterators to be created with 32 * a given set of constraints.<p> 33 * 34 * @deprecated The {@link JavaSpace05#contents JavaSpace05.contents} 35 * method can be used to view the space's contents. 36 * 37 * @author Sun Microsystems, Inc. 38 * @since 2.0 39 */ 40 public interface ConstrainableJavaSpaceAdmin extends JavaSpaceAdmin { 41 /** 42 * Return an <code>AdminIterator</code> that will iterate over all 43 * the entries in the space that match the given template and are 44 * visible under the given transaction. 45 * <p> 46 * The interactions between other operations on the space and 47 * the returned iterator are undefined 48 * <p> 49 * Note, because this is a convenience method for 50 * <code>contents(Entry, Transaction, int, 51 * MethodConstraints)</code> the constraints associated with 52 * <code>contents(Entry, Transaction, int, 53 * MethodConstraints)</code> are used for any calls though this 54 * method, not the constraints associated with this method. 55 * 56 * @param tmpl The iterator should return only entries that match 57 * tmpl 58 * @param txn The iterator should return only entries that match 59 * this transaction 60 * @throws RemoteException if communications with the 61 * server is necessary and it can not be completed. 62 * @throws TransactionException if there is a problem with 63 * <code>txn</code>. 64 * @throws SecurityException If the space is performing 65 * access control and it can not be confirmed 66 * that the subject making this call has permission 67 * to create an <code>AdminIterator</code> with 68 * the specified template and transaction. 69 */ 70 AdminIterator contents(Entry tmpl, Transaction txn) 71 throws TransactionException, RemoteException; 72 73 /** 74 * Return an <code>AdminIterator</code> that will iterate over all 75 * the entries in the space that match the given template and are 76 * visible under the given transaction. 77 * <p> 78 * The interactions between other operations on the space and 79 * the returned iterator are undefined 80 * <p> 81 * Note, because this is a convenience method for 82 * <code>contents(Entry, Transaction, int, 83 * MethodConstraints)</code> the constraints associated with 84 * <code>contents(Entry, Transaction, int, 85 * MethodConstraints)</code> are used for any calls though this 86 * method, not the constraints associated with this method. 87 * 88 * @param tmpl The iterator should return only entries that match 89 * tmpl 90 * @param txn The iterator should return only entries that match 91 * this transaction 92 * @param fetchSize advice on how many entries to fetch when the iterator 93 * has to go to the server for more entries. 94 * @throws RemoteException if communications with the 95 * server is necessary and it can not be completed. 96 * @throws TransactionException if there is a problem with 97 * <code>txn</code>. 98 * @throws SecurityException If the space is performing 99 * access control and it can not be confirmed 100 * that the subject making this call has permission 101 * to create an <code>AdminIterator</code> with 102 * the specified template and transaction. 103 * @throws IllegalArgumentException if fetchSize is 104 * not postive, or <code>USE_DEFUALT</code>. 105 */ 106 AdminIterator contents(Entry tmpl, Transaction txn, int fetchSize) 107 throws TransactionException, RemoteException; 108 109 /** 110 * Return an <code>AdminIterator</code> that will iterate over all 111 * the entries in the space that match the given template and are 112 * visible under the given transaction. The returned iterator 113 * will support proxy trust verification and will enforce 114 * the specified <code>MethodConstraints</code>. 115 * <p> 116 * The interactions between other operations on the space and 117 * the returned iterator are undefined 118 * <p> 119 * @param tmpl The iterator should return only entries that match 120 * tmpl 121 * @param txn The iterator should return only entries that match 122 * this transaction 123 * @param fetchSize advice on how many entries to fetch when the 124 * iterator has to go to the server for more entries. 125 * @param constrains the <code>MethodConstraints</code> the 126 * returned proxy should enforce. 127 * @return An object that can be used to iterate over entries 128 * in the space. 129 * @throws RemoteException if communications with the 130 * server is necessary and it can not be completed. 131 * @throws TransactionException if there is a problem with 132 * <code>txn</code>. 133 * @throws SecurityException If the space is performing 134 * access control and it can not be confirmed 135 * that the subject making this call has permission 136 * to create an <code>AdminIterator</code> with 137 * the specified template and transaction. 138 * @throws IllegalArgumentException if fetchSize is 139 * not postive, or <code>USE_DEFUALT</code>. 140 */ 141 AdminIterator contents(Entry tmpl, Transaction txn, int fetchSize, 142 MethodConstraints constrains) 143 throws TransactionException, RemoteException; 144 }