Search in sources :

Example 1 with PerunNotifAuditMessage

use of cz.metacentrum.perun.notif.entities.PerunNotifAuditMessage in project perun by CESNET.

the class SchedulingManagerImpl method processOneAuditerMessage.

public void processOneAuditerMessage(String message) throws Exception {
    PerunNotifAuditMessage perunNotifAuditMessage = null;
    try {
        perunNotifAuditMessage = perunNotifAuditMessagesManager.saveMessageToPerunAuditerMessage(message, session);
    } catch (InternalErrorException ex) {
        logger.error("Error during saving one time auditer message: " + message);
    }
    processPerunNotifAuditMessage(perunNotifAuditMessage, session);
}
Also used : InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException) PerunNotifAuditMessage(cz.metacentrum.perun.notif.entities.PerunNotifAuditMessage)

Example 2 with PerunNotifAuditMessage

use of cz.metacentrum.perun.notif.entities.PerunNotifAuditMessage in project perun by CESNET.

the class SchedulingManagerImpl method processPerunAuditMessages.

/**
	 * The method loads perun audit messages from the database and saves them as PerunNotifAudiMessages.
	 */
public void processPerunAuditMessages() throws Exception {
    List<PerunNotifAuditMessage> perunNotifAuditMessages = new ArrayList<PerunNotifAuditMessage>();
    try {
        List<AuditMessage> messages = perun.getAuditMessagesManagerBl().pollConsumerMessagesForParser(consumerName);
        for (AuditMessage message : messages) {
            try {
                PerunNotifAuditMessage perunNotifAuditMessage = perunNotifAuditMessagesManager.saveMessageToPerunAuditerMessage(message.getMsg(), session);
                perunNotifAuditMessages.add(perunNotifAuditMessage);
            } catch (InternalErrorException ex) {
                logger.error("Error during saving message to db. Message: " + message.getMsg());
                throw ex;
            }
        }
    } catch (Exception ex) {
        logger.error("Error during perunNotification process.");
        throw ex;
    }
}
Also used : AuditMessage(cz.metacentrum.perun.core.api.AuditMessage) PerunNotifAuditMessage(cz.metacentrum.perun.notif.entities.PerunNotifAuditMessage) ArrayList(java.util.ArrayList) InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException) PerunNotifAuditMessage(cz.metacentrum.perun.notif.entities.PerunNotifAuditMessage) InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException)

Aggregations

InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)2 PerunNotifAuditMessage (cz.metacentrum.perun.notif.entities.PerunNotifAuditMessage)2 AuditMessage (cz.metacentrum.perun.core.api.AuditMessage)1 ArrayList (java.util.ArrayList)1