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 String
namespace
protected org.apache.jackrabbit.vault.packaging.PackageId
packageId
protected PackageNode
pckg
protected String
registryNamespace
protected String
version
-
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 String
getGroup()
Calendar
getInstallTime()
String
getNamespace()
The namespace encoded in the path - can be empty if the tree is merged.String
getNamespacedPath()
Returns the full path for the version, including the registry namespace - even in merged mode.org.apache.jackrabbit.vault.packaging.PackageId
getPackageId()
PackageNode
getPackageNode()
RegistryUtil.PropertyMap
getPackageProps()
String
getVersion()
boolean
isClosed()
boolean
isCurrent()
boolean
isInstalled()
boolean
isValid()
void
load(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.void
loadForItems(BeanContext context)
Makes sureRegistryItem.getItems()
are present, though not necessarily loaded.protected void
toTreeProperties(com.google.gson.stream.JsonWriter writer)
protected void
toTreeState(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:
getNamespace
in interfacePackageView
-
getPackageId
public org.apache.jackrabbit.vault.packaging.PackageId getPackageId()
- Specified by:
getPackageId
in 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:
getGroup
in interfacePackageView
-
getVersion
public String getVersion()
- Specified by:
getVersion
in interfacePackageView
-
isValid
public boolean isValid()
- Specified by:
isValid
in interfacePackageView
-
isInstalled
public boolean isInstalled()
- Specified by:
isInstalled
in interfacePackageView
-
isClosed
public boolean isClosed()
- Specified by:
isClosed
in interfacePackageView
-
toTreeState
protected void toTreeState(@Nonnull com.google.gson.stream.JsonWriter writer) throws IOException
- Overrides:
toTreeState
in 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:
toTreeProperties
in classAbstractNode
- Throws:
IOException
-
load
public void load(@Nonnull BeanContext context) throws IOException
Description copied from interface:RegistryItem
Loads all details of this node from the package(s) and makes sure all children (RegistryItem.getItems()
) are present, though not necessarily loaded.- Specified by:
load
in interfaceRegistryItem
- Throws:
IOException
-
loadForItems
public void loadForItems(@Nonnull BeanContext context) throws IOException
Description copied from interface:RegistryItem
Makes 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:
loadForItems
in interfaceRegistryItem
- Throws:
IOException
-
-