Class VersionNode
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<String,Object>
-
- com.composum.sling.core.pckgmgr.regpckg.tree.AbstractNode
-
- com.composum.sling.core.pckgmgr.regpckg.tree.VersionNode
-
- All Implemented Interfaces:
RegistryItem,PackageView,Serializable,Cloneable,Map<String,Object>
public class VersionNode extends AbstractNode implements PackageView
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringnamespaceprotected org.apache.jackrabbit.vault.packaging.PackageIdpackageIdprotected PackageNodepckgprotected StringregistryNamespaceprotected Stringversion-
Fields inherited from class com.composum.sling.core.pckgmgr.regpckg.tree.AbstractNode
KEY_ITEMS, KEY_LOADED, KEY_NAME, KEY_PATH, KEY_STATE, KEY_TEXT, KEY_TYPE
-
-
Constructor Summary
Constructors Constructor Description VersionNode(PackageNode pckg, String registryNamespace, org.apache.jackrabbit.vault.packaging.PackageId packageId, String version)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetGroup()CalendargetInstallTime()StringgetNamespace()The namespace encoded in the path - can be empty if the tree is merged.StringgetNamespacedPath()Returns the full path for the version, including the registry namespace - even in merged mode.org.apache.jackrabbit.vault.packaging.PackageIdgetPackageId()PackageNodegetPackageNode()RegistryUtil.PropertyMapgetPackageProps()StringgetVersion()booleanisClosed()booleanisCurrent()booleanisInstalled()booleanisValid()voidload(com.composum.sling.core.BeanContext context)Loads all details of this node from the package(s) and makes sure all children (RegistryItem.getItems()) are present, though not necessarily loaded.voidloadForItems(com.composum.sling.core.BeanContext context)Makes sureRegistryItem.getItems()are present, though not necessarily loaded.protected voidtoTreeProperties(com.google.gson.stream.JsonWriter writer)protected voidtoTreeState(com.google.gson.stream.JsonWriter writer)-
Methods inherited from class com.composum.sling.core.pckgmgr.regpckg.tree.AbstractNode
combineChildren, compactSubTree, compactTree, equals, getItem, getItems, getItemsMap, getName, getParent, getPath, getText, getType, hashCode, isLoaded, setLoaded, toJson, toTree, toTreeChildren
-
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
Methods inherited from class java.util.AbstractMap
toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from interface com.composum.sling.core.pckgmgr.regpckg.view.PackageView
getName
-
-
-
-
Field Detail
-
pckg
protected final PackageNode pckg
-
namespace
protected final String namespace
-
packageId
protected final org.apache.jackrabbit.vault.packaging.PackageId packageId
-
version
protected final String version
-
registryNamespace
protected final String registryNamespace
-
-
Method Detail
-
getNamespace
public String getNamespace()
The namespace encoded in the path - can be empty if the tree is merged.- Specified by:
getNamespacein interfacePackageView
-
getPackageId
public org.apache.jackrabbit.vault.packaging.PackageId getPackageId()
- Specified by:
getPackageIdin interfacePackageView
-
getNamespacedPath
public String getNamespacedPath()
Returns the full path for the version, including the registry namespace - even in merged mode.
-
getGroup
public String getGroup()
- Specified by:
getGroupin interfacePackageView
-
getVersion
public String getVersion()
- Specified by:
getVersionin interfacePackageView
-
isValid
public boolean isValid()
- Specified by:
isValidin interfacePackageView
-
isInstalled
public boolean isInstalled()
- Specified by:
isInstalledin interfacePackageView
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfacePackageView
-
toTreeState
protected void toTreeState(@Nonnull com.google.gson.stream.JsonWriter writer) throws IOException
- Overrides:
toTreeStatein classAbstractNode- Throws:
IOException
-
getPackageNode
public PackageNode getPackageNode()
-
isCurrent
public boolean isCurrent()
-
getInstallTime
public Calendar getInstallTime()
-
getPackageProps
public RegistryUtil.PropertyMap getPackageProps()
-
toTreeProperties
protected void toTreeProperties(@Nonnull com.google.gson.stream.JsonWriter writer) throws IOException
- Overrides:
toTreePropertiesin classAbstractNode- Throws:
IOException
-
load
public void load(@Nonnull com.composum.sling.core.BeanContext context) throws IOException
Description copied from interface:RegistryItemLoads all details of this node from the package(s) and makes sure all children (RegistryItem.getItems()) are present, though not necessarily loaded.- Specified by:
loadin interfaceRegistryItem- Throws:
IOException
-
loadForItems
public void loadForItems(@Nonnull com.composum.sling.core.BeanContext context) throws IOException
Description copied from interface:RegistryItemMakes sureRegistryItem.getItems()are present, though not necessarily loaded. might or might not trigger aRegistryItem.load(BeanContext)if that's necessary for that. (Optimized version ofRegistryItem.load(BeanContext)if we just need theRegistryItem.getItems()).- Specified by:
loadForItemsin interfaceRegistryItem- Throws:
IOException
-
-