model: Allow renaming tunnels

Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
Samuel Holland
2018-01-07 01:22:31 -06:00
parent e70b242c01
commit 30396b8718
2 changed files with 32 additions and 0 deletions
@@ -112,6 +112,12 @@ public class Tunnel extends BaseObservable implements Keyed<String> {
notifyPropertyChanged(BR.statistics);
}
public CompletionStage<Tunnel> rename(@NonNull final String name) {
if (!name.equals(this.name))
return manager.rename(this, name);
return CompletableFuture.completedFuture(this);
}
public CompletionStage<Config> setConfig(@NonNull final Config config) {
if (!config.equals(this.config))
return manager.setTunnelConfig(this, config);