Package net.spy.memcached.ops

Examples of net.spy.memcached.ops.OperationStatus


    case ERR_UNKNOWN_COMMAND:
    case ERR_NO_MEM:
    case ERR_NOT_SUPPORTED:
    case ERR_BUSY:
    case ERR_TEMP_FAIL:
      return new OperationStatus(false, new String(errPl));
    default:
      return null;
    }
  }
View Full Code Here


  }

  @Override
  public void handleLine(String line) {
    getLogger().debug("Result:  %s", line);
    OperationStatus found = null;
    if (line.equals("NOT_FOUND")) {
      found = NOT_FOUND;
    } else {
      found = new OperationStatus(true, line);
    }
    getCallback().receivedStatus(found);
    transitionState(OperationState.COMPLETE);
  }
View Full Code Here

  }

  @Override
  protected void finishedPayload(byte[] pl) throws IOException {
    if (errorCode == SASL_CONTINUE) {
      getCallback().receivedStatus(new OperationStatus(true, new String(pl)));
      transitionState(OperationState.COMPLETE);
    } else if (errorCode == 0) {
      getCallback().receivedStatus(new OperationStatus(true, ""));
      transitionState(OperationState.COMPLETE);
    } else {
      super.finishedPayload(pl);
    }
  }
View Full Code Here

  }

  @Override
  protected void decodePayload(byte[] pl) {
    getCallback().receivedStatus(
        new OperationStatus(true, String.valueOf(decodeLong(pl, 0))));
  }
View Full Code Here

    prepareBuffer(key, cas, data, flags, exp);
  }

  @Override
  protected OperationStatus getStatusForErrorCode(int errCode, byte[] errPl) {
    OperationStatus rv=null;
    switch(errCode) {
      case ERR_EXISTS:
        rv=EXISTS_STATUS;
        break;
      case ERR_NOT_FOUND:
View Full Code Here

   * @param statii several status objects
   * @return the appropriate status object
   */
  protected final OperationStatus matchStatus(String line,
      OperationStatus... statii) {
    OperationStatus rv=null;
    for(OperationStatus status : statii) {
      if(line.equals(status.getMessage())) {
        rv=status;
      }
    }
    if(rv == null) {
      rv=new OperationStatus(false, line);
    }
    return rv;
  }
View Full Code Here

  }

  protected void finishedPayload(byte[] pl) throws IOException {
    if(errorCode != 0) {
      OperationStatus status=getStatusForErrorCode(errorCode, pl);
      if(status == null) {
        handleError(OperationErrorType.SERVER, new String(pl));
      } else {
        getCallback().receivedStatus(status);
        transitionState(OperationState.COMPLETE);
View Full Code Here

    prepareBuffer(key, cas, data);
  }

  @Override
  protected OperationStatus getStatusForErrorCode(int errCode, byte[] errPl) {
    OperationStatus rv=null;
    switch(errCode) {
      case ERR_EXISTS:
        rv=EXISTS_STATUS;
        break;
      case ERR_NOT_FOUND:
View Full Code Here

    return errCode == ERR_NOT_FOUND ? NOT_FOUND_STATUS : null;
  }

  @Override
  protected void decodePayload(byte[] pl) {
    getCallback().receivedStatus(new OperationStatus(true,
      String.valueOf(decodeLong(pl, 0))));
  }
View Full Code Here

  }

  @Override
  public void handleLine(String line) {
    getLogger().debug("Result:  %s", line);
    OperationStatus found=null;
    if(line.equals("NOT_FOUND")) {
      found=NOT_FOUND;
    } else {
      found=new OperationStatus(true, line);
    }
    getCallback().receivedStatus(found);
    transitionState(OperationState.COMPLETE);
  }
View Full Code Here

TOP

Related Classes of net.spy.memcached.ops.OperationStatus

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.