ErrorsBuffer.java revision d81978a0815d5b8a75633c35e3e1f8708d36f017
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
*/
/**
* Buffer to store the errors who occured
* while the monitoring client is running.
*/
public class ErrorsBuffer {
/**
* Main class of the client.
*/
private MonitoringClient client;
/**
* Errors who occured when the client is running.
*/
/**
* Number of consumers who have cloned the buffer.
*/
private int consumers;
/**
* Construct a ErrorsBuffer object.
*
* @param client The main class of the client.
*/
consumers = 0;
}
/**
* Add a general error in the buffer and notify the consumers.
*
* @param protocol The name of the protocol.
* @param message The message of the error.
* @param date The date of the error.
* @return true if the error have been add in the buffer, false otherwise.
*/
return result;
}
/**
* Add an error in the buffer and notify the consumers.
*
* @param protocol The name of the protocol.
* @param attribute The name of the attribute monitored.
* @param message The message of the error.
* @return true if the error have been add in the buffer, false otherwise.
*/
return result;
}
/**
* Add an error in the buffer and notify the consumers.
*
* @param protocol The name of the protocol.
* @param attribute The name of the attribute monitored.
* @param message The message of the error.
* @param date The date of the error.
* @return true if the error have been add in the buffer, false otherwise.
*/
return result;
}
/**
* Add an error in the buffer.
*
* @param protocol The name of the protocol.
* @param attribute The name of the attribute monitored.
* @param message The message of the error.
* @param date The date of the error.
* @return true if the error have been add in the buffer, false otherwise.
*/
}
/**
* Test if there is at least one error in the buffer.
*
* @return true if there is at least one error in the buffer, false otherwise.
*/
public synchronized boolean isEmpty(){
}
/**
* Return the first error in the buffer and remove it.
*
* @return The first error in the buffer.
*/
public synchronized Error removeFirstError() {
}
/**
* Clone the ErrorsBuffer and clear it if all the consumers have cloned it.
*
* @return A clone of the ErrorsBuffer.
*/
public synchronized ErrorsBuffer clone () {
}
consumers = 0;
}
return result;
}
}