public List<String> createEntity(Referenceable... entities) throws AtlasServiceException { return createEntity(Arrays.asList(entities)); }
public List<String> createEntity(Referenceable... entities) throws AtlasServiceException { return createEntity(Arrays.asList(entities)); }
public List<String> createEntity(Referenceable... entities) throws AtlasServiceException { return createEntity(Arrays.asList(entities)); }
/** * Create the given entity * @param entitiesAsJson entity(type instance) as json * @return json array of guids * @throws AtlasServiceException */ public List<String> createEntity(String... entitiesAsJson) throws AtlasServiceException { return createEntity(new JSONArray(Arrays.asList(entitiesAsJson))); }
public List<String> createEntity(Collection<Referenceable> entities) throws AtlasServiceException { ArrayNode entityArray = getEntitiesArray(entities); return createEntity(entityArray); }
public List<String> createEntity(Collection<Referenceable> entities) throws AtlasServiceException { ArrayNode entityArray = getEntitiesArray(entities); return createEntity(entityArray); }
public List<String> createEntity(Collection<Referenceable> entities) throws AtlasServiceException { JSONArray entityArray = getEntitiesArray(entities); return createEntity(entityArray); }
/** * Create the given entity * @param entitiesAsJson entity(type instance) as json * @return json array of guids * @throws AtlasServiceException */ public List<String> createEntity(String... entitiesAsJson) throws AtlasServiceException { try { return createEntity(AtlasJson.parseToV1ArrayNode(Arrays.asList(entitiesAsJson))); } catch (IOException excp) { throw new AtlasServiceException(excp); } }
/** * Create the given entity * @param entitiesAsJson entity(type instance) as json * @return json array of guids * @throws AtlasServiceException */ public List<String> createEntity(String... entitiesAsJson) throws AtlasServiceException { try { return createEntity(AtlasJson.parseToV1ArrayNode(Arrays.asList(entitiesAsJson))); } catch (IOException excp) { throw new AtlasServiceException(excp); } }
private Id createInstance(Referenceable referenceable) throws Exception { String typeName = referenceable.getTypeName(); String entityJSON = AtlasType.toV1Json(referenceable); System.out.println("Submitting new entity= " + entityJSON); List<String> guids = metadataServiceClient.createEntity(entityJSON); System.out.println("created instance for type " + typeName + ", guid: " + guids); // return the Id for created instance with guid if (guids.size() > 0) { return new Id(guids.get(guids.size() - 1), referenceable.getId().getVersion(), referenceable.getTypeName()); } return null; }
/** * Registers an entity in atlas * @param referenceable * @return * @throws Exception */ private Referenceable registerInstance(Referenceable referenceable) throws Exception { String typeName = referenceable.getTypeName(); LOG.debug("creating instance of type {}", typeName); String entityJSON = InstanceSerialization.toJson(referenceable, true); LOG.debug("Submitting new entity {} = {}", referenceable.getTypeName(), entityJSON); List<String> guids = getAtlasClient().createEntity(entityJSON); LOG.debug("created instance for type {}, guid: {}", typeName, guids); return new Referenceable(guids.get(guids.size() - 1), referenceable.getTypeName(), null); }