Package com.mongodb

Examples of com.mongodb.Mongo


   
    public TestMongoDbAppender()
        throws Exception
    {
        PropertyConfigurator.configure(LOG4J_PROPS);
        mongo    = new Mongo(TEST_MONGO_SERVER_HOSTNAME, TEST_MONGO_SERVER_PORT);
        appender = (MongoDbAppender)Logger.getRootLogger().getAppender(MONGODB_APPENDER_NAME);
    }
View Full Code Here


   
   
    @BeforeClass
    public static void setUpBeforeClass() throws Exception
    {
      Mongo mongo = new Mongo(TEST_MONGO_SERVER_HOSTNAME, TEST_MONGO_SERVER_PORT);
      mongo.dropDatabase(TEST_DATABASE_NAME);
    }
View Full Code Here

   
   
    @AfterClass
    public static void tearDownAfterClass() throws Exception
    {
      Mongo mongo = new Mongo(TEST_MONGO_SERVER_HOSTNAME, TEST_MONGO_SERVER_PORT);
      mongo.dropDatabase(TEST_DATABASE_NAME);
    }
View Full Code Here

    private final Mongo mongo;
    private DBCollection collection;

    public TestMongoDbAppenderAuth() throws Exception
    {
        mongo = new Mongo(TEST_MONGO_SERVER_HOSTNAME, TEST_MONGO_SERVER_PORT);
    }
View Full Code Here

    }

    @BeforeClass
    public static void setUpBeforeClass() throws Exception
    {
        Mongo mongo = new Mongo(TEST_MONGO_SERVER_HOSTNAME,
                TEST_MONGO_SERVER_PORT);
        mongo.dropDatabase(TEST_DATABASE_NAME);
    }
View Full Code Here

    }

    @AfterClass
    public static void tearDownAfterClass() throws Exception
    {
        Mongo mongo = new Mongo(TEST_MONGO_SERVER_HOSTNAME,
                TEST_MONGO_SERVER_PORT);
        mongo.dropDatabase(TEST_DATABASE_NAME);
    }
View Full Code Here

        ServerAddress serverAddr = (dbConnectionSettings.getPort()!=null)
          ? new ServerAddress(dbConnectionSettings.getHostname(), dbConnectionSettings.getPort().intValue())
          : new ServerAddress(dbConnectionSettings.getHostname());

        // get Mongo
        Mongo mongo = (dbConnectionSettings.getOptions()!=null)
        ? new Mongo(serverAddr, dbConnectionSettings.getOptions())
        : new Mongo(serverAddr);
       
        // we're good :)
        return mongo;
    }
View Full Code Here

    public void executeInternal()
        throws MojoExecutionException,
        MojoFailureException {
       
        try {
            Mongo mongo = openConnection();
            DB db = getDatabase(mongo);
            for (int i=0; i<dbCreateScriptsDirectory.length; i++) {
                executeScriptsInDirectory(
                  dbCreateScriptsDirectory[i], db);
            }
View Full Code Here

    public void executeInternal()
        throws MojoExecutionException,
        MojoFailureException {
       
        try {
            Mongo mongo = openConnection();
            DB db = getDatabase(mongo);
            for (int i=0; i<dbUpdateScriptsDirectory.length; i++) {
                executeScriptsInDirectory(
                  dbUpdateScriptsDirectory[i], db);
            }
View Full Code Here

        if (_collection != null) return _collection;

        synchronized(sMutex) {
            if (_collection != null) return _collection;

            _mongo = new Mongo(new MongoURI(_mongoUri));

            final DB db = _mongo.getDB(_databaseName);

            _collection = _mongo.getDB(_databaseName).getCollection(_collectionName);
View Full Code Here

TOP

Related Classes of com.mongodb.Mongo

Copyright © 2018 www.massapicom. 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.