Search in sources :

Example 16 with AtlasTypesDef

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;
}
Also used : AtlasEntityDef(org.apache.atlas.model.typedef.AtlasEntityDef) AtlasTypesDef(org.apache.atlas.model.typedef.AtlasTypesDef) AtlasTypeRegistry(org.apache.atlas.type.AtlasTypeRegistry) AtlasTypesDef(org.apache.atlas.model.typedef.AtlasTypesDef)

Example 17 with AtlasTypesDef

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);
}
Also used : File(java.io.File) AtlasTypesDef(org.apache.atlas.model.typedef.AtlasTypesDef)

Example 18 with AtlasTypesDef

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);
}
Also used : AtlasTypesDef(org.apache.atlas.model.typedef.AtlasTypesDef)

Example 19 with AtlasTypesDef

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);
}
Also used : AtlasTypesDef(org.apache.atlas.model.typedef.AtlasTypesDef)

Example 20 with AtlasTypesDef

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);
}
Also used : AtlasTypesDef(org.apache.atlas.model.typedef.AtlasTypesDef)

Aggregations

AtlasTypesDef (org.apache.atlas.model.typedef.AtlasTypesDef)118 AtlasEntityDef (org.apache.atlas.model.typedef.AtlasEntityDef)54 AtlasClassificationDef (org.apache.atlas.model.typedef.AtlasClassificationDef)39 Test (org.testng.annotations.Test)39 AtlasStructDef (org.apache.atlas.model.typedef.AtlasStructDef)30 AtlasEntity (org.apache.atlas.model.instance.AtlasEntity)22 AtlasEnumDef (org.apache.atlas.model.typedef.AtlasEnumDef)22 AtlasBaseException (org.apache.atlas.exception.AtlasBaseException)20 AtlasAttributeDef (org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef)19 ArrayList (java.util.ArrayList)18 SearchFilter (org.apache.atlas.model.SearchFilter)15 EntityMutationResponse (org.apache.atlas.model.instance.EntityMutationResponse)15 AtlasEntityHeader (org.apache.atlas.model.instance.AtlasEntityHeader)14 BeforeClass (org.testng.annotations.BeforeClass)14 HashMap (java.util.HashMap)13 AtlasConstraintDef (org.apache.atlas.model.typedef.AtlasStructDef.AtlasConstraintDef)13 AtlasClassification (org.apache.atlas.model.instance.AtlasClassification)12 AtlasEnumElementDef (org.apache.atlas.model.typedef.AtlasEnumDef.AtlasEnumElementDef)9 MultivaluedMapImpl (com.sun.jersey.core.util.MultivaluedMapImpl)8 AtlasServiceException (org.apache.atlas.AtlasServiceException)7