Package org.opennms.netmgt.poller
Class PollStatus
- java.lang.Object
-
- org.opennms.netmgt.poller.PollStatus
-
- All Implemented Interfaces:
Serializable
@Embeddable public class PollStatus extends Object implements Serializable
Represents the status of a node, interface or services- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROPERTY_RESPONSE_TIME
static int
SERVICE_AVAILABLE
The constant that defines a service as being in a normal state.static int
SERVICE_UNAVAILABLE
The constant that defines a service that is not working normally and should be scheduled using the downtime models.static int
SERVICE_UNKNOWN
The constant the defines a status is unknown.static int
SERVICE_UNRESPONSIVE
The constant that defines a service that is up but is most likely suffering due to excessive load or latency issues and because of that has not responded within the configured timeout period.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static PollStatus
available()
availablestatic PollStatus
available(Double responseTime)
availablestatic PollStatus
decode(String statusName)
decodestatic PollStatus
decode(String statusName, Double responseTime)
decodestatic PollStatus
decode(String statusName, String reason)
decodestatic PollStatus
decode(String statusName, String reason, Double responseTime)
decodestatic PollStatus
down()
Deprecated.We should specify a reason on every PollStatus object.static PollStatus
down(String reason)
downboolean
equals(Object o)
static PollStatus
get(int status, Double responseTime)
getstatic PollStatus
get(int status, String reason)
getstatic PollStatus
get(int status, String reason, Double responseTime)
getMap<String,Number>
getProperties()
getPropertiesNumber
getProperty(String key)
getPropertyString
getReason()
getReasonDouble
getResponseTime()
getResponseTimeint
getStatusCode()
getStatusCodeString
getStatusName()
getStatusNameDate
getTimestamp()
getTimestampint
hashCode()
hashCodeboolean
isAvailable()
isAvailableboolean
isDown()
isDownboolean
isUnavailable()
isUnavailableboolean
isUnknown()
isUnknownboolean
isUnresponsive()
isUnresponsiveboolean
isUp()
isUpvoid
setProperties(Map<String,Number> p)
setPropertiesvoid
setProperty(String key, Number value)
setPropertyvoid
setReason(String reason)
setReasonvoid
setResponseTime(Double responseTime)
setResponseTimevoid
setTimestamp(Date timestamp)
setTimestampString
toString()
toStringstatic PollStatus
unavailable()
Deprecated.We should specify a reason on every PollStatus object.static PollStatus
unavailable(String reason)
unavailablestatic PollStatus
unknown()
Deprecated.We should specify a reason on every PollStatus object.static PollStatus
unknown(String reason)
unknownstatic PollStatus
unresponsive()
Deprecated.We should specify a reason on every PollStatus object.static PollStatus
unresponsive(String reason)
unresponsivestatic PollStatus
up()
upstatic PollStatus
up(Double responseTime)
up
-
-
-
Field Detail
-
PROPERTY_RESPONSE_TIME
public static final String PROPERTY_RESPONSE_TIME
- See Also:
- Constant Field Values
-
SERVICE_UNRESPONSIVE
public static final int SERVICE_UNRESPONSIVE
The constant that defines a service that is up but is most likely suffering due to excessive load or latency issues and because of that has not responded within the configured timeout period.
- See Also:
- Constant Field Values
-
SERVICE_UNAVAILABLE
public static final int SERVICE_UNAVAILABLE
The constant that defines a service that is not working normally and should be scheduled using the downtime models.
- See Also:
- Constant Field Values
-
SERVICE_AVAILABLE
public static final int SERVICE_AVAILABLE
The constant that defines a service as being in a normal state. If this is returned by the poll() method then the framework will re-schedule the service for its next poll using the standard uptime interval
- See Also:
- Constant Field Values
-
SERVICE_UNKNOWN
public static final int SERVICE_UNKNOWN
The constant the defines a status is unknown. Used mostly internally- See Also:
- Constant Field Values
-
-
Method Detail
-
decode
public static PollStatus decode(String statusName)
decode
- Parameters:
statusName
- aString
object.- Returns:
- a
PollStatus
object.
-
decode
public static PollStatus decode(String statusName, String reason)
decode
- Parameters:
statusName
- aString
object.reason
- aString
object.- Returns:
- a
PollStatus
object.
-
decode
public static PollStatus decode(String statusName, Double responseTime)
decode
- Parameters:
statusName
- aString
object.responseTime
- aDouble
object.- Returns:
- a
PollStatus
object.
-
decode
public static PollStatus decode(String statusName, String reason, Double responseTime)
decode
- Parameters:
statusName
- aString
object.reason
- aString
object.responseTime
- aDouble
object.- Returns:
- a
PollStatus
object.
-
get
public static PollStatus get(int status, String reason)
get
- Parameters:
status
- a int.reason
- aString
object.- Returns:
- a
PollStatus
object.
-
get
public static PollStatus get(int status, Double responseTime)
get
- Parameters:
status
- a int.responseTime
- aDouble
object.- Returns:
- a
PollStatus
object.
-
get
public static PollStatus get(int status, String reason, Double responseTime)
get
- Parameters:
status
- a int.reason
- aString
object.responseTime
- aDouble
object.- Returns:
- a
PollStatus
object.
-
up
public static PollStatus up()
up
- Returns:
- a
PollStatus
object.
-
up
public static PollStatus up(Double responseTime)
up
- Parameters:
responseTime
- aDouble
object.- Returns:
- a
PollStatus
object.
-
available
public static PollStatus available()
available
- Returns:
- a
PollStatus
object.
-
available
public static PollStatus available(Double responseTime)
available
- Parameters:
responseTime
- aDouble
object.- Returns:
- a
PollStatus
object.
-
unknown
public static PollStatus unknown()
Deprecated.We should specify a reason on every PollStatus object.- Returns:
- a
PollStatus
object.
-
unknown
public static PollStatus unknown(String reason)
unknown
- Parameters:
reason
- aString
object.- Returns:
- a
PollStatus
object.
-
unresponsive
public static PollStatus unresponsive()
Deprecated.We should specify a reason on every PollStatus object.- Returns:
- a
PollStatus
object.
-
unresponsive
public static PollStatus unresponsive(String reason)
unresponsive
- Parameters:
reason
- aString
object.- Returns:
- a
PollStatus
object.
-
down
public static PollStatus down()
Deprecated.We should specify a reason on every PollStatus object.- Returns:
- a
PollStatus
object.
-
unavailable
public static PollStatus unavailable()
Deprecated.We should specify a reason on every PollStatus object.- Returns:
- a
PollStatus
object.
-
down
public static PollStatus down(String reason)
down
- Parameters:
reason
- aString
object.- Returns:
- a
PollStatus
object.
-
unavailable
public static PollStatus unavailable(String reason)
unavailable
- Parameters:
reason
- aString
object.- Returns:
- a
PollStatus
object.
-
isUp
public boolean isUp()
isUp
- Returns:
- a boolean.
-
isAvailable
public boolean isAvailable()
isAvailable
- Returns:
- a boolean.
-
isUnresponsive
public boolean isUnresponsive()
isUnresponsive
- Returns:
- a boolean.
-
isUnavailable
public boolean isUnavailable()
isUnavailable
- Returns:
- a boolean.
-
isDown
public boolean isDown()
isDown
- Returns:
- a boolean.
-
isUnknown
public boolean isUnknown()
isUnknown
- Returns:
- a boolean.
-
toString
public String toString()
toString
-
setTimestamp
public void setTimestamp(Date timestamp)
setTimestamp
- Parameters:
timestamp
- aDate
object.
-
setResponseTime
public void setResponseTime(Double responseTime)
setResponseTime
- Parameters:
responseTime
- aDouble
object.
-
setProperties
public void setProperties(Map<String,Number> p)
setProperties
- Parameters:
p
- aMap
object.
-
getStatusCode
public int getStatusCode()
getStatusCode
- Returns:
- a int.
-
-