com.basho.riak.client.raw.http
Class KeySource

java.lang.Object
  extended by com.basho.riak.client.raw.http.KeySource
All Implemented Interfaces:
Iterator<String>

public class KeySource
extends Object
implements Iterator<String>

Wraps the stream of keys from BucketResponse.getBucketInfo.getKeys in an iterator, handles closing the underlying http stream when finished.

Author:
russell

Constructor Summary
KeySource(BucketResponse bucketResponse)
          Create a Key Source from an http.BucketResponse in response to RiakClient.streamBucket(String) request.
 
Method Summary
 boolean hasNext()
           
 String next()
           
 void remove()
          This is a read only stream of keys, calling this results in UnsupportedOperationException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeySource

public KeySource(BucketResponse bucketResponse)
Create a Key Source from an http.BucketResponse in response to RiakClient.streamBucket(String) request. The bucket response contains a stream which this key source will close when this key source becomes weakly reachable. When you have finished iterating over the keys do not retain the key source.

Parameters:
bucketResponse - the BucketResponse with a List of keys.
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<String>

next

public String next()
Specified by:
next in interface Iterator<String>

remove

public void remove()
This is a read only stream of keys, calling this results in UnsupportedOperationException

Specified by:
remove in interface Iterator<String>
See Also:
Iterator.remove()


Copyright © 2012. All Rights Reserved.