Class

org.cert.netsa.io.ipfix

ExportRecord

Related Doc: package ipfix

Permalink

abstract class ExportRecord extends Record

An ExportRecord represents the data for an individual Record that is being built from instances of objects. The ExportRecord class supports subclasses that use class members to represent the values for the information elements of a Template.

When creating a record from a buffer containing serialzed data, the CollectedRecord class is used.

The ArrayRecord class is similar this class, except ArrayRecord is concrete and fields are always accessed by numeric position. The ExportRecord class allows the caller to reference members by name or by position; the class may have default values for elements. The ExportRecord class forces the caller to provide a class member for each element in the Template whereas the elements of ArrayRecord are represented by an Array[Any].

Example:
  1. The caller extends this class, adds members that represent the elements in the class, annotates those members with the IPFIXExtract class, and defines a corresponding template. The caller may then instantiate the class and reference members by name.

    class MyRec(template: Template) extends ExportRecord(template) {
      @IPFIXExtract(name = "sourceIPv4Address")
      var sip = org.cert.netsa.data.net.IPv4Address("0.0.0.0")
      @IPFIXExtract(name = "flowStartTimeMilliseconds")
      var stime = java.time.Instant.EPOCH
      @IPFIXExtract(name = "packetTotalCount")
      var packets: Long = 0L
      // may add other members
    }
    val template = Template(Seq(
      IEFieldSpecifier(model, "sourceIPv4Address", 4),
      IEFieldSpecifier(model, "flowStartTimeMilliseconds", 8),
      IEFieldSpecifier(model, "packetTotalCount", 8)))
    val rec = new MyRec(template)
    rec.sip = org.cert.netsa.data.net.IPv4Address("10.1.2.3")
    rec.stime = java.time.Instant.now()
    rec.packets = 365
Linear Supertypes
Record, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ExportRecord
  2. Record
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ExportRecord(template: Template)

    Permalink

    template

    The Template for this Record.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def allBasicListElements(): Set[InfoElement]

    Permalink

    Gets a Set containing the InfoElement used by any basic list on the record and by the record's ListElements.

    Gets a Set containing the InfoElement used by any basic list on the record and by the record's ListElements.

    Definition Classes
    Record
  5. final def allTemplates(): Set[Template]

    Permalink

    Gets a Set containing the Template used by the record and the Templates used by any ListElements in the record.

    Gets a Set containing the Template used by the record and the Templates used by any ListElements in the record.

    Definition Classes
    Record
  6. def apply(idx: Int): Any

    Permalink

    The value of the field in this record at the given field position within the Template.

    The value of the field in this record at the given field position within the Template.

    Definition Classes
    ExportRecordRecord
    Exceptions thrown

    java.lang.IndexOutOfBoundsException if the index is out of range.

  7. def apply(ie: InfoElement): Any

    Permalink

    The value of the first occurrence of the specified Information Element in this Record.

    The value of the first occurrence of the specified Information Element in this Record.

    Definition Classes
    Record
    Since

    1.3.1

    Exceptions thrown

    java.lang.IndexOutOfBoundsException if this Record's Template does not contain that Information Element.

  8. def apply(spec: FieldSpec): Any

    Permalink

    The value of the field within this record matching the given specification.

    The value of the field within this record matching the given specification.

    Definition Classes
    Record
    Since

    1.3.1

    Exceptions thrown

    java.lang.IndexOutOfBoundsException if the Template does not contain the FieldSpec.

  9. final def apply[T](extractor: FieldExtractor[T]): Option[T]

    Permalink

    Gets the value within the record for the field referenced by the extractor as an Option.

    Gets the value within the record for the field referenced by the extractor as an Option.

    T

    The result type of the extractor.

    extractor

    A field extractor.

    returns

    The value for the referenced field, or scala.None if the extractor does not match a field in this record.

    Definition Classes
    Record
  10. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def copyFieldsByPosition(source: Record): Unit

    Permalink

    Copies fields from source to this by position.

    Copies fields from source to this by position.

    Calls

    update(i, source.apply(i))

    for all i less than the size of source and this.

    update(i, source.apply(i)) }}} size of source and this.

  13. def detach(): Record

    Permalink

    Modifies the current record so that it carries as little data as necessary to exist by itself.

    Modifies the current record so that it carries as little data as necessary to exist by itself. More specifically, it detaches itself from as much of its parent Message's data as possible. If non-complete subsets of Records are going to be kept in memory, they should be detached so they don't carry the memory of any discarded Records by association to their parent Messages.

    returns

    the record itself (not a new record)

    Definition Classes
    ExportRecordRecord
  14. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  16. val exportTime: Option[Instant]

    Permalink

    Gets the export time of the Message that generated this record as an Option.

    Gets the export time of the Message that generated this record as an Option.

    returns

    The export time of the Message or None if the record represents a list element or was not read from a Message.

    Definition Classes
    ExportRecordRecord
  17. final def fields: Iterator[Field]

    Permalink

    Returns an Iterator where iteration yields a Field.

    Returns an Iterator where iteration yields a Field.

    Definition Classes
    Record
  18. final def fill(obj: Fillable): Unit

    Permalink

    Fills the fields of obj that are marked with the IPFIXExtract annotation from this record.

    Fills the fields of obj that are marked with the IPFIXExtract annotation from this record.

    obj

    the object to fill

    Definition Classes
    Record
    See also

    IPFIXExtract

  19. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def formatted: String

    Permalink
    Definition Classes
    Record
  21. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  22. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. val message: Option[Message]

    Permalink

    Returns the Message object from which the Record was read as an Option or scala.None if the Record was not read from a Message.

    Returns the Message object from which the Record was read as an Option or scala.None if the Record was not read from a Message.

    Definition Classes
    ExportRecordRecord
  25. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. val observationDomain: Option[Int]

    Permalink

    Returns the observation domain of the Message that generated this record as an Option or None if the record represents a list element or was not read from a Message.

    Returns the observation domain of the Message that generated this record as an Option or None if the record represents a list element or was not read from a Message.

    Definition Classes
    ExportRecordRecord
  29. def octetLength: Int

    Permalink

    Gets the number of octets required to write the record to a stream.

    Gets the number of octets required to write the record to a stream.

    Definition Classes
    ExportRecordRecord
  30. final lazy val size: Int

    Permalink

    Gets the number of fields in the record.

    Gets the number of fields in the record.

    Definition Classes
    Record
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  32. final val template: Template

    Permalink

    The Template that describes this Record.

    The Template that describes this Record.

    Definition Classes
    Record
  33. def toBuffer(outbuf: ByteBuffer, session: Session): ByteBuffer

    Permalink

    Appends this Record to a buffer for writing to an IPFIX stream.

    Appends this Record to a buffer for writing to an IPFIX stream. The function uses the template IDs in session if the Record contains SubTemplateLists or a SubTemplateMultiList. Assumes the Template(s) used by the Record have already been added to the Session and appeneded to the buffer.

    Definition Classes
    Record
  34. def toString(): String

    Permalink
    Definition Classes
    Record → AnyRef → Any
  35. def update(idx: Int, obj: Any): Unit

    Permalink

    Updates the value within the record for the field specified by position in the record's template.

    Updates the value within the record for the field specified by position in the record's template.

    Exceptions thrown

    java.lang.IndexOutOfBoundsException if the index is out of range.

  36. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Record

Inherited from AnyRef

Inherited from Any

Ungrouped