Package org.jredis

Examples of org.jredis.ProviderException


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


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

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

    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

   * to associate state with the transaction.
   * @throws RedisException
   */
  @Version(major=2, minor=0, release=Release.ALPHA)
  public <K extends Object> JRedis multi() throws RedisException {
    throw new ProviderException("NOT IMPLEMENTED");
//    // works
//    this.serviceRequest(Command.MULTI);
//    return this;
  }
View Full Code Here

  /**
   * @throws RedisException
   */
  @Version(major=2, minor=0, release=Release.ALPHA)
  public <K extends Object> JRedis discard () throws RedisException {
    throw new ProviderException("NOT IMPLEMENTED");
//    // works
//    this.serviceRequest(Command.DISCARD);
//    return this;
  }
View Full Code Here

     */
    private void getStatusResponse (Pending pending, InputStream in) throws IOException {
      readLine (in);
      byte code = lineBuffer[0];
    if(code != ProtocolBase.OK_BYTE && code != ProtocolBase.ERR_BYTE) {
      throw new ProviderException ("Got [ " + (char)code + " | "+code+" ] when expecing either - or +  pending.status: " + pending.status);
    }
      pending.isError = code == ProtocolBase.ERR_BYTE;
      pending.status = new String(lineBuffer, 1, lineBufferOffset - 3);
    }
View Full Code Here

    private void getValueResponse (Pending pending, InputStream in) throws IOException {
      readLine (in);
      byte code = lineBuffer[0];
    if(code != ProtocolBase.NUM_BYTE && code != ProtocolBase.ERR_BYTE) {
      throw new ProviderException ("Got [ " + (char)code + " | "+code+" ] when expecing either - or :  pending.status: " + pending.status);
    }
      if((pending.isError = (code == ProtocolBase.ERR_BYTE)) != true){
        // flavor switch goes here
        pending.intValue = Convert.toInt(lineBuffer, 1, lineBufferOffset - 3);
      }
View Full Code Here

    int available = buffer.length - offset;
    if(len > available) {
      int c = getMoreBytes (len)// this is a potentially blocking call
      if(c==-1) return -1;
      else if(c < len - available)
        throw new ProviderException ("Bug: getMoreBytes() returned less bytes than requested.  c="+c+" len=" + len + "available=" + available);
    }

    if(len == 1){
      b[off] = buffer[offset];
    }
View Full Code Here

  private void getBulkResponse(Pending pending, InputStream in) throws IOException {
    readLine (in);
      byte code = lineBuffer[0];
    if(code != ProtocolBase.SIZE_BYTE && code != ProtocolBase.ERR_BYTE) {
      throw new ProviderException ("Got [ " + (char)code + " | "+code+" ] when expecing either - or $  pending.status: " + pending.status);
    }
    pending.isError = (code == ProtocolBase.ERR_BYTE);
    byte[] data = new byte[0];
      if(!pending.isError){
        int   length = Convert.toInt(lineBuffer, 1, lineBufferOffset - 3);
View Full Code Here

TOP

Related Classes of org.jredis.ProviderException

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.