All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ikasan.systemevent.service.SolrSystemEventServiceImpl Maven / Gradle / Ivy

The newest version!
package org.ikasan.systemevent.service;

import org.ikasan.spec.persistence.BatchInsert;
import org.ikasan.spec.solr.SolrService;
import org.ikasan.spec.solr.SolrServiceBase;
import org.ikasan.spec.systemevent.SystemEvent;
import org.ikasan.systemevent.dao.SolrSystemEventDaoImpl;

import java.util.List;

/**
 * Created by Ikasan Development Team on 23/09/2017.
 */
public class SolrSystemEventServiceImpl extends SolrServiceBase implements SolrService, BatchInsert
{

    private SolrSystemEventDaoImpl systemEventDao;

    public SolrSystemEventServiceImpl(SolrSystemEventDaoImpl systemEventDao)
    {
        this.systemEventDao = systemEventDao;
        if(this.systemEventDao == null)
        {
            throw new IllegalArgumentException("systemEventDao cannot be null!");
        }
    }

    @Override
    public void insert(List systemEvents)
    {
        this.save(systemEvents);
    }

    @Override
    public void save(SystemEvent systemEvent)
    {
        this.systemEventDao.setSolrUsername(this.solrUsername);
        this.systemEventDao.setSolrPassword(this.solrPassword);
        systemEventDao.save(systemEvent);
    }

    @Override
    public void save(List systemEvents)
    {
        this.systemEventDao.setSolrUsername(this.solrUsername);
        this.systemEventDao.setSolrPassword(this.solrPassword);
        systemEventDao.save(systemEvents);

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy