⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simulatedservice.java

📁 opennms得相关源码 请大家看看
💻 JAVA
字号:
package org.opennms.test.netsim;public final class SimulatedService{    private SimulatedInterface _interface;    private String _servicename = "";    private boolean _isUp = true;    private String _remoteScript = "";    public SimulatedService(String name, String remoteScript)    {        this._servicename = name;        this._remoteScript = remoteScript;    }    protected void setParentInterface(SimulatedInterface iface)    {        this._interface = iface;    }    protected SimulatedInterface getParentInterface()    {        return this._interface;    }    public String getName()    {        return this._servicename;    }    public void start()    {        SimulatorController cont = this.getParentInterface().getParentNode().getParentController();        String command = this._remoteScript                        + " start "                        + cont.getLocalInetAddress().getHostAddress()                       + " "                        + this.getParentInterface().getIpAddress();        cont.sendCommand(command);        this._isUp = true;    }    public void stop()    {        SimulatorController cont = this.getParentInterface().getParentNode().getParentController();        String command = this._remoteScript                        + " stop "                        + cont.getLocalInetAddress().getHostAddress()                       + " "                        + this.getParentInterface().getIpAddress();        cont.sendCommand(command);        this._isUp = false;    }    public boolean isUp()    {        return this._isUp;    }    public boolean isDown()    {        return !(this.isUp());    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -