class ShutdownServer extends AdminStatement {

    private final int port;
    private final String name;

    public ShutdownServer(ServerSession session, int port, String name) {
        super(session);
        this.port = port;
        this.name = name;
    }

    @Override
    public int getType() {
        return SQLStatement.SHUTDOWN_SERVER;
    }

    @Override
    public int update() {<FILL_FUNCTION_BODY>}

    public static ProtocolServerEngine getProtocolServerEngine(String name) {
        ProtocolServerEngine e = PluginManager.getPlugin(ProtocolServerEngine.class, name);
        if (e == null) {
            throw DbException.get(ErrorCode.PLUGIN_NOT_FOUND_1, name);
        }
        return e;
    }
}

        LealoneDatabase.checkAdminRight(session, "shutdown server");
        // 通过指定的名称来关闭server
        if (name != null) {
            ProtocolServerEngine e = getProtocolServerEngine(name);
            e.stop();
        } else {
            // 通过指定的端口号来关闭server，如果端口号小于0就关闭所有server
            ThreadUtils.start("ShutdownServerThread-Port-" + port, () -> {
                for (ProtocolServer server : ProtocolServerEngine.startedServers) {
                    if (port < 0 || server.getPort() == port) {
                        server.stop();
                    }
                }
            });
        }
        return 0;
    
<methods>public void <init>(com.lealone.db.session.ServerSession) ,public boolean needRecompile() <variables>