1 17 18 package org.objectweb.jac.aspects.persistence; 19 20 import java.lang.IndexOutOfBoundsException ; 21 import java.util.Collection ; 22 import java.util.List ; 23 import java.util.Map ; 24 import org.objectweb.jac.core.rtti.ClassItem; 25 import org.objectweb.jac.core.rtti.CollectionItem; 26 import org.objectweb.jac.core.rtti.FieldItem; 27 28 33 34 public interface Storage { 35 36 39 String getId(); 40 41 44 void setId(String id); 45 46 53 OID createObject(String className) throws Exception ; 54 55 61 void deleteObject(OID oid) throws Exception ; 62 63 72 void setField(OID oid, FieldItem field, Object value) 73 throws Exception ; 74 75 83 void updateField(OID oid, FieldItem field, Object value) 84 throws Exception ; 85 86 94 Object getField(OID oid, FieldItem field) 95 throws Exception ; 96 97 106 StorageField[] getFields(OID oid, ClassItem cl, FieldItem[] fields) 107 throws Exception ; 108 109 111 119 120 OID getCollectionID(OID oid, CollectionItem collection) 121 throws Exception ; 122 123 125 133 List getList(OID oid, CollectionItem collection) 134 throws Exception , IndexOutOfBoundsException ; 135 136 143 List getList(OID cid) 144 throws Exception ; 145 146 154 Object getListItem(OID cid, long index) 155 throws Exception ; 156 157 164 long getListSize(OID cid) throws Exception ; 165 166 174 boolean listContains(OID cid, Object value) 175 throws Exception ; 176 177 178 186 void addToList(OID cid, long position, Object value) 187 throws Exception ; 188 189 196 void addToList(OID cid, Object value) 197 throws Exception ; 198 199 207 void setListItem(OID cid, long index, Object value) 208 throws Exception ; 209 210 217 void removeFromList(OID cid, long position) 218 throws Exception ; 219 220 227 void removeFromList(OID cid, Object value) 228 throws Exception ; 229 230 236 void clearList(OID cid) throws Exception ; 237 238 246 long getIndexInList(OID cid, Object value) 247 throws Exception ; 248 249 257 long getLastIndexInList(OID cid, Object value) 258 throws Exception ; 259 260 262 270 List getSet(OID oid, CollectionItem collection) 271 throws Exception ; 272 273 280 List getSet(OID cid) 281 throws Exception ; 282 283 284 291 long getSetSize(OID cid) throws Exception ; 292 293 301 boolean addToSet(OID cid, Object value) 302 throws Exception ; 303 304 312 boolean removeFromSet(OID cid, Object value) 313 throws Exception ; 314 315 321 void clearSet(OID cid) 322 throws Exception ; 323 324 332 boolean setContains(OID cid, Object value) 333 throws Exception ; 334 335 337 345 Map getMap(OID oid, CollectionItem collection) 346 throws Exception ; 347 348 355 Map getMap(OID cid) 356 throws Exception ; 357 358 365 long getMapSize(OID cid) throws Exception ; 366 367 376 Object putInMap(OID cid, Object key, Object value) 377 throws Exception ; 378 379 387 Object getFromMap(OID cid, Object key) 388 throws Exception ; 389 390 398 boolean mapContainsKey(OID cid, Object key) 399 throws Exception ; 400 401 409 boolean mapContainsValue(OID cid, Object value) 410 throws Exception ; 411 412 420 Object removeFromMap(OID cid, Object key) 421 throws Exception ; 422 423 429 void clearMap(OID cid) 430 throws Exception ; 431 432 439 void removeField(OID oid, FieldItem field, Object value) 440 throws Exception ; 441 442 448 String newName(String className) throws Exception ; 449 450 456 Map getNameCounters() throws Exception ; 457 458 466 void updateNameCounters(Map counters) throws Exception ; 467 468 474 OID getOIDFromName(String name) throws Exception ; 475 476 481 String getNameFromOID(OID oid) throws Exception ; 482 483 492 void bindOIDToName(OID oid,String name) throws Exception ; 493 494 498 void deleteName(String name) throws Exception ; 499 500 506 String getClassID(OID oid) throws Exception ; 507 508 514 Collection getRootObjects() throws Exception ; 515 516 522 Collection getObjects(ClassItem cl) throws Exception ; 523 524 527 void close(); 528 529 532 void startTransaction() throws Exception ; 533 534 537 void commit() throws Exception ; 538 539 542 void rollback() throws Exception ; 543 } 544 | Popular Tags |