public class Watch<T> extends Object implements Iterable<Watch.Response<T>>, Iterator<Watch.Response<T>>, Closeable, AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
Watch.Response<T>
Response class holds a watch response that has a `type` that can be ADDED, MODIFIED, DELETED
and ERROR.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
static <T> Watch<T> |
createWatch(io.kubernetes.client.ApiClient client,
com.squareup.okhttp.Call call,
Type watchType)
Creates a watch on a TYPENAME (T) using an API Client and a Call object.
|
boolean |
hasNext() |
Iterator<Watch.Response<T>> |
iterator() |
Watch.Response<T> |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
forEachRemaining
public static <T> Watch<T> createWatch(io.kubernetes.client.ApiClient client, com.squareup.okhttp.Call call, Type watchType) throws io.kubernetes.client.ApiException
T
- TYPENAME.client
- the API clientcall
- the call object returned by api.{ListOperation}Call(...) method. Make sure watch
flag is set in the call.watchType
- The type of the WatchResponse<T>. Use something like new
TypeToken<Watch.Response<TYPENAME>>(){}.getType()io.kubernetes.client.ApiException
- on IO exceptions.public Watch.Response<T> next()
next
in interface Iterator<Watch.Response<T>>
public boolean hasNext()
hasNext
in interface Iterator<Watch.Response<T>>
public Iterator<Watch.Response<T>> iterator()
iterator
in interface Iterable<Watch.Response<T>>
public void remove()
remove
in interface Iterator<Watch.Response<T>>
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2018. All rights reserved.