|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IRuntimeRepository
The runtime repository gives access to the information about products, enums and tables.
| Method Summary | ||
|---|---|---|
void |
addDirectlyReferencedRepository(IRuntimeRepository repository)
Adds a repository this repository depends on because the one to add contains product data that is referenced from this repository. |
|
void |
addEnumValueLookupService(IEnumValueLookupService<?> lookupService)
Adds the service to lookup enumeration values for the enumeration type specified by IEnumValueLookupService.getEnumTypeClass(). |
|
List<IpsTest2> |
getAllIpsTestCases(IRuntimeRepository runtimeRepository)
Returns a list of all test cases stored in the repository and all repositories this one references. |
|
Set<String> |
getAllModelTypeImplementationClasses()
Returns a set containing the Java Class names of the implementation classes for all model types available in this repository (either directly or via a referenced repository). |
|
List<String> |
getAllProductComponentIds()
Returns a list of the IDs of all product components held by this repository or any dependent repository. |
|
List<IProductComponent> |
getAllProductComponents()
Returns all product components available in this repository. |
|
|
getAllProductComponents(Class<T> productComponentType)
Returns all product components that are instances of the indicated class. |
|
List<IProductComponent> |
getAllProductComponents(String kindId)
Returns all product components that belong to the indicated product component kind. |
|
List<IRuntimeRepository> |
getAllReferencedRepositories()
Returns all repositories this one depends on directly or indirectly. |
|
List<ITable> |
getAllTables()
Returns all tables available in this repository. |
|
ClassLoader |
getClassLoader()
Returns the class loader that is used to load Java classes by this repository. |
|
|
getCustomRuntimeObject(Class<T> type,
String qName)
Returns a object of type T, identified by it's qualified name, or null if no
such object exists in this repository or it's referenced repositories. |
|
List<IRuntimeRepository> |
getDirectlyReferencedRepositories()
Returns the runtime repositories this one directly depends on. |
|
|
getEnumValue(Class<T> clazz,
Object id)
Returns the enumeration value for the provided enumeration class and string representation of the value. |
|
Object |
getEnumValue(String uniqueId)
Deprecated. This method does only return valid enums if the id attribute of the enum is of type String. You should never use this method! Use
getEnumValue(Class, Object) instead. This method may be returned in
future releases. |
|
|
getEnumValueLookupService(Class<T> enumClazz)
Returns the lookup service for the given enumeration type. |
|
|
getEnumValues(Class<T> clazz)
Returns the type safe List of enumeration values of the provided faktor ips generated
enumeration class. |
|
IProductComponent |
getExistingProductComponent(String id)
Returns the product component identified by the given id. |
|
IProductComponentGeneration |
getExistingProductComponentGeneration(String id,
Calendar effectiveDate)
Returns the product component generation identified by the id and the effective date. |
|
IFormulaEvaluatorFactory |
getFormulaEvaluatorFactory()
Getting a formula evaluator factory to create a new formula evaluator. |
|
IpsTest2 |
getIpsTest(String qName)
Returns the test (either test case or suite) for the given qualified name. |
|
IpsTest2 |
getIpsTest(String qName,
IRuntimeRepository runtimeRepository)
Returns the test (either test case or suite) for the given qualified name. |
|
IpsTestCaseBase |
getIpsTestCase(String qName)
Returns the test case for the given qualified name. |
|
IpsTestCaseBase |
getIpsTestCase(String qName,
IRuntimeRepository runtimeRepository)
Returns the test case for the given qualified name. |
|
List<IpsTest2> |
getIpsTestCasesStartingWith(String qNamePrefix,
IRuntimeRepository runtimeRepository)
Returns a list of test cases starting with the given qualified name prefix stored in the repository and all repositories this one references. |
|
IpsTestSuite |
getIpsTestSuite(String qNamePrefix)
Returns a test suite that contains all tests that have qualified names starting with the given prefix. |
|
IpsTestSuite |
getIpsTestSuite(String qNamePrefix,
IRuntimeRepository runtimeRepository)
Returns a test suite that contains all tests that have qualified names starting with the given prefix. |
|
IProductComponentGeneration |
getLatestProductComponentGeneration(IProductComponent productCmpt)
Returns the latest product component generation of the provided product component. |
|
IModelType |
getModelType(Class<?> modelObjectClass)
Returns the IModelType containing the meta information for the given model
object class. |
|
IModelType |
getModelType(IModelObject modelObject)
Returns the IModelType containing the meta information for the given model
object. |
|
IModelType |
getModelType(IProductComponent productComponent)
Returns the IModelType containing the meta information for the given product
component. |
|
String |
getName()
Returns the repository's name. |
|
IProductComponentGeneration |
getNextProductComponentGeneration(IProductComponentGeneration generation)
Returns the product component generation that follows the provided generation with respect to its valid from date. |
|
int |
getNumberOfProductComponentGenerations(IProductComponent productCmpt)
Returns the number of product component generations of the provided product component. |
|
IProductComponentGeneration |
getPreviousProductComponentGeneration(IProductComponentGeneration generation)
Returns the product component generation that is prior to the provided generation with respect to its valid from date. |
|
IProductComponent |
getProductComponent(String id)
Returns the product component identified by the given id. |
|
IProductComponent |
getProductComponent(String kindId,
String versionId)
Returns the product component identified by the given KindId and versionId. |
|
IProductComponentGeneration |
getProductComponentGeneration(String id,
Calendar effectiveDate)
Returns the product component generation identified by the id and the effective date. |
|
List<IProductComponentGeneration> |
getProductComponentGenerations(IProductComponent productCmpt)
Returns all product component generations for the given product component. |
|
IRuntimeRepositoryLookup |
getRuntimeRepositoryLookup()
Returns the IRuntimeRepositoryLookup that was previously set using
setRuntimeRepositoryLookup(IRuntimeRepositoryLookup). |
|
|
getTable(Class<T> tableClass)
Returns the table contents for the given table class. |
|
ITable |
getTable(String qualifiedTableName)
Returns the table contents for the given qualified table name. |
|
boolean |
isModifiable()
Returns true if the repository's content is modifiable. |
|
JAXBContext |
newJAXBContext()
Creates a new JAXBContext that can marshall / unmarshall all modell classes defined in the given repository. |
|
void |
removeEnumValueLookupService(IEnumValueLookupService<?> lookupService)
Removes the lookup service registered for the given enumeration type. |
|
void |
setRuntimeRepositoryLookup(IRuntimeRepositoryLookup repositoryLookup)
Setting a IRuntimeRepositoryLookup is needed to enable serialization of policy
components. |
|
| Method Detail |
|---|
String getName()
void addDirectlyReferencedRepository(IRuntimeRepository repository)
getProductComponent(..) include all repositories this one depends on in their
search.
repository - The repository to add.
NullPointerException - if repository is null.List<IRuntimeRepository> getDirectlyReferencedRepositories()
List<IRuntimeRepository> getAllReferencedRepositories()
IProductComponent getProductComponent(String id)
null if the id
is null or no component with the indicated id can be found.
Note
How the product component id is structured, is defined as part of the ips project. The definition is called a product component naming (and identification) strategy. The standard strategy is to use the id of the product component kind followed by a separator followed by component's versionId. However it is possible to use completly different strategies for example to create numeric identifiers to reduce the size of indices in a datatbase. In the latter case the product component id can't be derived from the product component kind id and it's version id.
id - The id of the product component to find.
null.IProductComponent getExistingProductComponent(String id)
id - The id of the product component to find.
ProductCmptNotFoundException - if no product component with the given id exists.getProductComponent(String)
IProductComponent getProductComponent(String kindId,
String versionId)
null the most recent version is returned. Returns null if the
kindId is null or no component with the indicated kindId and versionId can be
found.
kindId - The product component kind id, e.g. CollisionCoverageversionId - The versionId to find, e.g. 2005-01
null.List<IProductComponent> getAllProductComponents(String kindId)
null or no component with the indicated kind
is found.
kindId - The product component kind id, e.g. CollisionCoverage<T> List<T> getEnumValues(Class<T> clazz)
List of enumeration values of the provided faktor ips generated
enumeration class. This method is only relevant for faktor ips enumerations whose values are
deferred to a content that is hold by this repository.
clazz - the enumeration class upon which the list of enumeration values is returned
<T> T getEnumValue(Class<T> clazz,
Object id)
null will be returned. If the provided class cannot be recognized as a faktor
ips enumeration null will be returned. This method is only relevant for faktor
ips enumerations whose values are deferred to a content that is hold by this repository.
clazz - The enumeration class upon which the enumeration value is returnedid - The enum value's identification@Deprecated Object getEnumValue(String uniqueId)
String. You should never use this method! Use
getEnumValue(Class, Object) instead. This method may be returned in
future releases.
void addEnumValueLookupService(IEnumValueLookupService<?> lookupService)
IEnumValueLookupService.getEnumTypeClass(). If a service is already registered for
the enumeration type, the new service replaces the old one.
lookupService - The new lookup service.<T> IEnumValueLookupService<T> getEnumValueLookupService(Class<T> enumClazz)
null if no
service is registered for the given type.
void removeEnumValueLookupService(IEnumValueLookupService<?> lookupService)
IProductComponentGeneration getProductComponentGeneration(String id,
Calendar effectiveDate)
null if either the id is null, the effectiveDate is
nullor no generation with the indicated id can be found or the product component
hasn't got a generation that is effective on the given date.
id - The product component's id.effectiveDate - The process' effective date
null.
IProductComponentGeneration getExistingProductComponentGeneration(String id,
Calendar effectiveDate)
id - The product component's id.effectiveDate - The process' effective date
ProductCmptGenerationNotFoundException - if no generation for the given effectiveDate.getProductComponentGeneration(String, Calendar)<T extends IProductComponent> List<T> getAllProductComponents(Class<T> productComponentType)
List<IProductComponent> getAllProductComponents()
Note that this is an expensive operation as all components have to be loaded into memory.
List<IProductComponentGeneration> getProductComponentGenerations(IProductComponent productCmpt)
The generations are ordered by valid from date in reverse order that means the latest generation (latest valid from date) is the first one, the oldest generation is the last one.
int getNumberOfProductComponentGenerations(IProductComponent productCmpt)
IProductComponentGeneration getNextProductComponentGeneration(IProductComponentGeneration generation)
If there is no further generation this method returns null.
IllegalArgumentException - if the given product component generation could not be found
in this repository or in any dependent repository.IProductComponentGeneration getPreviousProductComponentGeneration(IProductComponentGeneration generation)
If there is no previous generation this method returns null.
IllegalArgumentException - if the given product component generation could not be found
in this repository or in any dependent repository.IProductComponentGeneration getLatestProductComponentGeneration(IProductComponent productCmpt)
List<String> getAllProductComponentIds()
List<ITable> getAllTables()
Note that this is an expensive operation as all tables have to be loaded into memory.
<T extends ITable> T getTable(Class<T> tableClass)
ITable getTable(String qualifiedTableName)
List<IpsTest2> getAllIpsTestCases(IRuntimeRepository runtimeRepository)
List<IpsTest2> getIpsTestCasesStartingWith(String qNamePrefix,
IRuntimeRepository runtimeRepository)
IpsTest2 getIpsTest(String qName)
NullPointerException - if qName is null.
IpsTest2 getIpsTest(String qName,
IRuntimeRepository runtimeRepository)
NullPointerException - if qName is null.getIpsTestCase(java.lang.String)IpsTestCaseBase getIpsTestCase(String qName)
NullPointerException - if qName is null.
IpsTestCaseBase getIpsTestCase(String qName,
IRuntimeRepository runtimeRepository)
NullPointerException - if qName is null.IpsTestSuite getIpsTestSuite(String qNamePrefix)
NullPointerException - if qNamePrefix is null.
IpsTestSuite getIpsTestSuite(String qNamePrefix,
IRuntimeRepository runtimeRepository)
NullPointerException - if qNamePrefix is null.getIpsTestCase(java.lang.String)boolean isModifiable()
true if the repository's content is modifiable. This feature is mainly
targeted for writing test cases that need to setup a repository with a test specific content
programatically. Returns false otherwise.
IModelType getModelType(Class<?> modelObjectClass)
IModelType containing the meta information for the given model
object class.
IModelType getModelType(IModelObject modelObject)
IModelType containing the meta information for the given model
object. This is a convenience method calling getModelType with the model
object's class.
IModelType getModelType(IProductComponent productComponent)
IModelType containing the meta information for the given product
component. This is a convenience method calling getModelType with the product
component class.
Set<String> getAllModelTypeImplementationClasses()
Returns an empty set if no type is available.
JAXBContext newJAXBContext()
IFormulaEvaluatorFactory getFormulaEvaluatorFactory()
ClassLoader getClassLoader()
<T> T getCustomRuntimeObject(Class<T> type,
String qName)
T, identified by it's qualified name, or null if no
such object exists in this repository or it's referenced repositories. It is up to extensions
to define which types can be found in the repository (e.g. a
AbstractTocBasedRuntimeRepository could define CustomTocEntryObjects for new
types. If there are no objects of the given type, null is returned. If the
IRuntimeRepository implementation does not allow custom types, null is
returned.
type - a class supported by the IRuntimeRepository implementationqName - the qualified name of the object
nullIRuntimeRepositoryLookup getRuntimeRepositoryLookup()
IRuntimeRepositoryLookup that was previously set using
setRuntimeRepositoryLookup(IRuntimeRepositoryLookup). The
IRuntimeRepositoryLookup is used for serialization of policy components especially
for the ProductConfiguration in configured policy components.
IRuntimeRepositoryLookup that is serialized by a
ProductConfiguration and used to load the product component and its
generation after deserialization.IRuntimeRepositoryLookup,
ProductConfigurationvoid setRuntimeRepositoryLookup(IRuntimeRepositoryLookup repositoryLookup)
IRuntimeRepositoryLookup is needed to enable serialization of policy
components. You need to set a IRuntimeRepositoryLookup before you could serialize any
product configured policy component.
repositoryLookup - The IRuntimeRepositoryLookup will provide an instance of this
IRuntimeRepository when deserializing a policy component.IRuntimeRepositoryLookup
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||