public class Watch<T> extends java.lang.Object implements Watchable<T>
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.JSON json,
com.squareup.okhttp.ResponseBody body,
java.lang.reflect.Type watchType,
com.squareup.okhttp.Call call) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static <T> Watch<T> |
createWatch(io.kubernetes.client.ApiClient client,
com.squareup.okhttp.Call call,
java.lang.reflect.Type watchType)
Creates a watch on a TYPENAME (T) using an API Client and a Call object.
|
boolean |
hasNext() |
protected boolean |
isStatus(java.lang.String line) |
java.util.Iterator<Watch.Response<T>> |
iterator() |
Watch.Response<T> |
next() |
protected Watch.Response<T> |
parseLine(java.lang.String line) |
void |
remove() |
protected Watch(io.kubernetes.client.JSON json, com.squareup.okhttp.ResponseBody body, java.lang.reflect.Type watchType, com.squareup.okhttp.Call call)
public static <T> Watch<T> createWatch(io.kubernetes.client.ApiClient client, com.squareup.okhttp.Call call, java.lang.reflect.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 java.util.Iterator<Watch.Response<T>>
protected boolean isStatus(java.lang.String line) throws java.io.IOException
java.io.IOException
protected Watch.Response<T> parseLine(java.lang.String line) throws java.io.IOException
java.io.IOException
public boolean hasNext()
hasNext
in interface java.util.Iterator<Watch.Response<T>>
public java.util.Iterator<Watch.Response<T>> iterator()
iterator
in interface java.lang.Iterable<Watch.Response<T>>
public void remove()
remove
in interface java.util.Iterator<Watch.Response<T>>
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
Copyright © 2019. All rights reserved.