public class SmfDb2Record extends SmfRecord
Typically you would not create SmfDb2Records directly, instead create the
specific type e.g. Smf100Record
DB2 section mappings are in package com.blackhillsoftware.smf.db2.section
Typical steps to process DB2 records are:
SmfRecordReader
class
SmfRecord
to see whether it is one you are interested in
Smf100Record.from(record)
Records compressed with CSRCESRV will be automatically expanded when the SmfDb2Record is constructed.
The IFCID of the record can be determined using the
SmfDb2Record.ifcid()
method.
DB2 records are typically made up of a varying number of sections of different types.
Sections of a specific type are returned in a List<E>
of that type.
If there are no sections
of the type in the record an empty List is returned.
This allows you to iterate over the sections without explicitly checking whether the sections
exist in the record - an empty list will iterate 0 times.
However, you may need to check the IFCID if the section is present for multiple IFCIDs but you want data from a
specific IFCID.
try (SmfRecordReader reader =
SmfRecordReader.fromDD("INPUT").include(100)) // include only type 100 records
{
for (SmfRecord record : reader) // read each record
{
Smf100Record r100 = Smf100Record.from(record); // construct a Smf100record
// Example : process QWOS sections
for (Qwos qwos : r100.qwos()) // process 0 or more sections
{
//... // do stuff
}
}
}
// reader automatically closed at end of try with resources block
Modifier and Type | Field and Description |
---|---|
static int |
SMFDB2CMP
Constant: 0x80 = 128
|
static int |
SMFDB2END
Constant: 0x1C = 28
|
Constructor and Description |
---|
SmfDb2Record(byte[] data)
Constructs an SmfDb2Record from the specified byte array.
|
SmfDb2Record(SmfRecord record)
Constructs a new SmfDb2Record from an existing SMF record.
|
Modifier and Type | Method and Description |
---|---|
protected <T> List<T> |
db2Sections(List<T> current,
byte[] data,
IntFunction<com.blackhillsoftware.smf.internal.Triplet> tripletSupplier,
int tripletOffset,
com.blackhillsoftware.smf.internal.CreateDb2Section<T> builder) |
protected <T> List<T> |
db2Sections(List<T> current,
byte[] data,
IntFunction<com.blackhillsoftware.smf.internal.Triplet> tripletSupplier,
int tripletOffset,
com.blackhillsoftware.smf.internal.CreateDb2Section<T> builder,
int ifcid) |
static SmfDb2Record |
from(byte[] data)
Constructs an SmfDb2Record from the specified byte array.
|
static SmfDb2Record |
from(SmfRecord record)
Constructs a new SmfDb2Record from an existing SMF record.
|
protected byte[] |
getDataArray() |
int |
ifcid()
Get the IFCID from the standard header
|
Qwha |
qwha()
Get the Data Sharing header (QWHA) for this record
|
Qwhc |
qwhc()
Get the Correlation header (QWHC) for this record
|
Qwhd |
qwhd()
Get the Distributed header (QWHD) for this record
|
Qwhs |
qwhs()
Get the standard header (QWHS) for this record
|
Qwht |
qwht()
Get the Trace header (QWHT) for this record
|
Qwhu |
qwhu()
Get the CPU header (QWHU) for this record
|
long |
smfDb2buf()
SMFDB2BUF value, with mask 0x7FFF.
|
boolean |
smfDb2cmp()
Return true if SMFDB2CMP bit in
smfDb2seq() is set. |
LocalDate |
smfDb2dte()
SMFDB2DTE as a LocalDate.
|
int |
smfDb2dteRawValue()
SMFDB2DTE raw value.
|
int |
smfDb2flg()
SMFDB2FLG value.
|
int |
smfDb2len()
SMFDB2LEN value.
|
int |
smfDb2rty()
SMFDB2RTY value.
|
long |
smfDb2seq()
SMFDB2SEQ value.
|
int |
smfDb2sgd()
SMFDB2SGD value.
|
String |
smfDb2sid()
SMFDB2SID value.
|
String |
smfDb2ssi()
SMFDB2SSI value.
|
int |
smfDb2stf()
SMFDB2STF value.
|
LocalTime |
smfDb2tme()
SMFDB2TME as a LocalTime.
|
long |
smfDb2tmeRawValue()
SMFDB2TME raw value
|
equals, extendedHeader, extendedHeader, hashCode, hasSubtypes, hasSubtypes, recordLength, recordLength, recordType, recordType, sanityCheck, smfDate, smfDate, smfDateTime, smfDateTime, smfhdr1Flag, smfhdr1Iefu86, smfhdr1Len, smfhdr1Len, smfhdr1Stcke, smfhdr1StckeRawValue, smfhdr1Tzo, smfhdr1TzoRawValue, smfhdr1Version, smfhdr1Version, smfTime, smfTime, subSystem, subSystem, subType, subType, system, system, toString
createSection, dump, dump, dump, dump, getBytes, getBytes, getTriplet
public static final int SMFDB2CMP
public static final int SMFDB2END
public SmfDb2Record(byte[] data)
data
- a byte array containing the SMF record datapublic SmfDb2Record(SmfRecord record)
record
- an existing SMF recordpublic static SmfDb2Record from(SmfRecord record)
record
- an existing SMF recordpublic static SmfDb2Record from(byte[] data)
data
- a byte array containing the SMF record dataprotected byte[] getDataArray()
getDataArray
in class SmfData
public int smfDb2len()
public int smfDb2sgd()
public int smfDb2flg()
public int smfDb2rty()
public LocalTime smfDb2tme()
LocalTime
public long smfDb2tmeRawValue()
public LocalDate smfDb2dte()
LocalDate
public int smfDb2dteRawValue()
public String smfDb2sid()
public String smfDb2ssi()
public int smfDb2stf()
public long smfDb2seq()
public boolean smfDb2cmp()
smfDb2seq()
is set.SMFDB2CMP = 0x80
public long smfDb2buf()
public int ifcid()
public Qwhs qwhs()
public Qwhc qwhc()
public Qwht qwht()
public Qwhu qwhu()
public Qwhd qwhd()
public Qwha qwha()
protected <T> List<T> db2Sections(List<T> current, byte[] data, IntFunction<com.blackhillsoftware.smf.internal.Triplet> tripletSupplier, int tripletOffset, com.blackhillsoftware.smf.internal.CreateDb2Section<T> builder, int ifcid)
protected <T> List<T> db2Sections(List<T> current, byte[] data, IntFunction<com.blackhillsoftware.smf.internal.Triplet> tripletSupplier, int tripletOffset, com.blackhillsoftware.smf.internal.CreateDb2Section<T> builder)
Copyright © 2020 Black Hill Software Pty Ltd. All rights reserved.