public class SmfRecord extends SmfData
SmfRecord also provides static methods to access information e.g SMF record type from an array of bytes without creating a SmfRecord instance.
Constructor and Description |
---|
SmfRecord(byte[] data)
Constructs an SmfRecord using the specified byte array.
|
SmfRecord(SmfRecord record)
Constructs a new SmfRecord from an existing SMF record.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object smfrecord)
Compare this SMF record with another SMF record, returning true if both contain the same data
|
boolean |
extendedHeader()
Return true if the SMF record has an extended header, as indicated by the SMFxFLG
field in the SMF record header and SMFxRTY value equal to 126
|
static boolean |
extendedHeader(byte[] data)
Return true if the SMF record has an extended header, as indicated by the SMFxFLG
field in the SMF record header and SMFxRTY value equal to 126
|
int |
hashCode()
Get a hash code for this record
|
boolean |
hasSubtypes()
Return true if the SMF record has subtypes, as indicated by the SMFxFLG
field in the standard SMF record header.
|
static boolean |
hasSubtypes(byte[] data)
Return true if the SMF record has subtypes, as indicated by the SMFxFLG
field in the standard SMF record header.
|
int |
recordLength()
Return the length of the SMF record.
|
static int |
recordLength(byte[] data)
Return the record length from the specified byte array.
|
int |
recordType()
Return the record type, as indicated by the SMFxRTY
field in the standard SMF record header or the
SMFHDR1_EXT_RTY field in the extended header
|
static int |
recordType(byte[] data)
Return the record type, as indicated by the SMFxRTY
field in the standard SMF record header or the
SMFHDR1_EXT_RTY field in the extended header
|
boolean |
sanityCheck()
Perform a basic sanity check on the SMF record.
|
LocalDate |
smfDate()
Return the date the record was written, from the SMFxDTE
field in the standard SMF record header.
|
static LocalDate |
smfDate(byte[] data)
Return the date the record was written, from the SMFxDTE
field in the standard SMF record header.
|
LocalDateTime |
smfDateTime()
Return the date and time the record was written, from the SMFxDTE and SMFxTME
fields in the standard SMF record header or the SMFHDR1_STCKE and SMFHDR1_TZO
fields if the record has an extended header.
|
static LocalDateTime |
smfDateTime(byte[] data)
Return the date and time the record was written, from the SMFxDTE and SMFxTME
fields in the standard SMF record header or the SMFHDR1_STCKE and SMFHDR1_TZO
fields if the record has an extended header.
|
int |
smfhdr1Flag()
Return the Extended Header flag byte from the SMFHDR1_FLAG
field.
|
boolean |
smfhdr1Iefu86()
Return true if IEFU86 bit in
smfhdr1Flag() is set. |
int |
smfhdr1Len()
Return the Extended Header length from the SMFHDR1_LEN
field.
|
static int |
smfhdr1Len(byte[] data)
Return the Extended Header length from the SMFHDR1_LEN
field.
|
ZonedDateTime |
smfhdr1Stcke()
SMFHDR1_STCKE value converted to ZonedDateTime (nanosecond precision, ZoneOffset.UTC).
|
BigInteger |
smfhdr1StckeRawValue()
SMFHDR1_STCKE value.
|
ZoneOffset |
smfhdr1Tzo()
SMFHDR1_TZO as ZoneOffset.
|
long |
smfhdr1TzoRawValue()
SMFHDR1_TZO raw value.
|
int |
smfhdr1Version()
Return the Extended Header length from the SMFHDR1_VERSION
field.
|
static int |
smfhdr1Version(byte[] data)
Return the Extended Header version from the SMFHDR1_VERSION
field.
|
LocalTime |
smfTime()
Return the time the record was written, from the SMFxTME
field in the standard SMF record header.
|
static LocalTime |
smfTime(byte[] data)
Return the time the record was written, from the SMFxTME
field in the standard SMF record header.
|
String |
subSystem()
Return the subsystem identification from the SMFxSSI
field in the standard SMF record header.
|
static String |
subSystem(byte[] data)
Return the subsystem identification from the SMFxSSI
field in the standard SMF record header.
|
int |
subType()
Return the subtype from the SMFxSTY
field in the standard SMF record header.
|
static int |
subType(byte[] data)
Return the subtype from the SMFxSTY
field in the standard SMF record header.
|
String |
system()
Return the system ID, as indicated by the SMFxSID
field in the standard SMF record header.
|
static String |
system(byte[] data)
Return the system ID, as indicated by the SMFxSID
field in the standard SMF record header.
|
String |
toString() |
createSection, dump, dump, dump, dump, getBytes, getBytes, getDataArray, getTriplet
public SmfRecord(byte[] data)
data
- a byte array containing the SMF record data.
Ownership of the array passes to the SMF record object
i.e. a new array should be used to create each SMF record, and
no modifications should be made to the byte array after it is used to
create the record.public SmfRecord(SmfRecord record)
record
- an existing SMF recordpublic boolean equals(Object smfrecord)
equals
in class SmfData
smfrecord
- a SMF record to compareObject.equals(java.lang.Object)
public int hashCode()
public static int recordLength(byte[] data)
data
- a byte arraypublic int recordLength()
public static boolean hasSubtypes(byte[] data)
data
- a byte array containing an SMF recordpublic boolean hasSubtypes()
public static boolean extendedHeader(byte[] data)
data
- a byte array containing an SMF recordpublic boolean extendedHeader()
public static int recordType(byte[] data)
data
- a byte array containing an SMF recordpublic int recordType()
public static String system(byte[] data)
data
- a byte array containing an SMF recordpublic String system()
public static LocalTime smfTime(byte[] data)
data
- a byte array containing an SMF recordpublic LocalTime smfTime()
public static LocalDate smfDate(byte[] data)
data
- a byte array containing an SMF recordpublic LocalDate smfDate()
public static LocalDateTime smfDateTime(byte[] data)
data
- a byte array containing an SMF recordpublic LocalDateTime smfDateTime()
public static String subSystem(byte[] data)
data
- a byte array containing an SMF recordpublic String subSystem()
public static int subType(byte[] data)
data
- a byte array containing an SMF recordIllegalArgumentException
- if the record does not have subtypespublic int subType()
IllegalArgumentException
- if the record does not have subtypespublic static int smfhdr1Len(byte[] data)
data
- a byte array containing an SMF recordIllegalArgumentException
- if the record does not have an extended headerpublic int smfhdr1Len()
IllegalArgumentException
- if the record does not have an extended headerpublic static int smfhdr1Version(byte[] data)
data
- a byte array containing an SMF recordIllegalArgumentException
- if the record does not have an extended headerpublic int smfhdr1Version()
IllegalArgumentException
- if the record does not have an extended headerpublic int smfhdr1Flag()
IllegalArgumentException
- if the record does not have an extended headerpublic boolean smfhdr1Iefu86()
smfhdr1Flag()
is set.IllegalArgumentException
- if the record does not have an extended header
IEFU86 = 0x80
public ZonedDateTime smfhdr1Stcke()
Use smfhdr1StckeRawValue()
for a BigInteger containing the complete
STCKE value.
IllegalArgumentException
- if the record does not have an extended headerZonedDateTime
public BigInteger smfhdr1StckeRawValue()
IllegalArgumentException
- if the record does not have an extended headerpublic ZoneOffset smfhdr1Tzo()
IllegalArgumentException
- if the record does not have an extended headerpublic long smfhdr1TzoRawValue()
IllegalArgumentException
- if the record does not have an extended headerpublic boolean sanityCheck()
Copyright © 2021 Black Hill Software Pty Ltd. All rights reserved.