public abstract class NedCliBase extends NedConnectionBase
Constructor and Description |
---|
NedCliBase() |
Modifier and Type | Method and Description |
---|---|
abstract void |
abort(NedWorker w,
String data)
Is invoked by NCS to abort the configuration to the state before the
previous prepare() invocation.
|
NedCliBase |
initNoConnect(String device_id,
NedMux mux,
NedWorker worker)
Make a new instance of Ned object without establishing a connection
towards the device.
|
abstract boolean |
isConnection(String deviceId,
InetAddress ip,
int port,
String proto,
String ruser,
String pass,
String secpass,
String keydir,
boolean trace,
int connectTimeout,
int readTimeout,
int writeTimeout)
Used by the connection pool to find a matching connection.
|
abstract NedCliBase |
newConnection(String deviceId,
InetAddress ip,
int port,
String proto,
String ruser,
String pass,
String secpass,
String publicKeyDir,
boolean trace,
int connectTimeout,
int readTimeout,
int writeTimeout,
NedMux mux,
NedWorker w)
Establish a new connection to a device and send response to
NCS with information about the device.
|
abstract void |
prepare(NedWorker w,
String data)
Is invoked by NCS to take the configuration to a new state.
|
abstract void |
prepareDry(NedWorker w,
String data)
Is invoked by NCS to tell the NED what actions it should take towards
the device if it should do a prepare.
|
abstract void |
revert(NedWorker w,
String data)
Is invoked by NCS to undo the changes introduced in the last commit
operation (communicated to the NED in the prepare method invocation).
|
abstract void |
show(NedWorker w,
String toptag)
Extract parts of the configuration and send it to NCS.
|
void |
showOffline(NedWorker w,
String toptag,
String data)
Extract parts of the configuration and send it to NCS.
|
void |
showPartial(NedWorker w,
ConfPath[] paths)
Extract parts of the configuration and send it to NCS.
|
void |
showPartial(NedWorker w,
ConfPath[] paths,
String[] cmdpaths)
Extract parts of the configuration and send it to NCS.
|
void |
showPartial(NedWorker w,
String[] cmdpaths)
Deprecated.
Use the method
NedCliBase.showPartial(NedWorker,ConfPath[],String[])
instead.
Extract parts of the configuration and send it to NCS. The response
is sent by invoking the w.showCliResponse() method in the provided
NedWorker. |
close, close, command, commit, connection_id, createSubscription, device_id, getCapas, getConnectionId, getStatsCapas, getSystemStateData, getTimeInPool, getTransactionIdMode, getTransId, getUseStoredCapas, getWantRevertDiff, identity, initialize, isAlive, isAlive, keepAlive, modules, persist, reconnect, setCapabilities, setConnectionData, setPlatformData, showStats, showStatsList, showStatsPath, type, uninitialize, useStoredCapabilities
public abstract void prepare(NedWorker w, String data) throws Exception
w
- The NedWorker instance currently responsible for driving the
communication
between NCS and the device. This NedWorker instance should be
used when communicating with the NCS, ie for sending responses,
errors, and trace messages. It is also implements the NedTracer
API and can be used in, for example, the SSHSession as a tracer.data
- is the CLI commands for transforming the configuration to
a new state. The commands are generated using the YANG data
model in combination with the tailf: extensions to guide the
mapping.Exception
public abstract void prepareDry(NedWorker w, String data) throws Exception
prepareDryResponse()
when the operation is completed. If no changes needs to be done
just answer prepareDryResponse(data)
If an error is detected answer this through a call to
error()
in NedWorker w
.w
- The NedWorker instance currently responsible for driving the
communication
between NCS and the device. This NedWorker instance should be
used when communicating with the NCS, ie for sending responses,
errors, and trace messages. It is also implements the
NedTracer
API and can be used in, for example, the SSHSession
as a tracer.data
- is the CLI commands for transforming the configuration to
a new state. The commands are generated using the YANG data
model in combination with the tailf: extensions to guide the
mapping.Exception
public abstract void abort(NedWorker w, String data) throws Exception
w
- The NedWorker instance currently responsible for driving the
communication
between NCS and the device. This NedWorker instance should be
used when communicating with the NCS, ie for sending responses,
errors, and trace messages. It is also implements the NedTracer
API and can be used in, for example, the SSHSession as a tracer.data
- is the commands for taking the config back to the previous
state. The commands are generated using the YANG data
model in combination with the tailf: extensions to guide the
mapping.Exception
public abstract void revert(NedWorker w, String data) throws Exception
w
- The NedWorker instance currently responsible for driving the
communication
between NCS and the device. This NedWorker instance should be
used when communicating with the NCS, ie for sending responses,
errors, and trace messages. It is also implements the NedTracer
API and can be used in, for example, the SSHSession as a tracer.data
- is the commands for taking the config back to the previous
state.Exception
public abstract void show(NedWorker w, String toptag) throws Exception
w
- The NedWorker instance currently responsible for driving the
communication
between NCS and the device. This NedWorker instance should be
used when communicating with the NCS, ie for sending responses,
errors, and trace messages. It is also implements the NedTracer
API and can be used in, for example, the SSHSession as a tracer.toptag
- is the top level tag indicating which part of the config
should be extracted.Exception
@Deprecated public void showPartial(NedWorker w, String[] cmdpaths) throws Exception
NedCliBase.showPartial(NedWorker,ConfPath[],String[])
instead.
Extract parts of the configuration and send it to NCS. The response
is sent by invoking the w.showCliResponse() method in the provided
NedWorker.w
- The NedWorker instance currently responsible for driving the
communication
between NCS and the device. This NedWorker instance should be
used when communicating with the NCS, ie for sending responses,
errors, and trace messages. It is also implements the NedTracer
API and can be used in, for example, the SSHSession as a tracer.cmdpaths
- are cmd paths to filter the various parts of the configuration tree
that should be extracted.Exception
public void showPartial(NedWorker w, ConfPath[] paths) throws Exception
w
- The NedWorker instance currently responsible for driving the
communication
between NCS and the device. This NedWorker instance should be
used when communicating with the NCS, ie for sending responses,
errors, and trace messages. It is also implements the NedTracer
API and can be used in, for example, the SSHSession as a tracer.paths
- are paths to filter the various parts of the configuration tree
that should be extracted.Exception
public void showPartial(NedWorker w, ConfPath[] paths, String[] cmdpaths) throws Exception
w
- The NedWorker instance currently responsible for driving the
communication
between NCS and the device. This NedWorker instance should be
used when communicating with the NCS, ie for sending responses,
errors, and trace messages. It is also implements the NedTracer
API and can be used in, for example, the SSHSession as a tracer.paths
- are paths to filter the various parts of the configuration tree
that should be extracted.cmdpaths
- are cmd paths to filter the various parts of the configuration tree
that should be extracted.Exception
public void showOffline(NedWorker w, String toptag, String data) throws Exception
w
- The NedWorker instance currently responsible for driving the
communication
between NCS and the device. This NedWorker instance should be
used when communicating with the NCS, ie for sending responses,
errors, and trace messages. It is also implements the NedTracer
API and can be used in, for example, the SSHSession as a tracer.toptag
- is the top level tag indicating which part of the config
should be extracted.data
- is the CLI commands in native format.Exception
public abstract boolean isConnection(String deviceId, InetAddress ip, int port, String proto, String ruser, String pass, String secpass, String keydir, boolean trace, int connectTimeout, int readTimeout, int writeTimeout)
deviceId
- name of deviceip
- address to connect to deviceport
- port to connect toproto
- ssh or telnetruser
- name of user to connect aspass
- password to use when connectingsecpass
- secondary password to use when entering config mode,
set to empty string if not configured in the authgrouptrace
- indicates if raw trace messages should be generated or notconnectTimeout
- in millisecondsreadTimeout
- in millisecondswriteTimeout
- in millisecondspublic abstract NedCliBase newConnection(String deviceId, InetAddress ip, int port, String proto, String ruser, String pass, String secpass, String publicKeyDir, boolean trace, int connectTimeout, int readTimeout, int writeTimeout, NedMux mux, NedWorker w)
deviceId
- name of deviceip
- address to connect to deviceport
- port to connect toproto
- ssh or telnetruser
- name of user to connect aspass
- password to use when connectingsecpass
- secondary password to use when entering config mode,
set to empty string if not configured in the authgrouppublicKeyDir
- directory to read public keys. null if password is
giventrace
- indicates if raw trace messages should be generated or notconnectTimeout
- in millisecondsreadTimeout
- in millisecondswriteTimeout
- in millisecondsmux
- w
- The NedWorker instance currently responsible for driving the
communication
between NCS and the device. This NedWorker instance should be
used when communicating with the NCS, ie for sending responses,
errors, and trace messages. It is also implements the NedTracer
API and can be used in, for example, the SSHSession as a tracer.public NedCliBase initNoConnect(String device_id, NedMux mux, NedWorker worker) throws NedWorker.NotEnoughDataException
device_id
- name of devicemux
- worker
- The NedWorker instance currently responsible for driving the
communication between NCS and the device. This NedWorker instance
should be used when communicating with the NCS, ie for sending
responses, errors, and trace messages.NedWorker.NotEnoughDataException