Package org.restheart.mongodb.services
Class CsvLoader
- java.lang.Object
-
- org.restheart.mongodb.services.CsvLoader
-
- All Implemented Interfaces:
ConfigurablePlugin,ExchangeTypeResolver<BsonFromCsvRequest,BsonResponse>,HandlingPlugin<BsonFromCsvRequest,BsonResponse>,Plugin,Service<BsonFromCsvRequest,BsonResponse>
public class CsvLoader extends Object implements Service<BsonFromCsvRequest,BsonResponse>
service to upload a csv file in a collection query parameters:
- db=<db_name> *required
- coll=<collection_name> *required
- id=<id_column_index> optional (default: no _id column, each row will get an new ObjectId)
- sep=<column_separator> optional (default: ,)
- props=<props> optional (default: no props) additional props to add to each row
- values=<values> optional (default: no values) values of additional props to add to each row
defined in conf file) of a tranformer to apply to imported data - update optional (default: no).use data to update matching documents");- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
-
Field Summary
Fields Modifier and Type Field Description static StringFILTER_PROPERTY
-
Constructor Summary
Constructors Constructor Description CsvLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandle(BsonFromCsvRequest request, BsonResponse response)Function<io.undertow.server.HttpServerExchange,BsonFromCsvRequest>request()Consumer<io.undertow.server.HttpServerExchange>requestInitializer()Function<io.undertow.server.HttpServerExchange,BsonResponse>response()Consumer<io.undertow.server.HttpServerExchange>responseInitializer()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.restheart.plugins.ExchangeTypeResolver
requestType, responseType
-
Methods inherited from interface org.restheart.plugins.Service
handleOptions
-
-
-
-
Field Detail
-
FILTER_PROPERTY
public static final String FILTER_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
handle
public void handle(BsonFromCsvRequest request, BsonResponse response) throws Exception
- Specified by:
handlein interfaceService<BsonFromCsvRequest,BsonResponse>- Throws:
Exception
-
requestInitializer
public Consumer<io.undertow.server.HttpServerExchange> requestInitializer()
- Specified by:
requestInitializerin interfaceService<BsonFromCsvRequest,BsonResponse>
-
responseInitializer
public Consumer<io.undertow.server.HttpServerExchange> responseInitializer()
- Specified by:
responseInitializerin interfaceService<BsonFromCsvRequest,BsonResponse>
-
request
public Function<io.undertow.server.HttpServerExchange,BsonFromCsvRequest> request()
- Specified by:
requestin interfaceService<BsonFromCsvRequest,BsonResponse>
-
response
public Function<io.undertow.server.HttpServerExchange,BsonResponse> response()
- Specified by:
responsein interfaceService<BsonFromCsvRequest,BsonResponse>
-
-