Package com.mongodb

Examples of com.mongodb.MongoException$CursorNotFound


     *
     * @throws MongoException
     */
    public void save(){
        if ( _fs == null )
            throw new MongoException( "need _fs" );
        _fs._filesCollection.save( this );
    }
View Full Code Here


     *
     * @throws MongoException
     */
    public void validate(){
        if ( _fs == null )
            throw new MongoException( "no _fs" );
        if ( _md5 == null )
            throw new MongoException( "no _md5 stored" );
       
        DBObject cmd = new BasicDBObject( "filemd5" , _id );
        cmd.put( "root" , _fs._bucketName );
        DBObject res = _fs._db.command( cmd );
        if ( res != null && res.containsField( "md5" ) ) {
            String m = res.get( "md5" ).toString();
            if ( m.equals( _md5 ) )
                return;
            throw new MongoException( "md5 differ.  mine [" + _md5 + "] theirs [" + m + "]" );
        }

        // no md5 from the server
        throw new MongoException( "no md5 returned from server: " + res );

    }
View Full Code Here

    final Boolean updatedExisting = (Boolean) result
        .getField("updatedExisting");
    if (result.getN() == 0 && result.getError() == null) {
      throw new UpdateConflictException(timestamp);
    } else if (result.getN() != 1) {
      throw new MongoException(result.getError()+ " <--- "+properties);
    }
    timestamp = now;
    return updatedExisting;
  }
View Full Code Here

    final int port = getPort()// store in variable to protect against change by subclass
    ArgumentChecker.notNull(host, "host");
    try {
      return new MongoClient(host, port);
    } catch (UnknownHostException ex) {
      throw new MongoException(ex.getMessage(), ex);
    }
  }
View Full Code Here

TOP

Related Classes of com.mongodb.MongoException$CursorNotFound

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.