public final class ChannelAccessStatus extends Object
Channel Access status codes. The status codes are used to signal exceptional
conditions over the network. The forStatusCode(int)
method can be
used to convert a status code that has been sent over the network as an
integer.
A status code has a message number and a severity. For each message, there is
a severity, that should be associated with this message. For status codes
received from remote peers however, there is no guarantee that the expected
severity is associated with a certain message. Therefore, status codes should
only be compared regarding the message, not the severity. The easiest way to
do this is using the matchesMessage(StatusMessage)
method.
Unlike the EPICS C-library, this library does not return status codes to
signal error conditions internally. Instead, Java exceptions are preferred
for this purpose. An error condition that is associated with a network error
(e.g. that has been received from a peer) is typically signaled by a
ChannelAccessException
that wraps the status code.
Modifier and Type | Class and Description |
---|---|
static class |
ChannelAccessStatus.StatusMessage
Message describing a type of error.
|
static class |
ChannelAccessStatus.StatusSeverity
Severity for status codes.
|
static class |
ChannelAccessStatus.StatusSeverityLevel
Severity levels associated with status codes.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Tells whether the specified object represents the same status object.
|
static ChannelAccessStatus |
forStatusCode(int statusCode)
Returns an object representing the specified status code.
|
ChannelAccessStatus.StatusMessage |
getMessage()
Returns the status message associated with this status code.
|
ChannelAccessStatus.StatusSeverity |
getSeverity()
Returns the severity associated with this status code.
|
int |
hashCode()
Returns a hash code value for this status object.
|
boolean |
matchesMessage(ChannelAccessStatus.StatusMessage message)
Checks whether the message part of this status code matches a certain
message.
|
static String |
messageForStatusCode(int statusCode)
Returns a text message associated with a certain status code.
|
int |
toStatusCode()
Returns the integer representation of this status code.
|
String |
toString()
Returns a text message associated with this status code.
|
public int toStatusCode()
matchesMessage(StatusMessage)
method instead.public ChannelAccessStatus.StatusMessage getMessage()
null
if the message part of the status code
specifies a message number that is not known by this
implementation.public ChannelAccessStatus.StatusSeverity getSeverity()
Returns the severity associated with this status code.
null
).public static String messageForStatusCode(int statusCode)
forStatusCode(statusCode).toString()
.statusCode
- integer representation of the status code (e.g. received from
a network peer).null
, not even for an unknown
status code).public static ChannelAccessStatus forStatusCode(int statusCode)
statusCode
- integer representation of the status code (e.g. received from
a network peer).null
).public String toString()
forStatusCode(statusCode).toString()
.public int hashCode()
Returns a hash code value for this status object. This method is supported for the benefit of hash tables. The hash code is calculated based on the status code so that a different status code typically results in a different hash code.
If two status objects are equal (as indicated by the return value of
equals(Object)
), they also have the same hash code. However, the
fact that two status objects have the same hash code does not imply that
they are equal.
public boolean equals(Object obj)
public boolean matchesMessage(ChannelAccessStatus.StatusMessage message)
equals(Object)
method, that also
checks whether the severities match.message
- message to compare this status code's message with.true
if message
is the same message as
represented by this status code, false
if it is a
different message.Copyright © 2014–2017 aquenos GmbH. All rights reserved.