Package org.jredis.protocol

Examples of org.jredis.protocol.ValueResponse


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

    RedisType  type = null;
    /* ValueRespose */
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.TYPE, keybytes);
      String stringValue = valResponse.getStringValue();
      type = RedisType.valueOf(stringValue);
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
    }
View Full Code Here


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

    ObjectInfo  objectInfo = null;
    /* ValueRespose */
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.DEBUG, "OBJECT".getBytes(), keybytes);
      String stringValue = valResponse.getStringValue();
      objectInfo = ObjectInfo.valueOf(stringValue);
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
    }
View Full Code Here

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

    long resp = Long.MIN_VALUE;
    try {
      ValueResponse valueResponse = (ValueResponse) this.serviceRequest(Command.ZREMRANGEBYSCORE, keybytes, fromBytes, toBytes);
      resp = valueResponse.getLongValue();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a numeric ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return resp;
View Full Code Here

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

    long resp = Long.MIN_VALUE;
    try {
      ValueResponse valueResponse = (ValueResponse) this.serviceRequest(Command.ZCOUNT, keybytes, fromBytes, toBytes);
      resp = valueResponse.getLongValue();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a numeric ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return resp;
View Full Code Here

    byte[] fromBytes = Convert.toBytes(minRank);
    byte[] toBytes = Convert.toBytes(maxRank);

    long resp = Long.MIN_VALUE;
    try {
      ValueResponse valueResponse = (ValueResponse) this.serviceRequest(Command.ZREMRANGEBYRANK, keybytes, fromBytes, toBytes);
      resp = valueResponse.getLongValue();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a numeric ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return resp;
View Full Code Here

      protected List<byte[]> execSortStore(byte[]... fullSortCmd)
      throws IllegalStateException, RedisException {
       
        List<byte[]> multiBulkData= new ArrayList<byte[]>(1);
        try {
          ValueResponse valueResp = (ValueResponse) client.serviceRequest(Command.SORT$STORE, fullSortCmd);
          long resSize = valueResp.getLongValue();
          multiBulkData.add(Convert.toBytes(resSize));
        }
        catch (ClassCastException e){
          throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
        }
View Full Code Here

      keybytes[i++] = keydata;
    }

    long resvalue = -1;
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.DEL, keybytes);
      resvalue = valResponse.getLongValue();
    }
    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+"]");

    boolean resvalue = false;
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.EXISTS, keybytes);
      resvalue = valResponse.getBooleanValue();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return resvalue;
View Full Code Here

    byte[] countBytes = Convert.toBytes(count);

    long remcnt = 0;
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.LREM, keybytes, countBytes, value);
      remcnt = valResponse.getLongValue();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return remcnt;
View Full Code Here

   
    byte[] toBytes = Convert.toBytes(dbIndex);

    boolean resvalue = false;
    try {
      ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.MOVE, keybytes, toBytes);
      resvalue = valResponse.getBooleanValue();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e);
    }
    return resvalue;
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.