1 package org.opendaylight.controller.netconf.util.handler.ssh.client;
3 import java.io.IOException;
6 * Abstract class providing mechanism of invoking various SSH level services.
7 * Class is not allowed to be extended, as it provides its own implementations via instance initiators.
9 public abstract class Invoker {
10 private boolean invoked = false;
14 protected boolean isInvoked() {
18 abstract void invoke(SshSession session) throws IOException;
21 * Invoker implementation to invokes subsystem SSH service.
26 public static Invoker subsystem(final String subsystem) {
27 return new Invoker() {
29 void invoke(SshSession session) throws IOException {
30 if (isInvoked() == true) throw new IllegalStateException("Already invoked.");
32 session.startSubSystem(subsystem);