projects/syncslides/app/src/main/java/io/v/android/apps/syncslides/discovery/ParticipantPeer.java
/**
     * Make an RPC on the mServiceName to get title, snapshot, etc.
     */
Make an RPC on the mServiceName to get title, snapshot, etc.
Make an RPC on the mServiceName to get title snapshot etc .
@Override
    public boolean refreshData() {
        if (mServiceName.equals(Unknown.SERVER_NAME)) {
            return true;
        }
        Log.d(TAG, "refreshData");
        Log.d(TAG, "Flushing cache for service " + mServiceName);
        V23Manager.Singleton.get().flushServerFromCache(mServiceName);
        ParticipantClient client =
                ParticipantClientFactory.getParticipantClient(mServiceName);
        Log.d(TAG, "Got client = " + client.toString());
        try {
            Log.d(TAG, "Starting RPC to service \"" + mServiceName + "\"...");
            Presentation p = client.get(
                    V23Manager.Singleton.get().getVContext().withTimeout(
                            Duration.standardSeconds(5)));
            mDeck = mDeckFactory.make(p.getDeck(), p.getDeckId());
            mSyncgroupName = p.getSyncgroupName();
            mPresentationId = p.getPresentationId();
            mRefreshTime = DateTime.now();
            Log.d(TAG, "   Discovered:");
            Log.d(TAG, "               mDeck = " + mDeck);
            Log.d(TAG, "      mSyncgroupName = " + mSyncgroupName);
            Log.d(TAG, "     mPresentationId = " + mPresentationId);
            return true;
        } catch (VException e) {
            Log.d(TAG, "RPC failed, leaving current deck in place.");
            e.printStackTrace();
        }
        return false;
    }
@ Override public boolean refreshData ( ) { if ( mServiceName . equals ( Unknown . SERVER_NAME ) ) { return true ; } Log . d ( TAG , "refreshData" ) ; Log . d ( TAG , "Flushing cache for service " + mServiceName ) ; V23Manager . Singleton . get ( ) . flushServerFromCache ( mServiceName ) ; ParticipantClient client = ParticipantClientFactory . getParticipantClient ( mServiceName ) ; Log . d ( TAG , "Got client = " + client . toString ( ) ) ; try { Log . d ( TAG , "Starting RPC to service \"" + mServiceName + "\"..." ) ; Presentation p = client . get ( V23Manager . Singleton . get ( ) . getVContext ( ) . withTimeout ( Duration . standardSeconds ( 5 ) ) ) ; mDeck = mDeckFactory . make ( p . getDeck ( ) , p . getDeckId ( ) ) ; mSyncgroupName = p . getSyncgroupName ( ) ; mPresentationId = p . getPresentationId ( ) ; mRefreshTime = DateTime . now ( ) ; Log . d ( TAG , "   Discovered:" ) ; Log . d ( TAG , "               mDeck = " + mDeck ) ; Log . d ( TAG , "      mSyncgroupName = " + mSyncgroupName ) ; Log . d ( TAG , "     mPresentationId = " + mPresentationId ) ; return true ; } catch ( VException e ) { Log . d ( TAG , "RPC failed, leaving current deck in place." ) ; e . printStackTrace ( ) ; } return false ; }
Make an RPC on the mServiceName to get title, snapshot, etc.
Make an RPC on the mServiceName to get title snapshot etc .
// Don't attempt refresh. // Flush, since the server might have died and restarted, invalidating // cached endpoints.