@Override void resolveReferencesPhase2(AtlasTypeRegistry typeRegistry) throws AtlasBaseException { super.resolveReferencesPhase2(typeRegistry); for (AtlasEntityType superType : superTypes) { superType.addSubType(this); } for (String superTypeName : allSuperTypes) { AtlasEntityType superType = typeRegistry.getEntityTypeByName(superTypeName); superType.addToAllSubTypes(this); } }
RegistryData() { allTypes = new TypeCache(); enumDefs = new TypeDefCache<>(allTypes); structDefs = new TypeDefCache<>(allTypes); classificationDefs = new TypeDefCache<>(allTypes); entityDefs = new TypeDefCache<>(allTypes); relationshipDefs = new TypeDefCache<>(allTypes); allDefCaches = new TypeDefCache[] { enumDefs, structDefs, classificationDefs, entityDefs, relationshipDefs }; init(); }
@Override public void resolveReferencesPhase2(AtlasTypeRegistry typeRegistry) throws AtlasBaseException { super.resolveReferencesPhase2(typeRegistry); for (String superTypeName : allSuperTypes) { AtlasEntityType superType = typeRegistry.getEntityTypeByName(superTypeName); superType.addSubType(this); } }
void init() { allTypes.addType(new AtlasBuiltInTypes.AtlasBooleanType()); allTypes.addType(new AtlasBuiltInTypes.AtlasByteType()); allTypes.addType(new AtlasBuiltInTypes.AtlasShortType()); allTypes.addType(new AtlasBuiltInTypes.AtlasIntType()); allTypes.addType(new AtlasBuiltInTypes.AtlasLongType()); allTypes.addType(new AtlasBuiltInTypes.AtlasFloatType()); allTypes.addType(new AtlasBuiltInTypes.AtlasDoubleType()); allTypes.addType(new AtlasBuiltInTypes.AtlasBigIntegerType()); allTypes.addType(new AtlasBuiltInTypes.AtlasBigDecimalType()); allTypes.addType(new AtlasBuiltInTypes.AtlasDateType()); allTypes.addType(new AtlasBuiltInTypes.AtlasStringType()); allTypes.addType(new AtlasBuiltInTypes.AtlasObjectIdType()); }
private boolean isRelationshipAttribute(AtlasAttribute attribute) throws AtlasBaseException { boolean ret = true; AtlasType attrType = attribute.getAttributeType(); if (attrType.getTypeCategory() == ARRAY) { attrType = ((AtlasArrayType) attrType).getElementType(); } else if (attrType.getTypeCategory() == MAP) { attrType = ((AtlasMapType) attrType).getValueType(); } if (attrType.getTypeCategory() != OBJECT_ID_TYPE) { ret = false; } return ret; }
@Override void resolveReferencesPhase2(AtlasTypeRegistry typeRegistry) throws AtlasBaseException { super.resolveReferencesPhase2(typeRegistry); for (AtlasClassificationType superType : superTypes) { superType.addSubType(this); } for (String superTypeName : allSuperTypes) { AtlasClassificationType superType = typeRegistry.getClassificationTypeByName(superTypeName); superType.addToAllSubTypes(this); } }
@Override public void resolveReferencesPhase2(AtlasTypeRegistry typeRegistry) throws AtlasBaseException { super.resolveReferencesPhase2(typeRegistry); for (String superTypeName : allSuperTypes) { AtlasClassificationType superType = typeRegistry.getClassificationTypeByName(superTypeName); superType.addSubType(this); } }
private String getCollectionElementType(AtlasType elemType) { if(elemType.getTypeCategory() == TypeCategory.OBJECT_ID_TYPE) { return ((AtlasBuiltInTypes.AtlasObjectIdType)elemType).getObjectType(); } else { return elemType.getTypeName(); } }
private void createTypes(List<? extends AtlasBaseTypeDef> typeDefs) throws AtlasBaseException { AtlasTransientTypeRegistry ttr = typeRegistry.lockTypeRegistryForUpdate(); ttr.addTypes(typeDefs); typeRegistry.releaseTypeRegistryForUpdate(ttr, true); }
private void resolveReferences() throws AtlasBaseException { for (AtlasType type : registryData.allTypes.getAllTypes()) { type.resolveReferences(this); } for (AtlasType type : registryData.allTypes.getAllTypes()) { type.resolveReferencesPhase2(this); } for (AtlasType type : registryData.allTypes.getAllTypes()) { type.resolveReferencesPhase3(this); } }
@Override public boolean validateValueForUpdate(Object obj, String objName, List<String> messages) { boolean ret = true; if (obj != null) { for (AtlasClassificationType superType : superTypes) { ret = superType.validateValueForUpdate(obj, objName, messages) && ret; } ret = validateTimeBoundaries(obj, messages) && ret; ret = super.validateValueForUpdate(obj, objName, messages) && ret; } return ret; }
@Override public boolean validateValueForUpdate(Object obj, String objName, List<String> messages) { boolean ret = true; if (obj != null) { for (AtlasClassificationType superType : superTypes) { ret = superType.validateValueForUpdate(obj, objName, messages) && ret; } ret = super.validateValueForUpdate(obj, objName, messages) && ret; } return ret; }
@Override public void normalizeAttributeValues(Map<String, Object> obj) { if (obj != null) { for (AtlasClassificationType superType : superTypes) { superType.normalizeAttributeValues(obj); } super.normalizeAttributeValues(obj); } }
@Override public boolean isValidValueForUpdate(Object obj) { if (obj != null) { for (AtlasEntityType superType : superTypes) { if (!superType.isValidValueForUpdate(obj)) { return false; } } return super.isValidValueForUpdate(obj); } return true; }
@Override public boolean areEqualValues(Object val1, Object val2) { for (AtlasEntityType superType : superTypes) { if (!superType.areEqualValues(val1, val2)) { return false; } } return super.areEqualValues(val1, val2); }
public void normalizeAttributeValuesForUpdate(AtlasClassification classification) { if (classification != null) { for (AtlasClassificationType superType : superTypes) { superType.normalizeAttributeValuesForUpdate(classification); } super.normalizeAttributeValuesForUpdate(classification); } }
private String getCollectionElementType(AtlasType elemType) { if(elemType.getTypeCategory() == TypeCategory.OBJECT_ID_TYPE) { return ((AtlasBuiltInTypes.AtlasObjectIdType)elemType).getObjectType(); } else { return elemType.getTypeName(); } }
RegistryData() { allTypes = new TypeCache(); enumDefs = new TypeDefCache<>(allTypes); structDefs = new TypeDefCache<>(allTypes); classificationDefs = new TypeDefCache<>(allTypes); entityDefs = new TypeDefCache<>(allTypes); relationshipDefs = new TypeDefCache<>(allTypes); allDefCaches = new TypeDefCache[] { enumDefs, structDefs, classificationDefs, entityDefs, relationshipDefs }; init(); }