本文整理汇总了Java中org.javaswift.joss.client.factory.AccountConfig.setTenantName方法的典型用法代码示例。如果您正苦于以下问题:Java AccountConfig.setTenantName方法的具体用法?Java AccountConfig.setTenantName怎么用?Java AccountConfig.setTenantName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.javaswift.joss.client.factory.AccountConfig
的用法示例。
在下文中一共展示了AccountConfig.setTenantName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.javaswift.joss.client.factory.AccountConfig; //导入方法依赖的package包/类
public void init() {
AccountConfig config = new AccountConfig();
config.setAuthenticationMethod(AuthenticationMethod.BASIC);
config.setUsername(username);
config.setPassword(password);
config.setAuthUrl(url);
if (StringUtils.isNotEmpty(tenantId)) {
config.setTenantId(tenantId);
}
if (StringUtils.isNotEmpty(tenantName)) {
config.setTenantName(tenantName);
}
Account account = new AccountFactory(config).createAccount();
this.container = account.getContainer(containerName);
}
示例2: getMockAccountConfig
import org.javaswift.joss.client.factory.AccountConfig; //导入方法依赖的package包/类
public static AccountConfig getMockAccountConfig ()
{
AccountConfig accConf = new AccountConfig () ;
accConf.setAllowCaching(true) ;
accConf.setAllowReauthenticate(true) ;
accConf.setAllowContainerCaching(true) ;
accConf.setAuthUrl(null) ;
accConf.setHashPassword(null) ;
accConf.setMock(true) ;
accConf.setMockAllowEveryone(true) ;
accConf.setMockAllowObjectDeleter(true) ;
accConf.setMockMillisDelay(0) ;
accConf.setMockOnFileObjectStore(null) ;
accConf.setPassword(null) ;
accConf.setPreferredRegion(null) ;
accConf.setPrivateHost(null) ;
accConf.setPublicHost(null) ;
accConf.setSocketTimeout(0) ;
accConf.setTenantName(null) ;
accConf.setTenantId(null) ;
accConf.setUsername(null);
return accConf ;
}
示例3: swiftKeyStone
import org.javaswift.joss.client.factory.AccountConfig; //导入方法依赖的package包/类
public synchronized Account swiftKeyStone(String url, String username, String password, String tenantName, String preferredRegion) {
if (swiftUser != null) {
return swiftUser;
}
try {
AccountConfig conf = getStandardConfig(url, username, password, AuthenticationMethod.KEYSTONE, preferredRegion);
conf.setTenantName(tenantName);
swiftUser = createAccount(conf);
} catch (CommandException ce) {
throw new ElasticsearchException(
"Unable to authenticate to Swift Keystone " + url + "/" + username + "/" + password + "/" + tenantName, ce);
}
return swiftUser;
}
示例4: createSwiftManager
import org.javaswift.joss.client.factory.AccountConfig; //导入方法依赖的package包/类
/**
* swift manager (rely on joss component structure).
*
* @return the account
*/
public Account createSwiftManager() {
AccountConfig jossConfig = new AccountConfig();
jossConfig.setAuthenticationMethod(AuthenticationMethod.KEYSTONE);
jossConfig.setUsername(config.getLogin());
jossConfig.setPassword(config.getPassword());
jossConfig.setAuthUrl(RUNABOVE_KEYSTONE_URL);
jossConfig.setTenantName(config.getTenantName());
jossConfig.setTenantId(config.getTenantId());
jossConfig.setMock(config.isMocked());
return new AccountFactory(jossConfig).createAccount();
}