Package org.eclipse.jetty.nosql.kvs

Examples of org.eclipse.jetty.nosql.kvs.KeyValueStoreClientException


    return result;
  }

  public boolean delete(String key) throws KeyValueStoreClientException {
    if (!isAlive()) {
      throw(new KeyValueStoreClientException(new IllegalStateException("client not established")));
    }
    boolean result;
    try {
      Future<Boolean> f = _client.delete(key);
      result = f.get(_timeoutInMs, TimeUnit.MILLISECONDS);
    } catch (Exception error) {
      throw(new KeyValueStoreClientException(error));
    }
    return result;
  }
View Full Code Here


    return data != null;
  }

  public byte[] get(String key) throws KeyValueStoreClientException {
    if (!isAlive()) {
      throw(new KeyValueStoreClientException(new IllegalStateException("client not established")));
    }
    byte[] raw = null;
    synchronized(data) {
      Entry entry = data.get(key);
      if ( entry != null) {
View Full Code Here

    return this.set(key, raw, FOREVER);
  }

  public boolean set(String key, byte[] raw, int exp) throws KeyValueStoreClientException {
    if (!isAlive()) {
      throw(new KeyValueStoreClientException(new IllegalStateException("client not established")));
    }
    data.put(key, new Entry(raw, expiryTimeMillis(exp)));
    return true;
  }
View Full Code Here

    return this.add(key, raw, FOREVER);
  }

  public boolean add(String key, byte[] raw, int exp) throws KeyValueStoreClientException {
    if (!isAlive()) {
      throw(new KeyValueStoreClientException(new IllegalStateException("client not established")));
    }
    boolean notExists = false;
    synchronized(data) {
      notExists = !data.containsKey(key);
      if (notExists) {
View Full Code Here

    return notExists;
  }

  public boolean delete(String key) throws KeyValueStoreClientException {
    if (!isAlive()) {
      throw(new KeyValueStoreClientException(new IllegalStateException("client not established")));
    }
    data.remove(key);
    return true;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.nosql.kvs.KeyValueStoreClientException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.