Package fr.eolya.crawler.cache

Source Code of fr.eolya.crawler.cache.DocumentCacheFactory

package fr.eolya.crawler.cache;

import fr.eolya.crawler.cache.mongodb.MongoDBDocumentCache;
import fr.eolya.utils.nosql.IDBConnection;
import fr.eolya.utils.nosql.mongodb.MongoDBConnection;

public class DocumentCacheFactory {

  public static IDocumentCache getDocumentCacheInstance(String type, IDBConnection con, String dbName, String dbCollName, String sourceId) {
    if (!type.equals(con.getType())) return null;
   
    if ("mongodb".equals(type)) {
        return new MongoDBDocumentCache(sourceId, (MongoDBConnection) con, dbName, dbCollName);
    }
    return null;
  }

}
TOP

Related Classes of fr.eolya.crawler.cache.DocumentCacheFactory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.