Interface JcrPackageManager
- 
- All Superinterfaces:
 PackageManager
@ProviderType public interface JcrPackageManager extends PackageManager
Extends thePackageManagerby repository specific operations. 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidassemble(@NotNull javax.jcr.Node packNode, @NotNull JcrPackageDefinition definition, @Nullable ProgressTrackerListener listener)Assembles a package.voidassemble(@NotNull JcrPackageDefinition definition, @Nullable ProgressTrackerListener listener, @NotNull java.io.OutputStream out)Assembles a package directly to a output streamvoidassemble(@NotNull JcrPackage pack, @Nullable ProgressTrackerListener listener)Assembles a package.@NotNull JcrPackagecreate(@NotNull java.lang.String group, @NotNull java.lang.String name)Creates a new package with the new group and name.@NotNull JcrPackagecreate(@NotNull java.lang.String group, @NotNull java.lang.String name, @Nullable java.lang.String version)Creates a new package with the new group, name and version.@NotNull JcrPackagecreate(@Nullable javax.jcr.Node folder, @NotNull java.lang.String name)Creates a new package below the given folder.@NotNull PackageId[]extract(@NotNull Archive archive, @NotNull ImportOptions options, boolean replace)Extracts a package directly from the given archive without uploading it to the repository first.@NotNull javax.jcr.NodegetPackageRoot()Returns the configured package root node.@Nullable javax.jcr.NodegetPackageRoot(boolean noCreate)Returns the configured package root node.@NotNull java.util.List<JcrPackage>listPackages()Returns the list of all packages installed below the package root.@NotNull java.util.List<JcrPackage>listPackages(@Nullable java.lang.String group, boolean built)Returns the list of all packages installed below the package root that match the given group.@NotNull java.util.List<JcrPackage>listPackages(@Nullable WorkspaceFilter filter)Returns the list of all packages installed below the package root that are included in the filter.@Nullable JcrPackageopen(@NotNull javax.jcr.Node node)Opens a package that is based on the given node.@Nullable JcrPackageopen(@NotNull javax.jcr.Node node, boolean allowInvalid)Opens a package that is based on the given node.@Nullable JcrPackageopen(@NotNull PackageId id)Opens a package with the given package id.voidremove(@NotNull JcrPackage pack)Removes a package and its snapshots if present.@NotNull JcrPackagerename(@NotNull JcrPackage pack, @Nullable java.lang.String groupId, @Nullable java.lang.String name)Renames the given package with a new group id and name.@NotNull JcrPackagerename(@NotNull JcrPackage pack, @Nullable java.lang.String groupId, @Nullable java.lang.String name, @Nullable java.lang.String version)Renames the given package with a new group id, name and version.@Nullable PackageIdresolve(@NotNull Dependency dependency, boolean onlyInstalled)Finds the id of the package that matches the given dependency best.voidrewrap(@NotNull JcrPackage pack, @Nullable ProgressTrackerListener listener)Rewraps the package in respect to its underlying definition.@NotNull JcrPackageupload(@NotNull java.io.File file, boolean isTmpFile, boolean replace, @Nullable java.lang.String nameHint)Uploads a package.@NotNull JcrPackageupload(@NotNull java.io.File file, boolean isTmpFile, boolean replace, @Nullable java.lang.String nameHint, boolean strict)Uploads a package.@NotNull JcrPackageupload(@NotNull java.io.InputStream in, boolean replace)Uploads a package.@NotNull JcrPackageupload(@NotNull java.io.InputStream in, boolean replace, boolean strict)Uploads a package.@NotNull PackageId[]usage(@NotNull PackageId id)Returns the package ids of installed packages that depend on the given package. 
 - 
 
- 
- 
Method Detail
- 
open
@Nullable @Nullable JcrPackage open(@NotNull @NotNull PackageId id) throws javax.jcr.RepositoryException
Opens a package with the given package id.- Parameters:
 id- the package id.- Returns:
 - the new package or 
nullit the package does not exist or is not valid. - Throws:
 javax.jcr.RepositoryException- if an error occurs- Since:
 - 2.3.22
 
 
- 
open
@Nullable @Nullable JcrPackage open(@NotNull @NotNull javax.jcr.Node node) throws javax.jcr.RepositoryException
Opens a package that is based on the given node.- Parameters:
 node- the underlying node- Returns:
 - the new package or 
nullit the package is not valid. - Throws:
 javax.jcr.RepositoryException- if an error occurs
 
- 
open
@Nullable @Nullable JcrPackage open(@NotNull @NotNull javax.jcr.Node node, boolean allowInvalid) throws javax.jcr.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).- Parameters:
 node- the underlying nodeallowInvalid- iftrueinvalid packages are openend, too.- Returns:
 - the new package or 
nullit the package is not valid unlessallowInvalidistrue. - Throws:
 javax.jcr.RepositoryException- if an error occurs
 
- 
resolve
@Nullable @Nullable PackageId resolve(@NotNull @NotNull Dependency dependency, boolean onlyInstalled) throws javax.jcr.RepositoryException
Finds the id of the package that matches the given dependency best. IfonlyInstalledistrueonly installed packages are searched.- Parameters:
 dependency- dependency informationonlyInstalled- iftrueonly installed packages are searched.- Returns:
 - the id of the matching package or 
nullif not found. - Throws:
 javax.jcr.RepositoryException- if an error occurs- Since:
 - 2.4.6
 
 
- 
usage
@NotNull @NotNull PackageId[] usage(@NotNull @NotNull PackageId id) throws javax.jcr.RepositoryException
Returns the package ids of installed packages that depend on the given package.- Parameters:
 id- the package id to search for- Returns:
 - the array of package ids.
 - Throws:
 javax.jcr.RepositoryException- if an error occurs- Since:
 - 3.1.32
 
 
- 
upload
@NotNull @NotNull JcrPackage upload(@NotNull @NotNull java.io.File file, boolean isTmpFile, boolean replace, @Nullable @Nullable java.lang.String nameHint) throws javax.jcr.RepositoryException, java.io.IOException
Uploads a package. The location is chosen from the installation path of the package. if the package does not provide such a path, the nameHint is respected and the package is placed below the package root. if the package already exists at that path it is not installed andnullis returned unlessreplaceistrue.- Parameters:
 file- package file to uploadisTmpFile- indicates if the given file is a temp file and can be deleted when the package is closedreplace- iftrueexisting packages are replaced.nameHint- hint for the name if package does not provide one- Returns:
 - the new jcr package
 - Throws:
 javax.jcr.RepositoryException- if an error occurrsjava.io.IOException- if an I/O error occurrs
 
- 
upload
@NotNull @NotNull JcrPackage upload(@NotNull @NotNull java.io.File file, boolean isTmpFile, boolean replace, @Nullable @Nullable java.lang.String nameHint, boolean strict) throws javax.jcr.RepositoryException, java.io.IOException
Uploads a package. The location is chosen from the installation path of the package. if the package does not provide such a path, the nameHint is respected and the package is placed below the package root. if the package already exists at that path it is not uploaded aItemExistsExceptionis thrown unlessreplaceistrue.- Parameters:
 file- package file to uploadisTmpFile- indicates if the given file is a temp file and can be deleted when the package is closedreplace- iftrueexisting packages are replaced.nameHint- hint for the name if package does not provide onestrict- iftrueimport is more strict in regards to errors- Returns:
 - the new jcr package
 - Throws:
 javax.jcr.RepositoryException- if an error occurrsjava.io.IOException- if an I/O error occurrs
 
- 
upload
@NotNull @NotNull JcrPackage upload(@NotNull @NotNull java.io.InputStream in, boolean replace) throws javax.jcr.RepositoryException, java.io.IOException
Uploads a package. The location is chosen from the installation path of the package. if the package does not provide such a path an IOException is thrown. if the package already exists at that path it is not uploaded aItemExistsExceptionis thrown unlessreplaceistrue.- Parameters:
 in- input stream that provides the content of the package. note that after this method returns, the input stream is closed in any case.replace- iftrueexisting packages are replaced.- Returns:
 - the new jcr package
 - Throws:
 javax.jcr.RepositoryException- if an error occurrsjava.io.IOException- if an I/O error occurrs
 
- 
upload
@NotNull @NotNull JcrPackage upload(@NotNull @NotNull java.io.InputStream in, boolean replace, boolean strict) throws javax.jcr.RepositoryException, java.io.IOException
Uploads a package. The location is chosen from the installation path of the package. if the package does not provide such a path an IOException is thrown. if the package already exists at that path it is not uploaded aItemExistsExceptionis thrown unlessreplaceistrue.- Parameters:
 in- input stream that provides the content of the package. note that after this method returns, the input stream is closed in any case.replace- iftrueexisting packages are replaced.strict- iftrueimport is more strict in regards to errors- Returns:
 - the new jcr package
 - Throws:
 javax.jcr.RepositoryException- if an error occurrsjava.io.IOException- if an I/O error occurrs
 
- 
create
@NotNull @NotNull JcrPackage create(@Nullable @Nullable javax.jcr.Node folder, @NotNull @NotNull java.lang.String name) throws javax.jcr.RepositoryException, java.io.IOException
Creates a new package below the given folder.- Parameters:
 folder- parent folder ornullfor the package rootname- name of the new package- Returns:
 - a new jcr package
 - Throws:
 javax.jcr.RepositoryException- if a repository error occurrsjava.io.IOException- if an I/O exception occurs
 
- 
create
@NotNull @NotNull JcrPackage create(@NotNull @NotNull java.lang.String group, @NotNull @NotNull java.lang.String name) throws javax.jcr.RepositoryException, java.io.IOException
Creates a new package with the new group and name.- Parameters:
 group- group of the new packagename- name of the new package- Returns:
 - a new jcr package
 - Throws:
 javax.jcr.RepositoryException- if a repository error occurrsjava.io.IOException- if an I/O exception occurs- Since:
 - 2.2.5
 
 
- 
create
@NotNull @NotNull JcrPackage create(@NotNull @NotNull java.lang.String group, @NotNull @NotNull java.lang.String name, @Nullable @Nullable java.lang.String version) throws javax.jcr.RepositoryException, java.io.IOException
Creates a new package with the new group, name and version.- Parameters:
 group- group of the new packagename- name of the new packageversion- version of the new package; can benull- Returns:
 - a new jcr package
 - Throws:
 javax.jcr.RepositoryException- if a repository error occurrsjava.io.IOException- if an I/O exception occurs- Since:
 - 2.3
 
 
- 
extract
@NotNull @NotNull PackageId[] extract(@NotNull @NotNull Archive archive, @NotNull @NotNull ImportOptions options, boolean replace) throws javax.jcr.RepositoryException, PackageException, java.io.IOException
Extracts a package directly from the given archive without uploading it to the repository first. A package node is created but w/o any content. The resulting package cannot be downloaded, uninstalled or re-installed.If the package defines unsatisfied dependencies
DependencyHandlingmight cause the extraction to fail.If the package contains sub-packages, they will follow the same behaviour, i.e. they will not be uploaded to the repository but directly installed unless
ImportOptions.setNonRecursive(boolean)is set to true, in which case the sub packages will be uploaded.The method will throw an
ItemExistsExceptionif a package with the same id already exists, unlessreplaceis set totrue.- Parameters:
 archive- the input archive that contains the package.options- the import optionsreplace- iftrueexisting packages are replaced.- Returns:
 - an array of the package(s) that were extracted.
 - Throws:
 javax.jcr.RepositoryException- if an error occursjava.io.IOException- if an I/O error occurrsPackageException- if an internal error occurrsjava.io.IOException- if an I/O exception occurs
 
- 
remove
void remove(@NotNull @NotNull JcrPackage pack) throws javax.jcr.RepositoryExceptionRemoves a package and its snapshots if present.- Parameters:
 pack- the package to remove- Throws:
 javax.jcr.RepositoryException- if a repository error occurrs- Since:
 - 2.2.7
 
 
- 
rename
@NotNull @NotNull JcrPackage rename(@NotNull @NotNull JcrPackage pack, @Nullable @Nullable java.lang.String groupId, @Nullable @Nullable java.lang.String name) throws PackageException, javax.jcr.RepositoryException
Renames the given package with a new group id and name. Please note that the package is moved and the internal 'path' is adjusted in the definition, but the package is not rewrapped.- Parameters:
 pack- the package to renamegroupId- the new group id ornullname- the new name ornull- Returns:
 - the renamed package
 - Throws:
 javax.jcr.RepositoryException- if an error occursPackageException- if the package is not unwrapped.- Since:
 - 2.0
 
 
- 
rename
@NotNull @NotNull JcrPackage rename(@NotNull @NotNull JcrPackage pack, @Nullable @Nullable java.lang.String groupId, @Nullable @Nullable java.lang.String name, @Nullable @Nullable java.lang.String version) throws PackageException, javax.jcr.RepositoryException
Renames the given package with a new group id, name and version. Please note that the package is moved and the internal 'path' is adjusted in the definition, but the package is not rewrapped.- Parameters:
 pack- the package to renamegroupId- the new group id ornullname- the new name ornullversion- the new version ornull- Returns:
 - the renamed package
 - Throws:
 javax.jcr.RepositoryException- if an error occursPackageException- if the package is not unwrapped.- Since:
 - 2.3
 
 
- 
assemble
void assemble(@NotNull @NotNull JcrPackage pack, @Nullable @Nullable ProgressTrackerListener listener) throws PackageException, javax.jcr.RepositoryException, java.io.IOExceptionAssembles a package.- Parameters:
 pack- the package to assemblelistener- a progress listener- Throws:
 PackageException- if a package error occursjavax.jcr.RepositoryException- if a repository error occursjava.io.IOException- if an I/O error occurs
 
- 
assemble
void assemble(@NotNull @NotNull javax.jcr.Node packNode, @NotNull @NotNull JcrPackageDefinition definition, @Nullable @Nullable ProgressTrackerListener listener) throws PackageException, javax.jcr.RepositoryException, java.io.IOExceptionAssembles a package.- Parameters:
 packNode- the node of the packagedefinition- the definition of the packagelistener- a progress listener- Throws:
 PackageException- if a package error occursjavax.jcr.RepositoryException- if a repository error occursjava.io.IOException- if an I/O error occurs
 
- 
assemble
void assemble(@NotNull @NotNull JcrPackageDefinition definition, @Nullable @Nullable ProgressTrackerListener listener, @NotNull @NotNull java.io.OutputStream out) throws java.io.IOException, javax.jcr.RepositoryException, PackageExceptionAssembles a package directly to a output stream- Parameters:
 definition- the definition of the packagelistener- a progress listenerout- the output stream to write to- Throws:
 javax.jcr.RepositoryException- if a repository error occursjava.io.IOException- if an I/O error occursPackageException- if a package error occurs
 
- 
rewrap
void rewrap(@NotNull @NotNull JcrPackage pack, @Nullable @Nullable ProgressTrackerListener listener) throws PackageException, javax.jcr.RepositoryException, java.io.IOExceptionRewraps the package in respect to its underlying definition.- Parameters:
 pack- the package to rewraplistener- the progress listener- Throws:
 PackageException- if a package error occursjavax.jcr.RepositoryException- if a repository error occursjava.io.IOException- if an I/O error occurs
 
- 
getPackageRoot
@NotNull @NotNull javax.jcr.Node getPackageRoot() throws javax.jcr.RepositoryExceptionReturns the configured package root node.- Returns:
 - the package root node
 - Throws:
 javax.jcr.RepositoryException- if an error occurs
 
- 
getPackageRoot
@Nullable @Nullable javax.jcr.Node getPackageRoot(boolean noCreate) throws javax.jcr.RepositoryExceptionReturns the configured package root node.- Parameters:
 noCreate- do not create missing root iftrue- Returns:
 - the package root node or 
nullif not present and noCreate istrue. - Throws:
 javax.jcr.RepositoryException- if an error occurs
 
- 
listPackages
@NotNull @NotNull java.util.List<JcrPackage> listPackages() throws javax.jcr.RepositoryException
Returns the list of all packages installed below the package root.- Returns:
 - a list of packages
 - Throws:
 javax.jcr.RepositoryException- if an error occurs
 
- 
listPackages
@NotNull @NotNull java.util.List<JcrPackage> listPackages(@Nullable @Nullable WorkspaceFilter filter) throws javax.jcr.RepositoryException
Returns the list of all packages installed below the package root that are included in the filter.- Parameters:
 filter- filter for packages- Returns:
 - a list of packages
 - Throws:
 javax.jcr.RepositoryException- if an error occurs
 
- 
listPackages
@NotNull @NotNull java.util.List<JcrPackage> listPackages(@Nullable @Nullable java.lang.String group, boolean built) throws javax.jcr.RepositoryException
Returns the list of all packages installed below the package root that match the given group. ifgroupisnullall packages are returned.- Parameters:
 group- the group filterbuilt- iftrueonly packages with size > 0 are listed- Returns:
 - the list of packages
 - Throws:
 javax.jcr.RepositoryException- if an error occurs
 
 - 
 
 -