Package com.tailf.progress
Class ProgressTraceNed
Object
com.tailf.progress.ProgressTrace
com.tailf.progress.ProgressTraceNed
The purpose of ProgressTraceNed
class
is to make it easy for a NED to interact with NSO's
progress trace framework with the concept of spans.
ProgressTraceNed(Maapi, String)
,
and the device phase is set using
setPhase(String)
method. For example:
ProgressTraceNed progress = new ProgressTraceNed(maapi, "mydev"); progress.setPhase("connect"); progress.event("connect");
- See Also:
-
Constructor Summary
ConstructorDescriptionProgressTraceNed
(Maapi maapi, String deviceId) Creates a new instance ofProgressTraceNed
-
Method Summary
Modifier and TypeMethodDescriptionvoid
event
(Maapi.Verbosity verbosity, String message) Report an eventvoid
event
(Maapi.Verbosity verbosity, String message, Attributes attributes) Report an eventvoid
Report an eventvoid
setDeviceId
(String deviceId) Set a device IDvoid
Set a NED phasestartSpan
(Maapi.Verbosity verbosity, String message) Start a new spanstartSpan
(Maapi.Verbosity verbosity, String message, Attributes attributes, Span[] links) Start a new spanStart a new spanMethods inherited from class com.tailf.progress.ProgressTrace
endSpan, endSpan, getCurrentSpan, setServicePath
-
Constructor Details
-
ProgressTraceNed
Creates a new instance ofProgressTraceNed
- Parameters:
maapi
- aMAAPI
instancedeviceId
- device ID- Throws:
ConfException
- is thrown if device Id is eithernull
or empty
-
-
Method Details
-
setDeviceId
Set a device ID- Parameters:
deviceId
- the device ID
-
setPhase
Set a NED phase- Parameters:
phase
- the NED phase
-
event
Report an event- Overrides:
event
in classProgressTrace
- Parameters:
message
- message to report- Throws:
IOException
ConfException
IOException
-
event
Report an event- Overrides:
event
in classProgressTrace
- Parameters:
verbosity
- at which verbosity level the message should be reportedmessage
- message to report- Throws:
ConfException
- is thrown if either device Id or device phase is not set.IOException
-
event
public void event(Maapi.Verbosity verbosity, String message, Attributes attributes) throws IOException, ConfException Report an event- Overrides:
event
in classProgressTrace
- Parameters:
verbosity
- at which verbosity level the message should be reportedmessage
- message to reportattributes
- attributes of the events. This can benull
.- Throws:
ConfException
- is thrown if either device Id or device phase is not set.IOException
-
startSpan
Start a new span- Overrides:
startSpan
in classProgressTrace
- Parameters:
message
- message of the span- Returns:
- a
Span
object that is used forProgressTrace.endSpan(com.tailf.progress.Span)
- Throws:
ConfException
- is thrown if either device Id or device phase is not set.IOException
-
startSpan
Start a new span- Overrides:
startSpan
in classProgressTrace
- Parameters:
verbosity
- at which verbosity level the message should be reportedmessage
- message of the span- Returns:
- a
Span
object that can used inProgressTrace.endSpan(com.tailf.progress.Span)
- Throws:
ConfException
- is thrown if either device Id or device phase is not set.IOException
-
startSpan
public Span startSpan(Maapi.Verbosity verbosity, String message, Attributes attributes, Span[] links) throws IOException, ConfException Start a new span- Overrides:
startSpan
in classProgressTrace
- Parameters:
verbosity
- at which verbosity level the message should be reportedmessage
- message of the spanattributes
- attributes of the span This can benull
.links
- list of linked spans This can benull
.- Returns:
- a
Span
object that can used inProgressTrace.endSpan(com.tailf.progress.Span)
- Throws:
ConfException
- is thrown if either device Id or device phase is not set.IOException
-