예제 #1
0
  /* (non-Javadoc)
   * @see com.basho.riak.client.HttpRiakObject#fetchMeta(com.basho.riak.client.request.RequestMeta)
   */
  public FetchResponse fetchMeta(RequestMeta meta) {
    if (riak == null)
      throw new IllegalStateException("Cannot fetch meta for an object without a RiakClient");

    FetchResponse r = riak.fetchMeta(bucket, key, meta);
    if (r.isSuccess()) {
      this.updateMeta(r);
    }
    return r;
  }
예제 #2
0
  /* (non-Javadoc)
   * @see com.basho.riak.client.HttpRiakObject#store(com.basho.riak.client.RiakClient, com.basho.riak.client.request.RequestMeta)
   */
  public StoreResponse store(RiakClient riak, RequestMeta meta) {
    if (riak == null)
      throw new IllegalStateException("Cannot store an object without a RiakClient");

    StoreResponse r = riak.store(this, meta);
    if (r.isSuccess()) {
      this.updateMeta(r);
    }
    return r;
  }
예제 #3
0
  /* (non-Javadoc)
   * @see com.basho.riak.client.HttpRiakObject#fetch(com.basho.riak.client.request.RequestMeta)
   */
  public FetchResponse fetch(RequestMeta meta) {
    if (riak == null)
      throw new IllegalStateException("Cannot fetch an object without a RiakClient");

    FetchResponse r = riak.fetch(bucket, key, meta);
    if (r.getObject() != null) {
      RiakObject other = r.getObject();
      shallowCopy(other);
      r.setObject(this);
    }
    return r;
  }
예제 #4
0
  /* (non-Javadoc)
   * @see com.basho.riak.client.HttpRiakObject#delete(com.basho.riak.client.request.RequestMeta)
   */
  public HttpResponse delete(RequestMeta meta) {
    if (riak == null)
      throw new IllegalStateException("Cannot delete an object without a RiakClient");

    return riak.delete(bucket, key, meta);
  }