Interface Packaging
Default access point to package managers.
- Since:
- 2.4.0
-
Method Summary
Modifier and TypeMethodDescriptioncreatePackageDefinition
(Node defNode) Creates a new jcr package definition based on the given node.getCompositePackageRegistry
(Session session, boolean useJcrRegistryAsPrimaryRegistry) Returns a new composite package registry which acts on all currently registered package registries and a JCR-based registry for the current configuration and the given session.getJcrBasedPackageRegistry
(Session session) Returns a JCR-based package registry using the given session.org.apache.jackrabbit.vault.packaging.registry.impl.JcrPackageRegistry
getJcrPackageRegistry
(Session session) Deprecated.Returns a non-repository based package manager.getPackageManager
(Session session) Returns a repository based package manager.Opens a package that is based on the given node.
-
Method Details
-
getPackageManager
PackageManager getPackageManager()Returns a non-repository based package manager.- Returns:
- the package manager
-
getPackageManager
Returns a repository based package manager.- Parameters:
session
- repository session- Returns:
- the package manager
-
createPackageDefinition
Creates a new jcr package definition based on the given node.- Parameters:
defNode
- the node- Returns:
- the definition
-
open
Opens a package that is based on the given node. IfallowInvalid
istrue
also invalid packages are returned, but only if the node is file like (i.e. is nt:hierarchyNode and has a jcr:content/jcr:data property). This is a shortcut version ofJcrPackageManager.open(javax.jcr.Node, boolean)
which does not create a package manager instance.- Parameters:
node
- the underlying nodeallowInvalid
- iftrue
invalid packages are opened, too.- Returns:
- the new package or
null
it the package is not valid unlessallowInvalid
istrue
. - Throws:
RepositoryException
- if an error occurs- Since:
- 2.3.0
-
getCompositePackageRegistry
PackageRegistry getCompositePackageRegistry(Session session, boolean useJcrRegistryAsPrimaryRegistry) throws IOException Returns a new composite package registry which acts on all currently registered package registries and a JCR-based registry for the current configuration and the given session. All operations creating new packages will act on the primary registry which is determined by argumentuseJcrRegistryAsPrimaryRegistry
. Due to the dynamic nature of package registries the return value should not be persisted.- Parameters:
session
- the JCR session to use for the JCR-based registryuseJcrRegistryAsPrimaryRegistry
- iftrue
the JCR-based registry will be used as primary registry, otherwise the first registered package registry is used and the JCR-based registry will be inserted as last registry.- Returns:
- the composite package registry
- Throws:
IOException
-
getJcrPackageRegistry
@Deprecated org.apache.jackrabbit.vault.packaging.registry.impl.JcrPackageRegistry getJcrPackageRegistry(Session session) Deprecated.Rather usegetJcrBasedPackageRegistry(Session)
which doesn't return a private classReturns a JCR-based package registry using the given session.- Parameters:
session
- the JCR session to use for reading/writing nodes in the repository- Returns:
- the JCR-based package registry
-
getJcrBasedPackageRegistry
Returns a JCR-based package registry using the given session.- Parameters:
session
- the JCR session to use for reading/writing nodes in the repository- Returns:
- the JCR-based package registry
-
getJcrBasedPackageRegistry(Session)
which doesn't return a private class