• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java CredentialRefreshListener类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.google.api.client.auth.oauth2.CredentialRefreshListener的典型用法代码示例。如果您正苦于以下问题:Java CredentialRefreshListener类的具体用法?Java CredentialRefreshListener怎么用?Java CredentialRefreshListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

CredentialRefreshListener类属于com.google.api.client.auth.oauth2包,在下文中一共展示了CredentialRefreshListener类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setUp

点赞 2

import com.google.api.client.auth.oauth2.CredentialRefreshListener; //导入依赖的package包/类
/**
 * Sets up.
 */
@Before
public void setUp() {
  // Remove existing handlers attached to j.u.l root logger
  SLF4JBridgeHandler.removeHandlersForRootLogger();

  // add SLF4JBridgeHandler to j.u.l's root logger
  SLF4JBridgeHandler.install();

  printTimingLog = true;
  time_start = System.currentTimeMillis();
  logger.debug( "*** Tests started: " + name.getMethodName() );

  try {

    final long httpCacheSize = 10 * 1024 * 1024; // 10 MiB
    final File httpCacheDir = CACHE_DIR;
    HttpResponseCache.install( httpCacheDir, httpCacheSize );

    JacksonFactory jf = new JacksonFactory();

    Configuration config = new Configuration( env )
        .setCredentialDataStore( new FileCredentialStore( DATA_STORE_DIR ) )
        .setApiKey( fixtures.getString( "authentication.client_id" ) )
        .setApiSecret( fixtures.getString( "authentication.client_secret" ) )
        .setHttpTransport( new NetHttpTransport() )
        .setJsonFactory( jf );

    CredentialRefreshListener crl = new DataStoreCredentialRefreshListener( AudioBoxClient.ACCOUNT_TOKENS, ( ( FileCredentialStore ) config.getCredentialDataStore() ).getDB() );
    config.setCredentialRefreshListener( crl );

    c = new AudioBoxClient( config );
  } catch ( ConfigurationException | IOException e ) {
    fail( e.getMessage() );
  }
}
 

开发者ID:icoretech,
项目名称:audiobox-jlib,
代码行数:39,
代码来源:AudioBoxIntegrationTests.java

示例2: setRefreshListeners

点赞 2

import com.google.api.client.auth.oauth2.CredentialRefreshListener; //导入依赖的package包/类
@Override
public Builder setRefreshListeners(Collection<CredentialRefreshListener> refreshListeners) {
    return (Builder) super.setRefreshListeners(refreshListeners);
}
 

开发者ID:agilie,
项目名称:dribbble-android-sdk,
代码行数:5,
代码来源:OAuthHmacCredential.java

示例3: addRefreshListener

点赞 2

import com.google.api.client.auth.oauth2.CredentialRefreshListener; //导入依赖的package包/类
@Override
public Builder addRefreshListener(CredentialRefreshListener refreshListener) {
    return (Builder) super.addRefreshListener(refreshListener);
}
 

开发者ID:agilie,
项目名称:dribbble-android-sdk,
代码行数:5,
代码来源:OAuthHmacCredential.java

示例4: setUp

点赞 2

import com.google.api.client.auth.oauth2.CredentialRefreshListener; //导入依赖的package包/类
/**
 * Sets up.
 */
@Before
public void setUp() {
  // Remove existing handlers attached to j.u.l root logger
  SLF4JBridgeHandler.removeHandlersForRootLogger();

  // add SLF4JBridgeHandler to j.u.l's root logger
  SLF4JBridgeHandler.install();

  printTimingLog = true;
  time_start = System.currentTimeMillis();
  logger.debug( "*** Tests started: " + name.getMethodName() );

  try {

    final long httpCacheSize = 10 * 1024 * 1024; // 10 MiB
    final File httpCacheDir = CACHE_DIR;
    HttpResponseCache.install( httpCacheDir, httpCacheSize );

    JacksonFactory jf = new JacksonFactory();

    Configuration config = new Configuration()
        .setCredentialDataStore( new MemoryCredentialStore() )
        .setApiKey( fixtures.getString( "authentication.client_id" ) )
        .setApiSecret( fixtures.getString( "authentication.client_secret" ) )
        .setHttpTransport( MockHttp.getTransport() )
        .setJsonFactory( jf )
        .setApplicationName( "Tests" )
        .setVersion( "1.0" );

    CredentialRefreshListener crl = new DataStoreCredentialRefreshListener( AudioBoxClient.ACCOUNT_TOKENS, config.getCredentialDataStore().getDB());
    config.setCredentialRefreshListener( crl );

    config.setEnvironment( env );
    c = new AudioBoxClient( config );

    assertNotNull(c);

  } catch ( ConfigurationException | IOException e ) {
    fail( e.getMessage() );
  }
}
 

开发者ID:icoretech,
项目名称:audiobox-jlib,
代码行数:45,
代码来源:AudioBoxTests.java

示例5: setCredentialRefreshListener

点赞 1

import com.google.api.client.auth.oauth2.CredentialRefreshListener; //导入依赖的package包/类
/**
 * Sets the credential refresh listener for the OAuth dance.
 *
 * @param refreshListener the {@link com.google.api.client.auth.oauth2.CredentialRefreshListener} to set
 *
 * @return the {@link fm.audiobox.core.config.Configuration}
 */
public Configuration setCredentialRefreshListener(CredentialRefreshListener refreshListener) {
  this.refreshListener = refreshListener;
  return this;
}
 

开发者ID:icoretech,
项目名称:audiobox-jlib,
代码行数:12,
代码来源:Configuration.java

示例6: getRefreshListener

点赞 1

import com.google.api.client.auth.oauth2.CredentialRefreshListener; //导入依赖的package包/类
/**
 * Gets the credential refresh listener.
 *
 * @return the configured {@link com.google.api.client.auth.oauth2.CredentialRefreshListener}
 */
public CredentialRefreshListener getRefreshListener() {
  return this.refreshListener;
}
 

开发者ID:icoretech,
项目名称:audiobox-jlib,
代码行数:9,
代码来源:Configuration.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)