package cn.axzo.msg.center.message.service.card.log;

import cn.axzo.msg.center.domain.entity.Card;
import org.apache.commons.collections4.CollectionUtils;

import java.util.Collection;

/**
 * @author yanglin
 */
public interface CardLogger {

    default void reloadAndLogCards(String operationContext) {
        reloadAndLogCards(operationContext, null);
    }

    default void addCards(Collection<Card> cards) {
        if (CollectionUtils.isNotEmpty(cards))
            cards.forEach(this::addCard);
    }

    void reloadAndLogCards(String operationContext, Exception e);

    void addCard(Card card);

}