Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

DB2::Admin::DataElement
Support for DB2 self-describing data stream

DB2::Admin::DataElement - Support for DB2 self-describing data stream


NAME

DB2::Admin::DataElement - Support for DB2 self-describing data stream


SYNOPSIS


  use DB2::Admin::DataStream;

  #

  # Get binary data from snapshot or event file/pipe, then...

  #

  my $stream = DB2::Admin::DataStream::->new($binary_data);

  #

  # Access to a particular node (two alternatives)

  #

  my $node = $stream->findNode('SWITCH_LIST/UOW_SWITCH/SWITCH_SET_TIME/SECONDS');

  my $time_sec = $node->getValue();

  my $time_msec = $stream->findValue('SWITCH_LIST/UOW_SWITCH/SWITCH_SET_TIME/MICROSEC');


DESCRIPTION

The DB2 administrative API returns several types of return values in a so-called 'self-describing data stream'. The data stored in event files or written to event pipes is in the same format. The data format and all element types plus their values, are described in the ``System Monitor Guide and Reference'' (SC09-4847).

Access to this data stream is provided through the DB2::Admin::DataStream class, which converts the data stream into a tree of objects. The leaf nodes of the tree hold the data and are implemented using the present class, DB2::Admin::DataElement.

In most cases, access to data elements is not performed through this class, but through utiltiy methods in the DB2::Admin::DataStream class, such as findValue and getValues. Data element objects are most commonly used when traversing a tree hierarchicaly to process all elements, or when access to raw data is required.


METHODS

new

This method creates a Db2API::DataElement object from a numerical element code, a data type, and a string of binary data. It is not intended to be called from applications; instead it is invoked by the DB2::Admin::DataStream class when it needs to create leaf nodes.

getName

This method returns the name of a node, e.g. 'DBASE'. The DB2::Admin::DataStream class supports the same method, so this can safely be invoked on any object.

getDescription

This method returns the description of a node, e.g. 'database information'. This description is parsed from the DB2 header files at DB2::Admin module compile time. The DB2::Admin::DataStream class supports the same method, so this can safely be invoked on any object.

getValue

This method returns the value of a DB2::Admin::DataElement object. The value is in display format, i.e. for some enumerated element types such as platform and container type, the data has been formatted from a numerical value into a human-readable display format. Use the getRawValue method to get the numerical data.

getRawValue

This method returns the 'raw' value of a DB2::Admin::DataElement object. This is virtually always the same as the result of the getValue method, except for those cases where enumerate types have been formatted into human-readblbe format. This method is rarely used.

Decode

This class method is invoked with a string type code, a binary value and size as returned by the snapshot, event monitor, and configuration parameter methods. It decodes the bianry value into a string or number and returns it. It is used internally to get the raw value of a data element, and is also invoked from the DB2::Admin class to decode values returned from the GetDbmConfig and GetDatabaseConfig methods.

Encode

This class method is invoked with a string type code and a numerical or string value, which is then encoded into binary. It is invoked from the DB2::Admin class to encode values specified with the SetDbmConfig and SetDatabaseConfig methods.


AUTHOR

Hildo Biersma


SEE ALSO

Db2API(3), DB2::Admin::Constants(3), DB2::Admin::DataStream(3)

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy