Package step.core.imports
Class GenericDBImporter<A extends AbstractIdentifiableObject,T extends CRUDAccessor<A>>
- java.lang.Object
-
- step.core.imports.GenericDBImporter<A,T>
-
- All Implemented Interfaces:
Importer<A,T>
- Direct Known Subclasses:
PlanImporter
,ResourceImpoter
,ResourceRevisionsImporter
public class GenericDBImporter<A extends AbstractIdentifiableObject,T extends CRUDAccessor<A>> extends Object implements Importer<A,T>
-
-
Field Summary
Fields Modifier and Type Field Description protected GlobalContext
context
protected Entity<A,T>
entity
protected com.mongodb.client.MongoCollection<org.bson.Document>
tmpCollection
-
Constructor Summary
Constructors Constructor Description GenericDBImporter(GlobalContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.mongodb.BasicDBObject
applyMigrationTasks(ImportConfiguration importConfig, com.mongodb.BasicDBObject o)
protected com.mongodb.client.MongoCollection<org.bson.Document>
getOrInitTmpCollection()
protected com.mongodb.client.MongoCollection<org.bson.Document>
getTmpCollection()
void
importMany(ImportConfiguration importConfig, com.fasterxml.jackson.databind.ObjectMapper mapper)
A
importOne(ImportConfiguration importConfig, com.fasterxml.jackson.core.JsonParser jParser, com.fasterxml.jackson.databind.ObjectMapper mapper, Map<String,String> references)
void
init(Entity<A,T> entity)
protected void
saveToTmpCollection(org.bson.Document doc)
protected void
saveWithNewId(A aObj, Map<String,String> references)
-
-
-
Field Detail
-
entity
protected Entity<A extends AbstractIdentifiableObject,T extends CRUDAccessor<A>> entity
-
context
protected GlobalContext context
-
tmpCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> tmpCollection
-
-
Constructor Detail
-
GenericDBImporter
public GenericDBImporter(GlobalContext context)
-
-
Method Detail
-
init
public void init(Entity<A,T> entity)
- Specified by:
init
in interfaceImporter<A extends AbstractIdentifiableObject,T extends CRUDAccessor<A>>
-
importOne
public A importOne(ImportConfiguration importConfig, com.fasterxml.jackson.core.JsonParser jParser, com.fasterxml.jackson.databind.ObjectMapper mapper, Map<String,String> references) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException
- Specified by:
importOne
in interfaceImporter<A extends AbstractIdentifiableObject,T extends CRUDAccessor<A>>
- Throws:
com.fasterxml.jackson.core.JsonParseException
com.fasterxml.jackson.databind.JsonMappingException
IOException
-
applyMigrationTasks
protected com.mongodb.BasicDBObject applyMigrationTasks(ImportConfiguration importConfig, com.mongodb.BasicDBObject o)
-
getOrInitTmpCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> getOrInitTmpCollection()
-
getTmpCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> getTmpCollection()
-
saveToTmpCollection
protected void saveToTmpCollection(org.bson.Document doc)
-
importMany
public void importMany(ImportConfiguration importConfig, com.fasterxml.jackson.databind.ObjectMapper mapper) throws IOException
- Specified by:
importMany
in interfaceImporter<A extends AbstractIdentifiableObject,T extends CRUDAccessor<A>>
- Throws:
IOException
-
-