public class NoopPersistenceManager extends Object
implements PersistenceManager

Public Constructor Summary

Public Method Summary

void
void
List<UserWriteRecord>
loadUserWrites()
Return a list of all writes that were persisted
void
removeAllUserWrites()
Removes all writes
void
removeUserWrite(long writeId)
Remove a write with the given write id.
<T> T
runInTransaction(Callable<T> callable)
void
saveUserMerge(Path path, CompoundWrite children, long writeId)
Save a user merge
void
saveUserOverwrite(Path path, Node node, long writeId)
Save a user overwrite
CacheNode
serverCache(QuerySpec query)
Returns any cached node or children as a CacheNode.
void
void
void
void
void
updateServerCache(QuerySpec query, Node node)
Overwrite the server cache with the given node for a given query.
void
updateServerCache(Path path, CompoundWrite children)
Update the server cache at the given path with the given merge.
void

Inherited Method Summary

Public Constructors

public NoopPersistenceManager ()

Public Methods

public void applyUserWriteToServerCache (Path path, Node node)

Parameters
path
node

public void applyUserWriteToServerCache (Path path, CompoundWrite merge)

Parameters
path
merge

public List<UserWriteRecord> loadUserWrites ()

Return a list of all writes that were persisted

Returns
  • The list of writes

public void removeAllUserWrites ()

Removes all writes

public void removeUserWrite (long writeId)

Remove a write with the given write id.

Parameters
writeId The write id to remove

public T runInTransaction (Callable<T> callable)

Parameters
callable

public void saveUserMerge (Path path, CompoundWrite children, long writeId)

Save a user merge

Parameters
path The path for this merge
children The children for this merge
writeId The write id that was used for this merge

public void saveUserOverwrite (Path path, Node node, long writeId)

Save a user overwrite

Parameters
path The path for this write
node The node for this write
writeId The write id that was used for this write

public CacheNode serverCache (QuerySpec query)

Returns any cached node or children as a CacheNode. The query is *not* used to filter the node but rather to determine if it can be considered complete.

Parameters
query The query at the path
Returns
  • The cached node or an empty CacheNode if no cache is available

public void setQueryActive (QuerySpec query)

Parameters
query

public void setQueryComplete (QuerySpec query)

Parameters
query

public void setQueryInactive (QuerySpec query)

Parameters
query

public void setTrackedQueryKeys (QuerySpec query, Set<ChildKey> keys)

Parameters
query
keys

public void updateServerCache (QuerySpec query, Node node)

Overwrite the server cache with the given node for a given query. The query is considered to be complete after saving this node.

Parameters
query The query for which to apply this overwrite.
node The node to replace in the cache at the given path

public void updateServerCache (Path path, CompoundWrite children)

Update the server cache at the given path with the given merge.

NOTE: This doesn't mark any queries complete, since the common case is that there's already a complete query above this location.

Parameters
path The path for this merge
children The children to update

public void updateTrackedQueryKeys (QuerySpec query, Set<ChildKey> added, Set<ChildKey> removed)

Parameters
query
added
removed