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

com.lordofthejars.nosqlunit.infinispan.DefaultInfinispanInsertionStrategy Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package com.lordofthejars.nosqlunit.infinispan;

import java.io.InputStream;
import java.util.Map;

import com.lordofthejars.nosqlunit.objects.KeyValueObjectMapper;

public class DefaultInfinispanInsertionStrategy implements InfinispanInsertionStrategy {

	@Override
	public void insert(InfinispanConnectionCallback connection, InputStream dataset) throws Throwable {
		Map values = loadMap(dataset);
		connection.basicCache().putAll(values);
	}

	private Map loadMap(InputStream dataScript) {
		KeyValueObjectMapper keyValueObjectMapper = new KeyValueObjectMapper();
		Map values = keyValueObjectMapper.readValues(dataScript);
		return values;
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy