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 JcrPackageDefinition
createPackageDefinition(Node defNode)
Creates a new jcr package definition based on the given node.PackageRegistry
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.PackageRegistry
getJcrBasedPackageRegistry(Session session)
Returns a JCR-based package registry using the given session.JcrPackageRegistry
getJcrPackageRegistry(Session session)
Returns a JCR-based package registry using the given session.PackageManager
getPackageManager()
Returns a non-repository based package manager.JcrPackageManager
getPackageManager(Session session)
Returns a repository based package manager.JcrPackage
open(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:
getPackageManager
in interfacePackaging
- Returns:
- the package manager
-
getPackageManager
public JcrPackageManager getPackageManager(Session session)
Returns a repository based package manager.- Specified by:
getPackageManager
in 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:
createPackageDefinition
in 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. 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.- Specified by:
open
in interfacePackaging
- 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
-
getCompositePackageRegistry
public PackageRegistry getCompositePackageRegistry(Session session, boolean useJcrRegistryAsPrimaryRegistry) throws IOException
Description copied from interface:Packaging
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.- Specified by:
getCompositePackageRegistry
in interfacePackaging
- 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
public JcrPackageRegistry getJcrPackageRegistry(Session session)
Description copied from interface:Packaging
Returns a JCR-based package registry using the given session.- Specified by:
getJcrPackageRegistry
in 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:Packaging
Returns a JCR-based package registry using the given session.- Specified by:
getJcrBasedPackageRegistry
in interfacePackaging
- Parameters:
session
- the JCR session to use for reading/writing nodes in the repository- Returns:
- the JCR-based package registry
-
-