org.opends.testqa.monitoringclient
Class ErrorsBuffer

java.lang.Object
  extended by org.opends.testqa.monitoringclient.ErrorsBuffer

public class ErrorsBuffer
extends java.lang.Object

Buffer to store the errors who occured while the monitoring client is running.


Constructor Summary
ErrorsBuffer(MonitoringClient client)
          Construct a ErrorsBuffer object.
 
Method Summary
 boolean addError(java.lang.String protocol, java.lang.String message, java.util.Date date)
          Add a general error in the buffer and notify the consumers.
 boolean addError(java.lang.String protocol, java.lang.String attribute, java.lang.String message)
          Add an error in the buffer and notify the consumers.
 boolean addError(java.lang.String protocol, java.lang.String attribute, java.lang.String message, java.util.Date date)
          Add an error in the buffer and notify the consumers.
 ErrorsBuffer clone()
          Clone the ErrorsBuffer and clear it if all the consumers have cloned it.
 boolean isEmpty()
          Test if there is at least one error in the buffer.
 Error removeFirstError()
          Return the first error in the buffer and remove it.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorsBuffer

public ErrorsBuffer(MonitoringClient client)
Construct a ErrorsBuffer object.

Parameters:
client - The main class of the client.
Method Detail

addError

public boolean addError(java.lang.String protocol,
                        java.lang.String message,
                        java.util.Date date)
Add a general error in the buffer and notify the consumers.

Parameters:
protocol - The name of the protocol.
message - The message of the error.
date - The date of the error.
Returns:
true if the error have been add in the buffer, false otherwise.

addError

public boolean addError(java.lang.String protocol,
                        java.lang.String attribute,
                        java.lang.String message)
Add an error in the buffer and notify the consumers.

Parameters:
protocol - The name of the protocol.
attribute - The name of the attribute monitored.
message - The message of the error.
Returns:
true if the error have been add in the buffer, false otherwise.

addError

public boolean addError(java.lang.String protocol,
                        java.lang.String attribute,
                        java.lang.String message,
                        java.util.Date date)
Add an error in the buffer and notify the consumers.

Parameters:
protocol - The name of the protocol.
attribute - The name of the attribute monitored.
message - The message of the error.
date - The date of the error.
Returns:
true if the error have been add in the buffer, false otherwise.

isEmpty

public boolean isEmpty()
Test if there is at least one error in the buffer.

Returns:
true if there is at least one error in the buffer, false otherwise.

removeFirstError

public Error removeFirstError()
Return the first error in the buffer and remove it.

Returns:
The first error in the buffer.

clone

public ErrorsBuffer clone()
Clone the ErrorsBuffer and clear it if all the consumers have cloned it.

Overrides:
clone in class java.lang.Object
Returns:
A clone of the ErrorsBuffer.