/src/org/pentaho/mongo/wrapper/MongoClientWrapper.java

https://gitlab.com/bytekast/pentaho-mongodb-plugin · Java · 65 lines · 20 code · 13 blank · 32 comment · 0 complexity · ad71375a85e94845d9dcca79bda1e131 MD5 · raw file

  1. package org.pentaho.mongo.wrapper;
  2. import java.util.List;
  3. import java.util.Set;
  4. import org.pentaho.di.core.exception.KettleException;
  5. import org.pentaho.mongo.wrapper.collection.MongoCollectionWrapper;
  6. import org.pentaho.mongo.wrapper.field.MongoField;
  7. import com.mongodb.DBObject;
  8. public interface MongoClientWrapper {
  9. public Set<String> getCollectionsNames( String dB ) throws KettleException;
  10. public List<String> getIndexInfo( String dbName, String collection ) throws KettleException;
  11. public List<MongoField> discoverFields( String db, String collection, String query, String fields,
  12. boolean isPipeline, int docsToSample ) throws KettleException;
  13. /**
  14. * Retrieve all database names found in MongoDB as visible by the authenticated user.
  15. *
  16. * @throws KettleException
  17. */
  18. public List<String> getDatabaseNames() throws KettleException;
  19. /**
  20. * Get a list of all tagName : tagValue pairs that occur in the tag sets defined across the replica set.
  21. *
  22. * @return a list of tags that occur in the replica set configuration
  23. * @throws KettleException
  24. * if a problem occurs
  25. */
  26. public List<String> getAllTags() throws KettleException;
  27. /**
  28. * Return a list of replica set members whos tags satisfy the supplied list of tag set. It is assumed that members
  29. * satisfy according to an OR relationship = i.e. a member satisfies if it satisfies at least one of the tag sets in
  30. * the supplied list.
  31. *
  32. * @param tagSets
  33. * the list of tag sets to match against
  34. * @return a list of replica set members who's tags satisfy the supplied list of tag sets
  35. * @throws KettleException
  36. * if a problem occurs
  37. */
  38. public List<String> getReplicaSetMembersThatSatisfyTagSets( List<DBObject> tagSets ) throws KettleException;
  39. /**
  40. * Return a list of custom "lastErrorModes" (if any) defined in the replica set configuration object on the server.
  41. * These can be used as the "w" setting for the write concern in addition to the standard "w" values of <number> or
  42. * "majority".
  43. *
  44. * @return a list of the names of any custom "lastErrorModes"
  45. * @throws KettleException
  46. * if a problem occurs
  47. */
  48. public List<String> getLastErrorModes() throws KettleException;
  49. public MongoCollectionWrapper createCollection( String db, String name ) throws KettleException;
  50. public MongoCollectionWrapper getCollection( String db, String name ) throws KettleException;
  51. public void dispose() throws KettleException;
  52. }