public abstract class NedConnectionBase extends Object
Constructor and Description |
---|
NedConnectionBase() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
This method is invoked when a connection close is forced and no
NedWorker is involved.
|
abstract void |
close(NedWorker w)
This method is invoked when the connection is terminated.
|
abstract void |
command(NedWorker w,
String cmdName,
ConfXMLParam[] params)
This is for any optional commands on the device that are
not part of the yang files config data, but is modeled as
tailf:actions or rpcs in the device yang files.
|
abstract void |
commit(NedWorker w,
int timeout)
This indicates that the current set of operations should be
committed to the running configuration.
|
int |
connection_id() |
void |
createSubscription(NedWorker w,
String stream,
String startTime,
String filter,
int filterType)
This method is invoked to create a notification subscription.
|
abstract String |
device_id()
The device_id is originally provided by NCS to properly identify
the device.
|
NedCapability[] |
getCapas() |
int |
getConnectionId() |
NedCapability[] |
getStatsCapas() |
ConfXMLParam[] |
getSystemStateData() |
long |
getTimeInPool() |
NedWorker.TransactionIdMode |
getTransactionIdMode() |
abstract void |
getTransId(NedWorker w)
When this method is invoked the NED should produce a transaction
id that must be changed if any changes has been made to the
configuration since the last time the transaction id was requested.
|
boolean |
getUseStoredCapas() |
boolean |
getWantRevertDiff() |
String |
identity()
This should return the a unique (among registered NedConnection classes)
identity.
|
void |
initialize(NedWorker w)
Used for initializing an transaction.
|
boolean |
isAlive()
Deprecated.
Use the method
NedConnectionBase.isAlive(NedWorker)
instead.
If the NedConnectionBase.isAlive(NedWorker)
method is implemented in the NED, this method will not be
invoked. The NED must implement one of these methods. |
boolean |
isAlive(NedWorker w)
This method is invoked to check if a connection is still
alive.
|
boolean |
keepAlive(NedWorker w)
This method is invoked periodically to keep an connection
alive.
|
abstract String[] |
modules()
Which YANG modules are covered by the class instance.
|
abstract void |
persist(NedWorker w)
This method is invoked when the currently committed change set
should be made permanent.
|
abstract void |
reconnect(NedWorker w)
Used for resuming a connection found in the connection pool.
|
void |
setCapabilities(NedCapability[] capas)
This function is used to set the capabilities for a specific NED.
|
void |
setConnectionData(NedCapability[] capas,
NedCapability[] statscapas,
boolean wantRevertDiff,
NedWorker.TransactionIdMode transMode)
This function is used to set the parameters of NedConnection for
a specific NED.
|
void |
setPlatformData(ConfXMLParam[] platformData)
This function is used to set the platform operational data for
a specific NED.
|
void |
showStats(NedWorker w,
int th,
ConfPath path)
Deprecated.
|
void |
showStatsList(NedWorker w,
int th,
ConfPath path)
Deprecated.
|
void |
showStatsPath(NedWorker w,
int th,
ConfPath path)
When this method is invoked depending on the node type the NED should:
* if the path points to the list node or leaf-list node without
specifying the key, then the NED should populate the list keys.
|
abstract String |
type()
The type is one of "cli" and "generic".
|
void |
uninitialize(NedWorker w)
If the transaction is not completed and the NED has done initialize
this method is called to undo the transaction preparations.
|
void |
useStoredCapabilities()
This function is used to set the same capabilities as stored in
CDB for a particular device.
|
public long getTimeInPool()
public void setConnectionData(NedCapability[] capas, NedCapability[] statscapas, boolean wantRevertDiff, NedWorker.TransactionIdMode transMode)
capas
- an array of capabilities for config datastatscapas
- an array of capabilities for stats datawantRevertDiff
- Indicates if the NED should be provided with the edit operations
needed to undo the configuration changes done in
the prepare method when a transaction is aborted.transMode
- Indicates the mode of Transaction ID supported by the NED.
NONE if not supported. If supported, then getTransId()
should be implemented. Support for Transaction IDs is required
for check-sync action.public void setCapabilities(NedCapability[] capas)
capas
- an array of capabilities for config datapublic void useStoredCapabilities()
public void setPlatformData(ConfXMLParam[] platformData)
ConfXMLParam[] platformData = new ConfXMLParam[] { new ConfXMLParamStart("ncs", "platform"), new ConfXMLParamValue("ncs", "name", new ConfBuf("ios")), new ConfXMLParamValue("ncs", "version", new ConfBuf("15.0M")), new ConfXMLParamValue("ncs", "model", new ConfBuf("7200")), new ConfXMLParamStart("ginv", "inventory"), new ConfXMLParamValue("ginv", "name", new ConfBuf("lx-345")), new ConfXMLParamValue("ginv", "value", new ConfBuf("line-card")), new ConfXMLParamStop("ginv", "inventory"), new ConfXMLParamStart("ginv", "inventory"), new ConfXMLParamValue("ginv", nameStr, new ConfBuf("lx-1001")), new ConfXMLParamValue("ginv", "value", new ConfBuf("line-card")), new ConfXMLParamStop("ginv", "inventory"), new ConfXMLParamStart("ginv", "inventory"), new ConfXMLParamValue("ginv", "name", new ConfBuf("FA1209A4E389")), new ConfXMLParamValue("ginv", "value", new ConfBuf("licence")), new ConfXMLParamStop("ginv", "inventory"), new ConfXMLParamStop("ncs", "platform") }; setPlatformData(platformData);
platformData
- An ConfXMLParam array containing operational data to be set under
the platform container in the device model. Expected to start with
the platform tag. If the platform container is augmented with some user
specific model such data should also be part of this array to be set at
connection time.public int connection_id()
public int getConnectionId()
public NedCapability[] getCapas()
public NedCapability[] getStatsCapas()
public boolean getWantRevertDiff()
public NedWorker.TransactionIdMode getTransactionIdMode()
public ConfXMLParam[] getSystemStateData()
public boolean getUseStoredCapas()
public abstract String device_id()
public abstract String type()
public abstract String[] modules()
public String identity()
public abstract void commit(NedWorker w, int timeout) 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 NCS, i.e,
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.timeout
- If the commit operation does not complete within 'timeout' seconds
the operation should be aborted.Exception
public abstract void persist(NedWorker w) 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 NCS, i.e,
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.Exception
public abstract void close(NedWorker w) 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 NCS, i.e,
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.Exception
public abstract void close()
@Deprecated public boolean isAlive()
NedConnectionBase.isAlive(NedWorker)
instead.
If the NedConnectionBase.isAlive(NedWorker)
method is implemented in the NED, this method will not be
invoked. The NED must implement one of these methods.public boolean isAlive(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 NCS, i.e,
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 boolean keepAlive(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 NCS, i.e,
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 abstract void command(NedWorker w, String cmdName, ConfXMLParam[] params) 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 NCS, i.e,
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.cmdName
- Name of the command (path to action?)params
- Exception
@Deprecated public void showStats(NedWorker w, int th, ConfPath path) 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 NCS, i.e,
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.th
- a transaction handler that can be used in Maapipath
- a ConfPath indication which element is requestedException
@Deprecated public void showStatsList(NedWorker w, int th, ConfPath path) 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 NCS, i.e,
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.th
- a transaction handler that can be used in Maapipath
- a ConfPath indication which list is requestedException
public void showStatsPath(NedWorker w, int th, ConfPath path) 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 NCS, i.e,
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.th
- a transaction handler that can be used in Maapipath
- a ConfPath indication which list is requestedException
public abstract void getTransId(NedWorker w) 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 NCS, i.e,
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.Exception
public abstract void reconnect(NedWorker w) 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 NCS, i.e,
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.Exception
public void initialize(NedWorker w) 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 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.Exception
public void uninitialize(NedWorker w) 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 NCS, i.e,
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.Exception
public void createSubscription(NedWorker w, String stream, String startTime, String filter, int filterType) 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 NCS, i.e,
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.stream
- The notification stream to establish the subscription on.startTime
- Trigger the replay feature and indicate that the replay should
start at the time specified. If null, this is not a replay
subscription. It is not valid to specify start times that are
later than the current time. If the time specified is
earlier than the log can support, the replay will begin with
the earliest available notification. This parameter is of
dateTime XML schema type and compliant to RFC 3339.
Implementations must support time zones.filter
- Indicates which subset of all possible events is of interest.
The format of this parameter is the same as that of the filter
parameter in the NETCONF protocol operations. If not present,
all events not precluded by other parameters will be sent.filterType
- Indicates the type of filter if it is used:
Exception