es.upv.dsic.gti_ia.core
Class TraceEvent

java.lang.Object
  extended by es.upv.dsic.gti_ia.core.TraceEvent
All Implemented Interfaces:
Serializable

public class TraceEvent
extends Object
implements Serializable

Definition of Trace Event.

Author:
L Burdalo (lburdalo@dsic.upv.es)
See Also:
Serialized Form

Constructor Summary
TraceEvent()
          Void constructor which sets all attributes to null except for timestamp, which is set to -1
TraceEvent(String tService, AgentID originAid, String content)
          Creates a new trace event and sets its attributes according to the specified parameters, except for timestamp, which is set to System.currentTimeMillis() A new tracing entity is created for the specified AgentID
TraceEvent(String tService, TracingEntity originEntity, String content)
          Creates a new trace event and sets its attributes according to the specified parameters, except for timestamp, which is set to the current time using System.currentTimeMillis()
 
Method Summary
 String getContent()
          Returns the content of the trace event.
 TracingEntity getOriginEntity()
          Returns the origin entity of the trace event.
 long getTimestamp()
          Returns the time stamp of the trace event.
 String getTracingService()
          Returns the tracing service of the trace event.
 void setContent(String content)
          Sets the content of the trace event to the specified one.
 void setOriginEntity(TracingEntity originEntity)
          Sets the origin entity of the trace event to the specified one.
 void setTimestamp(long timestamp)
          Sets the time stamp of the trace event to the specified one.
 void setTracingService(String tService)
          Sets the tracing service of the trace event to the specified one.
 String toReadableString()
          Converts the trace event to a human readable string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TraceEvent

public TraceEvent()
Void constructor which sets all attributes to null except for timestamp, which is set to -1


TraceEvent

public TraceEvent(String tService,
                  TracingEntity originEntity,
                  String content)
Creates a new trace event and sets its attributes according to the specified parameters, except for timestamp, which is set to the current time using System.currentTimeMillis()

Parameters:
tService - Tracing service name
originEntity - Tracing entity which originated the trace event
content - Content of the trace event
See Also:
System.currentTimeMillis()

TraceEvent

public TraceEvent(String tService,
                  AgentID originAid,
                  String content)
Creates a new trace event and sets its attributes according to the specified parameters, except for timestamp, which is set to System.currentTimeMillis() A new tracing entity is created for the specified AgentID

Parameters:
tService - Tracing service name
originAid - AgentID of the tracing entity which originated the trace event
content - Content of the trace event
See Also:
System.currentTimeMillis(), AgentID
Method Detail

setTracingService

public void setTracingService(String tService)
Sets the tracing service of the trace event to the specified one.

Parameters:
tService - Name of the tracing service

setTimestamp

public void setTimestamp(long timestamp)
Sets the time stamp of the trace event to the specified one.

Parameters:
timestamp - Time at which the trace event was thrown

setOriginEntity

public void setOriginEntity(TracingEntity originEntity)
Sets the origin entity of the trace event to the specified one.

Parameters:
originEntity - Tracing entity which originated the trace event

setContent

public void setContent(String content)
Sets the content of the trace event to the specified one.

Parameters:
content - Content of the trace event

getTracingService

public String getTracingService()
Returns the tracing service of the trace event.

Returns:
tService Name of the tracing Service

getOriginEntity

public TracingEntity getOriginEntity()
Returns the origin entity of the trace event.

Returns:
originEntity Tracing entity which originated the trace event

getContent

public String getContent()
Returns the content of the trace event.

Returns:
content Content of the trace event

getTimestamp

public long getTimestamp()
Returns the time stamp of the trace event.

Returns:
timestamp Time at which the trace event was generated

toReadableString

public String toReadableString()
Converts the trace event to a human readable string.

Returns:
A readable string containing all information of the trace event
See Also:
TracingEntity.toReadableString()


Copyright © 2012 GTI-IA. All Rights Reserved.