@Override public boolean existsTable(String location) throws DataStructuresException { return getTable(location) != null; }
@Override public boolean existsAppend(String location) throws DataStructuresException { return getAppend(location) != null; }
@Override public boolean existsDelete(String location) throws DataStructuresException { return getDelete(location) != null; }
@Override public boolean existsView(String location) throws DataStructuresException { return getView(location) != null; }
@Override public boolean existsUpdate(String location) throws DataStructuresException { return getUpdate(location) != null; }
@Override public boolean existsSchema(String location) throws DataStructuresException { return getSchema(location) != null; }
@Override public boolean existsReplace(String location) throws DataStructuresException { return getReplace(location) != null; }
public String list() throws DataStructuresException { List<DataStructureModel> dataStructures = dataStructuresCoreService.getDataStructures(); return GsonHelper.GSON.toJson(dataStructures); }
/** * Register predelivered update files. * * @param contentPath * the data path * @throws IOException * Signals that an I/O exception has occurred. */ public void registerPredeliveredUpdate(String contentPath) throws IOException { String data = loadResourceContent(contentPath); DataStructureDataUpdateModel model = dataStructuresCoreService.parseUpdate(contentPath, data); UPDATE_PREDELIVERED.put(contentPath, model); }
/** * Register predelivered replace files. * * @param contentPath * the data path * @throws IOException * Signals that an I/O exception has occurred. */ public void registerPredeliveredReplace(String contentPath) throws IOException { String data = loadResourceContent(contentPath); DataStructureDataReplaceModel model = dataStructuresCoreService.parseReplace(contentPath, data); REPLACE_PREDELIVERED.put(contentPath, model); }
/** * Register predelivered schema files. * * @param contentPath * the data path * @throws IOException * Signals that an I/O exception has occurred. */ public void registerPredeliveredSchema(String contentPath) throws IOException { String data = loadResourceContent(contentPath); DataStructureSchemaModel model = dataStructuresCoreService.parseSchema(contentPath, data); SCHEMA_PREDELIVERED.put(contentPath, model); }
/** * Register predelivered append files. * * @param contentPath * the data path * @throws IOException * Signals that an I/O exception has occurred. */ public void registerPredeliveredAppend(String contentPath) throws IOException { String data = loadResourceContent(contentPath); DataStructureDataAppendModel model = dataStructuresCoreService.parseAppend(contentPath, data); APPEND_PREDELIVERED.put(contentPath, model); }
/** * Register predelivered delete files. * * @param contentPath * the data path * @throws IOException * Signals that an I/O exception has occurred. */ public void registerPredeliveredDelete(String contentPath) throws IOException { String data = loadResourceContent(contentPath); DataStructureDataDeleteModel model = dataStructuresCoreService.parseDelete(contentPath, data); DELETE_PREDELIVERED.put(contentPath, model); }
/** * Register predelivered table. * * @param tableModelPath * the table model path * @throws IOException * Signals that an I/O exception has occurred. */ public void registerPredeliveredTable(String tableModelPath) throws IOException { String json = loadResourceContent(tableModelPath); DataStructureTableModel tableModel = dataStructuresCoreService.parseTable(json); tableModel.setLocation(tableModelPath); TABLES_PREDELIVERED.put(tableModelPath, tableModel); }
/** * Register predelivered view. * * @param viewModelPath * the view model path * @throws IOException * Signals that an I/O exception has occurred. */ public void registerPredeliveredView(String viewModelPath) throws IOException { String json = loadResourceContent(viewModelPath); DataStructureViewModel viewModel = dataStructuresCoreService.parseView(json); viewModel.setLocation(viewModelPath); VIEWS_PREDELIVERED.put(viewModelPath, viewModel); }
@Override public void updateAppend(String location, String name, String hash) throws DataStructuresException { try { Connection connection = null; try { connection = dataSource.getConnection(); DataStructureDataAppendModel dataModel = getAppend(location); dataModel.setName(name); dataModel.setHash(hash); appendPersistenceManager.update(connection, dataModel); } finally { if (connection != null) { connection.close(); } } } catch (SQLException e) { throw new DataStructuresException(e); } }
@Override public void updateDelete(String location, String name, String hash) throws DataStructuresException { try { Connection connection = null; try { connection = dataSource.getConnection(); DataStructureDataDeleteModel dataModel = getDelete(location); dataModel.setName(name); dataModel.setHash(hash); deletePersistenceManager.update(connection, dataModel); } finally { if (connection != null) { connection.close(); } } } catch (SQLException e) { throw new DataStructuresException(e); } }
@Override public void updateView(String location, String name, String hash) throws DataStructuresException { try { Connection connection = null; try { connection = dataSource.getConnection(); DataStructureViewModel viewModel = getView(location); viewModel.setName(name); viewModel.setHash(hash); viewPersistenceManager.update(connection, viewModel); } finally { if (connection != null) { connection.close(); } } } catch (SQLException e) { throw new DataStructuresException(e); } }
@Override public void updateUpdate(String location, String name, String hash) throws DataStructuresException { try { Connection connection = null; try { connection = dataSource.getConnection(); DataStructureDataUpdateModel dataModel = getUpdate(location); dataModel.setName(name); dataModel.setHash(hash); updatePersistenceManager.update(connection, dataModel); } finally { if (connection != null) { connection.close(); } } } catch (SQLException e) { throw new DataStructuresException(e); } }
@Override public void updateSchema(String location, String name, String hash) throws DataStructuresException { try { Connection connection = null; try { connection = dataSource.getConnection(); DataStructureSchemaModel schemaModel = getSchema(location); schemaModel.setName(name); schemaModel.setHash(hash); schemaPersistenceManager.update(connection, schemaModel); } finally { if (connection != null) { connection.close(); } } } catch (SQLException e) { throw new DataStructuresException(e); } }