public interface PersistenceManager
Known Indirect Subclasses

Public Method Summary

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

Public Methods

public abstract void applyUserWriteToServerCache (Path path, Node node)

Parameters
path Path of user overwrite.
node Data of user write.

public abstract void applyUserWriteToServerCache (Path path, CompoundWrite merge)

Parameters
path Path of user merge.
merge Data of user merge.

public abstract List<UserWriteRecord> loadUserWrites ()

Return a list of all writes that were persisted

Returns
  • The list of writes

public abstract void removeAllUserWrites ()

Removes all writes

public abstract void removeUserWrite (long writeId)

Remove a write with the given write id.

Parameters
writeId The write id to remove

public abstract T runInTransaction (Callable<T> callable)

Parameters
callable

public abstract 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 abstract 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 abstract 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 abstract void setQueryActive (QuerySpec query)

Parameters
query

public abstract void setQueryComplete (QuerySpec query)

Parameters
query

public abstract void setQueryInactive (QuerySpec query)

Parameters
query

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

Parameters
query
keys

public abstract 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 abstract 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 abstract void updateTrackedQueryKeys (QuerySpec query, Set<ChildKey> added, Set<ChildKey> removed)

Parameters
query
added
removed