package com.hammurapi.store.local;

import java.util.Map;

import com.hammurapi.extract.Extractor;
import com.hammurapi.extract.Predicate;
import com.hammurapi.store.Store;

/**
 * Handle factory allows to configure LocalStore store to use custom handles which 
 * carry additional information about store entries. 
 * @author Pavel Vlasov
 *
 * @param <T>
 * @param <PK>
 * @param <H>
 */
public interface HandleFactory<T, PK, S extends Store<T,PK,S>, H extends LocalHandle<T,PK,S>> {
	
	H createHandle(
			S store,
			T obj,
			PK primaryKey,
			Map<S, Map<Extractor<T, ? super PK, S>, ? super PK>> cache,
			Predicate<T, S>[] validators,			
			LocalHandle.HandleStrength handleStrength,
			boolean cacheExtracted);

}
