Class PackageNode
- 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.PackageNode
-
- All Implemented Interfaces:
RegistryItem,PackageView,Serializable,Cloneable,Map<String,Object>
public class PackageNode 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 static Comparator<String>COMPARATORprotected GroupNodegroupprotected Stringnamespaceprotected org.apache.jackrabbit.vault.packaging.PackageIdpackageId-
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 PackageNode(GroupNode group, org.apache.jackrabbit.vault.packaging.PackageId packageId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VersionNodeaddVersion(String registryNamespace, org.apache.jackrabbit.vault.packaging.PackageId id)VersionNodegetCurrentInstalled()StringgetGroup()StringgetNamespace()org.apache.jackrabbit.vault.packaging.PackageIdgetPackageId()StringgetVersion()VersionNodegetVersion(String versionKey)booleanisClosed()booleanisInstalled()booleanisValid()voidload(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(BeanContext context)Makes sureRegistryItem.getItems()are present, though not necessarily loaded.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, toTreeProperties
-
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
-
COMPARATOR
public static final Comparator<String> COMPARATOR
-
namespace
protected final String namespace
-
group
protected final GroupNode group
-
packageId
protected final org.apache.jackrabbit.vault.packaging.PackageId packageId
-
-
Method Detail
-
getNamespace
public String getNamespace()
- Specified by:
getNamespacein interfacePackageView
-
getPackageId
@Nonnull public org.apache.jackrabbit.vault.packaging.PackageId getPackageId()
- Specified by:
getPackageIdin interfacePackageView
-
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
-
getCurrentInstalled
public VersionNode getCurrentInstalled()
-
load
public void load(@Nonnull 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 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
-
getVersion
@Nullable public VersionNode getVersion(String versionKey)
-
addVersion
@Nonnull public VersionNode addVersion(@Nonnull String registryNamespace, @Nonnull org.apache.jackrabbit.vault.packaging.PackageId id)
-
-