Package overit.geocall.edm.registry
Class EDMRegistry
java.lang.Object
overit.geocall.edm.registry.EDMRegistry
Service responsible for managing the registry of EDM (Extensible Data Model) entities.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEDMRegistry(DataEntityFactory dataEntityFactory, EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionvoidclearEntities(@NotNull Company company) Clears all entities associated with a company.Returns aList<DataAttribute> configured for theDataEntitys associated to the providedentityClassesandcompany.getAllDataAttributes(@NotNull String extendedColumn, @NotNull Company company) Returns aList<DataAttribute> configured for theDataEntitys associated to the providedextendedColumnandcompany.Returns aList<DataAttribute> configured for theDataEntitys associated to the providedentitiesandcompany.getAllDataAttributes(@NotNull Attribute extendedAttribute, @NotNull Company company) Returns aList<DataAttribute> configured for theDataEntitys associated to the providedextendedAttributeandcompany.getAllDataAttributesByAttributeName(@NotNull Class<? extends Entity>[] entityClasses, @NotNull String attributeName, @NotNull Company company) Returns aList<DataAttribute> configured for theDataEntitys associated to the providedentityClasses,attributeNameandcompany.Retrieves aList<DataEntity> by entities and company.Retrieves allDataEntityinstances associated with the provided tables andCompany.getDataEntityByName(@NotNull String name, @NotNull Company company) Retrieves a DataEntity by name and company.booleanisExtendedAttribute(@NotNull String extendedAttribute, @NotNull List<DataAttribute> dataAttributes, @NotNull Company company) Returnstruein case the providedextendedAttributewas recognized as anEDMextended attribute;falseotherwise.booleanisExtendedColumn(@NotNull String column, @NotNull Company company) Returnstruein case the column identified by the providedcolumnis extended for the providedCompany;falseotherwise.booleanvoidRegisters aEntity.
-
Field Details
-
EXTENDED_COLUMN_SUFFIX
- See Also:
-
-
Constructor Details
-
EDMRegistry
-
-
Method Details
-
getDataEntityByName
public DataEntity getDataEntityByName(@NotNull @NotNull String name, @NotNull @NotNull Company company) Retrieves a DataEntity by name and company.- Parameters:
name- The name of the DataEntity to retrieve.company- The company associated with the DataEntity.- Returns:
- the DataEntity with the specified name for the given company
- Throws:
NullPointerException- if name or company is null
-
getDataEntities
public List<DataEntity> getDataEntities(@NotNull @NotNull Class<? extends Entity>[] entities, @NotNull @NotNull Company company) Retrieves aList<DataEntity> by entities and company.- Parameters:
entities- the models array of theDataEntityto retrieve.company- the company associated with theDataEntitys to return.- Returns:
- the
List<DataEntity> by entities and company. - Throws:
NullPointerException- if entities or company are null.
-
getEntities
-
getDataEntitiesByTables
public List<DataEntity> getDataEntitiesByTables(@NotNull @NotNull Set<String> tables, @NotNull @NotNull Company company) Retrieves allDataEntityinstances associated with the provided tables andCompany.- Parameters:
tables- to retrieve models for.company- TheCompanyto retrieve models for.- Returns:
- A set of
DataEntityinstances associated with the providedCompany.
-
getAllDataAttributes
public List<DataAttribute> getAllDataAttributes(@NotNull @NotNull Class<? extends Entity>[] entityClasses, @NotNull @NotNull Company company) Returns aList<DataAttribute> configured for theDataEntitys associated to the providedentityClassesandcompany.- Parameters:
entityClasses- the array ofClass<Entity> about the models from which retrieve all configuredDataAttributes.company- theCompanyassociated with the retrievedDataAttributes.- Returns:
- a
List<DataAttribute> configured for theDataEntitys associated to the providedentityClassesandcompany. - Throws:
NullPointerException- if entityClasses or company are null.
-
getAllDataAttributes
public List<DataAttribute> getAllDataAttributes(@NotNull @NotNull List<Entity> entities, @NotNull @NotNull Company company) Returns aList<DataAttribute> configured for theDataEntitys associated to the providedentitiesandcompany.- Parameters:
entities-List<Entity> about the entities from which retrieve all configuredDataAttributes.company-Companyassociated with the retrievedDataAttributes.- Returns:
- a
List<DataAttribute> configured for theDataEntitys associated to the providedentitiesandcompany. - Throws:
NullPointerException- if entities or company are null.
-
getAllDataAttributesByAttributeName
public List<DataAttribute> getAllDataAttributesByAttributeName(@NotNull @NotNull Class<? extends Entity>[] entityClasses, @NotNull @NotNull String attributeName, @NotNull @NotNull Company company) Returns aList<DataAttribute> configured for theDataEntitys associated to the providedentityClasses,attributeNameandcompany.- Parameters:
entityClasses- the array ofClass<Entity> about the models from which retrieve all configuredDataAttributes.attributeName-Stringabout the attribute name.company- theCompanyassociated with the retrievedDataAttributes.- Returns:
- a
List<DataAttribute> configured for theDataEntitys associated to the providedentityClasses,attributeNameandcompany. - Throws:
NullPointerException- if entityClasses or company are null.
-
getAllDataAttributes
public List<DataAttribute> getAllDataAttributes(@NotNull @NotNull Attribute extendedAttribute, @NotNull @NotNull Company company) Returns aList<DataAttribute> configured for theDataEntitys associated to the providedextendedAttributeandcompany.- Parameters:
extendedAttribute-Attributeabout the extended attribute.company- theCompanyassociated with the retrievedDataAttributes.- Returns:
- a
List<DataAttribute> configured for theDataEntitys associated to the providedextendedAttributeandcompany. - Throws:
NullPointerException- if entityClasses or company are null.
-
getAllDataAttributes
public List<DataAttribute> getAllDataAttributes(@NotNull @NotNull String extendedColumn, @NotNull @NotNull Company company) Returns aList<DataAttribute> configured for theDataEntitys associated to the providedextendedColumnandcompany.- Parameters:
extendedColumn-Stringabout the extended column name.company- theCompanyassociated with the retrievedDataAttributes.- Returns:
- a
List<DataAttribute> configured for theDataEntitys associated to the providedextendedColumnandcompany. - Throws:
NullPointerException- if entityClasses or company are null.
-
clearEntities
Clears all entities associated with a company.- Parameters:
company- The company to clear entities for.
-
register
Registers aEntity.- Parameters:
entity- TheEntityto register.- Throws:
EDMConfigurationException- if a model with the same name is already registered.
-
isExtendedColumn
Returnstruein case the column identified by the providedcolumnis extended for the providedCompany;falseotherwise. -
isExtendedColumn
public boolean isExtendedColumn(@NotNull @NotNull String column, @NotNull @NotNull Company company, List<Entity> entities) Returnstruein case the column identified by the providedcolumnis extended for the providedCompanyand list ofEntitys;falseotherwise.- Parameters:
column-Stringabout the column name filter.company-Companyabout the company filter.entities-List<Entity> about theEDMconfiguration defined for the provided company.- Returns:
truein case the column identified by the providedcolumnis extended for the providedCompanyand list ofEntitys;falseotherwise.
-
isExtendedAttribute
public boolean isExtendedAttribute(@NotNull @NotNull String extendedAttribute, @NotNull @NotNull List<DataAttribute> dataAttributes, @NotNull @NotNull Company company) Returnstruein case the providedextendedAttributewas recognized as anEDMextended attribute;falseotherwise.- Parameters:
extendedAttribute-Stringabout the potentialEDMextended attribute to check.dataAttributes-List<DataAttribute> about the possibleEDMdata attributes.- Returns:
truein case the providedextendedAttributewas recognized as anEDMextended attribute;falseotherwise.
-