Class PollStatus
- java.lang.Object
-
- org.opennms.netmgt.poller.PollStatus
-
- All Implemented Interfaces:
java.io.Serializable
@Embeddable public class PollStatus extends java.lang.Object implements java.io.Serializable
Represents the status of a node, interface or services- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.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(java.lang.Double responseTime)
availablestatic PollStatus
decode(java.lang.String statusName)
decodestatic PollStatus
decode(java.lang.String statusName, java.lang.Double responseTime)
decodestatic PollStatus
decode(java.lang.String statusName, java.lang.String reason)
decodestatic PollStatus
decode(java.lang.String statusName, java.lang.String reason, java.lang.Double responseTime)
decodestatic PollStatus
down()
Deprecated.We should specify a reason on every PollStatus object.static PollStatus
down(java.lang.String reason)
downboolean
equals(java.lang.Object o)
static PollStatus
get(int status, java.lang.Double responseTime)
getstatic PollStatus
get(int status, java.lang.String reason)
getstatic PollStatus
get(int status, java.lang.String reason, java.lang.Double responseTime)
getjava.util.Map<java.lang.String,java.lang.Number>
getProperties()
getPropertiesjava.lang.Number
getProperty(java.lang.String key)
getPropertyjava.lang.String
getReason()
getReasonjava.lang.Double
getResponseTime()
getResponseTimeint
getStatusCode()
getStatusCodejava.lang.String
getStatusName()
getStatusNamejava.util.Date
getTimestamp()
getTimestampint
hashCode()
hashCodeboolean
isAvailable()
isAvailableboolean
isDown()
isDownboolean
isUnavailable()
isUnavailableboolean
isUnknown()
isUnknownboolean
isUnresponsive()
isUnresponsiveboolean
isUp()
isUpvoid
setProperties(java.util.Map<java.lang.String,java.lang.Number> p)
setPropertiesvoid
setProperty(java.lang.String key, java.lang.Number value)
setPropertyvoid
setReason(java.lang.String reason)
setReasonvoid
setResponseTime(java.lang.Double responseTime)
setResponseTimevoid
setTimestamp(java.util.Date timestamp)
setTimestampjava.lang.String
toString()
toStringstatic PollStatus
unavailable()
Deprecated.We should specify a reason on every PollStatus object.static PollStatus
unavailable(java.lang.String reason)
unavailablestatic PollStatus
unknown()
Deprecated.We should specify a reason on every PollStatus object.static PollStatus
unknown(java.lang.String reason)
unknownstatic PollStatus
unresponsive()
Deprecated.We should specify a reason on every PollStatus object.static PollStatus
unresponsive(java.lang.String reason)
unresponsivestatic PollStatus
up()
upstatic PollStatus
up(java.lang.Double responseTime)
up
-
-
-
Field Detail
-
PROPERTY_RESPONSE_TIME
public static final java.lang.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(java.lang.String statusName)
decode
- Parameters:
statusName
- aString
object.- Returns:
- a
PollStatus
object.
-
decode
public static PollStatus decode(java.lang.String statusName, java.lang.String reason)
decode
- Parameters:
statusName
- aString
object.reason
- aString
object.- Returns:
- a
PollStatus
object.
-
decode
public static PollStatus decode(java.lang.String statusName, java.lang.Double responseTime)
decode
- Parameters:
statusName
- aString
object.responseTime
- aDouble
object.- Returns:
- a
PollStatus
object.
-
decode
public static PollStatus decode(java.lang.String statusName, java.lang.String reason, java.lang.Double responseTime)
decode
- Parameters:
statusName
- aString
object.reason
- aString
object.responseTime
- aDouble
object.- Returns:
- a
PollStatus
object.
-
get
public static PollStatus get(int status, java.lang.String reason)
get
- Parameters:
status
- a int.reason
- aString
object.- Returns:
- a
PollStatus
object.
-
get
public static PollStatus get(int status, java.lang.Double responseTime)
get
- Parameters:
status
- a int.responseTime
- aDouble
object.- Returns:
- a
PollStatus
object.
-
get
public static PollStatus get(int status, java.lang.String reason, java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String reason)
down
- Parameters:
reason
- aString
object.- Returns:
- a
PollStatus
object.
-
unavailable
public static PollStatus unavailable(java.lang.String reason)
unavailable
- Parameters:
reason
- aString
object.- Returns:
- a
PollStatus
object.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
hashCode
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- a int.
-
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 java.lang.String toString()
toString
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a
String
object.
-
getTimestamp
public java.util.Date getTimestamp()
getTimestamp
- Returns:
- a
Date
object.
-
setTimestamp
public void setTimestamp(java.util.Date timestamp)
setTimestamp
- Parameters:
timestamp
- aDate
object.
-
getReason
public java.lang.String getReason()
getReason
- Returns:
- a
String
object.
-
setReason
public void setReason(java.lang.String reason)
setReason
- Parameters:
reason
- aString
object.
-
getResponseTime
public java.lang.Double getResponseTime()
getResponseTime
- Returns:
- a
Double
object.
-
setResponseTime
public void setResponseTime(java.lang.Double responseTime)
setResponseTime
- Parameters:
responseTime
- aDouble
object.
-
getProperties
public java.util.Map<java.lang.String,java.lang.Number> getProperties()
getProperties
- Returns:
- a
Map
object.
-
setProperties
public void setProperties(java.util.Map<java.lang.String,java.lang.Number> p)
setProperties
- Parameters:
p
- aMap
object.
-
getProperty
public java.lang.Number getProperty(java.lang.String key)
getProperty
- Parameters:
key
- aString
object.- Returns:
- a
Number
object.
-
setProperty
public void setProperty(java.lang.String key, java.lang.Number value)
setProperty
- Parameters:
key
- aString
object.value
- aNumber
object.
-
getStatusCode
public int getStatusCode()
getStatusCode
- Returns:
- a int.
-
getStatusName
public java.lang.String getStatusName()
getStatusName
- Returns:
- a
String
object.
-
-