org.opcfoundation.ua.builtintypes
Class StatusCode

java.lang.Object
  extended by org.opcfoundation.ua.builtintypes.StatusCode

public final class StatusCode
extends Object

A numeric identifier for a error or condition that is associated with a value or an operation. StatusCode is immutable. TODO Add type-safe enums

Author:
Toni Kalajainen (toni.kalajainen@vtt.fi)
See Also:
StatusCodes, StatusCodeDescriptions

Field Summary
static StatusCode BAD
          Constant BAD
static StatusCode GOOD
          GOOD Result
static int HISTORIANBITS_CALCULATED
          Constant HISTORIANBITS_CALCULATED=0x00000001
static int HISTORIANBITS_EXTRADATA
          Constant HISTORIANBITS_EXTRADATA=0x00000008
static int HISTORIANBITS_INTERPOLATED
          Constant HISTORIANBITS_INTERPOLATED=0x00000002
static int HISTORIANBITS_MASK
          These bits are set only when reading historical data.
static int HISTORIANBITS_MULTIVALUE
          Constant HISTORIANBITS_MULTIVALUE=0x00000010
static int HISTORIANBITS_PARTIAL
          Constant HISTORIANBITS_PARTIAL=0x00000004
static int HISTORIANBITS_RAW
          Constant HISTORIANBITS_RAW=0x00000000
static int HISTORIANBITS_RESERVED
          Constant HISTORIANBITS_RESERVED=0x00000003
static NodeId ID
          Constant ID
static int INFOBITS_MASK
          Additional information bits that qualify the StatusCode.
static int INFOTYPE_DATAVALUE
          The type of information is related to DataValue.
static int INFOTYPE_MASK
          The type of information contained in the info bits.
static int LIMITBITS_CONSTANT
          The value is constant and cannot change.
static int LIMITBITS_HIGH
          The value is at the higher limit for the data source.
static int LIMITBITS_LOW
          The value is at the lower limit for the data source.
static int LIMITBITS_MASK
          The limit bits associated with the data value.
static int LIMITBITS_NONE
          The value is free to change.
static int OVERFLOW_BIT
          If this bit is set, not every detected change has been returned since the Server's queue buffer for the MonitoredItem reached its limit and had to purge out data.
static int OVERFLOW_MASK
          If these bits are set, not every detected change has been returned since the Server's queue buffer for the MonitoredItem reached its limit and had to purge out data.
static int RES1_MASK
          Reserved for future use.
static int RES2_MASK
          Reserved for future use.
static int SEMANTICSCHANGED_MASK
          Indicates that the semantics of the associated data value have changed.
static int SEVERITY_BAD
          Constant SEVERITY_BAD=0x80000000
static int SEVERITY_GOOD
          Constant SEVERITY_GOOD=0x00000000
static int SEVERITY_MASK
          Indicates whether the StatusCode represents a good, bad or uncertain condition.
static int SEVERITY_UNCERTAIN
          Constant SEVERITY_UNCERTAIN=0x40000000
static int STRUCTURECHANGED_MASK
          Indicates that the structure of the associated data value has changed since the last Notification.
static int SUBCODE_MASK
          The code is a numeric value assigned to represent different conditions.
 
Constructor Summary
StatusCode(UnsignedInteger value)
          Constructor for StatusCode.
 
Method Summary
 boolean equals(Object obj)
          
 boolean equalsStatusCode(StatusCode statusCode)
          Check if the status codes equal to severity and subcode, ignoring the lowest bits of the code.
 String getDescription()
          getDescription.
static StatusCode getFromBits(int value)
          getFromBits.
 int getHistorianBits()
          getHistorianBits.
 int getInfotype()
          getInfotype.
 int getLimitBits()
          getLimitBits.
 String getName()
          getName.
 int getSeverity()
          getSeverity.
 int getSubcode()
          getSubcode.
 UnsignedInteger getValue()
          Getter for the field value.
 int getValueAsIntBits()
          getValueAsIntBits.
 int hashCode()
          
 boolean isBad()
          Tests if this status code is bad.
 boolean isGood()
          Tests if this status code is good.
 boolean isNotBad()
          tests if a status code is not bad.
 boolean isNotGood()
          Tests if this status code is not good.
 boolean isNotUncertain()
          Tests if this status code is not uncertain.
 boolean isOverflow()
          isOverflow.
 boolean isSemanticsChanged()
          isSemanticsChanged.
 boolean isStatusCode(UnsignedInteger statusCode)
          Matches argument against subcode and severity.
 boolean isStructureChanged()
          isStructureChanged.
 boolean isUncertain()
          Tests if this status code is not uncertain.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final NodeId ID
Constant ID


SEVERITY_MASK

public static final int SEVERITY_MASK
Indicates whether the StatusCode represents a good, bad or uncertain condition.

See Also:
Constant Field Values

SEVERITY_GOOD

public static final int SEVERITY_GOOD
Constant SEVERITY_GOOD=0x00000000

See Also:
Constant Field Values

SEVERITY_UNCERTAIN

public static final int SEVERITY_UNCERTAIN
Constant SEVERITY_UNCERTAIN=0x40000000

See Also:
Constant Field Values

SEVERITY_BAD

public static final int SEVERITY_BAD
Constant SEVERITY_BAD=0x80000000

See Also:
Constant Field Values

GOOD

public static final StatusCode GOOD
GOOD Result


BAD

public static final StatusCode BAD
Constant BAD


RES1_MASK

public static final int RES1_MASK
Reserved for future use. Shall always be zero.

See Also:
Constant Field Values

SUBCODE_MASK

public static final int SUBCODE_MASK
The code is a numeric value assigned to represent different conditions. Each code has a symbolic name and a numeric value. All descriptions in the OPC UA specification refer to the symbolic name. Part 6 maps the symbolic names onto a numeric value.

See Also:
Constant Field Values

STRUCTURECHANGED_MASK

public static final int STRUCTURECHANGED_MASK
Indicates that the structure of the associated data value has changed since the last Notification. Clients should not process the data value unless they re-read the metadata. Servers shall set this bit if the DataTypeEncoding used for a Variable changes. Clause 7.23 describes how the DataTypeEncoding is specified for a Variable. The bit is also set if the data type Attribute of the Variable changes. A Variable with data type BaseDataType does not require the bit to be set when the data type changes. Servers shall also set this bit if the ArrayDimensions or the ValueRank Attribute or the EnumStrings Property of the DataType of the Variable changes. This bit is provided to warn Clients that parse complex data values that their parsing routines could fail because the serialized form of the data value has changed. This bit has meaning only for StatusCodes returned as part of a data change Notification or the HistoryRead. StatusCodes used in other contexts shall always set this bit to zero.

See Also:
Constant Field Values

SEMANTICSCHANGED_MASK

public static final int SEMANTICSCHANGED_MASK
Indicates that the semantics of the associated data value have changed. Clients should not process the data value until they re-read the metadata associated with the Variable. Servers should set this bit if the metadata has changed in way that could cause application errors if the Client does not re-read the metadata. For example, a change to the engineering units could create problems if the Client uses the value to perform calculations. Part 8 defines the conditions where a Server shall set this bit for a DA Variable. Other specifications may define additional conditions. A Server may define other conditions that cause this bit to be set. This bit has meaning only for StatusCodes returned as part of a data change Notification or the HistoryRead. StatusCodes used in other contexts shall always set this bit to zero.

See Also:
Constant Field Values

RES2_MASK

public static final int RES2_MASK
Reserved for future use. Shall always be zero.

See Also:
Constant Field Values

INFOTYPE_MASK

public static final int INFOTYPE_MASK
The type of information contained in the info bits.

See Also:
Constant Field Values

INFOTYPE_DATAVALUE

public static final int INFOTYPE_DATAVALUE
The type of information is related to DataValue.

See Also:
Constant Field Values

INFOBITS_MASK

public static final int INFOBITS_MASK
Additional information bits that qualify the StatusCode. The structure of these bits depends on the Info Type field.

See Also:
Constant Field Values

LIMITBITS_MASK

public static final int LIMITBITS_MASK
The limit bits associated with the data value.

See Also:
Constant Field Values

LIMITBITS_NONE

public static final int LIMITBITS_NONE
The value is free to change.

See Also:
Constant Field Values

LIMITBITS_LOW

public static final int LIMITBITS_LOW
The value is at the lower limit for the data source.

See Also:
Constant Field Values

LIMITBITS_HIGH

public static final int LIMITBITS_HIGH
The value is at the higher limit for the data source.

See Also:
Constant Field Values

LIMITBITS_CONSTANT

public static final int LIMITBITS_CONSTANT
The value is constant and cannot change.

See Also:
Constant Field Values

OVERFLOW_MASK

public static final int OVERFLOW_MASK
If these bits are set, not every detected change has been returned since the Server's queue buffer for the MonitoredItem reached its limit and had to purge out data.

Consists of the INFOTYPE_DATAVALUE and OVERFLOW_BIT

See Also:
Constant Field Values

OVERFLOW_BIT

public static final int OVERFLOW_BIT
If this bit is set, not every detected change has been returned since the Server's queue buffer for the MonitoredItem reached its limit and had to purge out data.

Must be used with the INFOTYPE_DATAVALUE.

See Also:
OVERFLOW_MASK, Constant Field Values

HISTORIANBITS_MASK

public static final int HISTORIANBITS_MASK
These bits are set only when reading historical data. They indicate where the data value came from and provide information that affects how the Client uses the data value.

See Also:
Constant Field Values

HISTORIANBITS_RAW

public static final int HISTORIANBITS_RAW
Constant HISTORIANBITS_RAW=0x00000000

See Also:
Constant Field Values

HISTORIANBITS_CALCULATED

public static final int HISTORIANBITS_CALCULATED
Constant HISTORIANBITS_CALCULATED=0x00000001

See Also:
Constant Field Values

HISTORIANBITS_INTERPOLATED

public static final int HISTORIANBITS_INTERPOLATED
Constant HISTORIANBITS_INTERPOLATED=0x00000002

See Also:
Constant Field Values

HISTORIANBITS_RESERVED

public static final int HISTORIANBITS_RESERVED
Constant HISTORIANBITS_RESERVED=0x00000003

See Also:
Constant Field Values

HISTORIANBITS_PARTIAL

public static final int HISTORIANBITS_PARTIAL
Constant HISTORIANBITS_PARTIAL=0x00000004

See Also:
Constant Field Values

HISTORIANBITS_EXTRADATA

public static final int HISTORIANBITS_EXTRADATA
Constant HISTORIANBITS_EXTRADATA=0x00000008

See Also:
Constant Field Values

HISTORIANBITS_MULTIVALUE

public static final int HISTORIANBITS_MULTIVALUE
Constant HISTORIANBITS_MULTIVALUE=0x00000010

See Also:
Constant Field Values
Constructor Detail

StatusCode

public StatusCode(UnsignedInteger value)

Constructor for StatusCode.

Parameters:
value - a UnsignedInteger object.
Method Detail

getFromBits

public static StatusCode getFromBits(int value)

getFromBits.

Parameters:
value - a int.
Returns:
a StatusCode object.

getValueAsIntBits

public int getValueAsIntBits()

getValueAsIntBits.

Returns:
a int.

getValue

public UnsignedInteger getValue()

Getter for the field value.

Returns:
a UnsignedInteger object.

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

getDescription

public String getDescription()

getDescription.

Returns:
a String object.

getName

public String getName()

getName.

Returns:
a String object.

toString

public String toString()

Overrides:
toString in class Object

isBad

public boolean isBad()
Tests if this status code is bad.

Returns:
true if bad

isGood

public boolean isGood()
Tests if this status code is good.

Returns:
true if good

isNotBad

public boolean isNotBad()
tests if a status code is not bad.

Returns:
true if not bad

isNotGood

public boolean isNotGood()
Tests if this status code is not good.

Returns:
true if not good

isNotUncertain

public boolean isNotUncertain()
Tests if this status code is not uncertain.

Returns:
true if not uncertain

isUncertain

public boolean isUncertain()
Tests if this status code is not uncertain.

Returns:
true if not uncertain

isSemanticsChanged

public boolean isSemanticsChanged()

isSemanticsChanged.

Returns:
a boolean.

isStructureChanged

public boolean isStructureChanged()

isStructureChanged.

Returns:
a boolean.

isOverflow

public boolean isOverflow()

isOverflow.

Returns:
a boolean.

getSeverity

public int getSeverity()

getSeverity.

Returns:
a int.

getSubcode

public int getSubcode()

getSubcode.

Returns:
a int.

getInfotype

public int getInfotype()

getInfotype.

Returns:
a int.

getLimitBits

public int getLimitBits()

getLimitBits.

Returns:
a int.

getHistorianBits

public int getHistorianBits()

getHistorianBits.

Returns:
a int.

isStatusCode

public boolean isStatusCode(UnsignedInteger statusCode)
Matches argument against subcode and severity. This method can be used to compare statuscode to values in StatusCodes.

Parameters:
statusCode - a UnsignedInteger object.
Returns:
true if subcode and severity matches
See Also:
equalsStatusCode(StatusCode)

equalsStatusCode

public boolean equalsStatusCode(StatusCode statusCode)
Check if the status codes equal to severity and subcode, ignoring the lowest bits of the code.

Parameters:
statusCode - the StatusCode to compare this one to
Returns:
true if the codes are equal when masked with SEVERITY_MASK and SUBCODE_MASK


Copyright © 2018. All rights reserved.