本文整理汇总了Java中org.springframework.social.config.annotation.ConnectionFactoryConfigurer.addConnectionFactory方法的典型用法代码示例。如果您正苦于以下问题:Java ConnectionFactoryConfigurer.addConnectionFactory方法的具体用法?Java ConnectionFactoryConfigurer.addConnectionFactory怎么用?Java ConnectionFactoryConfigurer.addConnectionFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.social.config.annotation.ConnectionFactoryConfigurer
的用法示例。
在下文中一共展示了ConnectionFactoryConfigurer.addConnectionFactory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addConnectionFactories
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer, Environment environment) {
String discordClientId = environment.getProperty("spring.social.discord.clientId");
String discordClientSecret = environment.getProperty("spring.social.discord.clientSecret");
if (discordClientId != null && discordClientSecret != null) {
log.debug("Configuring DiscordConnectionFactory");
connectionFactoryConfigurer.addConnectionFactory(
new DiscordConnectionFactory(
discordClientId,
discordClientSecret
)
);
} else {
log.error("Cannot configure DiscordConnectionFactory id or secret null");
}
// jhipster-needle-add-social-connection-factory
}
示例2: addConnectionFactories
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; //导入方法依赖的package包/类
/**
* Configures the connection factories for Facebook and Twitter.
* @param cfConfig
* @param env
*/
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer cfConfig, Environment env) {
cfConfig.addConnectionFactory(new TwitterConnectionFactory(
env.getProperty("twitter.consumer.key"),
env.getProperty("twitter.consumer.secret")
));
cfConfig.addConnectionFactory(new GoogleConnectionFactory(
env.getProperty("twitter.consumer.key"), //TODO !!!!!!!!!!
env.getProperty("twitter.consumer.secret") //TODO !!!!!!!!!!
));
FacebookConnectionFactory facebookFactory = new FacebookConnectionFactory(
env.getProperty("facebook.app.id"),
env.getProperty("facebook.app.secret"));
facebookFactory.setScope("public_profile,email,user_friends");
cfConfig.addConnectionFactory(facebookFactory);
}
示例3: addConnectionFactories
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer config, Environment env) {
super.addConnectionFactories(config, env);
// Configured through AutoConfiguration:
// config.addConnectionFactory(new TwitterConnectionFactory(
// env.getProperty("spring.social.twitter.appId"),
// env.getProperty("spring.social.twitter.appSecret")));
// config.addConnectionFactory(new FacebookConnectionFactory(
// env.getProperty("spring.social.facebook.appId"),
// env.getProperty("spring.social.facebook.appSecret")));
// config.addConnectionFactory(new LinkedInConnectionFactory(
// env.getProperty("spring.social.linkedin.appId"),
// env.getProperty("spring.social.linkedin.appSecret")));
// Adding GitHub Connection with properties from application.yml
config.addConnectionFactory(new GitHubConnectionFactory(
env.getProperty("spring.social.github.appId"),
env.getProperty("spring.social.github.appSecret")));
// Adding Google Connection with properties from application.yml
config.addConnectionFactory(new GoogleConnectionFactory(
env.getProperty("spring.social.google.appId"),
env.getProperty("spring.social.google.appSecret")));
}
示例4: addConnectionFactories
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer configurer,
Environment env) {
final FacebookConnectionFactory facebook = new FacebookConnectionFactory(
env.getRequiredProperty("spring.social.facebook.appId"),
env.getRequiredProperty("spring.social.facebook.appSecret"));
facebook.setScope(EMAIL);
final TwitterConnectionFactory twitter = new TwitterConnectionFactory(
env.getRequiredProperty("spring.social.twitter.appId"),
env.getRequiredProperty("spring.social.twitter.appSecret"));
final GoogleConnectionFactory google = new GoogleConnectionFactory(
env.getRequiredProperty("spring.social.google.appId"),
env.getRequiredProperty("spring.social.google.appSecret"));
google.setScope(EMAIL);
configurer.addConnectionFactory(facebook);
configurer.addConnectionFactory(google);
configurer.addConnectionFactory(twitter);
}
示例5: addConnectionFactories
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer, Environment environment) {
connectionFactoryConfigurer.addConnectionFactory(new FacebookConnectionFactory(
environment.getProperty("spring.social.facebook.appId"),
environment.getProperty("spring.social.facebook.appSecret")));
connectionFactoryConfigurer.addConnectionFactory(new TwitterConnectionFactory(
environment.getProperty("twitter.consumerKey"),
environment.getProperty("twitter.consumerSecret")));
connectionFactoryConfigurer.addConnectionFactory(new LinkedInConnectionFactory(
environment.getProperty("spring.social.linkedin.appId"),
environment.getProperty("spring.social.linkedin.appSecret")));
connectionFactoryConfigurer.addConnectionFactory(new GoogleConnectionFactory(
environment.getProperty("spring.social.google.appId"),
environment.getProperty("spring.social.google.appSecret")));
connectionFactoryConfigurer.addConnectionFactory(new GitHubConnectionFactory(
environment.getProperty("spring.social.github.appId"),
environment.getProperty("spring.social.github.appSecret")));
connectionFactoryConfigurer.addConnectionFactory(new LiveConnectionFactory(
environment.getProperty("spring.social.live.appId"),
environment.getProperty("spring.social.live.appSecret")));
}
示例6: addConnectionFactories
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(
final ConnectionFactoryConfigurer configurer,
final Environment environment) {
final GoogleConnectionFactory factory = new GoogleConnectionFactory(
this.properties.getAppId(), this.properties.getAppSecret());
configurer.addConnectionFactory(factory);
}
示例7: addConnectionFactories
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer cfConfig, Environment env) {
cfConfig.addConnectionFactory(new TwitterConnectionFactory(appSettings.getTwitterAppId(),
appSettings.getTwitterAppSecret()));
cfConfig.addConnectionFactory(new FacebookConnectionFactory(appSettings.getFacebookAppId(),
appSettings.getFacebookAppSecret()));
cfConfig.addConnectionFactory(new GoogleConnectionFactory(appSettings.getGoogleAppId(),
appSettings.getGoogleAppSecret()));
}
示例8: addConnectionFactories
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer,
Environment environment) {
// a TwitterConnectionFactory has already been configured elsewhere
connectionFactoryConfigurer.addConnectionFactory(new GoogleConnectionFactory(
environment.getProperty("spring.social.google.app-id"),
environment.getProperty("spring.social.google.app-secret")));
connectionFactoryConfigurer.addConnectionFactory(new GitHubConnectionFactory(
environment.getProperty("spring.social.github.app-id"),
environment.getProperty("spring.social.github.app-secret")));
}
示例9: addConnectionFactories
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(
ConnectionFactoryConfigurer connectionFactoryConfigurer,
Environment environment) {
GoogleConfigurableConnectionFactory googleConnectionFactory =
new GoogleConfigurableConnectionFactory(
googleClientId, googleSecret, googleOAuthUrl, googleApiUrl);
googleConnectionFactory.setScope(googleScope);
connectionFactoryConfigurer.addConnectionFactory(googleConnectionFactory);
}
示例10: addConnectionFactories
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer, Environment environment) {
// Google configuration
String googleClientId = environment.getProperty("spring.social.google.client-id");
String googleClientSecret = environment.getProperty("spring.social.google.client-secret");
if (googleClientId != null && googleClientSecret != null) {
log.debug("Configuring GoogleConnectionFactory");
connectionFactoryConfigurer.addConnectionFactory(
new GoogleConnectionFactory(
googleClientId,
googleClientSecret
)
);
} else {
log.error("Cannot configure GoogleConnectionFactory id or secret null");
}
// Facebook configuration
String facebookClientId = environment.getProperty("spring.social.facebook.client-id");
String facebookClientSecret = environment.getProperty("spring.social.facebook.client-secret");
if (facebookClientId != null && facebookClientSecret != null) {
log.debug("Configuring FacebookConnectionFactory");
connectionFactoryConfigurer.addConnectionFactory(
new FacebookConnectionFactory(
facebookClientId,
facebookClientSecret
)
);
} else {
log.error("Cannot configure FacebookConnectionFactory id or secret null");
}
// Twitter configuration
String twitterClientId = environment.getProperty("spring.social.twitter.client-id");
String twitterClientSecret = environment.getProperty("spring.social.twitter.client-secret");
if (twitterClientId != null && twitterClientSecret != null) {
log.debug("Configuring TwitterConnectionFactory");
connectionFactoryConfigurer.addConnectionFactory(
new TwitterConnectionFactory(
twitterClientId,
twitterClientSecret
)
);
} else {
log.error("Cannot configure TwitterConnectionFactory id or secret null");
}
// jhipster-needle-add-social-connection-factory
}
示例11: addConnectionFactories
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer cfConfig, Environment env) {
cfConfig.addConnectionFactory(new FacebookConnectionFactory(config.getFacebookAppId(), config.getFacebookSecret()));
}
示例12: addConnectionFactories
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer, Environment environment) {
// Google configuration
String googleClientId = environment.getProperty("spring.social.google.clientId");
String googleClientSecret = environment.getProperty("spring.social.google.clientSecret");
if (googleClientId != null && googleClientSecret != null) {
log.debug("Configuring GoogleConnectionFactory");
connectionFactoryConfigurer.addConnectionFactory(
new GoogleConnectionFactory(
googleClientId,
googleClientSecret
)
);
} else {
log.error("Cannot configure GoogleConnectionFactory id or secret null");
}
// Facebook configuration
String facebookClientId = environment.getProperty("spring.social.facebook.clientId");
String facebookClientSecret = environment.getProperty("spring.social.facebook.clientSecret");
if (facebookClientId != null && facebookClientSecret != null) {
log.debug("Configuring FacebookConnectionFactory");
connectionFactoryConfigurer.addConnectionFactory(
new FacebookConnectionFactory(
facebookClientId,
facebookClientSecret
)
);
} else {
log.error("Cannot configure FacebookConnectionFactory id or secret null");
}
// Twitter configuration
String twitterClientId = environment.getProperty("spring.social.twitter.clientId");
String twitterClientSecret = environment.getProperty("spring.social.twitter.clientSecret");
if (twitterClientId != null && twitterClientSecret != null) {
log.debug("Configuring TwitterConnectionFactory");
connectionFactoryConfigurer.addConnectionFactory(
new TwitterConnectionFactory(
twitterClientId,
twitterClientSecret
)
);
} else {
log.error("Cannot configure TwitterConnectionFactory id or secret null");
}
}
示例13: addConnectionFactories
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer, Environment environment) {
// Google configuration
String googleClientId = environment.getProperty("spring.social.google.clientId");
String googleClientSecret = environment.getProperty("spring.social.google.clientSecret");
if (googleClientId != null && googleClientSecret != null) {
log.debug("Configuring GoogleConnectionFactory");
connectionFactoryConfigurer.addConnectionFactory(
new GoogleConnectionFactory(
googleClientId,
googleClientSecret
)
);
} else {
log.error("Cannot configure GoogleConnectionFactory id or secret null");
}
// Facebook configuration
String facebookClientId = environment.getProperty("spring.social.facebook.clientId");
String facebookClientSecret = environment.getProperty("spring.social.facebook.clientSecret");
if (facebookClientId != null && facebookClientSecret != null) {
log.debug("Configuring FacebookConnectionFactory");
connectionFactoryConfigurer.addConnectionFactory(
new FacebookConnectionFactory(
facebookClientId,
facebookClientSecret
)
);
} else {
log.error("Cannot configure FacebookConnectionFactory id or secret null");
}
// Twitter configuration
String twitterClientId = environment.getProperty("spring.social.twitter.clientId");
String twitterClientSecret = environment.getProperty("spring.social.twitter.clientSecret");
if (twitterClientId != null && twitterClientSecret != null) {
log.debug("Configuring TwitterConnectionFactory");
connectionFactoryConfigurer.addConnectionFactory(
new TwitterConnectionFactory(
twitterClientId,
twitterClientSecret
)
);
} else {
log.error("Cannot configure TwitterConnectionFactory id or secret null");
}
// jhipster-needle-add-social-connection-factory
}
示例14: addConnectionFactories
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer, Environment environment) {
connectionFactoryConfigurer.addConnectionFactory(createConnectionFactory());
}
开发者ID:saladinkzn,项目名称:social-vkontakte-spring-boot-starter,代码行数:5,代码来源:VKontakteAutoConfiguration.java
示例15: addConnectionFactories
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer configurer,
Environment environment) {
configurer.addConnectionFactory(createConnectionFactory());
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:6,代码来源:SocialAutoConfigurerAdapter.java