public class Watch<T> extends Object implements Watchable<T>, Closeable
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 | Constructor and Description |
---|---|
protected |
Watch(io.kubernetes.client.openapi.JSON json,
okhttp3.ResponseBody body,
Type watchType,
okhttp3.Call call) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static <T> Watch<T> |
createWatch(io.kubernetes.client.openapi.ApiClient client,
okhttp3.Call call,
Type watchType)
Creates a watch on a TYPENAME (T) using an API Client and a Call object.
|
boolean |
hasNext() |
protected boolean |
isStatus(String line) |
Iterator<Watch.Response<T>> |
iterator() |
Watch.Response<T> |
next() |
protected Watch.Response<T> |
parseLine(String line) |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
forEachRemaining
protected Watch(io.kubernetes.client.openapi.JSON json, okhttp3.ResponseBody body, Type watchType, okhttp3.Call call)
public static <T> Watch<T> createWatch(io.kubernetes.client.openapi.ApiClient client, okhttp3.Call call, Type watchType) throws io.kubernetes.client.openapi.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.openapi.ApiException
- on IO exceptions.public Watch.Response<T> next()
next
in interface Iterator<Watch.Response<T>>
protected boolean isStatus(String line) throws IOException
IOException
protected Watch.Response<T> parseLine(String line) throws IOException
IOException
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 © 2020. All rights reserved.