• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Account类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: init

import org.javaswift.joss.model.Account; //导入依赖的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);
	}
 
开发者ID:jeci-sarl,项目名称:alfresco-object-storage-connectors,代码行数:17,代码来源:SwiftServiceImpl.java


示例2: isJobSuccessful

import org.javaswift.joss.model.Account; //导入依赖的package包/类
/**
 * Checks if container/object contains
 * container/object/_SUCCESS
 * If so, this object was created by successful Hadoop job
 *
 * @param objectName
 * @return boolean if job is successful
 */
private boolean isJobSuccessful(String objectName) {
  LOG.trace("Checking if job completed successfull for {}", objectName);
  if (cachedSparkJobsStatus.containsKey(objectName)) {
    return cachedSparkJobsStatus.get(objectName).booleanValue();
  }
  String obj = objectName;
  Account account = mJossAccount.getAccount();
  LOG.trace("HEAD {}", obj + "/" + HADOOP_SUCCESS);
  StoredObject so = account.getContainer(container).getObject(obj
      + "/" + HADOOP_SUCCESS);
  Boolean isJobOK = Boolean.FALSE;
  if (so.exists()) {
    LOG.debug("{} exists", obj + "/" + HADOOP_SUCCESS);
    isJobOK = Boolean.TRUE;
  }
  cachedSparkJobsStatus.put(objectName, isJobOK);
  return isJobOK.booleanValue();
}
 
开发者ID:SparkTC,项目名称:stocator,代码行数:27,代码来源:SwiftAPIClient.java


示例3: ViPRSwiftClient

import org.javaswift.joss.model.Account; //导入依赖的package包/类
public static Account ViPRSwiftClient(String username,String password,String dataNode)throws Exception
{
	try {
		AccountConfig config = new AccountConfig();
		config.setUsername(username);
		config.setPassword(password);
		config.setAuthUrl(dataNode + "/v2.0/tokens");
		config.setDisableSslValidation(true);
		Account account = new AccountFactory(config).createAccount();
		return account;
	} catch (Exception e) {
		System.out.println("error during creating connection with " + dataNode);
		e.printStackTrace();
	}
	return null;
}
 
开发者ID:thecodeteam,项目名称:VStriker,代码行数:17,代码来源:swiftapi.java


示例4: CreateObject

import org.javaswift.joss.model.Account; //导入依赖的package包/类
public static void CreateObject(String username,String passwod,String dataNode, String container, String key, InputStream content)throws Exception
{
	try{
		Account client = ViPRSwiftClient(username, passwod, dataNode);
		Container myContainer = client.getContainer(container);
		if (!myContainer.exists()) {
			myContainer.create();
			myContainer.makePublic();
		}
		StoredObject object = myContainer.getObject(key);
		object.uploadObject(content);

	}
	catch(Exception e)
	{
		System.out.println("error during creating "+key);
		e.printStackTrace();
	}

}
 
开发者ID:thecodeteam,项目名称:VStriker,代码行数:21,代码来源:swiftapi.java


示例5: createSomeObjects

import org.javaswift.joss.model.Account; //导入依赖的package包/类
protected static void createSomeObjects(Account account) {
  Container container =
      account.getContainer("container-" + UUID.randomUUID().toString().toLowerCase());
  container.create();
  for (int i = 0; i < 3; i++) {
    container
        .getObject("OBJECT-" + UUID.randomUUID())
        .uploadObject(createString(4096).getBytes());
  }
}
 
开发者ID:twonote,项目名称:radosgw-admin4j,代码行数:11,代码来源:BaseTest.java


示例6: createSwift

import org.javaswift.joss.model.Account; //导入依赖的package包/类
protected static Account createSwift(String username, String password) {
  AccountConfig config = new AccountConfig();
  config.setUsername(username);
  config.setPassword(password);
  config.setAuthUrl(swiftEndpoint);
  config.setAuthenticationMethod(AuthenticationMethod.BASIC);
  return new AccountFactory(config).createAccount();
}
 
开发者ID:twonote,项目名称:radosgw-admin4j,代码行数:9,代码来源:BaseTest.java


示例7: getAccount

import org.javaswift.joss.model.Account; //导入依赖的package包/类
/**
 * Get account
 *
 * @return Account
 */
public Account getAccount() {
  if (mAccount == null) {
    createAccount();
  }
  return mAccount;
}
 
开发者ID:SparkTC,项目名称:stocator,代码行数:12,代码来源:JossAccount.java


示例8: createAccount

import org.javaswift.joss.model.Account; //导入依赖的package包/类
public Account createAccount() {
  final Client client;
  if (mConfig.isMock()) {
    client = createClientMock();
  } else {
    client = createClientImpl();
  }
  return client.authenticate();
}
 
开发者ID:SparkTC,项目名称:stocator,代码行数:10,代码来源:DummyAccountFactory.java


示例9: eagerFetchContainers

import org.javaswift.joss.model.Account; //导入依赖的package包/类
private Collection<Container> eagerFetchContainers(Account parent) {   	
	
	parent.reload();
	
    List<Container> results = new ArrayList<Container>(parent.getCount());
    PaginationMap map = parent.getPaginationMap(MAX_PAGE_SIZE);
    for (int page = 0; page < map.getNumberOfPages(); page++) {
        results.addAll(parent.list(map, page));
    }
    return results;
}
 
开发者ID:roikku,项目名称:swift-explorer,代码行数:12,代码来源:SwiftOperationsImpl.java


示例10: ReadObject

import org.javaswift.joss.model.Account; //导入依赖的package包/类
public static InputStream ReadObject(String username,String passwod,String dataNode, String container, String key)throws Exception {
	try {
		Account client = ViPRSwiftClient(username, passwod, dataNode);
		Container myContainer = client.getContainer(container);
		StoredObject object = myContainer.getObject(key);
		return object.downloadObjectAsInputStream();
	} catch (Exception e) {
		System.out.println("error during reading " + key);
		e.printStackTrace();
	}
	return null;
}
 
开发者ID:thecodeteam,项目名称:VStriker,代码行数:13,代码来源:swiftapi.java


示例11: DeleteObject

import org.javaswift.joss.model.Account; //导入依赖的package包/类
public static void DeleteObject(String username,String passwod,String dataNode, String container, String key)throws Exception {
	try {
		Account client = ViPRSwiftClient(username, passwod, dataNode);
		Container myContainer = client.getContainer(container);
		StoredObject object = myContainer.getObject(key);
		object.delete();

	} catch (Exception e) {
		System.out.println("error during delete " + key);
		e.printStackTrace();
	}
}
 
开发者ID:thecodeteam,项目名称:VStriker,代码行数:13,代码来源:swiftapi.java


示例12: ViPRSwiftClient

import org.javaswift.joss.model.Account; //导入依赖的package包/类
public static Account ViPRSwiftClient(String username,String password,String dataNode)throws Exception
{
	
	   AccountConfig config = new AccountConfig();  
	              config.setUsername(username);  
	               config.setPassword(password);  
	               config.setAuthUrl(dataNode + "/v2.0/tokens");  
	               config.setDisableSslValidation(true);  
	               Account account = new AccountFactory(config).createAccount();  
	   return account;
	
}
 
开发者ID:thecodeteam,项目名称:VStriker,代码行数:13,代码来源:swiftapi.java


示例13: CreateObject

import org.javaswift.joss.model.Account; //导入依赖的package包/类
public static void CreateObject(String username,String passwod,String dataNode, String container, String key, InputStream content)throws Exception
{
	
	Account client= ViPRSwiftClient(username, passwod, dataNode);
	Container myContainer=client.getContainer(container);
	StoredObject object = myContainer.getObject(key);
    object.uploadObject(content);

}
 
开发者ID:thecodeteam,项目名称:VStriker,代码行数:10,代码来源:swiftapi.java


示例14: ReadObject

import org.javaswift.joss.model.Account; //导入依赖的package包/类
public static InputStream ReadObject(String username,String passwod,String dataNode, String container, String key)throws Exception
{
	
	Account client= ViPRSwiftClient(username, passwod, dataNode);
	Container myContainer=client.getContainer(container);
	StoredObject object = myContainer.getObject(key);
    return object.downloadObjectAsInputStream();

}
 
开发者ID:thecodeteam,项目名称:VStriker,代码行数:10,代码来源:swiftapi.java


示例15: DeleteObject

import org.javaswift.joss.model.Account; //导入依赖的package包/类
public static void DeleteObject(String username,String passwod,String dataNode, String container, String key)throws Exception
{
	
	Account client= ViPRSwiftClient(username, passwod, dataNode);
	Container myContainer=client.getContainer(container);
	StoredObject object = myContainer.getObject(key);
    object.delete();
}
 
开发者ID:thecodeteam,项目名称:VStriker,代码行数:9,代码来源:swiftapi.java


示例16: TestSwiftGetClient

import org.javaswift.joss.model.Account; //导入依赖的package包/类
public static void TestSwiftGetClient() throws Exception
{
	
	String username="[email protected]";
	String password="uHJop3/sQpIcmBi1XaVYilrDKjBiXrycPcSTkuxr";
	String proxy="http://10.243.188.178:10501";
	
	Account conn =swiftapi.ViPRSwiftClient(username,password,proxy);
	
	vLogger.LogInfo("Unit Test SWIFT API " +conn.toString());
	System.out.println("Unit Test SWIFT API " +conn.toString());
}
 
开发者ID:thecodeteam,项目名称:VStriker,代码行数:13,代码来源:VStrikerAPIUnitTest.java


示例17: swiftBasic

import org.javaswift.joss.model.Account; //导入依赖的package包/类
/**
 * Create a Swift account object and connect it to Swift
 * 
 * @param url
 *            The auth url (eg: localhost:8080/auth/v1.0/)
 * @param username
 *            The username
 * @param password
 *            The password
 * @return swift Account
 */
public synchronized Account swiftBasic(String url, String username, String password, String preferredRegion) {
    if (swiftUser != null) {
        return swiftUser;
    }

    try {
        AccountConfig conf = getStandardConfig(url, username, password, AuthenticationMethod.BASIC, preferredRegion);
        swiftUser = createAccount(conf);
    } catch (CommandException ce) {
        throw new ElasticsearchException("Unable to authenticate to Swift Basic " + url + "/" + username + "/" + password, ce);
    }
    return swiftUser;
}
 
开发者ID:wikimedia,项目名称:search-repository-swift,代码行数:25,代码来源:SwiftService.java


示例18: createAccount

import org.javaswift.joss.model.Account; //导入依赖的package包/类
private Account createAccount(final AccountConfig conf) {
    return SwiftPerms.exec(new PrivilegedAction<Account>() {
        @Override
        public Account run() {
            return new AccountFactory(conf).createAccount();
        }
    });
}
 
开发者ID:wikimedia,项目名称:search-repository-swift,代码行数:9,代码来源:SwiftService.java


示例19: swiftKeyStone

import org.javaswift.joss.model.Account; //导入依赖的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;
}
 
开发者ID:wikimedia,项目名称:search-repository-swift,代码行数:16,代码来源:SwiftService.java


示例20: swiftTempAuth

import org.javaswift.joss.model.Account; //导入依赖的package包/类
public synchronized Account swiftTempAuth(String url, String username, String password, String preferredRegion) {
    if (swiftUser != null) {
        return swiftUser;
    }

    try {
        AccountConfig conf = getStandardConfig(url, username, password, AuthenticationMethod.TEMPAUTH, preferredRegion);
        swiftUser = createAccount(conf);
    } catch (CommandException ce) {
        throw new ElasticsearchException("Unable to authenticate to Swift Temp", ce);
    }
    return swiftUser;
}
 
开发者ID:wikimedia,项目名称:search-repository-swift,代码行数:14,代码来源:SwiftService.java



注:本文中的org.javaswift.joss.model.Account类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GetApplicationAttemptsRequest类代码示例发布时间:2022-05-22
下一篇:
Java BitTreeDecoder类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap