Package org.jredis.protocol

Examples of org.jredis.protocol.ValueResponse


        private final ObjectInfo getObjectInfo(ValueResponse resp){
      String stringValue = resp.getStringValue();
      return ObjectInfo.valueOf(stringValue);
        }
        public ObjectInfo get () throws InterruptedException, ExecutionException {
          ValueResponse valResp = (ValueResponse) pendingRequest.get();
          return getObjectInfo(valResp);
        }
View Full Code Here


        }

        public ObjectInfo get (long timeout, TimeUnit unit)
          throws InterruptedException, ExecutionException, TimeoutException
        {
          ValueResponse valResp = (ValueResponse) pendingRequest.get(timeout, unit);
          return getObjectInfo(valResp);
        }
View Full Code Here

      throw new IllegalArgumentException ("invalid key => ["+key+"]");

    /* ValueRespose */
    long value = Long.MIN_VALUE;
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.INCRBY, keybytes, Convert.toBytes(delta));
      value = valResponse.getLongValue();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return value;
View Full Code Here

      throw new IllegalArgumentException ("invalid key => ["+key+"]");

    /* ValueRespose */
    long value = Long.MAX_VALUE;
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.DECR, keybytes);
      value = valResponse.getLongValue();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return value;
View Full Code Here

      throw new IllegalArgumentException ("invalid key => ["+key+"]");

    /* ValueRespose */
    long value = Long.MAX_VALUE;
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.DECRBY, keybytes, Convert.toBytes(delta));
      value = valResponse.getLongValue();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return value;
View Full Code Here

      throw new IllegalArgumentException ("invalid key => ["+key+"]");

    /* ValueRespose */ /* int since max size is 1GB, an integer 1,073,741,824 */
    long value = Integer.MIN_VALUE;
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.LLEN, keybytes);
      value = valResponse.getLongValue();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return value;
View Full Code Here

    byte[] keybytes = null;
    if((keybytes = getKeyBytes(key)) == null)
      throw new IllegalArgumentException ("invalid key => ["+key+"]");
    long value = Long.MIN_VALUE;
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.SCARD, keybytes);
      value = valResponse.getLongValue();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return value;
View Full Code Here

    byte[] keybytes = null;
    if((keybytes = getKeyBytes(key)) == null)
      throw new IllegalArgumentException ("invalid key => ["+key+"]");
    long value = Long.MIN_VALUE;
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.ZCARD, keybytes);
      value = valResponse.getLongValue();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return value;
View Full Code Here

  @Override
  public <K extends Object> long dbsize() throws RedisException {
    long value = Long.MIN_VALUE;
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.DBSIZE);
      value = valResponse.getLongValue();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return value;
View Full Code Here

  }
  @Override
  public <K extends Object> long lastsave() throws RedisException {
    long value = Long.MIN_VALUE;
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.LASTSAVE);
      value = valResponse.getLongValue();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return value;
View Full Code Here

TOP

Related Classes of org.jredis.protocol.ValueResponse

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.