Class TraceRecord
java.lang.Object
de.iip_ecosphere.platform.transport.status.TraceRecord
Optional generic tracing of platform actions. [preliminary]
- Author:
- Holger Eichelberger, SSE
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringstatic final StringA parameter was changed.static final StringA data item was received.static final StringA data item was processed and send further.static final StringA family completed switching a service.static final StringA family starts switching a service.private Objectprivate Stringprivate longstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionCreates a trace record.TraceRecord(String source, long timestamp, String action, Object payload) Creates a trace record.TraceRecord(String source, String action, Object payload) Creates a trace record with the current time as timestamp. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClears all ignored types and fields.Characterizes the action causing the creation of the record.Returns the (arbitrary) payload.Returns the source of the record.longReturns the timestamp of record creation.static voidignoreClass(Class<?> cls) Registers a type to be ignored when serializing trace record (payloads).static voidignoreField(Class<?> cls, String field) Registers a field to be ignored when serializing trace record (payloads).static voidignoreFields(Class<?> cls, String... fields) Registers fields to be ignored when serializing trace record (payloads).voidsend(TransportConnector conn) Sends this message to the given connector on#TRACE_STREAM.(package private) voidChanges the action causing the creation of the record.(package private) voidsetPayload(Object payload) Changes the (arbitrary) payload.(package private) voidDefines the source of the record.(package private) voidsetTimestamp(long timestamp) Changes the timestamp of record creation.
-
Field Details
-
TRACE_STREAM
- See Also:
-
ACTION_RECEIVING
A data item was received. Payload is the data item.- See Also:
-
ACTION_SENDING
A data item was processed and send further. Payload is the data item.- See Also:
-
ACTION_PARAMETER_CHANGE
A parameter was changed.- See Also:
-
ACTION_SWITCHING_SERVICE
A family starts switching a service. Payload is the id of the service to switch to.- See Also:
-
ACTION_SWITCHED_SERVICE
A family completed switching a service. Payload is the id of the actual service (may be the old one).- See Also:
-
source
-
timestamp
private long timestamp -
action
-
payload
-
-
Constructor Details
-
TraceRecord
TraceRecord()Creates a trace record. [serialization] -
TraceRecord
Creates a trace record with the current time as timestamp.- Parameters:
source- the source of the recordaction- the actionpayload- arbitrary payload
-
TraceRecord
Creates a trace record.- Parameters:
source- the source of the recordtimestamp- the timestamp indicating the creation of the recordaction- the actionpayload- arbitrary payload
-
-
Method Details
-
getSource
Returns the source of the record.- Returns:
- the source, may be a service id, an AAS URL, ...
-
setSource
Defines the source of the record.- Parameters:
source- the source, may be a service id, an AAS URL, ...
-
getTimestamp
public long getTimestamp()Returns the timestamp of record creation.- Returns:
- the timestamp
-
setTimestamp
void setTimestamp(long timestamp) Changes the timestamp of record creation.- Parameters:
timestamp- the timestamp
-
getAction
Characterizes the action causing the creation of the record.- Returns:
- the action, e.g., classification; may be empty
-
setAction
Changes the action causing the creation of the record.- Parameters:
action- the action, e.g., classification; may be empty
-
getPayload
Returns the (arbitrary) payload.- Returns:
- the payload, may be null
-
setPayload
Changes the (arbitrary) payload.- Parameters:
payload- the payload, may be null
-
send
Sends this message to the given connector on#TRACE_STREAM. [convenience]- Parameters:
conn- the connector- Throws:
IOException- if sending fails
-
ignoreClass
Registers a type to be ignored when serializing trace record (payloads). [convenience]- Parameters:
cls- the class representing the type to be ignored
-
ignoreField
Registers a field to be ignored when serializing trace record (payloads). [convenience]- Parameters:
cls- the class representing the type containing the fieldfield- the field to be ignored
-
ignoreFields
Registers fields to be ignored when serializing trace record (payloads). [convenience]- Parameters:
cls- the class representing the type containing the fieldfields- the fields to be ignored
-
clearIgnores
public static void clearIgnores()Clears all ignored types and fields. [convenience]
-