com.day.jcr.vault.packaging
Interface JcrPackageManager

All Superinterfaces:
PackageManager

public interface JcrPackageManager
extends PackageManager

Extends the PackageManager by repository specific operations.


Method Summary
 void assemble(JcrPackageDefinition definition, ProgressTrackerListener listener, OutputStream out)
          Assembles a package directly to a output stream
 void assemble(JcrPackage pack, ProgressTrackerListener listener)
          Assembles a package.
 void assemble(Node packNode, JcrPackageDefinition definition, ProgressTrackerListener listener)
          Assembles a package.
 JcrPackage create(Node folder, String name)
          Creates a new package below the given folder.
 JcrPackage create(String group, String name)
          Creates a new package with the new group and name.
 JcrPackage create(String group, String name, String version)
          Creates a new package with the new group, name and version.
 Node getPackageRoot()
          Returns the configured package root node.
 Node getPackageRoot(boolean noCreate)
          Returns the configured package root node.
 List<JcrPackage> listPackages()
          Returns the list of all packages installed below the package root.
 List<JcrPackage> listPackages(String group, boolean built)
          Returns the list of all packages installed below the package root that match the given group.
 List<JcrPackage> listPackages(WorkspaceFilter filter)
          Returns the list of all packages installed below the package root that are included in the filter.
 JcrPackage open(Node node)
          Opens a package that is based on the given node.
 JcrPackage open(Node node, boolean allowInvalid)
          Opens a package that is based on the given node.
 JcrPackage open(PackageId id)
          Opens a package with the given package id.
 void remove(JcrPackage pack)
          Removes a package and its snaphost if present.
 JcrPackage rename(JcrPackage pack, String groupId, String name)
          Renames the given package with a new group id and name.
 JcrPackage rename(JcrPackage pack, String groupId, String name, String version)
          Renames the given package with a new group id, name and version.
 PackageId resolve(Dependency dependency, boolean onlyInstalled)
          Finds the id of the package that matches the given dependency best.
 void rewrap(JcrPackage pack, ProgressTrackerListener listener)
          Rewraps the package in respect to its underlying definition.
 JcrPackage upload(File file, boolean isTmpFile, boolean replace, String nameHint)
          Uploads a package.
 JcrPackage upload(File file, boolean isTmpFile, boolean replace, String nameHint, boolean strict)
          Uploads a package.
 JcrPackage upload(InputStream in, boolean replace)
          Uploads a package.
 JcrPackage upload(InputStream in, boolean replace, boolean strict)
          Uploads a package.
 
Methods inherited from interface com.day.jcr.vault.packaging.PackageManager
assemble, assemble, open, open, rewrap, rewrap
 

Method Detail

open

JcrPackage open(PackageId id)
                throws RepositoryException
Opens a package with the given package id.

Parameters:
id - the package id.
Returns:
the new package or null it the package does not exist or is not valid.
Throws:
RepositoryException - if an error occurs
Since:
2.3.22

open

JcrPackage open(Node node)
                throws RepositoryException
Opens a package that is based on the given node.

Parameters:
node - the underlying node
Returns:
the new package or null it the package is not valid.
Throws:
RepositoryException - if an error occurs

open

JcrPackage open(Node node,
                boolean allowInvalid)
                throws RepositoryException
Opens a package that is based on the given node. If allowInvalid is true 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).

Parameters:
node - the underlying node
allowInvalid - if true invalid packages are openend, too.
Returns:
the new package or null it the package is not valid unless allowInvalid is true.
Throws:
RepositoryException - if an error occurs

resolve

PackageId resolve(Dependency dependency,
                  boolean onlyInstalled)
                  throws RepositoryException
Finds the id of the package that matches the given dependency best. If onlyInstalled is true only installed packages are searched.

Parameters:
dependency - dependency information
onlyInstalled - if true only installed packages are searched.
Returns:
the id of the matching package or null if not found.
Throws:
RepositoryException - if an error occurs
Since:
2.4.6

upload

JcrPackage upload(File file,
                  boolean isTmpFile,
                  boolean replace,
                  String nameHint)
                  throws RepositoryException,
                         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 and null is returned unless replace is true.

Parameters:
file - package file to upload
isTmpFile - indicates if the given file is a temp file and can be deleted when the package is closed
replace - if true existing packages are replaced.
nameHint - hint for the name if package does not provide one
Returns:
the new jcr package or null if not installed
Throws:
RepositoryException - if an error occurrs
IOException - if an I/O error occurrs

upload

JcrPackage upload(File file,
                  boolean isTmpFile,
                  boolean replace,
                  String nameHint,
                  boolean strict)
                  throws RepositoryException,
                         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 a ItemExistsException is thrown unless replace is true.

Parameters:
file - package file to upload
isTmpFile - indicates if the given file is a temp file and can be deleted when the package is closed
replace - if true existing packages are replaced.
nameHint - hint for the name if package does not provide one
strict - if true import is more strict in regards to errors
Returns:
the new jcr package
Throws:
RepositoryException - if an error occurrs
IOException - if an I/O error occurrs

upload

JcrPackage upload(InputStream in,
                  boolean replace)
                  throws RepositoryException,
                         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 a ItemExistsException is thrown unless replace is true.

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 - if true existing packages are replaced.
Returns:
the new jcr package
Throws:
RepositoryException - if an error occurrs
IOException - if an I/O error occurrs

upload

JcrPackage upload(InputStream in,
                  boolean replace,
                  boolean strict)
                  throws RepositoryException,
                         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 a ItemExistsException is thrown unless replace is true.

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 - if true existing packages are replaced.
strict - if true import is more strict in regards to errors
Returns:
the new jcr package
Throws:
RepositoryException - if an error occurrs
IOException - if an I/O error occurrs

create

JcrPackage create(Node folder,
                  String name)
                  throws RepositoryException,
                         IOException
Creates a new package below the given folder.

Parameters:
folder - parent folder
name - name of the new package
Returns:
a new jcr package
Throws:
RepositoryException - if a repository error occurrs
IOException - if an I/O exception occurs

create

JcrPackage create(String group,
                  String name)
                  throws RepositoryException,
                         IOException
Creates a new package with the new group and name.

Parameters:
group - group of the new package
name - name of the new package
Returns:
a new jcr package
Throws:
RepositoryException - if a repository error occurrs
IOException - if an I/O exception occurs
Since:
2.2.5

create

JcrPackage create(String group,
                  String name,
                  String version)
                  throws RepositoryException,
                         IOException
Creates a new package with the new group, name and version.

Parameters:
group - group of the new package
name - name of the new package
version - version of the new package; can be null
Returns:
a new jcr package
Throws:
RepositoryException - if a repository error occurrs
IOException - if an I/O exception occurs
Since:
2.3

remove

void remove(JcrPackage pack)
            throws RepositoryException
Removes a package and its snaphost if present.

Parameters:
pack - the package to remove
Throws:
RepositoryException - if a repository error occurrs
Since:
2.2.7

rename

JcrPackage rename(JcrPackage pack,
                  String groupId,
                  String name)
                  throws PackageException,
                         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 deinition, but the package is not rewrapped.

Parameters:
pack - the package to rename
groupId - the new group id or null
name - the new name or null
Returns:
the renamed package
Throws:
RepositoryException - if an error occurs
PackageException - if the package is not unwrapped.
Since:
2.0

rename

JcrPackage rename(JcrPackage pack,
                  String groupId,
                  String name,
                  String version)
                  throws PackageException,
                         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 rename
groupId - the new group id or null
name - the new name or null
version - the new version or null
Returns:
the renamed package
Throws:
RepositoryException - if an error occurs
PackageException - if the package is not unwrapped.
Since:
2.3

assemble

void assemble(JcrPackage pack,
              ProgressTrackerListener listener)
              throws PackageException,
                     RepositoryException,
                     IOException
Assembles a package.

Parameters:
pack - the package to assemble
listener - a progress listener
Throws:
PackageException - if a package error occurs
RepositoryException - if a repository error occurs
IOException - if an I/O error occurs

assemble

void assemble(Node packNode,
              JcrPackageDefinition definition,
              ProgressTrackerListener listener)
              throws PackageException,
                     RepositoryException,
                     IOException
Assembles a package.

Parameters:
packNode - the node of the package
definition - the definition of the package
listener - a progress listener
Throws:
PackageException - if a package error occurs
RepositoryException - if a repository error occurs
IOException - if an I/O error occurs

assemble

void assemble(JcrPackageDefinition definition,
              ProgressTrackerListener listener,
              OutputStream out)
              throws IOException,
                     RepositoryException,
                     PackageException
Assembles a package directly to a output stream

Parameters:
definition - the definition of the package
listener - a progress listener
out - the output stream to write to
Throws:
RepositoryException - if a repository error occurs
IOException - if an I/O error occurs
PackageException - if a package error occurs

rewrap

void rewrap(JcrPackage pack,
            ProgressTrackerListener listener)
            throws PackageException,
                   RepositoryException,
                   IOException
Rewraps the package in respect to its underlying definition.

Parameters:
pack - the package to rewrap
listener - the progress listener
Throws:
PackageException - if a package error occurs
RepositoryException - if a repository error occurs
IOException - if an I/O error occurs

getPackageRoot

Node getPackageRoot()
                    throws RepositoryException
Returns the configured package root node.

Returns:
the package root node
Throws:
RepositoryException - if an error occurs

getPackageRoot

Node getPackageRoot(boolean noCreate)
                    throws RepositoryException
Returns the configured package root node.

Parameters:
noCreate - do not create missing root if true
Returns:
the package root node or null if not present and noCreate is true.
Throws:
RepositoryException - if an error occurs

listPackages

List<JcrPackage> listPackages()
                              throws RepositoryException
Returns the list of all packages installed below the package root.

Returns:
a list of packages
Throws:
RepositoryException - if an error occurs

listPackages

List<JcrPackage> listPackages(WorkspaceFilter filter)
                              throws 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:
RepositoryException - if an error occurs

listPackages

List<JcrPackage> listPackages(String group,
                              boolean built)
                              throws RepositoryException
Returns the list of all packages installed below the package root that match the given group. if group is null all packages are returned.

Parameters:
group - the group filter
built - if true only packages with size > 0 are listed
Returns:
the list of packages
Throws:
RepositoryException - if an error occurs


Copyright © 2011-2013 Adobe Systems Incorporated. All Rights Reserved.