Class PackagingImpl
- java.lang.Object
-
- org.apache.jackrabbit.vault.packaging.impl.PackagingImpl
-
-
Constructor Summary
Constructors Constructor Description PackagingImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JcrPackageDefinitioncreatePackageDefinition(Node defNode)Creates a new jcr package definition based on the given node.PackageRegistrygetCompositePackageRegistry(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.PackageRegistrygetJcrBasedPackageRegistry(Session session)Returns a JCR-based package registry using the given session.JcrPackageRegistrygetJcrPackageRegistry(Session session)Returns a JCR-based package registry using the given session.PackageManagergetPackageManager()Returns a non-repository based package manager.JcrPackageManagergetPackageManager(Session session)Returns a repository based package manager.JcrPackageopen(Node node, boolean allowInvalid)Opens a package that is based on the given node.
-
-
-
Method Detail
-
getPackageManager
public PackageManager getPackageManager()
Returns a non-repository based package manager.- Specified by:
getPackageManagerin interfacePackaging- Returns:
- the package manager
-
getPackageManager
public JcrPackageManager getPackageManager(Session session)
Returns a repository based package manager.- Specified by:
getPackageManagerin interfacePackaging- Parameters:
session- repository session- Returns:
- the package manager
-
createPackageDefinition
public JcrPackageDefinition createPackageDefinition(Node defNode)
Creates a new jcr package definition based on the given node.- Specified by:
createPackageDefinitionin interfacePackaging- Parameters:
defNode- the node- Returns:
- the definition
-
open
public JcrPackage open(Node node, boolean allowInvalid) throws RepositoryException
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
public JcrPackageRegistry getJcrPackageRegistry(Session session)
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
public PackageRegistry getJcrBasedPackageRegistry(Session session)
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
-
-