Search in sources :

Example 36 with KeyInfo

use of doitincloud.rdbcache.models.KeyInfo in project rdbcache by rdbcache.

the class ExpireOps method setExpireKey.

public void setExpireKey(Context context, KvPairs pairs, AnyKey anyKey) {
    for (int i = 0; i < pairs.size(); i++) {
        KvPair pair = pairs.get(i);
        KeyInfo keyInfo = anyKey.getAny(i);
        setExpireKey(context, pair, keyInfo);
    }
}
Also used : KvPair(doitincloud.rdbcache.models.KvPair) KeyInfo(doitincloud.rdbcache.models.KeyInfo)

Example 37 with KeyInfo

use of doitincloud.rdbcache.models.KeyInfo in project rdbcache by rdbcache.

the class AbsDbaseRepo method update.

@Override
public boolean update(final Context context, final KvPairs pairs, final AnyKey anyKey) {
    boolean allOk = true;
    for (int i = 0; i < pairs.size(); i++) {
        KvPair pair = pairs.get(i);
        KeyInfo keyInfo = anyKey.getAny(i);
        if (!update(context, pair, keyInfo)) {
            allOk = false;
        }
    }
    return allOk;
}
Also used : KvPair(doitincloud.rdbcache.models.KvPair) KeyInfo(doitincloud.rdbcache.models.KeyInfo)

Example 38 with KeyInfo

use of doitincloud.rdbcache.models.KeyInfo in project rdbcache by rdbcache.

the class AbsDbaseRepo method delete.

@Override
public boolean delete(final Context context, final KvPairs pairs, final AnyKey anyKey) {
    boolean allOk = true;
    for (int i = 0; i < pairs.size(); i++) {
        KvPair pair = pairs.get(i);
        KeyInfo keyInfo = anyKey.getAny(i);
        if (!delete(context, pair, keyInfo)) {
            allOk = false;
        }
    }
    return allOk;
}
Also used : KvPair(doitincloud.rdbcache.models.KvPair) KeyInfo(doitincloud.rdbcache.models.KeyInfo)

Example 39 with KeyInfo

use of doitincloud.rdbcache.models.KeyInfo in project rdbcache by rdbcache.

the class AnyKeyTest method getKey.

@Test
public void getKey() {
    AnyKey anyKey;
    KeyInfo keyInfo;
    anyKey = new AnyKey();
    keyInfo = anyKey.getKeyInfo();
    assertNull(keyInfo);
    keyInfo = new KeyInfo();
    keyInfo.setExpire("100");
    keyInfo.setTable("table");
    anyKey = new AnyKey(keyInfo);
    KeyInfo keyInfo2 = anyKey.getKeyInfo();
    assertNotNull(keyInfo2);
    assertTrue(keyInfo == keyInfo2);
}
Also used : AnyKey(doitincloud.rdbcache.supports.AnyKey) KeyInfo(doitincloud.rdbcache.models.KeyInfo) Test(org.junit.Test)

Example 40 with KeyInfo

use of doitincloud.rdbcache.models.KeyInfo in project rdbcache by rdbcache.

the class AnyKeyTest method setKey.

@Test
public void setKey() {
    AnyKey anyKey;
    KeyInfo keyInfo;
    anyKey = new AnyKey();
    keyInfo = new KeyInfo();
    keyInfo.setExpire("100");
    keyInfo.setTable("table");
    anyKey.setKeyInfo(keyInfo);
    assertEquals(1, anyKey.size());
    assertTrue(keyInfo == anyKey.get(0));
    anyKey = new AnyKey(new KeyInfo());
    anyKey.setKeyInfo(keyInfo);
    assertEquals(1, anyKey.size());
    assertTrue(keyInfo == anyKey.get(0));
}
Also used : AnyKey(doitincloud.rdbcache.supports.AnyKey) KeyInfo(doitincloud.rdbcache.models.KeyInfo) Test(org.junit.Test)

Aggregations

KeyInfo (doitincloud.rdbcache.models.KeyInfo)50 KvPair (doitincloud.rdbcache.models.KvPair)29 AnyKey (doitincloud.rdbcache.supports.AnyKey)21 Context (doitincloud.rdbcache.supports.Context)17 KvPairs (doitincloud.rdbcache.supports.KvPairs)17 Test (org.junit.Test)13 ServerErrorException (doitincloud.commons.exceptions.ServerErrorException)9 StopWatch (doitincloud.rdbcache.models.StopWatch)8 BadRequestException (doitincloud.commons.exceptions.BadRequestException)7 SQLException (java.sql.SQLException)4 QueryInfo (doitincloud.rdbcache.queries.QueryInfo)2 LinkedHashMap (java.util.LinkedHashMap)2 Map (java.util.Map)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)2 MockServletContext (org.springframework.mock.web.MockServletContext)2 NotFoundException (doitincloud.commons.exceptions.NotFoundException)1 CacheOps (doitincloud.rdbcache.services.CacheOps)1 DbaseOps (doitincloud.rdbcache.services.DbaseOps)1 ExpireDbOps (doitincloud.rdbcache.supports.ExpireDbOps)1