Search in sources :

Example 1 with BootstrapInfo

use of com.evernote.edam.userstore.BootstrapInfo in project Notes by lguipeng.

the class EvernoteOAuthHelper method fetchBootstrapProfiles.

public List<BootstrapProfile> fetchBootstrapProfiles() throws Exception {
    //Network request
    BootstrapManager.BootstrapInfoWrapper infoWrapper = new BootstrapManager(mSession.getEvernoteService(), mSession, mLocale).getBootstrapInfo();
    if (infoWrapper == null) {
        return null;
    }
    BootstrapInfo info = infoWrapper.getBootstrapInfo();
    if (info == null) {
        return null;
    }
    return info.getProfiles();
}
Also used : BootstrapInfo(com.evernote.edam.userstore.BootstrapInfo)

Example 2 with BootstrapInfo

use of com.evernote.edam.userstore.BootstrapInfo in project Notes by lguipeng.

the class BootstrapManager method getBootstrapInfo.

/**
   * Makes a web request to get the latest bootstrap information.
   * This is a requirement during the oauth process
   *
   * @return {@link BootstrapInfoWrapper}
   * @throws Exception
   */
BootstrapInfoWrapper getBootstrapInfo() throws Exception {
    Log.d(LOGTAG, "getBootstrapInfo()");
    BootstrapInfo bsInfo = null;
    try {
        if (mBootstrapServerUsed == null) {
            initializeUserStoreAndCheckVersion();
        }
        bsInfo = mEvernoteSession.getEvernoteClientFactory().getUserStoreClient(getUserStoreUrl(mBootstrapServerUsed), null).getBootstrapInfo(mLocale.toString());
        printBootstrapInfo(bsInfo);
    } catch (TException e) {
        Log.e(LOGTAG, "error getting bootstrap info", e);
    }
    return new BootstrapInfoWrapper(mBootstrapServerUsed, bsInfo);
}
Also used : TException(com.evernote.thrift.TException) BootstrapInfo(com.evernote.edam.userstore.BootstrapInfo)

Aggregations

BootstrapInfo (com.evernote.edam.userstore.BootstrapInfo)2 TException (com.evernote.thrift.TException)1