package de.uka.ipd.consensus.foundation.schema;

import java.io.Serializable;

import de.uka.ipd.consensus.foundation.ontology.OntologyManagerException;
import de.uka.ipd.consensus.foundation.rights.DynamicRightsManagerException;

/**
 * This is a mixin interface for elements that can have comments.
 * @author Thomas Much
 * @version 2006-06-14
 */
public interface Commentatable extends Serializable {

	/**
	 * Returns the comment of the element.
	 * @return the comment (may be the empty string, but never <code>null</code>)
	 */
	public String getComment();
	
	
	/**
	 * Changes the element's comment.
	 * @param setter the user who wants to change the comment
	 * @param comment the new comment (<code>null</code> is treated as an empty string)
	 * @throws OntologyManagerException if the comment could not be changed
	 * @throws DynamicRightsManagerException if the user is not allowed to change the comment
	 * @see de.uka.ipd.consensus.foundation.rights.DynamicRightsManager#mayChangeConceptComment(User, Concept)
	 * @see de.uka.ipd.consensus.foundation.rights.DynamicRightsManager#mayChangeUserComment(User, User)
	 */
	public void setComment(User setter, String comment) throws OntologyManagerException,DynamicRightsManagerException;

}
