Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.

PersistenceAsync Interface

Otávio Santana edited this page Mar 31, 2014 · 1 revision

The PersistenceAsync is an api for asynchronous calls on Cassandra. With it you can insert, delete, update and retrieve information. To query's operation, you will use an async callback to be called when the process has done.

Persistence interface

public interface PersistenceAsync  {
    <T> boolean insert(T bean);

    <T> boolean insert(T bean,ConsistencyLevel consistency);  

    <T> boolean insert(Iterable<T> beans);

    <T> boolean insert(Iterable<T> beans,ConsistencyLevel consistency);

    <T> boolean delete(T bean);

    <T> boolean delete(T bean,ConsistencyLevel consistency);

    <T> boolean delete(Iterable<T> beans);    

    <T> boolean delete(Iterable<T> beans,ConsistencyLevel consistency);

    <T> boolean update(T bean);

    <T> boolean update(T bean,ConsistencyLevel consistency);

    <T> boolean update(Iterable<T> beans);

    <T> boolean update(Iterable<T> beans,ConsistencyLevel consistency);

    <K,T> boolean deleteByKey(K key, Class<T> bean);

    <K,T> boolean deleteByKey(K key, Class<T> bean,ConsistencyLevel consistency);

    boolean executeUpdate(String query);

    <T> void removeAll(Class<T> bean);

    <T> void findAll(Class<T> bean, ResultAsyncCallBack<List<T>> resultCallBack);

    <T> void findAll(Class<T> bean, ConsistencyLevel consistency,
        ResultAsyncCallBack<List<T>> resultCallBack
        );

    <K, T> void findByKeys(Iterable<K> keys, Class<T> bean,
        ResultAsyncCallBack<List<T>> resultCallBack);

     <K, T> void findByKeys(Iterable<K> keys, Class<T> bean,
        ConsistencyLevel consistency,
        ResultAsyncCallBack<List<T>> resultCallBack);

     <K, T> void findByKey(K key, Class<T> bean, ResultAsyncCallBack<T> resultCallBack);

     <K, T> void findByKey(K key, Class<T> bean, ConsistencyLevel consistency,
        ResultAsyncCallBack<T> resultCallBack);

     <T, I> void findByIndex(String indexName, I index, Class<T> bean,
        ResultAsyncCallBack<List<T>> resultCallBack);

     <T, I> void findByIndex(String indexName, I index, Class<T> bean,
        ConsistencyLevel consistency,
        ResultAsyncCallBack<List<T>> resultCallBack);

     <T, I> void findByIndex(I index, Class<T> bean, ResultAsyncCallBack<List<T>> resultCallBack);

    <T, I> void findByIndex(I index, Class<T> bean, ResultAsyncCallBack<List<T>> resultCallBack,
        ConsistencyLevel consistency);

    <T> void count(Class<T> bean, ResultAsyncCallBack<Long> resultCallBack);

    <T> void count(Class<T> bean, ConsistencyLevel consistency,
        ResultAsyncCallBack<Long> resultCallBack);


}

Implementations:

  • org.easycassandra.persistence.cassandra.PersistenceSimpleAsyncImpl

Clone this wiki locally