public abstract class EntityMapping extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Reference |
igcEntity |
protected Reference |
igcEntityAlternative |
protected IGCOMRSMetadataCollection |
igcomrsMetadataCollection |
protected IGCOMRSRepositoryConnector |
igcomrsRepositoryConnector |
protected ArrayList<Classification> |
omrsClassifications |
protected EntityDetail |
omrsDetail |
protected ArrayList<Relationship> |
omrsRelationships |
protected EntitySummary |
omrsSummary |
protected String |
userId |
| Constructor and Description |
|---|
EntityMapping(IGCOMRSRepositoryConnector igcomrsRepositoryConnector,
String igcAssetType,
String igcAssetTypeDisplayName,
String omrsTypeDefName,
String userId,
String igcRidPrefix) |
| Modifier and Type | Method and Description |
|---|---|
void |
addClassificationMapper(ClassificationMapping classificationMapping)
Add the provided classification mapping as one that describes classifications for this entity.
|
void |
addComplexIgcProperty(String igcPropertyName)
Note the provided IGC property name as requiring more than a simple one-to-one mapping to an OMRS property.
|
void |
addComplexOmrsProperty(String omrsPropertyName)
Note the provided OMRS property name as requiring more than a simple one-to-one mapping to an IGC property.
|
void |
addOtherIGCAssetType(String igcAssetTypeName)
Add any other IGC asset type needed for this mapping.
|
void |
addRelationshipMapper(RelationshipMapping relationshipMapping)
Add the provided relationship mapping as one that describes relationships for this entity.
|
void |
addSimplePropertyMapping(String igcPropertyName,
String omrsPropertyName)
Add a simple one-to-one property mapping between an IGC property and an OMRS property.
|
void |
addSupportedStatus(InstanceStatus status)
Add the provided status as one supported by this entity mapping.
|
protected abstract void |
complexPropertyMappings(InstanceProperties instanceProperties)
This method needs to be implemented to define any complex property mapping logic, if any.
|
Reference |
getBaseIgcAssetFromAlternative(Reference otherAsset)
Retrieve the base IGC asset expected for the mapper from one of its alternative assets.
|
List<ClassificationMapping> |
getClassificationMappers()
Retrieve the classification mappings for this entity.
|
String |
getIgcAssetType()
Retrieve the primary IGC asset type used by this mapping.
|
String |
getIgcAssetTypeDisplayName()
Retrieve the display name of the primary IGC asset type used by this mapping.
|
Class |
getIgcPOJO()
Retrieve the POJO used to translate the IGC REST API's JSON representation into a Java object.
|
String |
getIgcRidPrefix()
Retrieves the IGC Repository ID (RID) prefix required by this entity, if any (or null if none is needed).
|
String |
getOmrsTypeDefName()
Retrieves the name of the OMRS TypeDef that this mapping translates IGC objects into.
|
List<String> |
getOtherIGCAssetTypes()
Retrieve listing of any additional IGC asset types needed by this mapping.
|
List<Class> |
getOtherIGCPOJOs()
Retrieve listing of any additional IGC POJOs needed by this mapping.
|
PropertyMappingSet |
getPropertyMappings()
Retrieve the set of property mappings that are defined by this Mapper.
|
List<RelationshipMapping> |
getRelationshipMappers()
Retrieve the relationship mappings for this entity.
|
List<InstanceStatus> |
getSupportedStatuses()
Retrieve the list of statuses that are supported by the entity mapping.
|
boolean |
igcRidNeedsPrefix()
Indicates whether the IGC Repository ID (RID) requires a prefix (true) or not (false).
|
protected void |
mapIGCToOMRSEntityDetail()
Utility function to initalize an EntityDetail object based on the initialized IGC entity.
|
protected void |
mapIGCToOMRSEntitySummary()
Utility function to initialize an EntitySummary object based on the initialized IGC entity.
|
boolean |
matchesAssetType(String igcAssetType)
Indicates whether this entity mapping matches the provided IGC asset type: that is, this mapping
can be used to translate to the provided IGC asset type.
|
protected IGCOMRSRepositoryConnector igcomrsRepositoryConnector
protected IGCOMRSMetadataCollection igcomrsMetadataCollection
protected String userId
protected Reference igcEntity
protected Reference igcEntityAlternative
protected EntitySummary omrsSummary
protected EntityDetail omrsDetail
protected ArrayList<Classification> omrsClassifications
protected ArrayList<Relationship> omrsRelationships
public void addSupportedStatus(InstanceStatus status)
status - a status that is supported by the mappingpublic List<InstanceStatus> getSupportedStatuses()
List<InstanceStatus>public String getIgcAssetType()
public String getIgcAssetTypeDisplayName()
public Class getIgcPOJO()
public boolean igcRidNeedsPrefix()
getIgcRidPrefix()public String getIgcRidPrefix()
igcRidNeedsPrefix()public String getOmrsTypeDefName()
public boolean matchesAssetType(String igcAssetType)
igcAssetType - the IGC asset type to check the mapping againstpublic void addOtherIGCAssetType(String igcAssetTypeName)
igcAssetTypeName - name of additional IGC assetpublic List<String> getOtherIGCAssetTypes()
List<String>public List<Class> getOtherIGCPOJOs()
List<Class>public Reference getBaseIgcAssetFromAlternative(Reference otherAsset)
otherAsset - the alternative asset to translate into a base assetpublic final void addSimplePropertyMapping(String igcPropertyName, String omrsPropertyName)
igcPropertyName - the IGC property name to be mappedomrsPropertyName - the OMRS property name to be mappedpublic final void addComplexIgcProperty(String igcPropertyName)
igcPropertyName - the IGC property namepublic final void addComplexOmrsProperty(String omrsPropertyName)
omrsPropertyName - the OMRS property namepublic PropertyMappingSet getPropertyMappings()
public final void addRelationshipMapper(RelationshipMapping relationshipMapping)
relationshipMapping - public List<RelationshipMapping> getRelationshipMappers()
List<RelationshipMapping>public final void addClassificationMapper(ClassificationMapping classificationMapping)
classificationMapping - public List<ClassificationMapping> getClassificationMappers()
List<ClassificationMapping>protected abstract void complexPropertyMappings(InstanceProperties instanceProperties)
instanceProperties - the instance properties to which to add the complex-mapped propertiesprotected final void mapIGCToOMRSEntitySummary()
protected final void mapIGCToOMRSEntityDetail()
Copyright © 2018–2019 ODPi. All rights reserved.