Example usage for com.mongodb MongoURI toString

List of usage examples for com.mongodb MongoURI toString

Introduction

In this page you can find the example usage for com.mongodb MongoURI toString.

Prototype

@Override
    public String toString() 

Source Link

Usage

From source file:com.zjy.mongo.input.MongoInputSplit.java

License:Apache License

/**
 * @deprecated use {@link #setAuthURI(MongoClientURI)} instead
 * @param authURI a MongoDB URI providing credentials
 *//*from w  w w .  ja  v  a 2s. c  o m*/
@Deprecated
public void setAuthURI(final MongoURI authURI) {
    setAuthURI(authURI != null ? new MongoClientURI(authURI.toString()) : null);
}

From source file:com.zjy.mongo.MongoConfig.java

License:Apache License

public void setMongoURI(final String key, final MongoURI value) {
    setMongoURI(key, new MongoClientURI(value.toString()));
}

From source file:com.zjy.mongo.splitter.MultiCollectionSplitBuilder.java

License:Apache License

/**
 * @deprecated Use {@link #add(MongoClientURI, MongoClientURI, boolean, DBObject, DBObject, DBObject, boolean, Class)}
 * @param inputURI the input URI for the collection
 * @param authURI the URI to use for authenticating to the collection
 * @param noTimeout disables timing out when reading
 * @param fields a projection specification
 * @param sort a sort specification//from   ww  w  .j av  a 2 s  .com
 * @param query a query specification
 * @param useRangeQuery enables using a range query
 * @param splitClass the InputSplit class to use
 * @return the builder
 */
@Deprecated
public MultiCollectionSplitBuilder add(final MongoURI inputURI, final MongoURI authURI, final boolean noTimeout,
        final DBObject fields, final DBObject sort, final DBObject query, final boolean useRangeQuery,
        final Class<? extends MongoSplitter> splitClass) {
    return add(new MongoClientURI(inputURI.toString()), new MongoClientURI(authURI.toString()), noTimeout,
            fields, sort, query, useRangeQuery, splitClass);
}

From source file:com.zjy.mongo.util.MongoConfigUtil.java

License:Apache License

/**
 * @deprecated use {@link #getCollection(MongoClientURI)}
 * @param uri the MongoDB URI/*  w  w w  . j a v a 2 s  . c o m*/
 * @return the DBCollection in the URI
 */
@Deprecated
public static DBCollection getCollection(final MongoURI uri) {
    return getCollection(new MongoClientURI(uri.toString()));
}

From source file:com.zjy.mongo.util.MongoConfigUtil.java

License:Apache License

/**
 * @deprecated use {@link #getCollectionWithAuth(MongoClientURI, MongoClientURI)} instead
 * @param authURI the URI with which to authenticate
 * @param uri the MongoDB URI// w w w  .  j  a va 2  s. c  o m
 * @return the authenticated DBCollection
 */
@Deprecated
public static DBCollection getCollectionWithAuth(final MongoURI uri, final MongoURI authURI) {
    return getCollectionWithAuth(new MongoClientURI(uri.toString()), new MongoClientURI(authURI.toString()));
}

From source file:com.zjy.mongo.util.MongoConfigUtil.java

License:Apache License

/**
 * @deprecated use {@link #setMongoURI(Configuration, String, MongoClientURI)} instead
 * @param conf the Configuration/*from   w  w  w.  j  a  v  a  2 s .com*/
 * @param key the key for the setting
 * @param value the value for the setting
 */
@Deprecated
public static void setMongoURI(final Configuration conf, final String key, final MongoURI value) {
    conf.set(key, value.toString()); // todo - verify you can toString a
    // URI object
}

From source file:org.eclipse.emf.cdo.tests.mongodb.MongoDBConfig.java

License:Open Source License

public IStore createStore(String repoName) {
    MongoURI mongoURI = new MongoURI("mongodb://localhost");
    if (!isRestarting()) {
        dropDatabase(mongoURI, repoName);
    }/* w w w  .jav  a2 s.com*/

    return CDOMongoDBUtil.createStore(mongoURI.toString(), repoName);
}