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

Java AmazonElasticLoadBalancing类代码示例

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

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



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

示例1: wrap

import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancing; //导入依赖的package包/类
/**
 * TODO: メソッドコメント
 * 
 * @param client
 * @return
 */
public AmazonElasticLoadBalancing wrap(final AmazonElasticLoadBalancing client) {
    InvocationHandler handler = new InvocationHandler() {
        @Override
        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
            if (!AmazonWebServiceResult.class.isAssignableFrom(method.getReturnType())) {
                return method.invoke(client, args);
            }

            return doInvoke(client, proxy, method, args);
        }
    };

    return (AmazonElasticLoadBalancing) Proxy.newProxyInstance(LoggingAwsClientWrapper.class.getClassLoader(),
            new Class[] { AmazonElasticLoadBalancing.class }, handler);
}
 
开发者ID:primecloud-controller-org,项目名称:primecloud-controller,代码行数:22,代码来源:AbstractAwsClientWrapper.java


示例2: createElbClient

import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancing; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public AmazonElasticLoadBalancing createElbClient(String awsAccessId, String awsSecretKey) {
    AWSCredentials credentials = new BasicAWSCredentials(awsAccessId, awsSecretKey);
    ClientConfiguration configuration = createConfiguration();

    AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(credentials, configuration);

    if (host != null) {
        client.setEndpoint(AmazonElasticLoadBalancing.ENDPOINT_PREFIX + "." + host);
    }

    client = new ExceptionHandleAwsClientWrapper().wrap(client);

    return client;
}
 
开发者ID:primecloud-controller-org,项目名称:primecloud-controller,代码行数:19,代码来源:AmazonAwsClientFactory.java


示例3: beforeEachTestRuns

import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancing; //导入依赖的package包/类
@Before
public void beforeEachTestRuns() {
	AWSCredentialsProvider credentialsProvider = new DefaultAWSCredentialsProviderChain();
	AmazonEC2 ec2Client = EnvironmentSetupForTests.createEC2Client();
	AmazonElasticLoadBalancing awsElbClient = EnvironmentSetupForTests.createELBClient();
	AmazonCloudFormation cfnClient = EnvironmentSetupForTests.createCFNClient();
	AmazonRDS awsRdsClient = EnvironmentSetupForTests.createRDSClient();

	CloudClient cloudClient = new CloudClient(ec2Client, new DefaultAwsRegionProviderChain());
	LoadBalancerClient elbClient = new LoadBalancerClient(awsElbClient);
	VpcRepository vpcRepository = new VpcRepository(cloudClient);

	CloudFormationClient cloudFormationClient = new CloudFormationClient(cfnClient);
	cloudRepository = new CloudRepository(cloudClient);
	ResourceRepository cfnRepository = new CfnRepository(cloudFormationClient, cloudRepository, "CfnAssist");
	
	elbRepository = new ELBRepository(elbClient, vpcRepository, cfnRepository);
	rdsClient = new RDSClient(awsRdsClient);
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:20,代码来源:TestPictureGeneration.java


示例4: amazonElbClient

import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancing; //导入依赖的package包/类
@Bean
public AmazonElasticLoadBalancing amazonElbClient(final AWSCredentialsProvider awsCredentialsProvider,
    final ClientConfiguration awsClientConfig, final Region awsRegion) {
    return AmazonElasticLoadBalancingClientBuilder.standard()
        .withCredentials(awsCredentialsProvider)
        .withClientConfiguration(awsClientConfig)
        .withRegion(awsRegion.getName())
        .build();
}
 
开发者ID:shinesolutions,项目名称:aem-orchestrator,代码行数:10,代码来源:AwsConfig.java


示例5: findLoadBalancers

import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancing; //导入依赖的package包/类
/**
 * Fetches and filters a Region's ELBs
 * @param amazonElasticLoadBalancing
 * @param filter
 * @return
 */
public static List<LoadBalancerDescription> findLoadBalancers(AmazonElasticLoadBalancing amazonElasticLoadBalancing, ELBFilter filter) {
    List<LoadBalancerDescription> loadBalancers = amazonElasticLoadBalancing.describeLoadBalancers().getLoadBalancerDescriptions();
    List<LoadBalancerDescription> result = new ArrayList<>(loadBalancers.size());
    for(LoadBalancerDescription loadBalancer:loadBalancers){
        if(filter.accept(loadBalancer)){
            result.add(loadBalancer);
        }
    }
    return result;
}
 
开发者ID:Kixeye,项目名称:chassis,代码行数:17,代码来源:AwsUtils.java


示例6: ServerInstanceContext

import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancing; //导入依赖的package包/类
public ServerInstanceContext(Ec2MetadataClient ec2MetadataClient, AmazonEC2 amazonEC2, AmazonElasticLoadBalancing amazonElasticLoadBalancing){
    this.ec2MetadataClient = ec2MetadataClient;
    this.amazonEC2 = amazonEC2;
    this.amazonElasticLoadBalancing = amazonElasticLoadBalancing;

    init();
}
 
开发者ID:Kixeye,项目名称:chassis,代码行数:8,代码来源:ServerInstanceContext.java


示例7: findClient

import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancing; //导入依赖的package包/类
private AmazonElasticLoadBalancing findClient(Account account, Region region) {
    // TODO: need to config client config parameter. ignore it for now.
    // TODO: need a cached version based on account and region as key
    AWSCredentials credential = new BasicAWSCredentials(account.getAccessKeyId(), account.getSecretAccessKey());
    AmazonElasticLoadBalancing elb = new AmazonElasticLoadBalancingClient(credential);
    elb.setRegion(com.amazonaws.regions.Region.getRegion(region.getRegions()));
    return elb;
}
 
开发者ID:veyronfei,项目名称:clouck,代码行数:9,代码来源:ElbWrapperImpl.java


示例8: describeLoadBalancers

import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancing; //导入依赖的package包/类
@Override
public List<AbstractResource<?>> describeLoadBalancers(Account account, Region region, DateTime dt) {
    AmazonElasticLoadBalancing elb = findClient(account, region);

    DescribeLoadBalancersRequest req = new DescribeLoadBalancersRequest();

    log.debug("start describing elb for account:{} in region:{} via api", account.getId() + "=>" + account.getName(), region);
    DescribeLoadBalancersResult res = elb.describeLoadBalancers(req);
    return converter.toLoadBalancers(res.getLoadBalancerDescriptions(), account.getId(), region, dt);
}
 
开发者ID:veyronfei,项目名称:clouck,代码行数:11,代码来源:ElbWrapperImpl.java


示例9: createElbClient

import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancing; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public AmazonElasticLoadBalancing createElbClient(String awsAccessId, String awsSecretKey) {
    return elbClient;
}
 
开发者ID:primecloud-controller-org,项目名称:primecloud-controller,代码行数:8,代码来源:EucaAwsClientFactory.java


示例10: createAwsClient

import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancing; //导入依赖的package包/类
protected AwsProcessClient createAwsClient(Platform platform, PlatformAws platformAws, AwsCertificate awsCertificate) {
    AwsClientFactory factory;
    if (BooleanUtils.isTrue(platformAws.getEuca())) {
        factory = new EucaAwsClientFactory();
    } else {
        factory = new AmazonAwsClientFactory();
    }

    factory.setHost(platformAws.getHost());
    factory.setPort(platformAws.getPort());
    factory.setSecure(platformAws.getSecure());

    if (BooleanUtils.isTrue(platform.getProxy())) {
        Proxy proxy = proxyDao.read();
        factory.setProxyHost(proxy.getHost());
        factory.setProxyPort(proxy.getPort());
        factory.setProxyUser(proxy.getUser());
        factory.setProxyPassword(proxy.getPassword());
    }

    // Clientの作成
    AmazonEC2 ec2Client = factory
            .createEc2Client(awsCertificate.getAwsAccessId(), awsCertificate.getAwsSecretKey());
    AmazonElasticLoadBalancing elbClient = factory.createElbClient(awsCertificate.getAwsAccessId(),
            awsCertificate.getAwsSecretKey());

    // ログ出力用Clientでラップ
    String logging = StringUtils.defaultIfEmpty(Config.getProperty("aws.logging"), "false");
    if (BooleanUtils.toBoolean(logging)) {
        LoggingAwsClientWrapper loggingAwsClientWrapper = new LoggingAwsClientWrapper();
        ec2Client = loggingAwsClientWrapper.wrap(ec2Client);
        elbClient = loggingAwsClientWrapper.wrap(elbClient);
    }

    // 同期実行用Clientでラップ
    String sync = StringUtils.defaultIfEmpty(Config.getProperty("aws.synchronized"), "true");
    if (BooleanUtils.toBoolean(sync)) {
        SynchronizedAwsClientWrapper synchronizedAwsClientWrapper = new SynchronizedAwsClientWrapper();
        ec2Client = synchronizedAwsClientWrapper.wrap(ec2Client);
        elbClient = synchronizedAwsClientWrapper.wrap(elbClient);
    }

    AwsProcessClient client = new AwsProcessClient(awsCertificate.getUserNo(), platform, platformAws, ec2Client,
            elbClient);

    String describeInterval = Config.getProperty("aws.describeInterval");
    client.setDescribeInterval(NumberUtils.toInt(describeInterval, 15));

    return client;
}
 
开发者ID:primecloud-controller-org,项目名称:primecloud-controller,代码行数:51,代码来源:AwsProcessClientFactory.java


示例11: getElbClient

import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancing; //导入依赖的package包/类
public AmazonElasticLoadBalancing getElbClient() {
    return elbClient;
}
 
开发者ID:primecloud-controller-org,项目名称:primecloud-controller,代码行数:4,代码来源:AwsProcessClient.java


示例12: LoadBalancerClient

import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancing; //导入依赖的package包/类
public LoadBalancerClient(AmazonElasticLoadBalancing elbClient) {
	this.elbClient = elbClient;
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:4,代码来源:LoadBalancerClient.java


示例13: AwsProcessClient

import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancing; //导入依赖的package包/类
/**
 * TODO: コンストラクタコメント
 * 
 * @param userNo
 * @param platform
 * @param platformAws
 * @param ec2Client
 * @param elbClient
 */
public AwsProcessClient(Long userNo, Platform platform, PlatformAws platformAws, AmazonEC2 ec2Client,
        AmazonElasticLoadBalancing elbClient) {
    this.userNo = userNo;
    this.platform = platform;
    this.platformAws = platformAws;
    this.ec2Client = ec2Client;
    this.elbClient = elbClient;
}
 
开发者ID:primecloud-controller-org,项目名称:primecloud-controller,代码行数:18,代码来源:AwsProcessClient.java


示例14: createELBClient

import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancing; //导入依赖的package包/类
public static AmazonElasticLoadBalancing createELBClient() {
       return AmazonElasticLoadBalancingClientBuilder.defaultClient();

}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:5,代码来源:EnvironmentSetupForTests.java


示例15: createElbClient

import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancing; //导入依赖的package包/类
public abstract AmazonElasticLoadBalancing createElbClient(String awsAccessId, String awsSecretKey); 
开发者ID:primecloud-controller-org,项目名称:primecloud-controller,代码行数:2,代码来源:AwsClientFactory.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java Decal类代码示例发布时间:2022-05-22
下一篇:
Java InactivityTimer类代码示例发布时间: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