public interface RepositoryNode extends RepositoryNodeVersion
| Modifier and Type | Interface and Description |
|---|---|
static interface |
RepositoryNode.RepositoryNodeContents
RepositoryNodeContents is used to obtain Properties and InputStream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abandonNewVersion()
Discards the currently open new version without writing.
|
void |
deactivateContent()
Deactivates the node.
|
int |
getChildCount()
Returns the number of children at this node.
|
long |
getContentSize()
Returns the size of the current version of stored cache.
|
int |
getCurrentVersion()
Returns the current version.
|
OutputStream |
getNewOutputStream()
Return an
OutputStream object which writes to a new version
in the cache. |
RepositoryNode.RepositoryNodeContents |
getNodeContents()
Return a
RepositoryNodeContents object which accesses the
content in the cache and its properties. |
String |
getNodeUrl()
Returns the url represented by this node.
|
RepositoryNodeVersion |
getNodeVersion(int version)
Return a RepositoryNodeVersion for the specified content version
|
RepositoryNodeVersion[] |
getNodeVersions()
Return an array of RepositoryNodeVersion for all versions of
content/props at this node.
|
RepositoryNodeVersion[] |
getNodeVersions(int maxVersions)
Return an array of RepositoryNodeVersion for the most recent
maxVersions versions of content/props at this node. |
long |
getTreeContentSize(org.lockss.daemon.CachedUrlSetSpec filter,
boolean calcIfUnknown)
Returns the size of the content tree under (and including) this cache, in
bytes.
|
RepositoryNode.RepositoryNodeContents |
getUnsealedRnc()
Return a
RepositoryNodeContents object which accesses the
content written to the node but not yet sealed.. |
boolean |
hasContent()
Determines if the node has current stored content.
|
boolean |
isContentInactive()
Determines if the node is currently inactive.
|
boolean |
isDeleted()
Determines if the node is deleted.
|
boolean |
isIdenticalVersion()
Return true if the already-sealed node was identical to the previous
version and was not stored.
|
boolean |
isLeaf()
Returns true if node has no children.
|
Iterator |
listChildren(org.lockss.daemon.CachedUrlSetSpec filter,
boolean includeInactive)
Returns the immediate children of the entry, possibly filtered (null
indicates no filtering).
|
void |
makeNewVersion()
Prepares the node to write to a new version.
|
void |
markAsDeleted()
Marks the node as deleted.
|
void |
markAsNotDeleted()
Marks the node as no longer deleted.
|
void |
restoreLastVersion()
Reverts to the last version.
|
void |
sealNewVersion()
Closes the new version to any further writing.
|
void |
setNewProperties(Properties newProps)
Stores the properties for a new version of the cache.
|
getVersionString getNodeUrl()
boolean hasContent()
hasContent in interface RepositoryNodeVersionboolean isContentInactive()
boolean isDeleted()
long getContentSize()
getContentSize in interface RepositoryNodeVersionUnsupportedOperationExceptionlong getTreeContentSize(org.lockss.daemon.CachedUrlSetSpec filter,
boolean calcIfUnknown)
filter - a spec to determine which urls to returncalcIfUnknown - if true, size will calculated if unknown (time
consumeing)boolean isLeaf()
int getChildCount()
Iterator listChildren(org.lockss.daemon.CachedUrlSetSpec filter, boolean includeInactive)
filter - a spec to determine which urls to returnincludeInactive - true to include inactive nodesIterator of RepositoryNode objectsvoid makeNewVersion()
UnsupportedOperationExceptionvoid sealNewVersion()
makeNewVersion() or if either getNewOutputStream()
or setNewProperties() has not been called.UnsupportedOperationExceptionvoid abandonNewVersion()
makeNewVersion()UnsupportedOperationExceptionboolean isIdenticalVersion()
void deactivateContent()
restoreLastVersion() or make a new
version.UnsupportedOperationExceptionvoid markAsDeleted()
deactivateContent().
To reactivate, call restoreLastVersion()
or make a new version (which gives it content), or call markAsNotDeleted().void markAsNotDeleted()
int getCurrentVersion()
getNodeInfo(). If inactive,
returns -1. Throws an exception if called on a content-less node.UnsupportedOperationExceptionvoid restoreLastVersion()
UnsupportedOperationExceptionRepositoryNodeVersion[] getNodeVersions()
RepositoryNodeVersionUnsupportedOperationException - if node has no versionsRepositoryNodeVersion[] getNodeVersions(int maxVersions)
maxVersions versions of content/props at this node. The
result is sorted from most to least recent; the RepositoryNodeVersion
for current version is the first element in the array.RepositoryNodeVersionUnsupportedOperationException - if node has no versionsRepositoryNodeVersion getNodeVersion(int version)
RepositoryNodeVersion bound to the specified versionUnsupportedOperationException - if node has no versionsRepositoryNode.RepositoryNodeContents getNodeContents()
RepositoryNodeContents object which accesses the
content in the cache and its properties. Throws if called on a content-less
or inactive node.getNodeContents in interface RepositoryNodeVersionRepositoryNode.RepositoryNodeContents object from which the contents of
the cache can be read.UnsupportedOperationExceptionRepositoryNode.RepositoryNodeContents getUnsealedRnc()
RepositoryNodeContents object which accesses the
content written to the node but not yet sealed.. Throws if called on
a node that doesn't have a new version open.RepositoryNode.RepositoryNodeContents object from which the contents of
the unsealed node can be read.UnsupportedOperationExceptionOutputStream getNewOutputStream()
OutputStream object which writes to a new version
in the cache.
Throws an exception if called before makeNewVersion() or
called twice.OutputStream object to which the new contents can be
written.UnsupportedOperationExceptionmakeNewVersion()void setNewProperties(Properties newProps)
makeNewVersion() or called twice.newProps - a Properties object containing the headers of
the new version being cached.UnsupportedOperationExceptionmakeNewVersion()Copyright © 2000–2021 LOCKSS Program. All rights reserved.