Class RepositoryManagementEngine
Since loading all metadata from a repository is not a light task, this engine should only be used on a machine having good access to the repository (on the same filesystem being usually the best suited).
To access information, you usually have before to call a method to init the data: load()
is used to load repository metadata, analyze()
is used to analyze them. These methods
being very time consuming, they must always be called explicitly.
On a large repository, this engine can be very memory consuming to use, it is not suited to be used in a long running process, but rather in short process loading data and taking action about the current state of the repository.
This engine is not intended to be used concurrently with publish, the order of repository loaded being nondeterministic and long, it could end up in having an inconsistent in memory state.
For better performance, we strongly suggest using this engine with cache in useOrigin mode.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
True when the repository has been analyzed, false otherwiseprivate Map<ModuleRevisionId,
ModuleRevisionId> Cache from requested module revision id to actual module revision id.private Map<ModuleRevisionId,
List<ModuleRevisionId>> list of dependers per ModuleRevisionId.private Map<ModuleRevisionId,
String> ModuleRevisionId for which loading was not possible, with corresponding error message.private static final int
private boolean
True if the repository has already been loaded, false otherwise.private Map<ModuleId,
Collection<ModuleDescriptor>> List of ModuleDescriptor per ModuleId.private ResolveEngine
private Map<ModuleRevisionId,
ModuleDescriptor> ModuleDescriptors stored by ModuleRevisionIdprivate SearchEngine
private static final double
-
Constructor Summary
ConstructorsConstructorDescriptionRepositoryManagementEngine
(RepositoryManagementEngineSettings settings, SearchEngine searchEngine, ResolveEngine resolveEngine) -
Method Summary
Modifier and TypeMethodDescriptionvoid
analyze()
Analyze data in the repository.private void
private void
private Collection<ModuleDescriptor>
private ModuleRevisionId
private Collection<ModuleRevisionId>
int
Returns the number of ModuleId in the repository.Returns Module Revisions which have no dependers.int
Returns the number of Module Revision in the repository.void
load()
Loads data from the repository.private void
private ResolveData
private ModuleRevisionId[]
-
Field Details
-
THOUSAND
private static final double THOUSAND- See Also:
-
KILO
private static final int KILO- See Also:
-
loaded
private boolean loadedTrue if the repository has already been loaded, false otherwise. -
revisions
ModuleDescriptors stored by ModuleRevisionId -
errors
ModuleRevisionId for which loading was not possible, with corresponding error message. -
modules
List of ModuleDescriptor per ModuleId. -
analyzed
private boolean analyzedTrue when the repository has been analyzed, false otherwise -
cache
Cache from requested module revision id to actual module revision id. -
dependers
list of dependers per ModuleRevisionId. -
searchEngine
-
resolveEngine
-
settings
-
-
Constructor Details
-
RepositoryManagementEngine
public RepositoryManagementEngine(RepositoryManagementEngineSettings settings, SearchEngine searchEngine, ResolveEngine resolveEngine)
-
-
Method Details
-
load
public void load()Loads data from the repository.This method usually takes a long time to proceed. It should never be called from event dispatch thread in a GUI.
-
analyze
public void analyze()Analyze data in the repository.This method may take a long time to proceed. It should never be called from event dispatch thread in a GUI.
- Throws:
IllegalStateException
- if the repository has not been loaded yet- See Also:
-
getRevisionsNumber
public int getRevisionsNumber()Returns the number of Module Revision in the repository.- Returns:
- the number of module revisions in the repository.
- Throws:
IllegalStateException
- if the repository has not been loaded yet- See Also:
-
getModuleIdsNumber
public int getModuleIdsNumber()Returns the number of ModuleId in the repository.- Returns:
- the number of ModuleId in the repository.
- Throws:
IllegalStateException
- if the repository has not been loaded yet- See Also:
-
getOrphans
Returns Module Revisions which have no dependers.- Returns:
- a Collection of the
ModuleRevisionId
of module revisions which have no dependers in the repository. - Throws:
IllegalStateException
- if the repository has not been analyzed yet- See Also:
-
searchModules
-
getDependency
-
getDependers
-
loadModuleRevision
- Throws:
Exception
-
getAllRevisions
-
newResolveData
-
ensureAnalyzed
private void ensureAnalyzed() -
ensureLoaded
private void ensureLoaded()
-