package org.slc.sli.ingestion.validation;

import java.util.HashMap;
import java.util.Map;

import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component;

import org.slc.sli.domain.Entity;
import org.slc.sli.domain.EntityRepository;

/**
 * Mock entity repository for testing purposes
 *
 * @author nbrown
 *
 */
@Component
public class DummyEntityRepository implements EntityRepository {

    private Map<String, Map<String, Entity>> entities = new HashMap<String, Map<String, Entity>>();

    public void addEntity(String collection, String id, Entity entity) {
        if (!entities.containsKey(collection)) {
            entities.put(collection, new HashMap<String, Entity>());
        }
        entities.get(collection).put(id, entity);
    }

    @Override
    public Entity find(String collectioName, String id) {
        Map<String, Entity> collection = entities.get(collectioName);
        return collection.get(id);
    }

    @Override
    public Iterable<Entity> findAll(String collectionName, int skip, int max) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public Iterable<Entity> findAll(String collectioName) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public boolean update(String collection, Entity entity) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public Entity create(String type, Map<String, Object> body) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public Entity create(String type, Map<String, Object> body, String collectionName) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public Entity create(String type, Map<String, Object> body, Map<String, Object> metaData, String collectionName) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public boolean delete(String collectionName, String id) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public void deleteAll(String collectionName) {
        // TODO Auto-generated method stub

    }

    @Override
    public Iterable<Entity> findByFields(String collectionName, Map<String, String> fields, int skip, int max) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public Iterable<Entity> findByPaths(String collectionName, Map<String, String> paths, int skip, int max) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public Iterable<Entity> findByFields(String collectionName, Map<String, String> fields) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public Iterable<Entity> findByPaths(String collectionName, Map<String, String> paths) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public Iterable<Entity> findByQuery(String collectionName, Query query, int skip, int max) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public boolean matchQuery(String collectioName, String id, Query query) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public Entity find(String arg0, String arg1, String arg2, String arg3) {
        // TODO Auto-generated method stub
        return null;
    }

}

@@ -325,17 +325,18 @@
 poses%0A *
+ 
 %0A
-
  * @auth
@@ -347,16 +347,17 @@
 brown%0A *
+ 
 %0A */%0A@Co
@@ -429,17 +429,21 @@
 itory %7B%0A
+    
 %0A
-
     priv
@@ -534,17 +534,21 @@
 ty%3E%3E();%0A
+    
 %0A
-
     publ
@@ -788,33 +788,37 @@
  entity);%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -976,33 +976,37 @@
 .get(id);%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -1145,33 +1145,37 @@
 urn null;%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -1294,33 +1294,37 @@
 urn null;%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -1446,33 +1446,37 @@
 rn false;%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -1601,33 +1601,37 @@
 urn null;%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -1779,33 +1779,37 @@
 urn null;%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -1987,33 +1987,37 @@
 urn null;%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -2139,33 +2139,37 @@
 rn false;%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -2260,24 +2260,36 @@
 od stub%0A
+        
 %0A
-
     %7D%0A
+    
 %0A
-
     @Ove
@@ -2469,33 +2469,37 @@
 urn null;%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -2669,33 +2669,37 @@
 urn null;%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -2852,33 +2852,37 @@
 urn null;%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -3033,33 +3033,37 @@
 urn null;%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -3219,33 +3219,37 @@
 urn null;%0A    %7D%0A
+    
 %0A
-
     @Override%0A  
@@ -3395,17 +3395,21 @@
 ;%0A    %7D%0A
+    
 %0A
-
     @Ove
@@ -3561,11 +3561,204 @@
 ;%0A    %7D%0A
+    %0A    @Override%0A    public Iterable%3CString%3E findIdsByQuery(String collectionName, Query query, int skip, int max) %7B%0A        // TODO Auto-generated method stub%0A        return null;%0A    %7D%0A    
 %0A%7D%0A

add unimplemented method from interface