Class RegistryRecord

java.lang.Object
kieker.common.record.AbstractMonitoringRecord
kieker.common.record.misc.RegistryRecord
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<IMonitoringRecord>, IMonitoringRecord

public final class RegistryRecord
extends AbstractMonitoringRecord
Record used to associate Objects (typically Strings) with unique ids.
Since:
1.5
Author:
Jan Waller
See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • RegistryRecord

      public RegistryRecord​(int id, java.lang.String string)
      Creates a new instance of this class using the given parameters.
      Parameters:
      id - The ID.
      string - The string.
    • RegistryRecord

      public RegistryRecord​(java.lang.Object[] values)
      This constructor converts the given array into a record. It is recommended to use the array which is the result of a call to #toArray().
      Parameters:
      values - The values for the record.
    • RegistryRecord

      public RegistryRecord​(IValueDeserializer deserializer) throws java.nio.BufferUnderflowException
      This constructor converts the given array into a record.
      Parameters:
      deserializer - The deserializer to decode the record with.
      Throws:
      java.nio.BufferUnderflowException - if buffer not sufficient
  • Method Details

    • serialize

      public void serialize​(IValueSerializer serializer) throws java.nio.BufferOverflowException
      This method serializes this record using the given serializer.
      Parameters:
      serializer - The serializer to serialize the record with. *
      Throws:
      java.nio.BufferOverflowException - If the underlying buffer has insufficient capacity to store this record
    • getValueTypes

      public java.lang.Class<?>[] getValueTypes()
      This method delivers an array with the classes of the single values for the record.
      Returns:
      The types of the values. This returned array should be treated readonly.
    • getValueNames

      public java.lang.String[] getValueNames()
      Description copied from interface: IMonitoringRecord
      This method delivers an array containing the value names of the record.
      Returns:
      The types of the values. This returned array should be treated readonly.
    • getSize

      public int getSize()
      This method should deliver the size of a binary representation of this record.
      Returns:
      The size.
    • getStrBytes

      public final byte[] getStrBytes()
      Returns:
      the String as byte[]
    • getId

      public final int getId()
      Returns:
      the id
    • getString

      public final java.lang.String getString()
      Returns:
      the string
    • registerRecordInRegistry

      public static final void registerRecordInRegistry​(java.nio.ByteBuffer buffer, ReaderRegistry<java.lang.String> stringRegistry) throws java.nio.BufferOverflowException
      Static function used to register strings stored in a byte buffer as string in the string registry with the proper id.
      Parameters:
      buffer - the byte buffer containing the string
      stringRegistry - the registry where the string is stored
      Throws:
      java.nio.BufferOverflowException - if the length encoded in the buffer exceeds the buffers boundary