本文整理汇总了Java中com.evernote.edam.userstore.BootstrapInfo类的典型用法代码示例。如果您正苦于以下问题:Java BootstrapInfo类的具体用法?Java BootstrapInfo怎么用?Java BootstrapInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BootstrapInfo类属于com.evernote.edam.userstore包,在下文中一共展示了BootstrapInfo类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getBootstrapInfo
import com.evernote.edam.userstore.BootstrapInfo; //导入依赖的package包/类
/**
* 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);
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:25,代码来源:BootstrapManager.java
示例2: getBootstrapInfo
import com.evernote.edam.userstore.BootstrapInfo; //导入依赖的package包/类
/**
* 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 (mUserStoreClient == null) {
initializeUserStoreAndCheckVersion();
}
bsInfo = mUserStoreClient.getClient().getBootstrapInfo(mLocale.toString());
printBootstrapInfo(bsInfo);
} catch (ClientUnsupportedException cue) {
throw cue;
} catch (TException e) {
Log.e(LOGTAG, "error getting bootstrap info", e);
}
BootstrapInfoWrapper wrapper = new BootstrapInfoWrapper(mBootstrapServerUsed, bsInfo);
return wrapper;
}
开发者ID:duanze,项目名称:PureNote,代码行数:28,代码来源:BootstrapManager.java
示例3: printBootstrapInfo
import com.evernote.edam.userstore.BootstrapInfo; //导入依赖的package包/类
/**
* Log the {@link BootstrapProfile} list.
* @param bsInfo
*/
void printBootstrapInfo(BootstrapInfo bsInfo) {
if (bsInfo == null) return;
Log.d(LOGTAG, "printBootstrapInfo");
List<BootstrapProfile> profiles = bsInfo.getProfiles();
if (profiles != null) {
for (BootstrapProfile profile : profiles) {
Log.d(LOGTAG, profile.toString());
}
} else {
Log.d(LOGTAG, "Profiles are null");
}
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:18,代码来源:BootstrapManager.java
示例4: fetchBootstrapProfiles
import com.evernote.edam.userstore.BootstrapInfo; //导入依赖的package包/类
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();
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:15,代码来源:EvernoteOAuthHelper.java
示例5: getBootstrapInfoAsync
import com.evernote.edam.userstore.BootstrapInfo; //导入依赖的package包/类
public Future<BootstrapInfo> getBootstrapInfoAsync(final String locale, EvernoteCallback<BootstrapInfo> callback) {
return submitTask(new Callable<BootstrapInfo>() {
@Override
public BootstrapInfo call() throws Exception {
return getBootstrapInfo(locale);
}
}, callback);
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:9,代码来源:EvernoteUserStoreClient.java
示例6: printBootstrapInfo
import com.evernote.edam.userstore.BootstrapInfo; //导入依赖的package包/类
/**
* Log the {@link BootstrapProfile} list
* @param bsInfo
*/
void printBootstrapInfo(BootstrapInfo bsInfo) {
if (bsInfo == null) return;
Log.d(LOGTAG, "printBootstrapInfo");
List<BootstrapProfile> profiles = bsInfo.getProfiles();
if (profiles != null) {
for (BootstrapProfile profile : profiles) {
Log.d(LOGTAG, profile.toString());
}
} else {
Log.d(LOGTAG, "Profiles are null");
}
}
开发者ID:duanze,项目名称:PureNote,代码行数:18,代码来源:BootstrapManager.java
示例7: BootstrapInfoWrapper
import com.evernote.edam.userstore.BootstrapInfo; //导入依赖的package包/类
BootstrapInfoWrapper(String serverUrl, BootstrapInfo info) {
mServerUrl = serverUrl;
mBootstrapInfo = info;
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:5,代码来源:BootstrapManager.java
示例8: getBootstrapInfo
import com.evernote.edam.userstore.BootstrapInfo; //导入依赖的package包/类
public BootstrapInfo getBootstrapInfo(String locale) throws TException {
return mClient.getBootstrapInfo(locale);
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:4,代码来源:EvernoteUserStoreClient.java
示例9: doInBackground
import com.evernote.edam.userstore.BootstrapInfo; //导入依赖的package包/类
@Override
protected String doInBackground(Void... params) {
String url = null;
try {
EvernoteSession session = EvernoteSession.getOpenSession();
if (session != null) {
//Network request
BootstrapManager.BootstrapInfoWrapper infoWrapper = session.getBootstrapSession().getBootstrapInfo();
if (infoWrapper != null) {
BootstrapInfo info = infoWrapper.getBootstrapInfo();
if (info != null) {
mBootstrapProfiles = (ArrayList<BootstrapProfile>) info.getProfiles();
if (mBootstrapProfiles != null &&
mBootstrapProfiles.size() > 0 &&
mSelectedBootstrapProfilePos < mBootstrapProfiles.size()) {
mSelectedBootstrapProfile = mBootstrapProfiles.get(mSelectedBootstrapProfilePos);
}
}
}
}
if (mSelectedBootstrapProfile == null || TextUtils.isEmpty(mSelectedBootstrapProfile.getSettings().getServiceHost())) {
Log.d(LOGTAG, "Bootstrap did not return a valid host");
return null;
}
OAuthService service = createService();
Log.i(LOGTAG, "Retrieving OAuth request token...");
Token reqToken = service.getRequestToken();
mRequestToken = reqToken.getToken();
mRequestTokenSecret = reqToken.getSecret();
Log.i(LOGTAG, "Redirecting user for authorization...");
url = service.getAuthorizationUrl(reqToken);
if (mSupportAppLinkedNotebooks) {
url += "&supportLinkedSandbox=true";
}
} catch (BootstrapManager.ClientUnsupportedException cue) {
return null;
} catch (Exception ex) {
Log.e(LOGTAG, "Failed to obtain OAuth request token", ex);
}
return url;
}
开发者ID:duanze,项目名称:PureNote,代码行数:50,代码来源:EvernoteOAuthActivity.java
示例10: testGetBootstrapInfo
import com.evernote.edam.userstore.BootstrapInfo; //导入依赖的package包/类
@Test
public void testGetBootstrapInfo() throws Exception {
BootstrapSettings settings = new BootstrapSettings();
settings.setServiceHost("SERVICE_HOST");
settings.setMarketingUrl("MARKETING_URL");
settings.setSupportUrl("SUPPORT_URL");
settings.setAccountEmailDomain("ACCOUNT_EMAIL_DOMAIN");
settings.setEnableFacebookSharing(true);
settings.setEnableGiftSubscriptions(true);
settings.setEnableSupportTickets(true);
settings.setEnableSharedNotebooks(true);
settings.setEnableSingleNoteSharing(true);
settings.setEnableSponsoredAccounts(true);
settings.setEnableTwitterSharing(true);
settings.setEnableLinkedInSharing(true);
settings.setEnablePublicNotebooks(true);
BootstrapProfile profile = new BootstrapProfile();
profile.setName("PROFILE_NAME");
profile.setSettings(settings);
List<BootstrapProfile> profiles = new ArrayList<BootstrapProfile>();
profiles.add(profile);
BootstrapInfo bootstrapInfo = new BootstrapInfo();
bootstrapInfo.setProfiles(profiles);
when(userStoreOperations.getBootstrapInfo("foo")).thenReturn(bootstrapInfo);
performRequest("/userStore/getBootstrapInfo", "{\"locale\": \"foo\"}")
.andExpect(jsonPath("$.profiles[0].name").value("PROFILE_NAME"))
.andExpect(jsonPath("$.profiles[0].settings.serviceHost").value("SERVICE_HOST"))
.andExpect(jsonPath("$.profiles[0].settings.marketingUrl").value("MARKETING_URL"))
.andExpect(jsonPath("$.profiles[0].settings.supportUrl").value("SUPPORT_URL"))
.andExpect(jsonPath("$.profiles[0].settings.accountEmailDomain").value("ACCOUNT_EMAIL_DOMAIN"))
.andExpect(jsonPath("$.profiles[0].settings.enableFacebookSharing").value(true))
.andExpect(jsonPath("$.profiles[0].settings.enableGiftSubscriptions").value(true))
.andExpect(jsonPath("$.profiles[0].settings.enableSupportTickets").value(true))
.andExpect(jsonPath("$.profiles[0].settings.enableSharedNotebooks").value(true))
.andExpect(jsonPath("$.profiles[0].settings.enableSingleNoteSharing").value(true))
.andExpect(jsonPath("$.profiles[0].settings.enableSponsoredAccounts").value(true))
.andExpect(jsonPath("$.profiles[0].settings.enableTwitterSharing").value(true))
.andExpect(jsonPath("$.profiles[0].settings.enableLinkedInSharing").value(true))
.andExpect(jsonPath("$.profiles[0].settings.enablePublicNotebooks").value(true))
;
verify(userStoreOperations).getBootstrapInfo("foo");
}
开发者ID:ttddyy,项目名称:evernote-rest-webapp,代码行数:47,代码来源:StoreOperationControllerUserStoreIntegrationTest.java
示例11: doInBackground
import com.evernote.edam.userstore.BootstrapInfo; //导入依赖的package包/类
@Override
protected String doInBackground(Void... params) {
String url = null;
try {
EvernoteSession session = EvernoteSession.getOpenSession();
if (session != null) {
// Network request
BootstrapManager.BootstrapInfoWrapper infoWrapper = session
.getBootstrapSession().getBootstrapInfo();
if (infoWrapper != null) {
BootstrapInfo info = infoWrapper.getBootstrapInfo();
if (info != null) {
mBootstrapProfiles = (ArrayList<BootstrapProfile>) info
.getProfiles();
if (mBootstrapProfiles != null
&& mBootstrapProfiles.size() > 0
&& mSelectedBootstrapProfilePos < mBootstrapProfiles
.size()) {
mSelectedBootstrapProfile = mBootstrapProfiles
.get(mSelectedBootstrapProfilePos);
}
}
}
}
if (mSelectedBootstrapProfile == null
|| TextUtils.isEmpty(mSelectedBootstrapProfile
.getSettings().getServiceHost())) {
Log.d(LOGTAG, "Bootstrap did not return a valid host");
return null;
}
OAuthService service = createService();
Log.i(LOGTAG, "Retrieving OAuth request token...");
Token reqToken = service.getRequestToken();
mRequestToken = reqToken.getToken();
mRequestTokenSecret = reqToken.getSecret();
Log.i(LOGTAG, "Redirecting user for authorization...");
url = service.getAuthorizationUrl(reqToken);
} catch (BootstrapManager.ClientUnsupportedException cue) {
return null;
} catch (Exception ex) {
Log.e(LOGTAG, "Failed to obtain OAuth request token", ex);
}
return url;
}
开发者ID:daimajia,项目名称:EverMemo,代码行数:53,代码来源:EvernoteOAuthActivity.java
示例12: doInBackground
import com.evernote.edam.userstore.BootstrapInfo; //导入依赖的package包/类
@Override
protected String doInBackground(Void... params) {
String url = null;
try {
EvernoteSession session = EvernoteSession.getOpenSession();
if (session != null) {
//Network request
BootstrapManager.BootstrapInfoWrapper infoWrapper = session.getBootstrapSession().getBootstrapInfo();
if (infoWrapper != null){
BootstrapInfo info = infoWrapper.getBootstrapInfo();
if(info != null) {
mBootstrapProfiles = (ArrayList<BootstrapProfile>) info.getProfiles();
if (mBootstrapProfiles != null &&
mBootstrapProfiles.size() > 0 &&
mSelectedBootstrapProfilePos < mBootstrapProfiles.size()){
mSelectedBootstrapProfile = mBootstrapProfiles.get(mSelectedBootstrapProfilePos);
}
}
}
}
if(mSelectedBootstrapProfile == null || TextUtils.isEmpty(mSelectedBootstrapProfile.getSettings().getServiceHost())) {
Log.d(LOGTAG, "Bootstrap did not return a valid host");
return null;
}
OAuthService service = createService();
Log.i(LOGTAG, "Retrieving OAuth request token...");
Token reqToken = service.getRequestToken();
mRequestToken = reqToken.getToken();
mRequestTokenSecret = reqToken.getSecret();
Log.i(LOGTAG, "Redirecting user for authorization...");
url = service.getAuthorizationUrl(reqToken);
} catch(BootstrapManager.ClientUnsupportedException cue) {
return null;
} catch (Exception ex) {
Log.e(LOGTAG, "Failed to obtain OAuth request token", ex);
}
return url;
}
开发者ID:daimajia,项目名称:EverMemo-EverNote,代码行数:47,代码来源:EvernoteOAuthActivity.java
示例13: getBootstrapInfo
import com.evernote.edam.userstore.BootstrapInfo; //导入依赖的package包/类
/**
* Asynchronous wrapper
*
* @param {@link OnClientCallback} providing an interface to the calling code
* @see UserStore.Client#getBootstrapInfo(String)
*/
public void getBootstrapInfo(final String locale, final OnClientCallback<BootstrapInfo> callback) {
AsyncReflector.execute(mClient, callback, "getBootstrapInfo", locale);
}
开发者ID:duanze,项目名称:PureNote,代码行数:10,代码来源:AsyncUserStoreClient.java
示例14: getBootstrapInfo
import com.evernote.edam.userstore.BootstrapInfo; //导入依赖的package包/类
/**
* Equivalent to {@link com.evernote.clients.UserStoreClient#getBootstrapInfo(String)}.
*
* @throws EvernoteException converted unchecked exception
* @see com.evernote.clients.UserStoreClient#getBootstrapInfo(String)
* @see com.evernote.edam.userstore.UserStore.Client#getBootstrapInfo(String)
*/
BootstrapInfo getBootstrapInfo(String locale) throws EvernoteException;
开发者ID:ttddyy,项目名称:spring-social-evernote,代码行数:9,代码来源:UserStoreOperations.java
注:本文中的com.evernote.edam.userstore.BootstrapInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论