syncbase/src/main/java/io/v/syncbase/Syncbase.java
/**
     * Returns a Database object. Return null if the user is not currently logged in.
     */
Returns a Database object. Return null if the user is not currently logged in.
Returns a Database object . Return null if the user is not currently logged in .
public static Database database() throws SyncbaseException {
        try {
            if (!isLoggedIn()) {
                return null;
            }
            if (sAppBlessing == null) {
                sAppBlessing = io.v.syncbase.internal.Blessings.AppBlessingFromContext();
            }
            if (sDatabase != null) {
                return sDatabase;
            }
            sDatabase = new Database(Service.database(DB_NAME));
            return sDatabase;
        } catch (VError e) {
            chainThrow("getting the database", e);
            throw new AssertionError("never happens");
        }
    }
public static Database database ( ) throws SyncbaseException { try { if ( ! isLoggedIn ( ) ) { return null ; } if ( sAppBlessing == null ) { sAppBlessing = io . v . syncbase . internal . Blessings . AppBlessingFromContext ( ) ; } if ( sDatabase != null ) { return sDatabase ; } sDatabase = new Database ( Service . database ( DB_NAME ) ) ; return sDatabase ; } catch ( VError e ) { chainThrow ( "getting the database" , e ) ; throw new AssertionError ( "never happens" ) ; } }
Returns a Database object.
Returns a Database object .
// Set the app blessing at this stage for later use. // Should not error because the user is logged in. // TODO(sadovsky): Check that opts matches original opts (sOpts)?