Package ch.ivyteam.ivy.application
Interface ILibrary
public interface ILibrary
Library belongs to an application. The content of a library is stored by a process model version.
Libraries can have dependencies between each other.
- Since:
- 10.04.2007
- API:
- This is a public API.
-
Method Summary
Modifier and TypeMethodDescriptioncreateRequiredLibrarySpecification
(String id, int position) Creates a new required library specificationvoid
Deletes the required library specificationfindLibraryInRequiredHierarchie
(String libraryId) Gets all library requirement specifications which match this library id and version. The returned libraries are candidates which could depend on this library.Finds a required library specification with it's idGets all libraries that depend on this library direct and indirectGets all libraries that are required by this library, in breadth-first order, without duplicates.Gets a list of library pathes that describes the circular dependent libraries of this library.Gets all libraries that depend on this library directGets the description of the librarygetId()
Gets the identifier of the librarygetName()
Gets the name of the project that this library belongs to.Gets the process model version that holds the library contentGets the provider of the libraryGets all libraries that the library requires (depends of) direct.Gets the required library specifications.boolean
Checks if the library is resolved.void
setDescription
(String description) Sets the description of the libraryvoid
Sets the identifier of the libraryvoid
setProvider
(String provider) Sets the provider of the libraryvoid
setQualifiedVersion
(QualifiedVersion qualifiedVersion)
-
Method Details
-
getId
String getId()Gets the identifier of the library- Returns:
- identifier of the library
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
setId
Sets the identifier of the library- Parameters:
id
- the new identifier of the library- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
- Security:
- SESSION OWNS LibraryWriteId PERMISSION OR OWNS LibraryWriteId@SYSTEM PERMISSION
-
getName
String getName()Gets the name of the project that this library belongs to. Please note that this is not equal to the library ID, which is returned bygetId()
!- Returns:
- name of the library's project
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
getDescription
String getDescription()Gets the description of the library- Returns:
- description of the library
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
setDescription
Sets the description of the library- Parameters:
description
- the new description of the library.- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
- Security:
- SESSION OWNS LibraryWriteDescription PERMISSION OR OWNS LibraryWriteDescription@SYSTEM PERMISSION
-
getProvider
String getProvider()Gets the provider of the library- Returns:
- provider of the library
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
setProvider
Sets the provider of the library- Parameters:
provider
- the new provider of the library- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
- Security:
- SESSION OWNS LibraryWriteProvider PERMISSION OR OWNS LibraryWriteProvider@SYSTEM PERMISSION
-
getQualifiedVersion
QualifiedVersion getQualifiedVersion()- Returns:
- qualified version of the library
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
setQualifiedVersion
- Parameters:
qualifiedVersion
- the new qualified version of the library- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
- Security:
- SESSION OWNS LibraryWriteVersion PERMISSION OR OWNS LibraryWriteVersion@SYSTEM PERMISSION
-
getProcessModelVersion
IProcessModelVersion getProcessModelVersion()Gets the process model version that holds the library content- Returns:
- process model version
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
getRequiredLibrarySpecifications
List<ILibrarySpecification> getRequiredLibrarySpecifications()Gets the required library specifications. The required library specifications in the returned list are ordered by their position attribute.- Returns:
- list of required library specifications. Maybe empty. Never null
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
createRequiredLibrarySpecification
Creates a new required library specification- Parameters:
id
- the library identifier of the required libraryposition
- the position the library specification has in releation to the other library specifications of this library (must be >= 0)- Returns:
- the new required library specification
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
- Security:
- SESSION OWNS LibrarySpecificationCreate PERMISSION OR OWNS LibrarySpecificationCreate@SYSTEM PERMISSION
-
deleteRequiredLibrarySpecification
Deletes the required library specification- Parameters:
id
- the identifier of the required library specification to delete- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
- Security:
- SESSION OWNS LibrarySpecificationDelete PERMISSION OR OWNS LibrarySpecificationDelete@SYSTEM PERMISSION
-
isResolved
boolean isResolved()Checks if the library is resolved. A library is resolved if all direct and indirect required libraries are available in the system.- Returns:
- true if library is resolved, otherwise false
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
findLibraryInRequiredHierarchie
- API:
- This public API is available in Java.
-
getRequiredLibraries
Gets all libraries that the library requires (depends of) direct. The libraries in the returned list are ordered by the position attribute of the required library specifications that specifies the requirement of the library.- Returns:
- list of all required libraries. Maybe empty. Never null.
- Throws:
PersistencyException
- if persistency access fails- See Also:
-
IProcessModelVersion.getAllRelatedProcessModelVersions(ProcessModelVersionRelation)
- API:
- This public API is available in Java.
-
getAllRequiredLibraries
Gets all libraries that are required by this library, in breadth-first order, without duplicates.
The libraries in the returned list are ordered as follows:
- Direct required libraries ordered by position in dependency list (See
ILibrarySpecification.getPosition()
). Libraries with the same position will be ordered alphabetically. - Libraries that are required by the direct required libraries (1st level of indirection) ordered first by position of the direct required library and second by their own position.
- Libraries that are required by the 1st level of indirect required libraries (i.e. 2nd level of indirection).
- etc ...
Example:
- LibZurich -> LibBern, LibLucerne
- LibBern -> LibGeneva, LibBasel, LibLausanne
- LibLucerne -> LibBasel, LibSierre
- LibBasel -> LibLausanne, LibZug
For this configuration
getAllRequiredLibraries()
will return the following list of all required libraries for LibZurich:[LibBern, LibLucerne, LibGeneva, LibBasel, LibLausanne, LibSierre, LibZug]
- Returns:
- list of all required libraries. Maybe empty. Never null.
- Throws:
PersistencyException
- if persistency access fails- See Also:
-
IProcessModelVersion.getAllRelatedProcessModelVersions(ProcessModelVersionRelation)
- API:
- This public API is available in Java.
- Direct required libraries ordered by position in dependency list (See
-
getDependentLibraries
Gets all libraries that depend on this library direct- Returns:
- list of all dependent libraries. Maybe empty. Never null.
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
getAllDependentLibraries
Gets all libraries that depend on this library direct and indirect- Returns:
- list of all dependent libraries. Maybe empty. Never null.
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
findMatchingLibrarySpecifications
List<ILibrarySpecification> findMatchingLibrarySpecifications()Gets all library requirement specifications which match this library id and version. The returned libraries are candidates which could depend on this library.- Returns:
librarySpecifications
which match this library.- API:
- This public API is available in Java.
-
getCircularDependentLibraries
Gets a list of library pathes that describes the circular dependent libraries of this library. A library path is a list of libraries.
E.g. If lib1 requires lib2 and lib3, lib2 requires lib6, lib3 requires lib6 and lib6 requires lib1 then this method returns the following:[[lib1, lib2, lib6, lib1], [lib1, lib3, lib6, lib1]]
- Returns:
- list of circular dependent library pathes
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
findRequiredLibrarySpecification
Finds a required library specification with it's id- Parameters:
id
- the id of the required library specification- Returns:
- library specification or null
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-