Package org.jredis.protocol

Examples of org.jredis.protocol.BulkResponse


  public static class FutureByteArray extends FutureResultBase implements Future<byte[]>{

        protected FutureByteArray (Future<Response> pendingRequest) { super(pendingRequest); }

        public byte[] get () throws InterruptedException, ExecutionException {
          BulkResponse resp = (BulkResponse) pendingRequest.get();
          return resp.getBulkData();
        }
View Full Code Here


        }

        public byte[] get (long timeout, TimeUnit unit)
          throws InterruptedException, ExecutionException, TimeoutException
        {
          BulkResponse resp = (BulkResponse) pendingRequest.get(timeout, unit);
          return resp.getBulkData();
        }
View Full Code Here

          infomap.put(_key, _value);
        }
        return infomap;
        }
        public Map<String, String> get () throws InterruptedException, ExecutionException {
          BulkResponse resp = (BulkResponse) pendingRequest.get();
          return getResultMap(resp);
        }
View Full Code Here

        }

        public Map<String, String> get (long timeout, TimeUnit unit)
          throws InterruptedException, ExecutionException, TimeoutException
        {
          BulkResponse resp = (BulkResponse) pendingRequest.get(timeout, unit);
          return getResultMap(resp);
        }
View Full Code Here

    byte[] destkeybytes = null;
    if((destkeybytes = getKeyBytes(destList)) == null)
      throw new IllegalArgumentException ("invalid dest key => ["+destList+"]");
    byte[] bulkData= null;
    try {
      BulkResponse response = (BulkResponse) this.serviceRequest(Command.RPOPLPUSH, srckeybytes, destkeybytes);
      bulkData = response.getBulkData();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a BulkResponse here => " + e.getLocalizedMessage(), e);
    }
    return bulkData;
View Full Code Here

    if((keybytes = getKeyBytes(key)) == null)
      throw new IllegalArgumentException ("invalid key => ["+key+"]");
    /* Double BulkResponse */
    Double resvalue = null;
    try {
      BulkResponse bulkResponse = (BulkResponse) this.serviceRequest(Command.ZINCRBY, keybytes, Convert.toBytes(score), member);
      if (bulkResponse.getBulkData() != null)
        resvalue = Convert.toDouble(bulkResponse.getBulkData());
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return resvalue;
View Full Code Here

    if((keybytes = getKeyBytes(key)) == null)
      throw new IllegalArgumentException ("invalid key => ["+key+"]");

    byte[] bulkData= null;
    try {
      BulkResponse response = (BulkResponse) this.serviceRequest(Command.GETSET, keybytes, value);
      bulkData = response.getBulkData();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a BulkResponse here => " + e.getLocalizedMessage(), e);
    }
    return bulkData;
View Full Code Here

    if((hashFieldBytes = getKeyBytes(hashField)) == null)
      throw new IllegalArgumentException ("invalid field => ["+hashField+"]");

    byte[] bulkData= null;
    try {
      BulkResponse response = (BulkResponse) this.serviceRequest(Command.HGET, hashKeyBytes, hashFieldBytes);
      bulkData = response.getBulkData();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a BulkResponse here => " + e.getLocalizedMessage(), e);
    }
    return bulkData;
View Full Code Here

    if((keybytes = getKeyBytes(setkey)) == null)
      throw new IllegalArgumentException ("invalid key => ["+setkey+"]");

    byte[] bulkData= null;
    try {
      BulkResponse response = (BulkResponse) this.serviceRequest(Command.SRANDMEMBER, keybytes);
      bulkData = response.getBulkData();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a BulkResponse here => " + e.getLocalizedMessage(), e);
    }
    return bulkData;
View Full Code Here

    if((keybytes = getKeyBytes(setkey)) == null)
      throw new IllegalArgumentException ("invalid key => ["+setkey+"]");

    byte[] bulkData= null;
    try {
      BulkResponse response = (BulkResponse) this.serviceRequest(Command.SPOP, keybytes);
      bulkData = response.getBulkData();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a BulkResponse here => " + e.getLocalizedMessage(), e);
    }
    return bulkData;
View Full Code Here

TOP

Related Classes of org.jredis.protocol.BulkResponse

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.