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>
COMPARATOR
protected GroupNode
group
protected String
namespace
protected org.apache.jackrabbit.vault.packaging.PackageId
packageId
-
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 VersionNode
addVersion(String registryNamespace, org.apache.jackrabbit.vault.packaging.PackageId id)
VersionNode
getCurrentInstalled()
String
getGroup()
String
getNamespace()
org.apache.jackrabbit.vault.packaging.PackageId
getPackageId()
String
getVersion()
VersionNode
getVersion(String versionKey)
boolean
isClosed()
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
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, 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:
getNamespace
in interfacePackageView
-
getPackageId
@Nonnull public org.apache.jackrabbit.vault.packaging.PackageId getPackageId()
- Specified by:
getPackageId
in interfacePackageView
-
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
-
getCurrentInstalled
public VersionNode getCurrentInstalled()
-
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
-
getVersion
@Nullable public VersionNode getVersion(String versionKey)
-
addVersion
@Nonnull public VersionNode addVersion(@Nonnull String registryNamespace, @Nonnull org.apache.jackrabbit.vault.packaging.PackageId id)
-
-