Package kieker.common.record.misc
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 Summary
Fields Modifier and Type Field Description static int
CLASS_ID
static java.lang.String
ENCODING
static int
SIZE
static java.lang.Class<?>[]
TYPES
Fields inherited from class kieker.common.record.AbstractMonitoringRecord
TYPE_SIZE_BOOLEAN, TYPE_SIZE_BYTE, TYPE_SIZE_CHARACTER, TYPE_SIZE_DOUBLE, TYPE_SIZE_FLOAT, TYPE_SIZE_INT, TYPE_SIZE_LONG, TYPE_SIZE_SHORT, TYPE_SIZE_STRING
-
Constructor Summary
Constructors Constructor Description RegistryRecord(int id, java.lang.String string)
Creates a new instance of this class using the given parameters.RegistryRecord(java.lang.Object[] values)
This constructor converts the given array into a record.RegistryRecord(IValueDeserializer deserializer)
This constructor converts the given array into a record. -
Method Summary
Modifier and Type Method Description int
getId()
int
getSize()
This method should deliver the size of a binary representation of this record.byte[]
getStrBytes()
java.lang.String
getString()
java.lang.String[]
getValueNames()
This method delivers an array containing the value names of the record.java.lang.Class<?>[]
getValueTypes()
This method delivers an array with the classes of the single values for the record.static void
registerRecordInRegistry(java.nio.ByteBuffer buffer, ReaderRegistry<java.lang.String> stringRegistry)
Static function used to register strings stored in a byte buffer as string in the string registry with the proper id.void
serialize(IValueSerializer serializer)
This method serializes this record using the given serializer.Methods inherited from class kieker.common.record.AbstractMonitoringRecord
checkArray, classForName, compareTo, createFromDeserializer, equals, fromStringArrayToTypedArray2, getLoggingTimestamp, hashCode, isNotEqual, isNotEqual, setLoggingTimestamp, typesForClass
-
Field Details
-
SIZE
public static final int SIZE- See Also:
- Constant Field Values
-
TYPES
public static final java.lang.Class<?>[] TYPES -
ENCODING
public static final java.lang.String ENCODING- See Also:
- Constant Field Values
-
CLASS_ID
public static final int CLASS_ID- See Also:
- Constant Field Values
-
-
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
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
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.BufferOverflowExceptionStatic 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 stringstringRegistry
- the registry where the string is stored- Throws:
java.nio.BufferOverflowException
- if the length encoded in the buffer exceeds the buffers boundary
-