26 #include <Ice/ObjectAdapter.h>
41 databasePrx(databasePrx),
42 snapshotListCollection(collection),
54 const Ice::Current&
c)
60 snapshot->saveWorkingMemory(workingMemory);
62 const DBStorableData dbSnapshot = dbSerializer->serialize(snapshot);
64 return createSnapshotProxy(snapshot,
c);
73 snapshot->saveWorkingMemorySubset(workingMemory, entityIdList);
75 const DBStorableData dbSnapshot = dbSerializer->serialize(snapshot);
77 return createSnapshotProxy(snapshot,
c);
86 return createSnapshotProxy(snapshot,
c);
89 throw SnapshotNotFoundException(
"Snapshot not found, check that corresponding record exists in " +
90 snapshotListCollection->getNS() +
" collection", name);
95 SnapshotMap::iterator itSnap = openedSnapshots.find(snapshot->ice_getIdentity());
97 if (itSnap != openedSnapshots.end())
99 openedSnapshots.erase(itSnap);
104 const Ice::Current&
c)
112 snapshot->restoreWorkingMemory(workingMemory);
116 throw SnapshotNotFoundException(
"SnapshotNotFound", name);
147 WorkingMemorySnapshotInterfacePrx WorkingMemorySnapshotListSegment::createSnapshotProxy(
const WorkingMemorySnapshotPtr& snapshot,
const Ice::Current&
c)
150 openedSnapshots[snapId] = snapshot;
151 Ice::ObjectPrx node =
c.adapter->add(snapshot, snapId);
152 return WorkingMemorySnapshotInterfacePrx::uncheckedCast(node);
157 DBStorableData dbSnapshot = snapshotListCollection->findOneByFieldValue(
SNAPSHOT_NAME_FIELD, name);
159 if (!dbSnapshot.JSON.empty())
162 dbSerializer->deserialize(dbSnapshot, snapshot);
174 id.name = (parentMemory ? parentMemory->getMemoryName() :
"") +
"_" + segmentName;
180 return snapshotListCollection->count();
187 for (NameList::const_iterator it = snapshotNames.begin(); it != snapshotNames.end(); ++it)