Package org.jredis.protocol

Examples of org.jredis.protocol.BulkResponse


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

    byte[] bulkData= null;
    try {
      BulkResponse response = (BulkResponse) this.serviceRequest(Command.GET, 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(key)) == null)
      throw new IllegalArgumentException ("invalid key => ["+key+"]");

    byte[] bulkData= null;
    try {
      BulkResponse response = (BulkResponse) this.serviceRequest(Command.LINDEX, keybytes, Convert.toBytes(index));
      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+"]");

    byte[] bulkData= null;
    try {
      BulkResponse response = (BulkResponse) this.serviceRequest(Command.LPOP, 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(key)) == null)
      throw new IllegalArgumentException ("invalid key => ["+key+"]");

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

  public byte[] randomkey() throws RedisException {
    /* ValueRespose */
    byte[] bulkData = null;
//    String stringValue = null;
    try {
      BulkResponse valResponse = (BulkResponse) this.serviceRequest(Command.RANDOMKEY);
      bulkData = valResponse.getBulkData();
//      if (null != bulkData) {
//        stringValue = new String(bulkData);
//      }
    }
    catch (ClassCastException e){
View Full Code Here

  @Override
  public <K extends Object> Map<String, String> info() throws RedisException {

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

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

    byte[] bulkData= null;
    try {
      BulkResponse bulkResponse = (BulkResponse) this.serviceRequest(Command.SUBSTR, keybytes, fromBytes, toBytes);
      bulkData = bulkResponse.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 resvalue = null;
    try {
      BulkResponse bulkResponse = (BulkResponse) this.serviceRequest(Command.ZSCORE, keybytes, member);
      if (bulkResponse.getBulkData() != null)
        resvalue = Convert.toDouble(bulkResponse.getBulkData());
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a BulkResponse here => " + e.getLocalizedMessage(), e);
    }
    return resvalue;
View Full Code Here

    if(value ==null)
      throw new IllegalArgumentException ("invalid echo value => [null]");

    byte[] bulkData= null;
    try {
      BulkResponse response = (BulkResponse) this.serviceRequest(Command.ECHO, value);
      bulkData = response.getBulkData();
    }
    catch (ClassCastException e){
      throw new ProviderException("Expecting a BulkResponse here => " + e.getLocalizedMessage(), e);
    }
    return bulkData;
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

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.