com.sibvisions.rad.server.protocol
Class Record

java.lang.Object
  extended by com.sibvisions.rad.server.protocol.Record
All Implemented Interfaces:
ICloseable

public class Record
extends java.lang.Object
implements ICloseable

The Record contains information for writing via IProtocolWriter.


Field Summary
protected  java.lang.Throwable exception
          an exception.
protected  int iCount
          the count.
protected  long lCreation
          the creation time in milliseconds.
protected  long lCreationNano
          the creation time in nanos.
protected  long lDuration
          the end time in nanos (default: -1, means undefined).
protected  long lMemoryConsumption
          the memory consumption.
protected  long lMemoryInitial
          the initial memory.
protected  java.lang.Object[] oIdentifier
          the identifier.
protected  java.lang.Object[] oParameter
          the parameter.
protected  java.lang.String sCategory
          the category.
protected  java.lang.String sCommand
          the command.
protected  java.lang.String sUUID
          the UUID.
 
Constructor Summary
Record(IProtocolWriter pWriter, java.lang.String pCategory, java.lang.String pCommand)
          Creates a new instance of Record for given writer and command.
Record(java.lang.String pCategory, java.lang.String pCommand)
          Creates a new instance of Record for given command.
 
Method Summary
 void addIdentifier(java.lang.Object pIdentifier)
          Adds an identifier at the end.
 void addIdentifier(java.lang.Object pIdentifier, int pIndex)
          Adds an identifier at the given position.
 void close()
          Closes the record.
 java.lang.String getCategory()
          Gets the protocol category.
 java.lang.String getCommand()
          Gets the command.
 int getCount()
          Gets the count.
 long getCreationTime()
          Gets the creation time.
 long getDuration()
          Gets the duration.
 java.lang.Throwable getException()
          Gets the exception (if occured).
 java.lang.Object[] getIdentifier()
          Gets the identifier.
 long getMemoryConsumption()
          Gets the memory consumption.
 long getMemoryInitial()
          Gets the initial memory.
 java.lang.Object[] getParameter()
          Gets the parameter.
 java.lang.String getUUID()
          Gets the Universal Unique Identifier.
 void setCount(int pCount)
          Sets the count.
 void setException(java.lang.Throwable pException)
          Sets the exception (if occured).
 void setParameter(java.lang.Object... pParameter)
          Sets the parameter.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sUUID

protected java.lang.String sUUID
the UUID.


sCategory

protected java.lang.String sCategory
the category.


sCommand

protected java.lang.String sCommand
the command.


oIdentifier

protected java.lang.Object[] oIdentifier
the identifier.


oParameter

protected java.lang.Object[] oParameter
the parameter.


exception

protected java.lang.Throwable exception
an exception.


lCreationNano

protected long lCreationNano
the creation time in nanos.


lCreation

protected long lCreation
the creation time in milliseconds.


lDuration

protected long lDuration
the end time in nanos (default: -1, means undefined).


lMemoryInitial

protected long lMemoryInitial
the initial memory.


lMemoryConsumption

protected long lMemoryConsumption
the memory consumption.


iCount

protected int iCount
the count.

Constructor Detail

Record

public Record(java.lang.String pCategory,
              java.lang.String pCommand)
Creates a new instance of Record for given command.

Parameters:
pCategory - the protocol category
pCommand - the assigned command

Record

public Record(IProtocolWriter pWriter,
              java.lang.String pCategory,
              java.lang.String pCommand)
Creates a new instance of Record for given writer and command.

Parameters:
pWriter - the IProtocolWriter
pCategory - the protocol category
pCommand - the assigned command
Method Detail

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

getUUID

public java.lang.String getUUID()
Gets the Universal Unique Identifier.

Returns:
the UUID

getCategory

public java.lang.String getCategory()
Gets the protocol category.

Returns:
the category

getCommand

public java.lang.String getCommand()
Gets the command.

Returns:
the command

getCreationTime

public long getCreationTime()
Gets the creation time.

Returns:
the time in milliseconds.

getDuration

public long getDuration()
Gets the duration.

Returns:
the duration in nanos

setParameter

public void setParameter(java.lang.Object... pParameter)
Sets the parameter.

Parameters:
pParameter - the parameter

getParameter

public java.lang.Object[] getParameter()
Gets the parameter.

Returns:
the parameter

addIdentifier

public void addIdentifier(java.lang.Object pIdentifier)
Adds an identifier at the end.

Parameters:
pIdentifier - the identifier

addIdentifier

public void addIdentifier(java.lang.Object pIdentifier,
                          int pIndex)
Adds an identifier at the given position.

Parameters:
pIdentifier - the identifier
pIndex - the index/position

getIdentifier

public java.lang.Object[] getIdentifier()
Gets the identifier.

Returns:
the identifier

setCount

public void setCount(int pCount)
Sets the count. The count can be a call or modified objects count.

Parameters:
pCount - the count

getCount

public int getCount()
Gets the count.

Returns:
the count

getMemoryInitial

public long getMemoryInitial()
Gets the initial memory.

Returns:
the bytes

getMemoryConsumption

public long getMemoryConsumption()
Gets the memory consumption.

Returns:
the bytes

setException

public void setException(java.lang.Throwable pException)
Sets the exception (if occured).

Parameters:
pException - the exception

getException

public java.lang.Throwable getException()
Gets the exception (if occured).

Returns:
the exception

close

public void close()
Closes the record.

Specified by:
close in interface ICloseable


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.