Package org.jredis.protocol

Examples of org.jredis.protocol.MultiBulkResponse


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

    List<byte[]> multibulkData = null;
    try {
      MultiBulkResponse response = (MultiBulkResponse) this.serviceRequest(Command.HKEYS, hashKeyBytes);
//      if(null != response.getMultiBulkData()) resp = DefaultCodec.toStr(response.getMultiBulkData());
      multibulkData = response.getMultiBulkData();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a MultiBulkResponse here => " + e.getLocalizedMessage(), e);
    }
    return multibulkData;
View Full Code Here


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

    List<byte[]> resp = null;
    try {
      MultiBulkResponse response = (MultiBulkResponse) this.serviceRequest(Command.HVALS, hashKeyBytes);
      resp = response.getMultiBulkData();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a MultiBulkResponse here => " + e.getLocalizedMessage(), e);
    }
    return resp;
View Full Code Here

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

    Map<byte[], byte[]> resp = null;
    try {
      MultiBulkResponse response = (MultiBulkResponse) this.serviceRequest(Command.HGETALL, hashKeyBytes);
      List<byte[]> bulkdata = response.getMultiBulkData();
      if(null != bulkdata) {
        resp = new HashMap<byte[], byte[]>(bulkdata.size()/2);
        for(int i=0; i<bulkdata.size(); i+=2){
          resp.put(bulkdata.get(i), bulkdata.get(i+1));
        }
View Full Code Here

      keybytes[i++] = keydata;
    }
   
    List<byte[]> multiBulkData= null;
    try {
      MultiBulkResponse MultiBulkResponse = (MultiBulkResponse) this.serviceRequest(Command.MGET, keybytes);
      multiBulkData = MultiBulkResponse.getMultiBulkData();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a MultiBulkResponse here => " + e.getLocalizedMessage(), e);
    }
    return multiBulkData;
View Full Code Here

    if((keydata = getKeyBytes(key)) == null)
      throw new RedisException (Command.KEYS, "ERR Invalid key.");

    List<byte[]> multiBulkData= null;
    try {
      MultiBulkResponse MultiBulkResponse = (MultiBulkResponse) this.serviceRequest(Command.SMEMBERS, keydata);
      multiBulkData = MultiBulkResponse.getMultiBulkData();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a MultiBulkResponse here => " + e.getLocalizedMessage(), e);
    }
    return multiBulkData;
View Full Code Here

    if((keydata = getKeyBytes(pattern)) == null)
      throw new RedisException (Command.KEYS, "ERR Invalid key.");

    List<byte[]> multiBulkData= null;
    try {
      MultiBulkResponse MultiBulkResponse = (MultiBulkResponse) this.serviceRequest(Command.KEYS, keydata);
      multiBulkData = MultiBulkResponse.getMultiBulkData();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a MultiBulkResponse here => " + e.getLocalizedMessage(), e);
    }
//    return DefaultCodec.toStr(multiBulkData);
View Full Code Here

    byte[] fromBytes = Convert.toBytes(from);
    byte[] toBytes = Convert.toBytes(to);

    List<byte[]> multiBulkData= null;
    try {
      MultiBulkResponse multiBulkResponse = (MultiBulkResponse) this.serviceRequest(Command.LRANGE, keybytes, fromBytes, toBytes);
      multiBulkData = multiBulkResponse.getMultiBulkData();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a MultiBulkResponse here => " + e.getLocalizedMessage(), e);
    }
    return multiBulkData;
View Full Code Here

    byte[] fromBytes = Convert.toBytes(minScore);
    byte[] toBytes = Convert.toBytes(maxScore);

    List<byte[]> multiBulkData= null;
    try {
      MultiBulkResponse MultiBulkResponse = (MultiBulkResponse) this.serviceRequest(Command.ZRANGEBYSCORE, keybytes, fromBytes, toBytes);
      multiBulkData = MultiBulkResponse.getMultiBulkData();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a MultiBulkResponse here => " + e.getLocalizedMessage(), e);
    }
    return multiBulkData;
View Full Code Here

    byte[] fromBytes = Convert.toBytes(minScore);
    byte[] toBytes = Convert.toBytes(maxScore);

    List<ZSetEntry> list= null;
    try {
      MultiBulkResponse multiBulkResponse = (MultiBulkResponse) this.serviceRequest(Command.ZRANGEBYSCORE$OPTS, keybytes, fromBytes, toBytes, Command.Option.WITHSCORES.bytes);
      List<byte[]> bulkData = multiBulkResponse.getMultiBulkData();
      if(null != bulkData){
        list = new ArrayList<ZSetEntry>(bulkData.size()/2);
        for(int i=0; i<bulkData.size(); i+=2){
          list.add(new ZSetEntryImpl(bulkData.get(i), bulkData.get(i+1)));
        }
View Full Code Here

    byte[] fromBytes = Convert.toBytes(from);
    byte[] toBytes = Convert.toBytes(to);

    List<byte[]> multiBulkData= null;
    try {
      MultiBulkResponse MultiBulkResponse = (MultiBulkResponse) this.serviceRequest(Command.ZRANGE, keybytes, fromBytes, toBytes);
      multiBulkData = MultiBulkResponse.getMultiBulkData();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a MultiBulkResponse here => " + e.getLocalizedMessage(), e);
    }
    return multiBulkData;
View Full Code Here

TOP

Related Classes of org.jredis.protocol.MultiBulkResponse

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.