syncbase/src/main/java/io/v/syncbase/Database.java
/**
     * Notifies {@code h} of any existing syncgroup invites, and of all subsequent new invites.
     */
Notifies  h of any existing syncgroup invites, and of all subsequent new invites.
Notifies h of any existing syncgroup invites and of all subsequent new invites .
public void addSyncgroupInviteHandler(final SyncgroupInviteHandler h, AddSyncgroupInviteHandlerOptions opts) {
        synchronized (mSyncgroupInviteHandlersMu) {
            try {
                long scanId = io.v.syncbase.internal.Database.SyncgroupInvitesNewScan(
                        getId().encode(),
                        new io.v.syncbase.internal.Database.SyncgroupInvitesCallbacks() {
                    @Override
                    public void onInvite(final io.v.syncbase.core.SyncgroupInvite invite) {
                        final SettableFuture<Boolean> setFuture = SettableFuture.create();
                        Syncbase.sOpts.mCallbackExecutor.execute(new Runnable() {
                            @Override
                            public void run() {
                                h.onInvite(new SyncgroupInvite(new Id(invite.syncgroup),
                                        invite.blessingNames));
                                setFuture.set(true);
                            }
                        });
                        try {
                            setFuture.get();
                        } catch (InterruptedException | ExecutionException e) {
                            e.printStackTrace();
                            System.err.println(e.toString());
                        }
                    }
                });
                mSyncgroupInviteHandlers.put(h, scanId);
            } catch (VError vError) {
                h.onError(vError);
            }
        }
    }
public void addSyncgroupInviteHandler ( final SyncgroupInviteHandler h , AddSyncgroupInviteHandlerOptions opts ) { synchronized ( mSyncgroupInviteHandlersMu ) { try { long scanId = io . v . syncbase . internal . Database . SyncgroupInvitesNewScan ( getId ( ) . encode ( ) , new io . v . syncbase . internal . Database . SyncgroupInvitesCallbacks ( ) { @ Override public void onInvite ( final io . v . syncbase . core . SyncgroupInvite invite ) { final SettableFuture < Boolean > setFuture = SettableFuture . create ( ) ; Syncbase . sOpts . mCallbackExecutor . execute ( new Runnable ( ) { @ Override public void run ( ) { h . onInvite ( new SyncgroupInvite ( new Id ( invite . syncgroup ) , invite . blessingNames ) ) ; setFuture . set ( true ) ; } } ) ; try { setFuture . get ( ) ; } catch ( InterruptedException | ExecutionException e ) { e . printStackTrace ( ) ; System . err . println ( e . toString ( ) ) ; } } } ) ; mSyncgroupInviteHandlers . put ( h , scanId ) ; } catch ( VError vError ) { h . onError ( vError ) ; } } }
Notifies {@code h} of any existing syncgroup invites, and of all subsequent new invites.
Notifies { @code h } of any existing syncgroup invites and of all subsequent new invites .