Class JcrPackageDefinitionImpl
java.lang.Object
org.apache.jackrabbit.vault.packaging.impl.JcrPackageDefinitionImpl
- All Implemented Interfaces:
JcrPackageDefinition,PackageProperties
The JCR package definition is used to operate with a unwrapped package
in the repository.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.apache.jackrabbit.vault.packaging.JcrPackageDefinition
NN_FILTER, PN_AC_HANDLING, PN_BUILD_COUNT, PN_CND_PATTERN, PN_CREATED, PN_CREATED_BY, PN_DEPENDENCIES, PN_DESCRIPTION, PN_DISABLE_INTERMEDIATE_SAVE, PN_GROUP, PN_LAST_UNPACKED, PN_LAST_UNPACKED_BY, PN_LAST_UNWRAPPED, PN_LAST_UNWRAPPED_BY, PN_LAST_WRAPPED, PN_LAST_WRAPPED_BY, PN_LASTMODIFIED, PN_LASTMODIFIED_BY, PN_MODE, PN_NAME, PN_PATTERN, PN_PROPERTY_RULES, PN_REQUIRES_RESTART, PN_REQUIRES_ROOT, PN_ROOT, PN_RULES, PN_SUB_PACKAGES, PN_TYPE, PN_VERSIONFields inherited from interface org.apache.jackrabbit.vault.packaging.PackageProperties
MF_KEY_IMPORT_PACKAGE, MF_KEY_PACKAGE_DEPENDENCIES, MF_KEY_PACKAGE_DEPENDENCIES_LOCATIONS, MF_KEY_PACKAGE_DESC, MF_KEY_PACKAGE_ID, MF_KEY_PACKAGE_ROOTS, MF_KEY_PACKAGE_TYPE, NAME_AC_HANDLING, NAME_ALLOW_INDEX_DEFINITIONS, NAME_BUILD_COUNT, NAME_CND_PATTERN, NAME_CREATED, NAME_CREATED_BY, NAME_DEPENDENCIES, NAME_DEPENDENCIES_LOCATIONS, NAME_DESCRIPTION, NAME_DISABLE_INTERMEDIATE_SAVE, NAME_GENERATOR, NAME_GROUP, NAME_LAST_MODIFIED, NAME_LAST_MODIFIED_BY, NAME_LAST_WRAPPED, NAME_LAST_WRAPPED_BY, NAME_NAME, NAME_PACKAGE_TYPE, NAME_REQUIRES_RESTART, NAME_REQUIRES_ROOT, NAME_SUB_PACKAGE_HANDLING, NAME_USE_BINARY_REFERENCES, NAME_VERSION, PREFIX_INSTALL_HOOK -
Constructor Summary
ConstructorsConstructorDescriptionJcrPackageDefinitionImpl(@NotNull Node definitionNode) Creates a new definition base on the underlying node. -
Method Summary
Modifier and TypeMethodDescriptionvoiddumpCoverage(ProgressTrackerListener listener) Dumps the coverage of this definition to the given listenerGeneric method to retrieve a string property of this definition.Returns the access control handling defined in the definition, ornullif not defined.Returns the access control handling defined in this package.booleangetBoolean(String name) Generic method to retrieve a boolean property of this definition.longReturns the build count of this packagegetCalendar(String name) Generic method to retrieve a date property of this definition.Returns the date when this package was built ornullif n/a.Returns the user that built this package or null if n/a.getDateProperty(String name) Returns the date property with the given name ornullif it does not exist or if the value cannot be converted to a date.Returns an unmodifiable list of dependenciesReturns a map of dependency locations where key = package id and value = uri of package dependency with that id.Returns a description of this package ornullif n/aReturns the name and version of the component that generated the package.getId()Returns the id of this package ornullif the id can't be determined.Returns the last modification date ornullif n/a.Returns the user that last modified the package ornullif n/a.Returns the date when the package was unpackedReturns the user id who unpacked the packageReturns the last unwrapped dateReturns the last unwrapped user idReturns the date when this package was wrapped ornullif n/a.Returns the user that wrapped this package or null if n/a.Returns the meta inf of this package@NotNull NodegetNode()Returns the underlying node@Nullable PackageTypeReturns the package type ornullif no package type was specified for this package.getProperty(String name) Returns the property with the given name ornullif it does not exist.getState()Returns a new state object that can be used to save modification information.Returns the sub package handling configurationbooleanChecks if the definition was modified since it was last wrapped.booleanChecks if this definition is unwrapped, i.e. if the definition structured was extracted from a VaultPackage.booleanReturnstrueif this package requires a restart after installation.booleanDeprecated.voidGeneric method to set a boolean property to this definition.voidGeneric method to set a string property to this definition.voidGeneric method to set a date property to this definition.voidsetDependencies(@NotNull Dependency[] dependencies, boolean autoSave) Sets the dependencies to this definition and stores it in a node representation.voidsetFilter(WorkspaceFilter filter, boolean autoSave) Sets the filter to this definition and stores it in a node representation.voidWrites the properties derived from the package id to the contentvoidSets the information stored in the state object back to this definition.voidTouches the last modified and last modified by property.voidvoidunwrap(VaultPackage pack, boolean force) voidunwrap(VaultPackage pack, boolean force, boolean autoSave) Unwraps the package definition to the underlying node.
-
Constructor Details
-
JcrPackageDefinitionImpl
Creates a new definition base on the underlying node.- Parameters:
definitionNode- the definition node
-
-
Method Details
-
getNode
Returns the underlying node- Specified by:
getNodein interfaceJcrPackageDefinition- Returns:
- the node
-
getId
Returns the id of this package ornullif the id can't be determined.- Specified by:
getIdin interfacePackageProperties- Returns:
- the id of this package.
-
setId
Writes the properties derived from the package id to the content- Specified by:
setIdin interfaceJcrPackageDefinition- Parameters:
id- the package idautoSave- iftruethe changes are saved automatically.
-
isUnwrapped
public boolean isUnwrapped()Checks if this definition is unwrapped, i.e. if the definition structured was extracted from a VaultPackage.- Specified by:
isUnwrappedin interfaceJcrPackageDefinition- Returns:
trueif unwrapped.
-
isModified
public boolean isModified()Checks if the definition was modified since it was last wrapped. new packages are considered modified.- Specified by:
isModifiedin interfaceJcrPackageDefinition- Returns:
trueif modified
-
unwrap
- Throws:
RepositoryExceptionIOException
-
unwrap
public void unwrap(VaultPackage pack, boolean force, boolean autoSave) throws RepositoryException, IOException Unwraps the package definition to the underlying node.- Specified by:
unwrapin interfaceJcrPackageDefinition- Parameters:
pack- the packageforce- iftrueunwrapping is forcedautoSave- iftruemodifications are saved automatically- Throws:
RepositoryException- if an error occursIOException- if an I/O error occurs
-
unwrap
- Throws:
RepositoryExceptionIOException
-
getDependencies
Returns an unmodifiable list of dependencies- Specified by:
getDependenciesin interfacePackageProperties- Returns:
- list of dependencies
-
setDependencies
Sets the dependencies to this definition and stores it in a node representation.- Specified by:
setDependenciesin interfaceJcrPackageDefinition- Parameters:
dependencies- the package dependenciesautoSave- iftruethe modifications are saved automatically.
-
dumpCoverage
Dumps the coverage of this definition to the given listener- Specified by:
dumpCoveragein interfaceJcrPackageDefinition- Parameters:
listener- the listener- Throws:
RepositoryException- if an error occurrs
-
get
Generic method to retrieve a string property of this definition.- Specified by:
getin interfaceJcrPackageDefinition- Parameters:
name- the name of the property.- Returns:
- the property value or
nullif it does not exist.
-
getBoolean
Generic method to retrieve a boolean property of this definition.- Specified by:
getBooleanin interfaceJcrPackageDefinition- Parameters:
name- the name of the property.- Returns:
- the property value or
nullif it does not exist.
-
getCalendar
Generic method to retrieve a date property of this definition.- Specified by:
getCalendarin interfaceJcrPackageDefinition- Parameters:
name- the name of the property.- Returns:
- the property value or
nullif it does not exist.
-
set
Generic method to set a string property to this definition.- Specified by:
setin interfaceJcrPackageDefinition- Parameters:
name- the name of the propertyvalue- the value ornullto clear the propertyautoSave- iftruethe modifications are saved automatically.
-
set
Generic method to set a date property to this definition.- Specified by:
setin interfaceJcrPackageDefinition- Parameters:
name- the name of the propertyvalue- the value ornullto clear the propertyautoSave- iftruethe modifications are saved automatically.
-
set
Generic method to set a boolean property to this definition.- Specified by:
setin interfaceJcrPackageDefinition- Parameters:
name- the name of the propertyvalue- the valueautoSave- iftruethe modifications are saved automatically.
-
touch
Touches the last modified and last modified by property.- Specified by:
touchin interfaceJcrPackageDefinition- Parameters:
now- calendar ornullautoSave- iftruethe modifications are saved automatically.
-
setFilter
Sets the filter to this definition and stores it in a node representation.- Specified by:
setFilterin interfaceJcrPackageDefinition- Parameters:
filter- the filter to setautoSave- iftruethe modifications are saved automatically.
-
getLastModified
Returns the last modification date ornullif n/a.- Specified by:
getLastModifiedin interfacePackageProperties- Returns:
- last modification date or
null
-
getLastModifiedBy
Returns the user that last modified the package ornullif n/a.- Specified by:
getLastModifiedByin interfacePackageProperties- Returns:
- the user or
null
-
getCreated
Returns the date when this package was built ornullif n/a.- Specified by:
getCreatedin interfacePackageProperties- Returns:
- the creation date
-
getCreatedBy
Returns the user that built this package or null if n/a.- Specified by:
getCreatedByin interfacePackageProperties- Returns:
- the creator
-
getGenerator
Returns the name and version of the component that generated the package.- Specified by:
getGeneratorin interfacePackageProperties- Returns:
- the generator or
nullif n/a
-
getLastUnwrapped
Returns the last unwrapped date- Specified by:
getLastUnwrappedin interfaceJcrPackageDefinition- Returns:
- the last unwrapped date
-
getLastWrappedBy
Returns the user that wrapped this package or null if n/a.- Specified by:
getLastWrappedByin interfacePackageProperties- Returns:
- the wrapper
-
getLastWrapped
Returns the date when this package was wrapped ornullif n/a.- Specified by:
getLastWrappedin interfacePackageProperties- Returns:
- the wrapped date
-
getLastUnwrappedBy
Returns the last unwrapped user id- Specified by:
getLastUnwrappedByin interfaceJcrPackageDefinition- Returns:
- the last unwrapped user id
-
getLastUnpacked
Returns the date when the package was unpacked- Specified by:
getLastUnpackedin interfaceJcrPackageDefinition- Returns:
- the unpacked date
-
getLastUnpackedBy
Returns the user id who unpacked the package- Specified by:
getLastUnpackedByin interfaceJcrPackageDefinition- Returns:
- the unpacked user id
-
requiresRoot
Deprecated.Returnstrueif this package can only be extracted by a admin session.- Specified by:
requiresRootin interfacePackageProperties- Returns:
trueif this package requires an admin session for extraction.
-
requiresRestart
public boolean requiresRestart()Returnstrueif this package requires a restart after installation.- Specified by:
requiresRestartin interfacePackageProperties- Returns:
trueif this package requires a restart after installation.
-
getAccessControlHandling
Returns the access control handling defined in the definition, ornullif not defined.- Specified by:
getAccessControlHandlingin interfaceJcrPackageDefinition- Returns:
- the access control handling or
null
-
getDescription
Returns a description of this package ornullif n/a- Specified by:
getDescriptionin interfacePackageProperties- Returns:
- a description
-
getBuildCount
public long getBuildCount()Returns the build count of this package- Specified by:
getBuildCountin interfacePackageProperties- Returns:
- the build count.
-
getMetaInf
Returns the meta inf of this package- Specified by:
getMetaInfin interfaceJcrPackageDefinition- Returns:
- the meta inf
- Throws:
RepositoryException- if an error occurs.
-
getState
Returns a new state object that can be used to save modification information.- Returns:
- a new state object.
-
setState
Sets the information stored in the state object back to this definition.- Parameters:
state- the sate
-
getExternalHooks
- Specified by:
getExternalHooksin interfacePackageProperties- Returns:
- all external hooks registered in a package (key = name, value = fully qualified class name)
-
getACHandling
Description copied from interface:PackagePropertiesReturns the access control handling defined in this package.- Specified by:
getACHandlingin interfacePackageProperties- Returns:
- the access control handling.
-
getSubPackageHandling
Description copied from interface:PackagePropertiesReturns the sub package handling configuration- Specified by:
getSubPackageHandlingin interfacePackageProperties- Returns:
- the sub package handling configuration.
-
getDateProperty
Description copied from interface:PackagePropertiesReturns the date property with the given name ornullif it does not exist or if the value cannot be converted to a date.- Specified by:
getDatePropertyin interfacePackageProperties- Parameters:
name- the property name- Returns:
- the property value or
null
-
getProperty
Description copied from interface:PackagePropertiesReturns the property with the given name ornullif it does not exist.- Specified by:
getPropertyin interfacePackageProperties- Parameters:
name- the property name- Returns:
- the property value or
null
-
getPackageType
Description copied from interface:PackagePropertiesReturns the package type ornullif no package type was specified for this package.- Specified by:
getPackageTypein interfacePackageProperties- Returns:
- the package type
-
getDependenciesLocations
Description copied from interface:PackagePropertiesReturns a map of dependency locations where key = package id and value = uri of package dependency with that id.- Specified by:
getDependenciesLocationsin interfacePackageProperties- Returns:
- dependencies locations as map
-