M - the specific model typeclass ModelRepository<M extends IModel> extends java.lang.Object implements IModelManagementRepository<M>, IModelRepository<M>
ModelManagement.
However, there are some methods that shall not directly be public in ModelManagement and
are, thus, hidden via delegation.| Modifier and Type | Field and Description |
|---|---|
private ModelManagement<M> |
modelMgmt |
| Constructor and Description |
|---|
ModelRepository(ModelManagement<M> modelMgmt)
Creates a model repository.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearLocation(java.io.File file,
ProgressObserver observer)
Removes a file location, i.e. a location from where models can be loaded.
|
java.util.List<VersionedModelInfos<M>> |
getAvailable(java.lang.String name)
Returns models available for a given model
name. |
ModelLocations.Location |
getLocationFor(java.net.URI uri)
Returns the location for
uri. |
ModelInfo<M> |
getModelInfo(java.lang.String name,
Version version,
java.net.URI uri)
Returns a known model information object via its URI.
|
ModelInfo<M> |
getResolvedModelInfo(M model)
Returns the model information object for the given model by considering resolved
models.
|
boolean |
isOutdated(ModelInfo<M> info)
Returns whether a model information is outdated.
|
M |
load(ModelInfo<M> info,
ImportResolver<M> resolver,
java.util.List<IMessage> messages)
Loads the model related to
info with the given import resolver. |
M |
load(ModelInfo<M> info,
java.util.List<IMessage> messages)
Loads the model related to
info with a new default import resolver. |
ModelLoaders<M> |
loaders()
Returns the loaders.
|
void |
updateForLoader(IModelLoader<M> loader,
ProgressObserver observer)
Registers a model loader and updates the model information
provided by the loader.
|
void |
updateModelInformation(java.io.File file,
ProgressObserver observer)
Updates the model information in
file. |
private ModelManagement<M extends IModel> modelMgmt
ModelRepository(ModelManagement<M> modelMgmt)
modelMgmt - the model management instance to delegate topublic java.util.List<VersionedModelInfos<M>> getAvailable(java.lang.String name)
IModelRepositoryname.getAvailable in interface IModelRepository<M extends IModel>name - the name to search forpublic boolean isOutdated(ModelInfo<M> info)
IModelRepositoryisOutdated in interface IModelRepository<M extends IModel>info - the object to be testedtrue if it is outdated, false elsepublic M load(ModelInfo<M> info, java.util.List<IMessage> messages)
IModelRepositoryinfo with a new default import resolver.load in interface IModelRepository<M extends IModel>info - the model info to load the model formessages - the messages collected so far (modified as a side effect)public M load(ModelInfo<M> info, ImportResolver<M> resolver, java.util.List<IMessage> messages)
IModelRepositoryinfo with the given import resolver.load in interface IModelRepository<M extends IModel>info - the model info to load the model forresolver - the import resolver to use (null for a new default resolver)messages - the messages collected so far (modified as a side effect)public ModelInfo<M> getModelInfo(java.lang.String name, Version version, java.net.URI uri)
IModelRepositorygetModelInfo in interface IModelRepository<M extends IModel>name - the name of the model to search forversion - the version of the model to search foruri - the URI to search forpublic void updateModelInformation(java.io.File file,
ProgressObserver observer)
throws ModelManagementException
file.updateModelInformation in interface IModelManagementRepository<M extends IModel>file - the location folder to searchobserver - an optional progress observer (use ProgressObserver.NO_OBSERVER but
not null in case that no observation is intended)ModelManagementException - in case that the available information
may be come inconsistent due to this updatepublic void updateForLoader(IModelLoader<M> loader, ProgressObserver observer) throws ModelManagementException
updateForLoader in interface IModelManagementRepository<M extends IModel>loader - the model loader (must not be null)observer - an optional progress observer (use ProgressObserver.NO_OBSERVER but
not null in case that no observation is intended)ModelManagementException - in case that the loader aims at loading
inconsistent informationpublic ModelLocations.Location getLocationFor(java.net.URI uri)
uri.getLocationFor in interface IModelRepository<M extends IModel>uri - the URI to search forpublic ModelLoaders<M> loaders()
loaders in interface IModelManagementRepository<M extends IModel>public void clearLocation(java.io.File file,
ProgressObserver observer)
clearLocation in interface IModelManagementRepository<M extends IModel>file - the file location (null is ignored)observer - an optional progress observer (use ProgressObserver.NO_OBSERVER but
not null in case that no observation is intended)public ModelInfo<M> getResolvedModelInfo(M model)
getResolvedModelInfo in interface IModelManagementRepository<M extends IModel>model - the model to search an information object for which resolves modelCopyright © 2009 - 2018 SSE. All Rights Reserved.