use of org.apache.atlas.model.typedef.AtlasTypesDef in project atlas by apache.
the class RestUtilsTest method convertV1toV2.
private List<AtlasEntityDef> convertV1toV2(List<ClassTypeDefinition> types) throws AtlasBaseException {
List<ClassTypeDefinition> classTypeList = new ArrayList(types);
TypesDef toConvert = new TypesDef(Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), classTypeList);
String json = AtlasType.toV1Json(toConvert);
AtlasTypeRegistry emptyRegistry = new AtlasTypeRegistry();
AtlasTypesDef converted = TypeConverterUtil.toAtlasTypesDef(json, emptyRegistry);
List<AtlasEntityDef> convertedEntityDefs = converted.getEntityDefs();
return convertedEntityDefs;
}
use of org.apache.atlas.model.typedef.AtlasTypesDef in project atlas by apache.
the class Exporter method exportTypes.
private void exportTypes() throws Exception {
displayMessage("exporting typesDef to file " + typesDefFileName);
AtlasTypesDef typesDef = getTypesDef(typeRegistry);
FileUtils.write(new File(typesDefFileName), AtlasType.toJson(typesDef));
displayMessage("exported typesDef to file " + typesDefFileName);
}
use of org.apache.atlas.model.typedef.AtlasTypesDef in project atlas by apache.
the class AtlasClientV2 method createStructDef.
@Deprecated
public AtlasStructDef createStructDef(AtlasStructDef structDef) throws AtlasServiceException {
AtlasTypesDef atlasTypesDef = new AtlasTypesDef();
atlasTypesDef.getStructDefs().add(structDef);
AtlasTypesDef created = createAtlasTypeDefs(atlasTypesDef);
assert created != null;
assert created.getStructDefs() != null;
return created.getStructDefs().get(0);
}
use of org.apache.atlas.model.typedef.AtlasTypesDef in project atlas by apache.
the class AtlasClientV2 method createEntityDef.
@Deprecated
public AtlasEntityDef createEntityDef(AtlasEntityDef entityDef) throws AtlasServiceException {
AtlasTypesDef atlasTypesDef = new AtlasTypesDef();
atlasTypesDef.getEntityDefs().add(entityDef);
AtlasTypesDef created = createAtlasTypeDefs(atlasTypesDef);
assert created != null;
assert created.getEntityDefs() != null;
return created.getEntityDefs().get(0);
}
use of org.apache.atlas.model.typedef.AtlasTypesDef in project atlas by apache.
the class AtlasClientV2 method createClassificationDef.
@Deprecated
public AtlasClassificationDef createClassificationDef(AtlasClassificationDef classificationDef) throws AtlasServiceException {
AtlasTypesDef atlasTypesDef = new AtlasTypesDef();
atlasTypesDef.getClassificationDefs().add(classificationDef);
AtlasTypesDef created = createAtlasTypeDefs(atlasTypesDef);
assert created != null;
assert created.getClassificationDefs() != null;
return created.getClassificationDefs().get(0);
}
Aggregations