Skip to content

Commit

Permalink
xds: throw UnsupportedOperation for unimplemented XdsClient interface…
Browse files Browse the repository at this point in the history
… methods (#7814)

Letting unimplemented XdsClient methods throw avoids misuses.
  • Loading branch information
voidzcy committed Jan 15, 2021
1 parent 727b17b commit 458b0e4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions xds/src/main/java/io/grpc/xds/XdsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ interface ListenerWatcher extends ResourceWatcher {
* Shutdown this {@link XdsClient} and release resources.
*/
void shutdown() {
throw new UnsupportedOperationException();
}

/**
Expand All @@ -487,54 +488,63 @@ boolean isShutDown() {
* Registers a data watcher for the given LDS resource.
*/
void watchLdsResource(String resourceName, LdsResourceWatcher watcher) {
throw new UnsupportedOperationException();
}

/**
* Unregisters the given LDS resource watcher.
*/
void cancelLdsResourceWatch(String resourceName, LdsResourceWatcher watcher) {
throw new UnsupportedOperationException();
}

/**
* Registers a data watcher for the given RDS resource.
*/
void watchRdsResource(String resourceName, RdsResourceWatcher watcher) {
throw new UnsupportedOperationException();
}

/**
* Unregisters the given RDS resource watcher.
*/
void cancelRdsResourceWatch(String resourceName, RdsResourceWatcher watcher) {
throw new UnsupportedOperationException();
}

/**
* Registers a data watcher for the given CDS resource.
*/
void watchCdsResource(String resourceName, CdsResourceWatcher watcher) {
throw new UnsupportedOperationException();
}

/**
* Unregisters the given CDS resource watcher.
*/
void cancelCdsResourceWatch(String resourceName, CdsResourceWatcher watcher) {
throw new UnsupportedOperationException();
}

/**
* Registers a data watcher for the given EDS resource.
*/
void watchEdsResource(String resourceName, EdsResourceWatcher watcher) {
throw new UnsupportedOperationException();
}

/**
* Unregisters the given EDS resource watcher.
*/
void cancelEdsResourceWatch(String resourceName, EdsResourceWatcher watcher) {
throw new UnsupportedOperationException();
}

/**
* Registers a watcher for a Listener with the given port.
*/
void watchListenerData(int port, ListenerWatcher watcher) {
throw new UnsupportedOperationException();
}

/**
Expand Down

0 comments on commit 458b0e4

Please sign in to comment.