Package org.netxms.client.datacollection
Class Threshold
java.lang.Object
org.netxms.client.datacollection.Threshold
Represents data collection item's threshold
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final String[]
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final String[]
-
Constructor Summary
ConstructorDescriptionCreate new threshold objectThreshold
(NXCPMessage msg, long baseId) Create DCI threshold object from NXCP messageCopy constructor -
Method Summary
Modifier and TypeMethodDescriptionDuplicate threshold for later use (do not copy ID for duplicated threshold)protected void
fillMessage
(NXCPMessage msg, long baseId) Fill NXCP message with threshold's data.int
int
long
getId()
Get message from last event generated when this threshold was activated.Get timestamp of last event generated when this threshold was activated.int
int
int
int
Get textual representation of this thresholdgetValue()
boolean
isActive()
Returns true if threshold is currently active (it's condition was evaluated to true at last poll).void
setFireEvent
(int fireEvent) void
setFunction
(int function) void
setOperation
(int operation) void
setRearmEvent
(int rearmEvent) void
setRepeatInterval
(int repeatInterval) void
setSampleCount
(int sampleCount) Set sample count for thresholdvoid
void
-
Field Details
-
F_LAST
public static final int F_LAST- See Also:
-
F_AVERAGE
public static final int F_AVERAGE- See Also:
-
F_MEAN_DEVIATION
public static final int F_MEAN_DEVIATION- See Also:
-
F_DIFF
public static final int F_DIFF- See Also:
-
F_ERROR
public static final int F_ERROR- See Also:
-
F_SUM
public static final int F_SUM- See Also:
-
F_SCRIPT
public static final int F_SCRIPT- See Also:
-
F_ABS_DEVIATION
public static final int F_ABS_DEVIATION- See Also:
-
OP_LE
public static final int OP_LE- See Also:
-
OP_LE_EQ
public static final int OP_LE_EQ- See Also:
-
OP_EQ
public static final int OP_EQ- See Also:
-
OP_GT_EQ
public static final int OP_GT_EQ- See Also:
-
OP_GT
public static final int OP_GT- See Also:
-
OP_NE
public static final int OP_NE- See Also:
-
OP_LIKE
public static final int OP_LIKE- See Also:
-
OP_NOTLIKE
public static final int OP_NOTLIKE- See Also:
-
FUNCTION_NAMES
-
OPERATION_NAMES
-
-
Constructor Details
-
Threshold
Create DCI threshold object from NXCP message- Parameters:
msg
- NXCP messagebaseId
- Base variable ID for this threshold in message
-
Threshold
public Threshold()Create new threshold object -
Threshold
Copy constructor- Parameters:
src
- source object
-
-
Method Details
-
fillMessage
Fill NXCP message with threshold's data. Operational data maintained by server will not be put into message.- Parameters:
msg
- NXCP messagebaseId
- Base variable identifier
-
getFireEvent
public int getFireEvent()- Returns:
- the fireEvent
-
setFireEvent
public void setFireEvent(int fireEvent) - Parameters:
fireEvent
- the fireEvent to set
-
getRearmEvent
public int getRearmEvent()- Returns:
- the rearmEvent
-
setRearmEvent
public void setRearmEvent(int rearmEvent) - Parameters:
rearmEvent
- the rearmEvent to set
-
getSampleCount
public int getSampleCount()- Returns:
- sample count
-
setSampleCount
public void setSampleCount(int sampleCount) Set sample count for threshold- Parameters:
sampleCount
- sample count
-
getFunction
public int getFunction()- Returns:
- the function
-
setFunction
public void setFunction(int function) - Parameters:
function
- the function to set
-
getOperation
public int getOperation()- Returns:
- the operation
-
setOperation
public void setOperation(int operation) - Parameters:
operation
- the operation to set
-
getRepeatInterval
public int getRepeatInterval()- Returns:
- the repeatInterval
-
setRepeatInterval
public void setRepeatInterval(int repeatInterval) - Parameters:
repeatInterval
- the repeatInterval to set
-
getValue
- Returns:
- the value
-
setValue
- Parameters:
value
- the value to set
-
getId
public long getId()- Returns:
- the id
-
isActive
public boolean isActive()Returns true if threshold is currently active (it's condition was evaluated to true at last poll). This field cannot be set and is always false when threshold received as part of DCI configuration.- Returns:
- the active status
-
getCurrentSeverity
- Returns:
- the currentSeverity
-
getLastEventTimestamp
Get timestamp of last event generated when this threshold was activated.- Returns:
- timestamp of last event generated when this threshold was activated or 0
-
getLastEventMessage
Get message from last event generated when this threshold was activated.- Returns:
- message from last event generated when this threshold was activated or null
-
getScript
- Returns:
- the script
-
setScript
- Parameters:
script
- the script to set
-
getTextualRepresentation
Get textual representation of this threshold- Returns:
- textual representation of this threshold
-
duplicate
Duplicate threshold for later use (do not copy ID for duplicated threshold)- Returns:
- threshold copy
-