Package kieker.common.record.misc
Class RegistryRecord
java.lang.Object
kieker.common.record.AbstractMonitoringRecord
kieker.common.record.misc.RegistryRecord
- All Implemented Interfaces:
Serializable,Comparable<IMonitoringRecord>,IMonitoringRecord
Record used to associate Objects (typically Strings) with unique ids.
- Since:
- 1.5
- Author:
- Jan Waller
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final Stringstatic final intstatic final Class<?>[]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
ConstructorsConstructorDescriptionRegistryRecord(int id, String string) Creates a new instance of this class using the given parameters.RegistryRecord(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 TypeMethodDescriptionfinal intgetId()intgetSize()This method should deliver the size of a binary representation of this record.final byte[]final StringString[]This method delivers an array containing the value names of the record.Class<?>[]This method delivers an array with the classes of the single values for the record.static final voidregisterRecordInRegistry(ByteBuffer buffer, ReaderRegistry<String> stringRegistry) Static function used to register strings stored in a byte buffer as string in the string registry with the proper id.voidserialize(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, typesForClassMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface kieker.common.record.IMonitoringRecord
toString
-
Field Details
-
SIZE
public static final int SIZE- See Also:
-
TYPES
-
ENCODING
- See Also:
-
CLASS_ID
public static final int CLASS_ID- See Also:
-
-
Constructor Details
-
RegistryRecord
Creates a new instance of this class using the given parameters.- Parameters:
id- The ID.string- The string.
-
RegistryRecord
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:
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:
BufferOverflowException- If the underlying buffer has insufficient capacity to store this record
-
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
Description copied from interface:IMonitoringRecordThis 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
- 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 stringstringRegistry- the registry where the string is stored- Throws:
BufferOverflowException- if the length encoded in the buffer exceeds the buffers boundary
-