@Override public void deleteSchema() throws GoraException { throw new GoraException("delete schema is not supported for " + "file backed data stores"); }
/** * {@inheritDoc} */ @Override public Result<K, T> execute(Query<K, T> query) throws GoraException { try { return (Result<K, T>) cassandraSerializer.execute(this, query); } catch (Exception e) { throw new GoraException(e); } }
@Override public boolean delete(K key) throws GoraException { try { return cache.remove(key); } catch (Exception e) { throw new GoraException(e); } }
@Override public T newPersistent() throws GoraException { try { return beanFactory.newPersistent(); } catch (Exception e) { throw new GoraException(e); } }
@Override public void flush() throws GoraException { try { if (batch.size() > 0) { add(batch, commitWithin); batch.clear(); } } catch (Exception e) { throw new GoraException(e); } }
@Override public K newKey() throws GoraException { try { return beanFactory.newKey(); } catch (Exception e) { throw new GoraException(e); } }
@Override /** * Executes a query inside a web service backed data store */ public Result<K, T> execute(Query<K, T> query) throws GoraException { try { return executeQuery(query); } catch (IOException e) { throw new GoraException(e); } }
public void dropCache() throws GoraException { try { cache.clear(); cacheExists = false; } catch (Exception e) { throw new GoraException(e); } }
@Override public void flush() throws GoraException { try { if (batchWriter != null) { batchWriter.flush(); } } catch (Exception e) { throw new GoraException(e); } }
@Override public void put(K key, T obj) throws GoraException { try{ getDatumWriter().write(obj, getEncoder()); } catch (Exception e) { throw new GoraException(e); } }
@Override public boolean schemaExists() throws GoraException { try { return (manager.getCache(super.getPersistentClass().getSimpleName(), keyClass, persistentClass) != null); } catch (Exception e) { throw new GoraException(e); } }
@Override public void flush() throws GoraException { try { db.executeBulk(bulkDocs); bulkDocs.clear(); db.flushBulkBuffer(); } catch (Exception e) { throw new GoraException(e); } }
/** * Check if the collection already exists or should be created. */ @Override public boolean schemaExists() throws GoraException { try { return mongoClientDB.collectionExists(mapping.getCollectionName()); } catch (Exception e) { throw new GoraException(e); } }
@Override public T get(K key, String[] fields) throws GoraException { try { T persitent = (T) cache.get(key); if (persitent == null) { return null; } return getPersistent(persitent, fields); } catch (Exception e) { throw new GoraException(e); } }
@Override public void put(K key, T obj) throws GoraException { try{ getWriter().append(obj); } catch (Exception e) { throw new GoraException(e); } }
@Override public boolean schemaExists() throws GoraException { try { return conn.tableOperations().exists(mapping.tableName); } catch (Exception e) { throw new GoraException(e); } }
/** * Check if the database already exists or should be created. */ @Override public boolean schemaExists() throws GoraException { try { return dbInstance.checkIfDbExists(mapping.getDatabaseName()); } catch (Exception e) { throw new GoraException(e); } }
@Override public boolean schemaExists() throws GoraException { try{ return admin.tableExists(mapping.getTable().getTableName()); } catch (Exception e) { throw new GoraException(e); } }
@Override public void createSchema() throws GoraException { try { if (!schemaExists()) CoreAdminRequest.createCore(mapping.getCoreName(), mapping.getCoreName(), adminServer, solrConfig, solrSchema); } catch (Exception e) { throw new GoraException(e); } }
@Override public boolean schemaExists() throws GoraException { boolean exists = false; try { CoreAdminResponse rsp = CoreAdminRequest.getStatus(mapping.getCoreName(), adminServer); exists = rsp.getUptime(mapping.getCoreName()) != null; } catch (Exception e) { throw new GoraException(e); } return exists; }