001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 * 019 */ 020 package org.apache.directory.server.xdbm; 021 022 023 import java.io.File; 024 025 import org.apache.directory.shared.ldap.cursor.Cursor; 026 import org.apache.directory.shared.ldap.schema.AttributeType; 027 028 029 /** 030 * A generic index implementation that is just used to hold the index configuration 031 * parameters (attributeId, cacheSize, wkDirPath). All other methods are not working. 032 * 033 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 034 * @version $Rev: 917312 $ 035 */ 036 public class GenericIndex<K, O, ID> implements Index<K, O, ID> 037 { 038 039 protected String attributeId; 040 protected int cacheSize; 041 protected File wkDirPath; 042 043 044 /** 045 * Creates a new instance of GenericIndex. 046 * 047 * @param attributeId the attribute ID 048 * @param cacheSize the cache size 049 */ 050 public GenericIndex( String attributeId, int cacheSize ) 051 { 052 this( attributeId, cacheSize, null ); 053 } 054 055 056 /** 057 * Creates a new instance of GenericIndex. 058 * 059 * @param attributeId the attribute ID 060 * @param cacheSize the cache size 061 * @param wkDirPath the working directory 062 */ 063 public GenericIndex( String attributeId, int cacheSize, File wkDirPath ) 064 { 065 this.attributeId = attributeId; 066 this.cacheSize = cacheSize; 067 this.wkDirPath = wkDirPath; 068 } 069 070 071 public void add( K attrVal, ID id ) throws Exception 072 { 073 throw new UnsupportedOperationException(); 074 } 075 076 077 public void close() throws Exception 078 { 079 throw new UnsupportedOperationException(); 080 } 081 082 083 public int count() throws Exception 084 { 085 throw new UnsupportedOperationException(); 086 } 087 088 089 public int count( K attrVal ) throws Exception 090 { 091 throw new UnsupportedOperationException(); 092 } 093 094 095 public void drop( ID id ) throws Exception 096 { 097 throw new UnsupportedOperationException(); 098 } 099 100 101 public void drop( K attrVal, ID id ) throws Exception 102 { 103 throw new UnsupportedOperationException(); 104 } 105 106 107 public IndexCursor<K, O, ID> forwardCursor() throws Exception 108 { 109 throw new UnsupportedOperationException(); 110 } 111 112 113 public IndexCursor<K, O, ID> forwardCursor( K key ) throws Exception 114 { 115 throw new UnsupportedOperationException(); 116 } 117 118 119 public ID forwardLookup( K attrVal ) throws Exception 120 { 121 throw new UnsupportedOperationException(); 122 } 123 124 125 public Cursor<ID> forwardValueCursor( K key ) throws Exception 126 { 127 throw new UnsupportedOperationException(); 128 } 129 130 131 public boolean forward( K attrVal ) throws Exception 132 { 133 throw new UnsupportedOperationException(); 134 } 135 136 137 public boolean forward( K attrVal, ID id ) throws Exception 138 { 139 throw new UnsupportedOperationException(); 140 } 141 142 143 public boolean reverse( ID id ) throws Exception 144 { 145 throw new UnsupportedOperationException(); 146 } 147 148 149 public boolean reverse( ID id, K attrVal ) throws Exception 150 { 151 throw new UnsupportedOperationException(); 152 } 153 154 155 public boolean forwardGreaterOrEq( K attrVal ) throws Exception 156 { 157 throw new UnsupportedOperationException(); 158 } 159 160 161 public boolean forwardGreaterOrEq( K attrVal, ID id ) throws Exception 162 { 163 throw new UnsupportedOperationException(); 164 } 165 166 167 public boolean reverseGreaterOrEq( ID id ) throws Exception 168 { 169 throw new UnsupportedOperationException(); 170 } 171 172 173 public boolean reverseGreaterOrEq( ID id, K attrVal ) throws Exception 174 { 175 throw new UnsupportedOperationException(); 176 } 177 178 179 public boolean forwardLessOrEq( K attrVal ) throws Exception 180 { 181 throw new UnsupportedOperationException(); 182 } 183 184 185 public boolean forwardLessOrEq( K attrVal, ID id ) throws Exception 186 { 187 throw new UnsupportedOperationException(); 188 } 189 190 191 public boolean reverseLessOrEq( ID id ) throws Exception 192 { 193 throw new UnsupportedOperationException(); 194 } 195 196 197 public boolean reverseLessOrEq( ID id, K attrVal ) throws Exception 198 { 199 throw new UnsupportedOperationException(); 200 } 201 202 203 public AttributeType getAttribute() 204 { 205 throw new UnsupportedOperationException(); 206 } 207 208 209 public String getAttributeId() 210 { 211 return attributeId; 212 } 213 214 215 public int getCacheSize() 216 { 217 return cacheSize; 218 } 219 220 221 public K getNormalized( K attrVal ) throws Exception 222 { 223 throw new UnsupportedOperationException(); 224 } 225 226 227 public File getWkDirPath() 228 { 229 return wkDirPath; 230 } 231 232 233 public int greaterThanCount( K attrVal ) throws Exception 234 { 235 throw new UnsupportedOperationException(); 236 } 237 238 239 public boolean isCountExact() 240 { 241 throw new UnsupportedOperationException(); 242 } 243 244 245 public int lessThanCount( K attrVal ) throws Exception 246 { 247 throw new UnsupportedOperationException(); 248 } 249 250 251 public IndexCursor<K, O, ID> reverseCursor() throws Exception 252 { 253 throw new UnsupportedOperationException(); 254 } 255 256 257 public IndexCursor<K, O, ID> reverseCursor( ID id ) throws Exception 258 { 259 throw new UnsupportedOperationException(); 260 } 261 262 263 public K reverseLookup( ID id ) throws Exception 264 { 265 throw new UnsupportedOperationException(); 266 } 267 268 269 public Cursor<K> reverseValueCursor( ID id ) throws Exception 270 { 271 throw new UnsupportedOperationException(); 272 } 273 274 275 public void setAttributeId( String attributeId ) 276 { 277 this.attributeId = attributeId; 278 } 279 280 281 public void setCacheSize( int cacheSize ) 282 { 283 this.cacheSize = cacheSize; 284 } 285 286 287 public void setWkDirPath( File wkDirPath ) 288 { 289 this.wkDirPath = wkDirPath; 290 } 291 292 293 public void sync() throws Exception 294 { 295 throw new UnsupportedOperationException(); 296 } 297 298 }