Examples of throwOnError()


Examples of com.mongodb.CommandResult.throwOnError()

                    res = col.getDB().command(cmdobj, col.getOptions());
                    return res;
                }

                res = col.getDB().command(cmdobj);
                res.throwOnError();
                output = new MapReduceOutput(col, cmdobj, res);
                return output;
            }

            @Override
View Full Code Here

Examples of com.mongodb.CommandResult.throwOnError()

    }

    @Override
    protected void refreshNode() {
        CommandResult res = getStatsCollection().getStats();
        res.throwOnError();
        stats = res;
    }
}
View Full Code Here

Examples of com.mongodb.CommandResult.throwOnError()

    }

    @Override
    protected void refreshNode() {
        CommandResult res = getServerMongoClient().getDB("local").command("isMaster");
        res.throwOnError();
        stats = res;
    }
   
    boolean isReplica() {
        return isReplica;
View Full Code Here

Examples of com.mongodb.CommandResult.throwOnError()

        new DbJob() {

            @Override
            public Object doRun() throws Exception {
                CommandResult res = db.command(cmd);
                res.throwOnError();
                StringBuilder sb = new StringBuilder();
                BasicDBList list = (BasicDBList) res.get("log");
                for (Object str : list){
                    sb.append(str);
                    sb.append("\n");
View Full Code Here

Examples of com.mongodb.CommandResult.throwOnError()

    }

    @Override
    protected void refreshNode() {
        CommandResult res = collection.getStats();
        res.throwOnError();
        stats = res;
    }
   
    public BasicDBObject getStats() {
        BasicDBObject cmd = new BasicDBObject("collStats", getCollection().getName());
View Full Code Here

Examples of com.mongodb.CommandResult.throwOnError()

     */
    protected void throwOnError(WriteConcern wc, WriteResult wr) {
        if (wc == null && wr.getLastConcern() == null) {
            CommandResult cr = wr.getLastError();
            if (cr != null && cr.getErrorMessage() != null && cr.getErrorMessage().length() > 0)
                cr.throwOnError();
        }
    }

    /**
     * @param kind
View Full Code Here

Examples of com.mongodb.CommandResult.throwOnError()

  /**
   * {@inheritDoc}
   */
  public CommandResult executeCommand(DBObject cmd) {
    CommandResult result = getDB().command(cmd);
    result.throwOnError();
    return result;
  }

  /**
   * {@inheritDoc}
 
View Full Code Here

Examples of com.mongodb.CommandResult.throwOnError()

  /**
   * {@inheritDoc}
   */
  public CommandResult executeCommand(String cmd) {
    CommandResult result = getDB().command(cmd);
    result.throwOnError();
    return result;
  }

  /**
   * {@inheritDoc}
 
View Full Code Here

Examples of com.mongodb.CommandResult.throwOnError()

    }

    private CommandResult executeCommand() {
        CommandResult commandResult = db.command(query.toDBObject());
        if (throwOnError) {
            commandResult.throwOnError();
        }
        return commandResult;
    }

    public class ResultCommand {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.