M - the specific type of modelpublic class AvailableModels<M extends IModel>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.String,java.util.List<VersionedModelInfos<M>>> |
availableModels |
private java.util.Map<java.net.URI,ModelInfo<M>> |
tmpInfo |
| Constructor and Description |
|---|
AvailableModels(IModelManagementRepository<M> repository)
Creates an instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
clear()
Clears all loaded model infos.
|
ModelInfo<M> |
createTempInfo(M model,
java.net.URI location)
Creates a temporary resolved model information without model loader.
|
(package private) java.util.List<VersionedModelInfos<M>> |
getAvailable(java.lang.String name)
Returns models available for a given model
name. |
ModelInfo<M> |
getInfo(java.net.URI uri)
Returns the (visible) information object at
uri. |
M |
getModel(java.lang.String name,
java.lang.String version,
java.net.URI uri)
Returns a known model object via its URI.
|
M |
getModel(java.lang.String name,
Version version,
java.net.URI uri)
Returns a known model object via its URI.
|
ModelInfo<M> |
getModelInfo(M model)
Returns the model information object for the specified model.
|
ModelInfo<M> |
getModelInfo(ModelInfo<M> info)
Returns the matching available model information instance.
|
java.util.List<ModelInfo<M>> |
getModelInfo(java.lang.String name)
Returns all known model information objects for the specified model.
|
java.util.List<ModelInfo<M>> |
getModelInfo(java.lang.String name,
java.lang.String version)
Returns the model information object for the specified model.
|
ModelInfo<M> |
getModelInfo(java.lang.String name,
java.lang.String version,
java.net.URI uri)
Returns a known model information object via its URI.
|
java.util.List<ModelInfo<M>> |
getModelInfo(java.lang.String name,
Version version)
Returns the model information objects for the specified model.
|
ModelInfo<M> |
getModelInfo(java.lang.String name,
Version version,
java.net.URI uri)
Returns a known model information object via its URI.
|
int |
getModelInfoCount(boolean differURIs)
Returns the number of different model information objects known in this class.
|
java.util.List<ModelInfo<M>> |
getModelInfos(M model)
Returns the model information objects for the specified model.
|
(package private) java.util.List<ModelInfo<M>> |
getModelInfoWith(java.net.URI uri)
Returns the available model information objects which are located at
uri. |
ModelInfo<M> |
getResolvedModelInfo(M model)
Returns the model information object for the given model by considering resolved
models.
|
ModelInfo<M> |
getResolvedModelInfo(M model,
java.net.URI uri)
Returns the model information object for
model while considering
uri as location of model. |
java.util.List<ModelInfo<M>> |
getVisibleModelInfo(java.lang.String name,
java.net.URI uri)
Returns the available model information objects which are available for and
visible from the given URI, i.e. either same path, containing or contained path.
|
java.util.List<ModelInfo<M>> |
getVisibleModelInfo(java.lang.String name,
Version version,
java.net.URI uri)
Returns the available model information objects which are available for and
visible from the given URI, i.e. either same path, containing or contained path.
|
java.util.List<ModelInfo<M>> |
getVisibleModelInfo(java.net.URI uri)
Returns the available model information objects which are available for and
visible from the given URI, i.e. either same path, containing or contained path.
|
boolean |
hasModelInfo(java.lang.String name)
Returns whether there are known model information objects for the specified model.
|
boolean |
isTempInfo(ModelInfo<M> info)
Returns whether
info is a temporary model. |
(package private) void |
putAvailable(java.lang.String name,
java.util.List<VersionedModelInfos<M>> infos)
Puts available model information objects for a given model name.
|
void |
releaseTempInfo(ModelInfo<M> info)
Releases a temporary model information object.
|
(package private) void |
removeAvailable(ModelInfo<M> info)
Removes a model information object for a given information object.
|
(package private) void |
removeAvailable(java.lang.String name)
Removes a model information object for a given model name.
|
(package private) boolean |
updateAvailableModel(ModelInfo<M> info)
Updates the list of available models.
|
(package private) java.util.Collection<java.util.List<VersionedModelInfos<M>>> |
versionedModelInfos()
Returns all versioned model information objects.
|
private java.util.Map<java.lang.String,java.util.List<VersionedModelInfos<M extends IModel>>> availableModels
AvailableModels(IModelManagementRepository<M> repository)
repository - the underlying repository instancevoid clear()
java.util.Collection<java.util.List<VersionedModelInfos<M>>> versionedModelInfos()
boolean updateAvailableModel(ModelInfo<M> info)
info - the model information to be added/updatedtrue in case of inconsistencies, falsepublic int getModelInfoCount(boolean differURIs)
differURIs - if the result should count different URIs or just different versionspublic ModelInfo<M> getInfo(java.net.URI uri)
uri.uri - the URI to look forpublic java.util.List<ModelInfo<M>> getVisibleModelInfo(java.net.URI uri)
uri - the URI to matchuripublic java.util.List<ModelInfo<M>> getVisibleModelInfo(java.lang.String name, Version version, java.net.URI uri)
name - the name of the model (may be null but then version is ignored and all
visible model information objects are returned as done in getVisibleModelInfo(URI)).version - the version of the model (may be null)uri - the URI to matchuripublic java.util.List<ModelInfo<M>> getVisibleModelInfo(java.lang.String name, java.net.URI uri)
name - the name of the model (may be null but then version is ignored and all
visible model information objects are returned as done in getVisibleModelInfo(URI)).uri - the URI to matchurijava.util.List<ModelInfo<M>> getModelInfoWith(java.net.URI uri)
uri.uri - the URI to matchuripublic ModelInfo<M> getResolvedModelInfo(M model, java.net.URI uri)
model while considering
uri as location of model. This method emulates an import.model - the model to search the info foruri - the URI to consider as starting pointpublic ModelInfo<M> getResolvedModelInfo(M model)
model - the model to search an information object for which resolves modelpublic ModelInfo<M> getModelInfo(java.lang.String name, Version version, java.net.URI uri)
name - the name of the model to search forversion - the version of the model to search foruri - the URI to search forpublic java.util.List<ModelInfo<M>> getModelInfo(java.lang.String name, Version version)
name - the name of the model to search forversion - the version of the model to search forpublic java.util.List<ModelInfo<M>> getModelInfos(M model)
model, all those with matching name / version
will be returned.model - the model to search forpublic ModelInfo<M> getModelInfo(M model)
model - the model to search formodel, null if unknownpublic java.util.List<ModelInfo<M>> getModelInfo(java.lang.String name, java.lang.String version) throws VersionFormatException
name - the name of the model to search forversion - the version of the model to search forVersionFormatException - in case of an erroneous version stringpublic boolean hasModelInfo(java.lang.String name)
name - the name of the modeltrue if model information is known (at least on model but
multiple in different versions may exist), false elsepublic java.util.List<ModelInfo<M>> getModelInfo(java.lang.String name)
name - the name of the modelpublic ModelInfo<M> getModelInfo(ModelInfo<M> info)
info - the information object to be internalizedpublic M getModel(java.lang.String name, java.lang.String version, java.net.URI uri) throws VersionFormatException
name - the name of the model to search forversion - the version of the model to search foruri - the URI to search forVersionFormatException - in case that version is in wrong format
(see Versionpublic M getModel(java.lang.String name, Version version, java.net.URI uri) throws VersionFormatException
name - the name of the model to search forversion - the version of the model to search foruri - the URI to search forVersionFormatException - in case that version is in wrong format
(see Versionpublic ModelInfo<M> getModelInfo(java.lang.String name, java.lang.String version, java.net.URI uri) throws VersionFormatException
name - the name of the model to search forversion - the version of the model to search foruri - the URI to search forVersionFormatException - in case that version is in wrong format
(see Versionjava.util.List<VersionedModelInfos<M>> getAvailable(java.lang.String name)
name.name - the name to search forvoid putAvailable(java.lang.String name,
java.util.List<VersionedModelInfos<M>> infos)
name - the name of the modelinfos - the associated model information objectsvoid removeAvailable(java.lang.String name)
name - the name of the modelvoid removeAvailable(ModelInfo<M> info)
info - the information objectpublic ModelInfo<M> createTempInfo(M model, java.net.URI location)
releaseTempInfo(ModelInfo) if the model
is not used anymore. Affects only getInfo(URI).model - the modellocation - the locationpublic void releaseTempInfo(ModelInfo<M> info)
info - the information object to release (may be null, ignored)Copyright © 2009 - 2018 SSE. All Rights Reserved.