Modifier and Type | Class and Description |
---|---|
static class |
NedWorker.NotEnoughDataException |
static class |
NedWorker.NotImplementedException |
static class |
NedWorker.TransactionIdMode
Indicates the mode of Transaction ID supported by the NED.
|
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
static int |
CONNECT_BADAUTH
Deprecated.
Use
NedErrorCode.CONNECT_BADAUTH instead. |
static int |
CONNECT_BADKEY
Deprecated.
Use
NedErrorCode.CONNECT_BADKEY instead. |
static int |
CONNECT_BADPASS
Deprecated.
Use
NedErrorCode.CONNECT_BADAUTH instead. |
static int |
CONNECT_CONNECTION_REFUSED
Deprecated.
Use
NedErrorCode.CONNECT_CONNECTION_REFUSED instead. |
static int |
CONNECT_HOST_KEY_REJECTED
Deprecated.
Use
NedErrorCode.CONNECT_HOST_KEY_REJECTED instead. |
static int |
CONNECT_HOSTUNREACH
Deprecated.
Use
NedErrorCode.CONNECT_HOSTUNREACH instead. |
static int |
CONNECT_TIMEOUT
Deprecated.
Use
NedErrorCode.CONNECT_TIMEOUT instead. |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
NedWorker(int wid,
NedMux mux,
String host,
int port,
String id) |
Modifier and Type | Method and Description |
---|---|
void |
abortResponse()
This method is called by the NED to indicate that the
abort method has been successfully completed.
|
void |
commandResponse()
This method is called by the NED to indicate that the
command method has been successfully completed.
|
void |
commandResponse(ConfXMLParam[] reply)
This method is called by the NED to indicate that the
command method has been successfully completed when the NED
also has a reply.
|
void |
commitResponse()
This method should be invoked by a NedConnection instance when it has
completed a commit operation to indicate a successful completion
of the commit.
|
void |
connectError(int intCode)
Deprecated.
Use the method
NedWorker.connectError(NedErrorCode)
instead |
void |
connectError(int intCode,
String info)
Deprecated.
Use the method
NedWorker.connectError(NedErrorCode, String)
instead |
void |
connectError(NedErrorCode code)
|
void |
connectError(NedErrorCode code,
String info)
This method should be invoked if the NED fails to perform the
connect() operation.
|
void |
createSubscriptionResponse()
This method is invoked by a NedConnection instance when it has
completed to create a notification subsription.
|
NedCmd |
currentCommand() |
void |
error(int op,
NedErrorCode errCode,
String reason)
This function should be called when a callback like abort,persist,
etc cannot be completed.
|
void |
error(int op,
String reason)
This function should be called when a callback like abort,persist,
etc cannot be completed.
|
void |
error(int op,
String error,
String reason)
This error report function is kept for backward compatible reasons and
should if possible be avoided.
|
ConfPath |
getCurrentPath()
This method returns the current path associated with the
action being processed.
|
String |
getDevicePhase()
Get the phase of the device.
|
int |
getFromTransactionId()
This method returns an integer that represents the transaction
we are going from.
|
String |
getKeyDir()
This method returns the ssh public key directory as defined in the
auth map.
|
int |
getLoadOp()
This method returns the load operation that should
be used when populating the transaction in any of
the show methods.
|
String |
getNedId()
This method returns the ned-id for the ned associated with this worker.
|
String |
getPassword()
This method returns the backend password as defined in the
auth map.
|
String |
getRemoteUser()
This method returns the backend user name as defined in the
auth map.
|
String |
getSecondaryPassword()
This method returns the backend secondary password as defined in the
auth map.
|
InetSocketAddress |
getSourceAddress()
This method returns the source IP address if such an address
is configured in the ncs configuration.
|
int |
getToTransactionId()
This method returns an integer that represents the transaction
we are going to, i.e the proposed new system state.
|
void |
getTransIdResponse(String id)
This method is called by the NED to send a response to the
getTransId request.
|
int |
getUsid()
This method returns an integer that represents the user session
that initiated this NedWorker.
|
void |
initializeResponse(String id)
This method is called by the NED to send a response to the
initialize request.
|
void |
isAliveResponse(boolean alive) |
boolean |
isSuppressTransId()
The initialize call can request the trans_id response to be suppressed.
|
boolean |
isVerbose()
This method helps NED determine whether an action has been invoked with
the verbose parameter.
|
void |
log(String msg)
Send log messages to NCS.
|
void |
notification(String data)
Send notification to NCS once subsciption has been created.
|
void |
persistResponse()
This method is called by the NED to indicate that the
persist method has been successfully completed.
|
void |
prepareDryResponse(String output)
This method should be invoked by a NedConnection instance when it has
completed a prepare dry operation to indicate a successful completion
of and the result of the dry run.
|
void |
prepareDryUnsupportedResponse()
This method should be invoked by a NedConnection instance when a
prepare dry operation is invoked and the NED is not able to support
such an operation.
|
void |
prepareResponse()
This method should be invoked by a NedConnection instance when it has
completed a prepare operation to indicate a successful completion
of the prepare.
|
void |
revertResponse()
This method should be invoked by a NedConnection instance when it has
completed a revert operation to indicate a successful completion
of the revert.
|
void |
run() |
void |
setAdditionalInfo(String info)
Set information to be passed back to the caller, typically
parse information if the user invokes a show action with
the verbose parameter.
|
void |
setProvisionalTransId(String id)
This method allows the NED to set transaction ID provisionally from
NedCliBase.show(NedWorker, String) or
NedGenericBase.show(NedWorker, int) NED callback. |
void |
setTimeout(int ms)
When the NED worker gets invoked, it gets passed three timeout
values, connect/read/write timeouts.
|
void |
showCliResponse(ArrayList<String> l) |
void |
showCliResponse(String config)
This method is invoked by a NedCli instance in response to a show
method invocation.
|
void |
showGenericResponse()
This method is invoked by a NedGeneric when it has completed
populating the transaction with the requested configuration
sub-tree.
|
void |
showStatsListResponse(int ttl,
NedTTL[] ttls)
This method is invoked during the showStatsList() request
to indicate that the NED has successfully populated at least
the full list with all existing instances (no data below each
instance key is required, but may be supplied).
|
void |
showStatsPathResponse(NedTTL[] ttls)
This method is invoked during the showStatsPath() request
to indicate that the NED has successfully populated the requested
subtree.
|
void |
showStatsResponse(NedTTL[] ttls)
This method is invoked during the invocation of the
showStats() method to indicate that the Ned has completed
populating the transaction with the requested stats (and
possibly more than that).
|
void |
trace(String msg,
String direction,
String device_id)
Send trace message to the NCS.
|
void |
uninitializeResponse()
This method should be invoked by a NedConnection instance when it has
completed a uninitialize operation to indicate a successful
uninitialization
|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
@Deprecated public static final int CONNECT_CONNECTION_REFUSED
NedErrorCode.CONNECT_CONNECTION_REFUSED
instead.@Deprecated public static final int CONNECT_TIMEOUT
NedErrorCode.CONNECT_TIMEOUT
instead.@Deprecated public static final int CONNECT_BADPASS
NedErrorCode.CONNECT_BADAUTH
instead.@Deprecated public static final int CONNECT_BADKEY
NedErrorCode.CONNECT_BADKEY
instead.@Deprecated public static final int CONNECT_HOSTUNREACH
NedErrorCode.CONNECT_HOSTUNREACH
instead.@Deprecated public static final int CONNECT_HOST_KEY_REJECTED
NedErrorCode.CONNECT_HOST_KEY_REJECTED
instead.@Deprecated public static final int CONNECT_BADAUTH
NedErrorCode.CONNECT_BADAUTH
instead.public void log(String msg) throws Exception
msg
- Exception
public void trace(String msg, String direction, String device_id)
public void setTimeout(int ms)
ms
- the number of milliseconds to set the new timeout to.public void setAdditionalInfo(String info)
info
- public String getDevicePhase()
public void commitResponse() throws IOException, NedException
IOException
NedException
public void prepareResponse() throws IOException, NedException
IOException
NedException
public void prepareDryResponse(String output) throws IOException, NedException
IOException
NedException
public void prepareDryUnsupportedResponse() throws IOException, NedException
IOException
NedException
public void revertResponse() throws IOException, NedException
IOException
NedException
public void showCliResponse(String config) throws IOException, NedException
config
- IOException
NedException
public void showCliResponse(ArrayList<String> l) throws IOException, NedException
IOException
NedException
public void showGenericResponse() throws IOException, NedException
IOException
NedException
public void showStatsResponse(NedTTL[] ttls) throws IOException, NedException
ttls
- an array of timeouts for different paths.IOException
NedException
public void showStatsListResponse(int ttl, NedTTL[] ttls) throws IOException, NedException
ttl
- is the timeout for the list. The list will be removed from
the cache when the timeout has expired.ttls
- an array of ttls for different paths. If the NED provides more
data than the actual list, it may optionally provide different
cache timeouts for different paths. All data below a path
will be removed from the cache when the timeout expires.IOException
NedException
public void showStatsPathResponse(NedTTL[] ttls) throws IOException, NedException
ttls
- an array of ttls for different paths. The NED may optionally provide
different cache timeouts for different paths.IOException
NedException
public void abortResponse() throws IOException, NedException
IOException
NedException
public void persistResponse() throws IOException, NedException
IOException
NedException
public void commandResponse() throws IOException, NedException
IOException
NedException
public void commandResponse(ConfXMLParam[] reply) throws IOException, NedException
reply
- is the return value from executing the commandIOException
NedException
public ConfPath getCurrentPath()
public int getFromTransactionId()
Maapi.attach(int,int,int)
Some complicated NEDs may require to read data from the system
the way it looked like before the current transaction arrived.public int getToTransactionId()
Maapi.attach(int,int,int)
Some complicated NEDs may require to read data from the system
the way it is going to look like once the current transaction is
committed.public int getUsid()
public String getNedId()
public String getRemoteUser()
public String getPassword()
public String getSecondaryPassword()
public String getKeyDir()
public int getLoadOp()
public void getTransIdResponse(String id) throws IOException, NedException
id
- is a string representing a transaction idIOException
NedException
public void isAliveResponse(boolean alive) throws IOException, NedException
IOException
NedException
public InetSocketAddress getSourceAddress()
public void initializeResponse(String id) throws IOException, NedException
id
- is a string representing a transaction idIOException
NedException
public void uninitializeResponse() throws IOException, NedException
IOException
NedException
public void createSubscriptionResponse() throws IOException, NedException
IOException
NedException
public void notification(String data)
data
- public boolean isSuppressTransId()
public boolean isVerbose()
NedWorker.setAdditionalInfo(String)
.public void setProvisionalTransId(String id)
NedCliBase.show(NedWorker, String)
or
NedGenericBase.show(NedWorker, int)
NED callback.
If NSO needs to fetch the transaction ID immediately after the show()
callback, it will first check whether the show() callback has indicated
any provisional transaction ID and in such case use this value. If no
provisional transaction ID has been supplied, then NSO will call
getTransId() as needed.
If a CLI NED has multiple top tags, then show() callback may be called
multiple times as a part of single operation. In such case the NSO will
only use the provisional transaction ID if show() has been called on all
top tags as a part of such logical operation, and the last provisional
transaction ID set by the NED will be used.public NedCmd currentCommand()
public void error(int op, String reason)
op
- is the command originally issued from NCS, ie a NedCmd.getCommand()
integer like NedCmd.CONNECT_CLI, NedCmd.CONNECT_GENERIC,
NedCmd.PREPARE_CLI, ...reason
- is the reason for the errorpublic void error(int op, String error, String reason)
op
- is the command originally issued from NCS, ie a NedCmd.getCommand()
integer like NedCmd.CONNECT_CLI, NedCmd.CONNECT_GENERIC,
NedCmd.PREPARE_CLI, ...error
- string representation of a NedErrorCodereason
- textual description of the reason for the errorpublic void error(int op, NedErrorCode errCode, String reason)
op
- is the command originally issued from NCS, ie a NedCmd.getCommand()
integer like NedCmd.CONNECT_CLI, NedCmd.CONNECT_GENERIC,
NedCmd.PREPARE_CLI, ...errCode
- NedErrorCode for the errorreason
- textual description of the reason for the errorpublic void connectError(NedErrorCode code) throws NedException
NedException
public void connectError(NedErrorCode code, String info) throws NedException
code
- is the reason for the connect to fail. See
NedErrorCode.CONNECT_CONNECTION_REFUSED
,
NedErrorCode.CONNECT_TIMEOUT
,
etc.info
- is a string describing the connect error. Normally this parameter
is not needed. If it is given, it will be appended to the
error message all the way to the northbound agent invoking
the NED connect callNedException
@Deprecated public void connectError(int intCode) throws NedException
NedWorker.connectError(NedErrorCode)
insteadNedException
@Deprecated public void connectError(int intCode, String info) throws NedException
NedWorker.connectError(NedErrorCode, String)
insteadNedException