All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliyuncs.v5.endpoint.UserVpcEndpointResolver Maven / Gradle / Ivy

Go to download

Aliyun Open API SDK for Java Copyright (C) Alibaba Cloud Computing All rights reserved. 版权所有 (C)阿里云计算有限公司 http://www.aliyun.com

The newest version!
package com.aliyuncs.v5.endpoint;

import com.aliyuncs.v5.exceptions.ClientException;

public class UserVpcEndpointResolver extends EndpointResolverBase {

    @Override
    public boolean isRegionIdValid(ResolveEndpointRequest request) {
        return request.regionId != null;
    }

    @Override
    public boolean isProductCodeValid(ResolveEndpointRequest request) {
        return request.productCode != null;
    }

    @Override
    public String makeEndpointKey(ResolveEndpointRequest request) {
        return null;
    }

    @Override
    public String resolve(ResolveEndpointRequest request) throws ClientException {
        String productCode = request.productCode.toLowerCase();
        String regionId = request.regionId.toLowerCase();
        return String.format("%s-vpc.%s.aliyuncs.com", productCode, regionId);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy