use of org.openkilda.model.history.FlowEventDump in project open-kilda by telstra.
the class HibernateHistoryFlowEventRepository method makeEntity.
@Override
protected HibernateFlowEvent makeEntity(FlowEventData view) {
HibernateFlowEvent entity = new HibernateFlowEvent();
FlowEventCloner.INSTANCE.copyWithoutRecordsAndDumps(view, entity);
for (FlowEventAction entry : view.getEventActions()) {
HibernateFlowEventAction action = new HibernateFlowEventAction();
FlowEventActionCloner.INSTANCE.copy(entry.getData(), action);
entity.addAction(action);
}
for (FlowEventDump entry : view.getEventDumps()) {
HibernateFlowEventDump dump = new HibernateFlowEventDump();
FlowEventDumpCloner.INSTANCE.copy(entry.getData(), dump);
entity.addDump(dump);
}
return entity;
}
use of org.openkilda.model.history.FlowEventDump in project open-kilda by telstra.
the class HistoryService method store.
/**
* Save history data into data storage.
*
* @param historyHolder holder of history information.
*/
public void store(FlowHistoryHolder historyHolder) {
transactionManager.doInTransaction(() -> {
String taskId = historyHolder.getTaskId();
if (historyHolder.getFlowEventData() != null) {
FlowEvent event = HistoryMapper.INSTANCE.map(historyHolder.getFlowEventData());
event.setTaskId(taskId);
flowEventRepository.add(event);
}
if (historyHolder.getFlowHistoryData() != null) {
FlowEventAction history = HistoryMapper.INSTANCE.map(historyHolder.getFlowHistoryData());
history.setTaskId(taskId);
flowEventActionRepository.add(history);
}
if (historyHolder.getFlowDumpData() != null) {
FlowEventDump dump = HistoryMapper.INSTANCE.map(historyHolder.getFlowDumpData());
dump.setTaskId(taskId);
flowEventDumpRepository.add(dump);
}
});
}
Aggregations