001: /*
002: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
003: * notice. All rights reserved.
004: */
005: package com.tc.objectserver.impl;
006:
007: import com.tc.exception.ImplementMe;
008: import com.tc.object.ObjectID;
009: import com.tc.objectserver.core.api.ManagedObject;
010: import com.tc.objectserver.persistence.api.ManagedObjectStore;
011: import com.tc.objectserver.persistence.api.PersistenceTransaction;
012: import com.tc.text.PrettyPrinter;
013: import com.tc.util.ObjectIDSet2;
014:
015: import java.util.Collection;
016: import java.util.Map;
017: import java.util.Set;
018:
019: public class TestManagedObjectStore implements ManagedObjectStore {
020:
021: public boolean addNewWasCalled = false;
022: public boolean containsKey;
023: public ObjectIDSet2 keySet;
024: public ManagedObject managedObject;
025: private int count;
026:
027: public boolean containsObject(ObjectID id) {
028: return containsKey;
029: }
030:
031: public void addNewObject(ManagedObject managed) {
032: addNewWasCalled = true;
033: count++;
034: }
035:
036: public ObjectIDSet2 getAllObjectIDs() {
037: return keySet;
038: }
039:
040: public int getObjectCount() {
041: return count;
042: }
043:
044: public ManagedObject getObjectByID(ObjectID id) {
045: return managedObject;
046: }
047:
048: public void commitObject(PersistenceTransaction tx,
049: ManagedObject object) {
050: return;
051: }
052:
053: public void commitAllObjects(PersistenceTransaction tx, Collection c) {
054: return;
055: }
056:
057: public PrettyPrinter prettyPrint(PrettyPrinter out) {
058: return out.print(getClass().getName());
059: }
060:
061: public void removeAllObjectsByIDNow(PersistenceTransaction tx,
062: Collection objectIds) {
063: count -= objectIds.size();
064: return;
065: }
066:
067: public void shutdown() {
068: return;
069: }
070:
071: public boolean inShutdown() {
072: return false;
073: }
074:
075: public ObjectID getRootID(String name) {
076: return null;
077: }
078:
079: public Set getRoots() {
080: return null;
081: }
082:
083: public Set getRootNames() {
084: return null;
085: }
086:
087: public void addNewRoot(PersistenceTransaction tx, String rootName,
088: ObjectID id) {
089: return;
090: }
091:
092: public long nextObjectIDBatch(int batchSize) {
093: throw new ImplementMe();
094: }
095:
096: public void setNextAvailableObjectID(long startID) {
097: throw new ImplementMe();
098: }
099:
100: public Map getRootNamesToIDsMap() {
101: return null;
102: }
103:
104: }
|