@Override public IMongoShellConfig build() { IFeatureAwareVersion version = version().get(); Net net = net().get(); Timeout timeout = timeout().get(); IMongoCmdOptions cmdOptions=get(CMD_OPTIONS); String pidFile = get(PID_FILE); String name = get(JS_SCRIPT,null); List<String> parameters = get(JS_SCRIPT_PARAMETERS,new ArrayList<String>()); if ((name==null) && (parameters.isEmpty())) { throw new RuntimeException("you must set parameters or scriptName"); } Long stopTimeoutInMillis = get(STOP_TIMEOUT_MILLIS); return new ImmutableMongoShellConfig(version, net, timeout, cmdOptions, pidFile, name, username().get(), password().get(), dbName().get(), stopTimeoutInMillis, parameters); }
public MongoShellConfigBuilder cmdOptions(IMongoCmdOptions cmdOptions) { cmdOptions().set(cmdOptions); return this; }
public MongoShellConfigBuilder parameters(String... parameters) { return parameters(Arrays.asList(parameters)); }
MongoShellStarter starter = MongoShellStarter.getInstance(runtimeConfig); final File scriptFile = writeTmpScriptFile(scriptText); final MongoShellConfigBuilder builder = new MongoShellConfigBuilder(); if (!isEmpty(dbName)) { builder.dbName(dbName); builder.username(username); builder.password(password); .scriptName(scriptFile.getAbsolutePath()) .version(mongodConfig.version()) .net(mongodConfig.net()) .build()).start(); if (mongoOutput instanceof LogWatchStreamProcessor) { ((LogWatchStreamProcessor) mongoOutput).waitForResult(INIT_TIMEOUT_MS);
public MongoShellConfigBuilder net(Net net) { net().set(net); return this; }
public MongoShellConfigBuilder username(String username) { username().set(username); return this; }
public MongoShellConfigBuilder password(String password) { password().set(password); return this; }
public MongoShellConfigBuilder dbName(String dbName) { dbName().set(dbName); return this; }
public MongoShellConfigBuilder version(IFeatureAwareVersion version) { version().set(version); return this; }
MongoShellStarter starter = MongoShellStarter.getInstance(runtimeConfig); final File scriptFile = writeTmpScriptFile(scriptText); final MongoShellConfigBuilder builder = new MongoShellConfigBuilder(); if (!isEmpty(dbName)) { builder.dbName(dbName); builder.username(username); builder.password(password); .scriptName(scriptFile.getAbsolutePath()) .version(mongodConfig.version()) .net(mongodConfig.net()) .build()).start(); if (mongoOutput instanceof LogWatchStreamProcessor) { ((LogWatchStreamProcessor) mongoOutput).waitForResult(INIT_TIMEOUT_MS);