Class PackagingImpl
java.lang.Object
org.apache.jackrabbit.vault.packaging.impl.PackagingImpl
- All Implemented Interfaces:
Packaging
PackagingImpl...-
Constructor Summary
Constructors -
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.getJcrPackageRegistry(Session session) Returns a JCR-based package registry using the given session.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.
-
Constructor Details
-
PackagingImpl
public PackagingImpl()
-
-
Method Details
-
getPackageManager
Returns a non-repository based package manager.- Specified by:
getPackageManagerin interfacePackaging- Returns:
- the package manager
-
getPackageManager
Returns a repository based package manager.- Specified by:
getPackageManagerin interfacePackaging- Parameters:
session- repository session- Returns:
- the package manager
-
createPackageDefinition
Creates a new jcr package definition based on the given node.- Specified by:
createPackageDefinitionin interfacePackaging- Parameters:
defNode- the node- Returns:
- the definition
-
open
Opens a package that is based on the given node. IfallowInvalidistruealso 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.- Specified by:
openin interfacePackaging- Parameters:
node- the underlying nodeallowInvalid- iftrueinvalid packages are opened, too.- Returns:
- the new package or
nullit the package is not valid unlessallowInvalidistrue. - Throws:
RepositoryException- if an error occurs
-
getCompositePackageRegistry
public PackageRegistry getCompositePackageRegistry(Session session, boolean useJcrRegistryAsPrimaryRegistry) throws IOException Description copied from interface:PackagingReturns 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.- Specified by:
getCompositePackageRegistryin interfacePackaging- Parameters:
session- the JCR session to use for the JCR-based registryuseJcrRegistryAsPrimaryRegistry- iftruethe 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
Description copied from interface:PackagingReturns a JCR-based package registry using the given session.- Specified by:
getJcrPackageRegistryin interfacePackaging- Parameters:
session- the JCR session to use for reading/writing nodes in the repository- Returns:
- the JCR-based package registry
-
getJcrBasedPackageRegistry
Description copied from interface:PackagingReturns a JCR-based package registry using the given session.- Specified by:
getJcrBasedPackageRegistryin interfacePackaging- Parameters:
session- the JCR session to use for reading/writing nodes in the repository- Returns:
- the JCR-based package registry
-