Class RegistryRecord

java.lang.Object
kieker.common.record.AbstractMonitoringRecord
kieker.common.record.misc.RegistryRecord
All Implemented Interfaces:
Serializable, 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:
  • Field Details

  • Constructor Details

    • RegistryRecord

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

      public RegistryRecord(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 BufferUnderflowException
      This constructor converts the given array into a record.
      Parameters:
      deserializer - The deserializer to decode the record with.
      Throws:
      BufferUnderflowException - if buffer not sufficient
  • Method Details

    • serialize

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

      public 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 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 String getString()
      Returns:
      the string
    • registerRecordInRegistry

      public static final void registerRecordInRegistry(ByteBuffer buffer, ReaderRegistry<String> stringRegistry) throws 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:
      BufferOverflowException - if the length encoded in the buffer exceeds the buffers boundary