package meerkat.bulletinboard;

import com.google.protobuf.BoolValue;
import meerkat.comm.CommunicationException;
import meerkat.protobuf.BulletinBoardApi.*;

/**
 * Created by Arbel Deutsch Peled on 13-Apr-16.
 */
public interface DeletableBulletinBoardServer extends BulletinBoardServer {

    /**
     * Deletes a message from the Bulletin Board
     * If the message is a batch: the batch data is deleted as well
     * Logs this action
     * @param msgID is the ID of the message to delete
     * @return a BoolMsg containing the value TRUE if a message was deleted, FALSE if the message does not exist
     * @throws CommunicationException in case of an error
     */
    public BoolValue deleteMessage(MessageID msgID) throws CommunicationException;

    /**
     * Deletes a message from the Bulletin Board
     * If the message is a batch: the batch data is deleted as well
     * Logs this action
     * @param entryNum is the serial entry number of the message to delete
     * @return a BoolMsg containing the value TRUE if a message was deleted, FALSE if the message does not exist
     * @throws CommunicationException in case of an error
     */
    public BoolValue deleteMessage(long entryNum) throws CommunicationException;

}
