// Path: src/main/java/org/mockenize/model/LogBean.java
// @Data
// public class LogBean implements Serializable, Cacheable {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	private String key;
// 
// 	private LogType type;
// 
// 	private String url;
// 
// 	private String path;
// 
// 	private String method;
// 
// 	private RequestLogBean request;
// 
// 	private ResponseLogBean response;
// 
// 	private Date date = new Date();
// 
// 	protected LogBean() {
// 	}
// 
// 	public LogBean(UUID key, LogType type) {
// 		this.key = key.toString();
// 		this.type = type;
// 	}
// 
// }
// 
// Path: src/main/java/org/mockenize/repository/LogRepository.java
// @Repository
// public class LogRepository extends AbstractRepository<LogBean> {
// 
// 	private static final String CACHE_KEY = "logs";
// 
// 	@Autowired
// 	public LogRepository(HazelcastInstance hazelcastInstance) {
// 		super(hazelcastInstance, CACHE_KEY);
// 		map.addIndex("key", false);
// 		map.addIndex("date", true);
// 	}
// 
// }


import java.util.Collection;
import java.util.Iterator;
import java.util.UUID;
import org.mockenize.model.LogBean;
import org.mockenize.repository.LogRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fasterxml.jackson.databind.JsonNode;
import com.hazelcast.query.Predicate;
import com.hazelcast.query.Predicates;
package org.mockenize.service;




@Service
public class LoggingService {

    @Autowired
    private LogRepository logRepository;

    public void save(LogBean logBean) {
        logRepository.save(logBean);
    }

    public Collection<LogBean> getAll() {
        return logRepository.findAll();
    }

    public LogBean getByKey(UUID key) {
        return logRepository.findByKey(key.toString());
    }


    public LogBean delete(UUID key) {
        return logRepository.delete(key.toString());
    }

    public Collection<LogBean> deleteAll() {
       return logRepository.deleteAll();
    }

	@SuppressWarnings("unchecked")
	public Collection<LogBean> findByFilters(JsonNode jsonNode) {
		Iterator<String> fieldNames = jsonNode.fieldNames();
// Path: src/main/java/org/mockenize/model/LogBean.java
// @Data
// public class LogBean implements Serializable, Cacheable {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	private String key;
// 
// 	private LogType type;
// 
// 	private String url;
// 
// 	private String path;
// 
// 	private String method;
// 
// 	private RequestLogBean request;
// 
// 	private ResponseLogBean response;
// 
// 	private Date date = new Date();
// 
// 	protected LogBean() {
// 	}
// 
// 	public LogBean(UUID key, LogType type) {
// 		this.key = key.toString();
// 		this.type = type;
// 	}
// 
// }
// 
// Path: src/main/java/org/mockenize/repository/LogRepository.java
// @Repository
// public class LogRepository extends AbstractRepository<LogBean> {
// 
// 	private static final String CACHE_KEY = "logs";
// 
// 	@Autowired
// 	public LogRepository(HazelcastInstance hazelcastInstance) {
// 		super(hazelcastInstance, CACHE_KEY);
// 		map.addIndex("key", false);
// 		map.addIndex("date", true);
// 	}
// 
// }


// Path: src/main/java/org/mockenize/service/LoggingService.java
import java.util.Collection;
import java.util.Iterator;
import java.util.UUID;
import org.mockenize.model.LogBean;
import org.mockenize.repository.LogRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fasterxml.jackson.databind.JsonNode;
import com.hazelcast.query.Predicate;
import com.hazelcast.query.Predicates;

package org.mockenize.service;




@Service
public class LoggingService {

    @Autowired
    private LogRepository logRepository;

    public void save(LogBean logBean) {
        logRepository.save(logBean);
    }

    public Collection<LogBean> getAll() {
        return logRepository.findAll();
    }

    public LogBean getByKey(UUID key) {
        return logRepository.findByKey(key.toString());
    }


    public LogBean delete(UUID key) {
        return logRepository.delete(key.toString());
    }

    public Collection<LogBean> deleteAll() {
       return logRepository.deleteAll();
    }

	@SuppressWarnings("unchecked")
	public Collection<LogBean> findByFilters(JsonNode jsonNode) {
		Iterator<String> fieldNames = jsonNode.fieldNames();
		Predicate<String, LogBean> predicate = null;