Class MountInfo
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.mount.MountInfo
-
-
Constructor Summary
Constructors Constructor Description MountInfo(java.lang.String name, boolean readOnly, java.util.List<java.lang.String> pathsSupportingFragments, java.util.List<java.lang.String> includedPaths)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.util.Set<java.lang.String>getIncludedPaths()java.lang.StringgetName()Name of the mount.java.lang.StringgetPathFragmentName()Returns fragment name which can be used to construct node name used for storing meta content belonging to path under thisMount.java.util.Set<java.lang.String>getPathsSupportingFragments()inthashCode()booleanisDefault()Checks whether current mount is the default mount.booleanisDirectlyUnder(java.lang.String path)Checks if this mount directly falls under given path.booleanisMounted(java.lang.String path)Checks if given path belongs to thisMountbooleanisReadOnly()Checks whether the mount is marked as read only.booleanisSupportFragment(java.lang.String path)Checks if this mount supports mounting nodes containing the fragment (seeMount.getPathFragmentName()) under the given path.booleanisSupportFragmentUnder(java.lang.String path)Checks if any path supporting the fragments falls under the specified path.booleanisUnder(java.lang.String path)Checks if this mount falls under given path.java.lang.StringtoString()
-
-
-
Method Detail
-
isUnder
public boolean isUnder(java.lang.String path)
Description copied from interface:MountChecks if this mount falls under given path.For e.g. if a mount consist of '/etc/config'. Then if path is
- /etc - Then it returns true
- /etc/config - Then it returns false
- /lib - Then it returns false
-
isDirectlyUnder
public boolean isDirectlyUnder(java.lang.String path)
Description copied from interface:MountChecks if this mount directly falls under given path.For e.g. if a mount consist of '/etc/my/config'. Then if path is
- /etc - Then it returns false
- /etc/my - Then it returns true
- /etc/my/config- Then it returns false
- /lib - Then it returns false
- Specified by:
isDirectlyUnderin interfaceMount- Parameters:
path- path to check- Returns:
- true if this Mount is rooted directly under given path
-
isMounted
public boolean isMounted(java.lang.String path)
Description copied from interface:MountChecks if given path belongs to thisMountA path belongs to a Mount in two scenarios:
- The path is below a fragment-supported path and the path contains a fragment name.
- The path of this mount is the most specific ancestor for the specified path.
The fragment check has a higher priority, and the presence of a fragment name in the path always decides the mount this path belongs to.
- Specified by:
isMountedin interfaceMount- Parameters:
path- path to check- Returns:
- true if path belong to this mount
- See Also:
Mount.getPathFragmentName()
-
getName
public java.lang.String getName()
Description copied from interface:MountName of the mount. If this@Mountis the default mount, an empty string is returned
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:MountChecks whether the mount is marked as read only.- Specified by:
isReadOnlyin interfaceMount- Returns:
- true if the mount is read only.
-
isDefault
public boolean isDefault()
Description copied from interface:MountChecks whether current mount is the default mount.The Default mount includes the root path and all other paths which are not part of any other mount.
-
isSupportFragment
public boolean isSupportFragment(java.lang.String path)
Description copied from interface:MountChecks if this mount supports mounting nodes containing the fragment (seeMount.getPathFragmentName()) under the given path.- Specified by:
isSupportFragmentin interfaceMount- Parameters:
path- ancestor path- Returns:
- true if the path fragment mounts are supported in the given subtree
-
isSupportFragmentUnder
public boolean isSupportFragmentUnder(java.lang.String path)
Description copied from interface:MountChecks if any path supporting the fragments falls under the specified path.- Specified by:
isSupportFragmentUnderin interfaceMount- Parameters:
path- ancestor path- Returns:
- true if the path fragment mounts are supported under some descendants of the specified path
-
getPathFragmentName
public java.lang.String getPathFragmentName()
Description copied from interface:MountReturns fragment name which can be used to construct node name used for storing meta content belonging to path under thisMount. Such a node name would be used by NodeStore to determine the storage for nodes under those paths.Fragment name is formatted as 'oak:mount-<mount name>'
For e.g. for mount name 'private' the fragment name would be
oak:mount-private. This can be then used to construct node name likeoak:mount-private-indexand then any derived content for path under this mount would be stored as child node under oak:mount-private-index like/fooIndex/oak:mount-private-index/foo. Such paths would then be stored in a separate store which would only be storing paths belonging to that mountIf this
Mountis the default mount, an empty string is returned- Specified by:
getPathFragmentNamein interfaceMount- Returns:
- node name prefix which can be used
-
getPathsSupportingFragments
public java.util.Set<java.lang.String> getPathsSupportingFragments()
-
getIncludedPaths
public java.util.Set<java.lang.String> getIncludedPaths()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-