index
int64
repo_id
string
file_path
string
content
string
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/exceptions/ClientException.java
package com.aliyuncs.v5.exceptions; public class ClientException extends Exception { private static final long serialVersionUID = 534996425110290578L; private String requestId; private String errCode; private String errMsg; private ErrorType errorType; private String errorDescription; public ClientException(String errorCode, String errorMessage, String requestId, String errorDescription) { this(errorCode, errorMessage); this.setErrorDescription(errorDescription); this.setRequestId(requestId); } public ClientException(String errCode, String errMsg, String requestId) { this(errCode, errMsg); this.requestId = requestId; this.setErrorType(ErrorType.Client); } public ClientException(String errCode, String errMsg, Throwable cause) { super(errCode + " : " + errMsg, cause); this.errCode = errCode; this.errMsg = errMsg; this.setErrorType(ErrorType.Client); } public ClientException(String errCode, String errMsg) { super(errCode + " : " + errMsg); this.errCode = errCode; this.errMsg = errMsg; this.setErrorType(ErrorType.Client); } public ClientException(String message) { super(message); this.setErrorType(ErrorType.Client); } public ClientException(Throwable cause) { super(cause); this.setErrorType(ErrorType.Client); } public String getRequestId() { return requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public String getErrCode() { return errCode; } public void setErrCode(String errCode) { this.errCode = errCode; } public String getErrMsg() { return errMsg; } public void setErrMsg(String errMsg) { this.errMsg = errMsg; } public ErrorType getErrorType() { return errorType; } public void setErrorType(ErrorType errorType) { this.errorType = errorType; } public String getErrorDescription() { return errorDescription; } public void setErrorDescription(String errorDescription) { this.errorDescription = errorDescription; } @Override public String getMessage() { return super.getMessage() + (null == getRequestId() ? "" : "\r\nRequestId : " + getRequestId()) + (null == getErrorDescription() ? "" : "\r\nDescription : " + getErrorDescription()); } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/exceptions/ErrorCodeConstant.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package com.aliyuncs.v5.exceptions; public class ErrorCodeConstant { public static final String SDK_ENDPOINT_RESOLVING_ERROR = "SDK.EndpointResolvingError"; public static final String SDK_ENDPOINT_TESTABILITY = "SDK.EndpointTestability"; public static final String SDK_INVALID_SERVER_RESPONSE = "SDK.InvalidServerResponse"; }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/exceptions/ErrorMessageConstant.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package com.aliyuncs.v5.exceptions; public class ErrorMessageConstant { public static final String SDK_ENDPOINT_MANAGEMENT_DOC_HTML = "https://www.alibabacloud.com/help/zh/doc-detail/92049.htm"; public static final String INVALID_REGION_ID = "No such region '%s'. Please check your region ID."; public static final String ENDPOINT_NO_REGION = "No endpoint in the region '%s' for product '%s'. \n" + "You can set an endpoint for your request explicitly.%s\n" + "See " + SDK_ENDPOINT_MANAGEMENT_DOC_HTML + "\n"; /** * Or use available regions: */ public static final String ENDPOINT_NO_PRODUCT = "No endpoint for product '%s'. \n" + "Please check the product code, or set an endpoint for your request explicitly.\n" + "See " + SDK_ENDPOINT_MANAGEMENT_DOC_HTML + "\n"; public static final String SERVER_RESPONSE_HTTP_BODY_EMPTY = "Failed to parse the response. The request was succeeded, but the server returned an empty HTTP body."; }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/exceptions/ErrorType.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package com.aliyuncs.v5.exceptions; public enum ErrorType { // 客户端异常 Client, // 服务端异常 Server, // 限流 Throttling, // default Unknown, }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/exceptions/ServerException.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package com.aliyuncs.v5.exceptions; public class ServerException extends ClientException { private static final long serialVersionUID = -7345371390798165336L; public ServerException(String errorCode, String errorMessage) { super(errorCode, errorMessage); this.setErrorType(ErrorType.Server); } public ServerException(String errCode, String errMsg, String requestId) { this(errCode, errMsg); this.setRequestId(requestId); } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/CallBack.java
package com.aliyuncs.v5.http; /** * 用于异步调用时的回调逻辑 * * @author VK.Gao * @date 2017/03/02 */ public interface CallBack { /** * 请求失败 * * @param request 封装后的请求对象,包含部分http相关信息 * @param e 导致失败的异常 */ void onFailure(HttpRequest request, Exception e); /** * 收到应答 * * @param request 封装后的请求对象,包含部分http相关信息 * @param response 封装后的应答对象,包含部分http相关信息,可以调用.getBody()获取content */ void onResponse(HttpRequest request, HttpResponse response); }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/CompositeX509TrustManager.java
package com.aliyuncs.v5.http; import javax.net.ssl.X509TrustManager; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class CompositeX509TrustManager implements X509TrustManager { private final List<X509TrustManager> trustManagers; private boolean ignoreSSLCert = false; public boolean isIgnoreSSLCert() { return ignoreSSLCert; } public void setIgnoreSSLCert(boolean ignoreSSLCert) { this.ignoreSSLCert = ignoreSSLCert; } public CompositeX509TrustManager(List<X509TrustManager> trustManagers) { this.trustManagers = trustManagers; } @Override public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { // do nothing } @Override public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { if (ignoreSSLCert) { return; } for (X509TrustManager trustManager : trustManagers) { try { trustManager.checkServerTrusted(chain, authType); return; // someone trusts them. success! } catch (CertificateException e) { // maybe someone else will trust them } } throw new CertificateException("None of the TrustManagers trust this certificate chain"); } @Override public X509Certificate[] getAcceptedIssuers() { List<X509Certificate> certificates = new ArrayList<X509Certificate>(); for (X509TrustManager trustManager : trustManagers) { certificates.addAll(Arrays.asList(trustManager.getAcceptedIssuers())); } X509Certificate[] certificatesArray = new X509Certificate[certificates.size()]; return certificates.toArray(certificatesArray); } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/FormatType.java
package com.aliyuncs.v5.http; import java.util.Arrays; public enum FormatType { /** * XML("application/xml","text/xml") * JSON:("application/json", "text/json") * RAW:("application/octet-stream") * FORM:("application/x-www-form-urlencoded") */ XML("application/xml", "text/xml"), JSON("application/json", "text/json"), RAW("application/octet-stream"), FORM("application/x-www-form-urlencoded"); private String[] formats; FormatType(String... formats) { this.formats = formats; } public static String mapFormatToAccept(FormatType format) { return format.formats[0]; } public static FormatType mapAcceptToFormat(String accept) { for (FormatType value : values()) { if (Arrays.asList(value.formats).contains(accept)) { return value; } } return FormatType.RAW; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/HttpClientConfig.java
package com.aliyuncs.v5.http; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.KeyManager; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.X509TrustManager; import java.security.SecureRandom; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ExecutorService; public class HttpClientConfig { public static final long DEFAULT_CONNECTION_TIMEOUT = 5000; public static final long DEFAULT_READ_TIMEOUT = 10000; /** * client type */ private HttpClientType clientType = null; private String customClientClassName = null; /** * connectionPool **/ private int maxIdleConnections = 5; private long maxIdleTimeMillis = 60 * 1000L; private long keepAliveDurationMillis = 5000L; /** * timeout **/ private long connectionTimeoutMillis = DEFAULT_CONNECTION_TIMEOUT; private long readTimeoutMillis = DEFAULT_READ_TIMEOUT; private long writeTimeoutMillis = 15000L; /** * global protocolType **/ private ProtocolType protocolType = ProtocolType.HTTP; /** * https **/ private boolean ignoreSSLCerts = false; @Deprecated private SSLSocketFactory sslSocketFactory = null; private KeyManager[] keyManagers = null; private X509TrustManager[] x509TrustManagers = null; private SecureRandom secureRandom = null; private HostnameVerifier hostnameVerifier = null; @Deprecated private String certPath = null; /** * dispatcher **/ private int maxRequests = 64; private int maxRequestsPerHost = 5; private Runnable idleCallback = null; private ExecutorService executorService = null; /** * proxy configurations */ private String httpProxy = null; private String httpsProxy = null; private String noProxy = null; /** * extra params */ private Map<String, Object> extParams = new HashMap<String, Object>(); private boolean compatibleMode = false; public static HttpClientConfig getDefault() { HttpClientConfig config = new HttpClientConfig(); config.setClientType(HttpClientType.ApacheHttpClient); return config; } public HttpClientType getClientType() { return clientType; } public void setClientType(HttpClientType clientType) { this.clientType = clientType; } @Deprecated public String getCertPath() { return certPath; } /** * use HttpClientConfig.setX509TrustManagers() and HttpClientConfig.setKeyManagers() instead */ @Deprecated public void setCertPath(String certPath) { this.certPath = certPath; } public int getMaxIdleConnections() { return maxIdleConnections; } public void setMaxIdleConnections(int maxIdleConnections) { this.maxIdleConnections = maxIdleConnections; } public long getMaxIdleTimeMillis() { return maxIdleTimeMillis; } public void setMaxIdleTimeMillis(long maxIdleTimeMillis) { this.maxIdleTimeMillis = maxIdleTimeMillis; } public long getKeepAliveDurationMillis() { return keepAliveDurationMillis; } public void setKeepAliveDurationMillis(long keepAliveDurationMillis) { this.keepAliveDurationMillis = keepAliveDurationMillis; } public long getConnectionTimeoutMillis() { return connectionTimeoutMillis; } public void setConnectionTimeoutMillis(long connectionTimeoutMillis) { this.connectionTimeoutMillis = connectionTimeoutMillis; } public long getReadTimeoutMillis() { return readTimeoutMillis; } public void setReadTimeoutMillis(long readTimeoutMillis) { this.readTimeoutMillis = readTimeoutMillis; } public long getWriteTimeoutMillis() { return writeTimeoutMillis; } public void setWriteTimeoutMillis(long writeTimeoutMillis) { this.writeTimeoutMillis = writeTimeoutMillis; } @Deprecated public SSLSocketFactory getSslSocketFactory() { return this.sslSocketFactory; } /** * use HttpClientConfig.setX509TrustManagers() and HttpClientConfig.setKeyManagers() instead */ @Deprecated public void setSslSocketFactory(SSLSocketFactory sslSocketFactory) { this.sslSocketFactory = sslSocketFactory; } public KeyManager[] getKeyManagers() { return keyManagers; } public void setKeyManagers(KeyManager[] keyManagers) { this.keyManagers = keyManagers; } public X509TrustManager[] getX509TrustManagers() { return x509TrustManagers; } public void setX509TrustManagers(X509TrustManager[] x509TrustManagers) { this.x509TrustManagers = x509TrustManagers; } public SecureRandom getSecureRandom() { return secureRandom; } public void setSecureRandom(SecureRandom secureRandom) { this.secureRandom = secureRandom; } public HostnameVerifier getHostnameVerifier() { return hostnameVerifier; } public void setHostnameVerifier(HostnameVerifier hostnameVerifier) { this.hostnameVerifier = hostnameVerifier; } public int getMaxRequests() { return maxRequests; } public void setMaxRequests(int maxRequests) { this.maxRequests = maxRequests; } public int getMaxRequestsPerHost() { return maxRequestsPerHost; } public void setMaxRequestsPerHost(int maxRequestsPerHost) { this.maxRequestsPerHost = maxRequestsPerHost; } public Runnable getIdleCallback() { return idleCallback; } public void setIdleCallback(Runnable idleCallback) { this.idleCallback = idleCallback; } public ExecutorService getExecutorService() { return executorService; } public void setExecutorService(ExecutorService executorService) { this.executorService = executorService; } public Map<String, Object> getExtParams() { return extParams; } public void setExtParams(Map<String, Object> extParams) { this.extParams = extParams; } public String getCustomClientClassName() { return customClientClassName; } public void setCustomClientClassName(String customClientClassName) { this.customClientClassName = customClientClassName; } public Object getExtParam(Object key) { return extParams.get(key); } public Object setExtParam(String key, Object value) { return extParams.put(key, value); } public boolean containsExtParam(Object key) { return extParams.containsKey(key); } public boolean isIgnoreSSLCerts() { return ignoreSSLCerts; } public void setIgnoreSSLCerts(boolean ignoreSSLCerts) { this.ignoreSSLCerts = ignoreSSLCerts; } public boolean isCompatibleMode() { return compatibleMode; } public void setCompatibleMode(boolean compatibleMode) { this.compatibleMode = compatibleMode; } public ProtocolType getProtocolType() { return protocolType; } public void setProtocolType(ProtocolType protocolType) { this.protocolType = protocolType; } public String getHttpProxy() { return httpProxy; } public void setHttpProxy(String httpProxy) { this.httpProxy = httpProxy; } public String getHttpsProxy() { return httpsProxy; } public void setHttpsProxy(String httpsProxy) { this.httpsProxy = httpsProxy; } public String getNoProxy() { return noProxy; } public void setNoProxy(String noProxy) { this.noProxy = noProxy; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/HttpClientFactory.java
package com.aliyuncs.v5.http; import com.aliyuncs.v5.http.clients.ApacheHttpClient; import com.aliyuncs.v5.http.clients.CompatibleUrlConnClient; import com.aliyuncs.v5.profile.IClientProfile; import com.aliyuncs.v5.utils.StringUtils; import java.lang.reflect.Constructor; public class HttpClientFactory { public static String HTTP_CLIENT_IMPL_KEY = "aliyuncs.sdk.httpclient"; public static String COMPATIBLE_HTTP_CLIENT_CLASS_NAME = CompatibleUrlConnClient.class.getName(); public static IHttpClient buildClient(IClientProfile profile) { try { HttpClientConfig clientConfig = profile.getHttpClientConfig(); if (clientConfig == null) { clientConfig = HttpClientConfig.getDefault(); profile.setHttpClientConfig(clientConfig); } String customClientClassName = null; if (clientConfig.isCompatibleMode()) { customClientClassName = COMPATIBLE_HTTP_CLIENT_CLASS_NAME; } else if (clientConfig.getClientType() == HttpClientType.Custom && !StringUtils.isEmpty(clientConfig.getCustomClientClassName())) { customClientClassName = clientConfig.getCustomClientClassName(); } else { customClientClassName = System.getProperty(HTTP_CLIENT_IMPL_KEY); } if (StringUtils.isEmpty(customClientClassName)) { customClientClassName = clientConfig.getClientType().getImplClass().getName(); } Class httpClientClass = Class.forName(customClientClassName); if (!IHttpClient.class.isAssignableFrom(httpClientClass)) { throw new IllegalStateException(String.format("%s is not assignable from com.aliyuncs.http.IHttpClient", customClientClassName)); } if (ApacheHttpClient.class.equals(httpClientClass)) { IHttpClient client = ApacheHttpClient.getInstance(); client.init(clientConfig); return client; } Constructor<? extends IHttpClient> constructor = httpClientClass.getConstructor(HttpClientConfig.class); return constructor.newInstance(clientConfig); } catch (Exception e) { // keep compatibility throw new IllegalStateException("HttpClientFactory buildClient failed", e); } } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/HttpClientType.java
package com.aliyuncs.v5.http; public enum HttpClientType { /** * define Compatiblen,HttpClient,okHttp,Custom */ Compatible(com.aliyuncs.v5.http.clients.CompatibleUrlConnClient.class), ApacheHttpClient(com.aliyuncs.v5.http.clients.ApacheHttpClient.class), OkHttp(null), Custom(null), ; private Class<? extends IHttpClient> implClass; HttpClientType(Class<? extends IHttpClient> implClass) { this.implClass = implClass; } public Class<? extends IHttpClient> getImplClass() { return implClass; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/HttpMessage.java
package com.aliyuncs.v5.http; import com.aliyuncs.v5.exceptions.ClientException; import com.aliyuncs.v5.utils.ParameterHelper; import lombok.ToString; import javax.net.ssl.KeyManager; import javax.net.ssl.X509TrustManager; import java.io.UnsupportedEncodingException; import java.util.Collections; import java.util.HashMap; import java.util.Map; @ToString public abstract class HttpMessage { protected static final String CONTENT_TYPE = "Content-Type"; protected static final String CONTENT_MD5 = "Content-MD5"; protected static final String CONTENT_LENGTH = "Content-Length"; protected FormatType httpContentType = null; protected byte[] httpContent = null; protected String encoding = null; protected Map<String, String> headers = new HashMap<String, String>(); protected Integer connectTimeout = null; protected Integer readTimeout = null; private String url = null; private MethodType method = null; protected boolean ignoreSSLCerts = false; private KeyManager[] keyManagers = null; private X509TrustManager[] x509TrustManagers = null; public KeyManager[] getKeyManagers() { return keyManagers; } public void setKeyManagers(KeyManager[] keyManagers) { this.keyManagers = keyManagers; } public X509TrustManager[] getX509TrustManagers() { return x509TrustManagers; } public void setX509TrustManagers(X509TrustManager[] x509TrustManagers) { this.x509TrustManagers = x509TrustManagers; } public boolean isIgnoreSSLCerts() { return ignoreSSLCerts; } public void setIgnoreSSLCerts(boolean ignoreSSLCerts) { this.ignoreSSLCerts = ignoreSSLCerts; } public HttpMessage(String strUrl) { this.url = strUrl; } public HttpMessage() { } /** * @Deprecated : Use getSysUrl instead of this */ @Deprecated public String getUrl() { return url; } /** * @Deprecated : Use setSysUrl instead of this */ @Deprecated protected void setUrl(String url) { this.url = url; } /** * @Deprecated : Use getSysMethod instead of this */ @Deprecated public MethodType getMethod() { return method; } /** * @Deprecated : Use setSysMethod instead of this */ @Deprecated public void setMethod(MethodType method) { this.method = method; } public FormatType getHttpContentType() { return httpContentType; } public void setHttpContentType(FormatType httpContentType) { this.httpContentType = httpContentType; if (null != this.httpContent || null != httpContentType) { this.headers.put(CONTENT_TYPE, getContentTypeValue(this.httpContentType, this.encoding)); } else { this.headers.remove(CONTENT_TYPE); } } public byte[] getHttpContent() { return httpContent; } public void setHttpContent(byte[] content, String encoding, FormatType format) { if (null == content) { this.headers.remove(CONTENT_MD5); this.headers.put(CONTENT_LENGTH, "0"); this.headers.remove(CONTENT_TYPE); this.httpContentType = null; this.httpContent = null; this.encoding = null; return; } // for GET HEADER DELETE OPTION method, sdk should ignore the content if (getSysMethod() != null && !getSysMethod().hasContent()) { content = new byte[0]; } this.httpContent = content; this.encoding = encoding; String contentLen = String.valueOf(content.length); String strMd5 = ParameterHelper.md5Sum(content); this.headers.put(CONTENT_MD5, strMd5); this.headers.put(CONTENT_LENGTH, contentLen); if (null != format) { this.headers.put(CONTENT_TYPE, FormatType.mapFormatToAccept(format)); } } /** * @Deprecated : Use getSysEncoding instead of this */ @Deprecated public String getEncoding() { return encoding; } /** * @Deprecated : Use setSysEncoding instead of this */ @Deprecated public void setEncoding(String encoding) { this.encoding = encoding; } public void putHeaderParameter(String name, String value) { if (null != name && null != value) { this.headers.put(name, value); } } public String getHeaderValue(String name) { return this.headers.get(name); } /** * @Deprecated : Use getSysConnectTimeout instead of this */ @Deprecated public Integer getConnectTimeout() { return connectTimeout; } /** * @Deprecated : Use setSysConnectTimeout instead of this */ @Deprecated public void setConnectTimeout(Integer connectTimeout) { this.connectTimeout = connectTimeout; } /** * @Deprecated : Use getSysReadTimeout instead of this */ @Deprecated public Integer getReadTimeout() { return readTimeout; } /** * @Deprecated : Use setSysReadTimeout instead of this */ @Deprecated public void setReadTimeout(Integer readTimeout) { this.readTimeout = readTimeout; } /** * @Deprecated : Use getSysHeaders instead of this */ @Deprecated public Map<String, String> getHeaders() { return Collections.unmodifiableMap(headers); } public String getContentTypeValue(FormatType contentType, String encoding) { if (null != contentType && null != encoding) { return FormatType.mapFormatToAccept(contentType) + ";charset=" + encoding.toLowerCase(); } else if (null != contentType) { return FormatType.mapFormatToAccept(contentType); } return null; } public String getHttpContentString() throws ClientException { String stringContent = ""; if (this.httpContent != null) { try { if (this.encoding == null) { stringContent = new String(this.httpContent); } else { stringContent = new String(this.httpContent, this.encoding); } } catch (UnsupportedEncodingException exp) { throw new ClientException("SDK.UnsupportedEncoding", "Can not parse response due to unsupported encoding."); } } return stringContent; } public String getSysUrl() { return url; } protected void setSysUrl(String url) { this.url = url; } public MethodType getSysMethod() { return method; } public void setSysMethod(MethodType method) { this.method = method; } public String getSysEncoding() { return encoding; } public void setSysEncoding(String encoding) { this.encoding = encoding; } public Integer getSysConnectTimeout() { return connectTimeout; } public void setSysConnectTimeout(Integer connectTimeout) { this.connectTimeout = connectTimeout; } public Integer getSysReadTimeout() { return readTimeout; } public void setSysReadTimeout(Integer readTimeout) { this.readTimeout = readTimeout; } public Map<String, String> getSysHeaders() { return Collections.unmodifiableMap(headers); } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/HttpRequest.java
package com.aliyuncs.v5.http; import lombok.ToString; import java.util.Map; @ToString(callSuper = true) public class HttpRequest extends HttpMessage { public HttpRequest(String strUrl) { super(strUrl); } public HttpRequest(String strUrl, Map<String, String> tmpHeaders) { super(strUrl); if (null != tmpHeaders) { this.headers = tmpHeaders; } } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/HttpResponse.java
package com.aliyuncs.v5.http; import lombok.ToString; @ToString(callSuper = true) public class HttpResponse extends HttpMessage { private int status; private String reasonPhrase; public HttpResponse(String strUrl) { super(strUrl); } public HttpResponse() { } @Override public void setHttpContent(byte[] content, String encoding, FormatType format) { this.httpContent = content; this.encoding = encoding; this.httpContentType = format; } @Override public String getHeaderValue(String name) { String value = this.headers.get(name); if (null == value) { value = this.headers.get(name.toLowerCase()); } return value; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public boolean isSuccess() { return 200 <= this.status && this.status < 300; } public String getReasonPhrase() { return reasonPhrase; } public void setReasonPhrase(String reasonPhrase) { this.reasonPhrase = reasonPhrase; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/HttpUtil.java
package com.aliyuncs.v5.http; import java.io.IOException; import java.net.InetSocketAddress; import java.net.MalformedURLException; import java.net.Proxy; import java.net.SocketAddress; import java.net.URL; import java.util.Map; import java.util.Map.Entry; import javax.xml.bind.DatatypeConverter; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.HttpHost; import com.aliyuncs.v5.exceptions.ClientException; import com.aliyuncs.v5.utils.StringUtils; public class HttpUtil { private final static Log log = LogFactory.getLog(HttpUtil.class); private static Boolean isHttpDebug; private static Boolean isHttpContentDebug; static { Boolean flag = "sdk".equalsIgnoreCase(System.getenv("DEBUG")); isHttpDebug = flag; isHttpContentDebug = flag; } public static Boolean getIsHttpDebug() { return isHttpDebug; } public static void setIsHttpDebug(Boolean isHttpDebug) { HttpUtil.isHttpDebug = isHttpDebug; } public static Boolean getIsHttpContentDebug() { return isHttpContentDebug; } public static void setIsHttpContentDebug(Boolean isHttpContentDebug) { HttpUtil.isHttpContentDebug = isHttpContentDebug; } public static String debugHttpRequest(HttpRequest request) { if (isHttpDebug) { StringBuilder debugString = new StringBuilder(); String sysUrl = request.getSysUrl(); URL url = null; try { url = new URL(sysUrl); debugString.append("> " + request.getSysMethod() + " " + url.getProtocol().toUpperCase() + "/1.1\n> "); debugString.append("Host : " + url.getHost() + "\n> "); } catch (MalformedURLException e) { debugString.append("> " + request.getSysMethod() + " " + sysUrl + "\n> "); debugString.append("Host : " + sysUrl + "\n> "); } Map<String, String> requestHeaders = request.getSysHeaders(); for (Entry<String, String> entry : requestHeaders.entrySet()) { debugString.append(entry.getKey() + " : " + entry.getValue() + "\n> "); } debugString.append("Request URL : " + sysUrl + "\n> "); if (isHttpContentDebug) { try { debugString.append("\n" + request.getHttpContentString()); } catch (ClientException e) { debugString.append("\n" + "Can not parse response due to unsupported encoding : " + request .getSysEncoding()); } } log.info("\n" + debugString); return debugString.toString(); } else { return null; } } public static String debugHttpResponse(HttpResponse response) { if (isHttpDebug) { StringBuilder debugString = new StringBuilder(); String protocol = "HTTP/1.1"; debugString.append("< " + protocol + " " + response.getStatus() + "\n< "); Map<String, String> responseHeaders = response.getSysHeaders(); for (Entry<String, String> entry : responseHeaders.entrySet()) { debugString.append(entry.getKey() + " : " + entry.getValue() + "\n< "); } if (isHttpContentDebug) { try { debugString.append("\n" + response.getHttpContentString()); } catch (ClientException e) { debugString.append("\n" + "Can not parse response due to unsupported encoding : " + response .getSysEncoding()); } } log.info("\n" + debugString); return debugString.toString(); } else { return null; } } public static Proxy getJDKProxy(String clientProxy, String envProxy, HttpRequest request) throws ClientException { Proxy proxy = Proxy.NO_PROXY; try { String proxyStr = (!StringUtils.isEmpty(clientProxy) ? clientProxy : envProxy); if (StringUtils.isEmpty(proxyStr)) { return proxy; } URL proxyUrl = new URL(proxyStr); String userInfo = proxyUrl.getUserInfo(); if (userInfo != null) { byte[] bytes = userInfo.getBytes("UTF-8"); String auth = DatatypeConverter.printBase64Binary(bytes); request.putHeaderParameter("Proxy-Authorization", "Basic " + auth); } String hostname = proxyUrl.getHost(); int port = proxyUrl.getPort(); if (port == -1) { port = proxyUrl.getDefaultPort(); } SocketAddress addr = new InetSocketAddress(hostname, port); proxy = new Proxy(Proxy.Type.HTTP, addr); } catch (IOException e) { throw new ClientException("SDK.InvalidProxy", "proxy url is invalid"); } return proxy; } public static HttpHost getApacheProxy(String clientProxy, String envProxy, HttpRequest request) throws ClientException { try { String proxyStr = (!StringUtils.isEmpty(clientProxy) ? clientProxy : envProxy); if (StringUtils.isEmpty(proxyStr)) { return null; } URL proxyUrl = new URL(proxyStr); String userInfo = proxyUrl.getUserInfo(); if (userInfo != null) { byte[] bytes = userInfo.getBytes("UTF-8"); String auth = DatatypeConverter.printBase64Binary(bytes); request.putHeaderParameter("Proxy-Authorization", "Basic " + auth); } return new HttpHost(proxyUrl.getHost(), proxyUrl.getPort(), proxyUrl.getProtocol()); } catch (IOException e) { throw new ClientException("SDK.InvalidProxy", "proxy url is invalid"); } } public static boolean needProxy(String targetHost, String clientNoProxyList, String envNoProxyList) { String noProxyList = (!StringUtils.isEmpty(clientNoProxyList) ? clientNoProxyList : envNoProxyList); if (StringUtils.isEmpty(noProxyList)) { return true; } String[] noProxyArr = noProxyList.split(","); for (String host : noProxyArr) { if (host.equals(targetHost)) { return false; } } return true; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/IHttpClient.java
package com.aliyuncs.v5.http; import com.aliyuncs.v5.exceptions.ClientException; import java.io.Closeable; import java.io.IOException; import java.util.concurrent.Future; public abstract class IHttpClient implements Closeable { protected HttpClientConfig clientConfig; public IHttpClient(HttpClientConfig clientConfig) throws ClientException { if (clientConfig == null) { clientConfig = HttpClientConfig.getDefault(); } this.clientConfig = clientConfig; init(clientConfig); } public IHttpClient() { // do nothing } protected abstract void init(HttpClientConfig clientConfig) throws ClientException; public abstract HttpResponse syncInvoke(HttpRequest apiRequest) throws IOException, ClientException; public abstract Future<HttpResponse> asyncInvoke(final HttpRequest apiRequest, final CallBack callback) throws IOException; @Deprecated public abstract void ignoreSSLCertificate(); @Deprecated public abstract void restoreSSLCertificate(); public abstract boolean isSingleton(); }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/MethodType.java
package com.aliyuncs.v5.http; public enum MethodType { /** * GET * PUT * POST * DELETE */ GET(false), PUT(true), POST(true), DELETE(false), HEAD(false), OPTIONS(false); private boolean hasContent; MethodType(boolean hasContent) { this.hasContent = hasContent; } public boolean hasContent() { return hasContent; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/ProtocolType.java
package com.aliyuncs.v5.http; public enum ProtocolType { /** * Define HTTP、HTTPS */ HTTP("http"), HTTPS("https"); private final String protocol; ProtocolType(String protocol) { this.protocol = protocol; } @Override public String toString() { return protocol; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/UserAgentConfig.java
package com.aliyuncs.v5.http; import com.aliyuncs.v5.CoreMessage; import com.aliyuncs.v5.utils.StringUtils; import java.util.*; public class UserAgentConfig { static { Properties sysProps = System.getProperties(); DEFAULT_MESSAGE = String.format("AlibabaCloud (%s; %s) Java/%s %s/%s", sysProps.getProperty("os.name"), sysProps .getProperty("os.arch"), sysProps.getProperty("java.runtime.version"), "Core", CoreMessage.coreVersion); } private static String DEFAULT_MESSAGE; private List<String> excludeList = new ArrayList<String>(); private final Map<String, String> userAgents = new LinkedHashMap<String, String>(); public UserAgentConfig() { excludeList.add("java"); excludeList.add("Core"); } public static String getDefaultMessage() { return DEFAULT_MESSAGE; } public void append(String key, String value) { if (StringUtils.isEmpty(key) || StringUtils.isEmpty(value)) { return; } if (excludeList.contains(key.toLowerCase())) { return; } this.userAgents.put(key, value); } public Map<String, String> getSysUserAgentsMap() { return Collections.unmodifiableMap(this.userAgents); } public static String resolve(UserAgentConfig requestConfig, UserAgentConfig clientConfig) { Map<String, String> finalMap = new LinkedHashMap<String, String>(); if (clientConfig != null && clientConfig.getSysUserAgentsMap().size() > 0) { finalMap.putAll(clientConfig.getSysUserAgentsMap()); } if (requestConfig != null && requestConfig.getSysUserAgentsMap().size() > 0) { finalMap.putAll(requestConfig.getSysUserAgentsMap()); } StringBuilder agents = new StringBuilder(DEFAULT_MESSAGE); for (Map.Entry<String, String> entry : finalMap.entrySet()) { agents.append(" "); agents.append(entry.getKey()); agents.append("/"); agents.append(entry.getValue()); } return agents.toString(); } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/X509TrustAll.java
package com.aliyuncs.v5.http; import com.aliyuncs.v5.IAcsClient; @Deprecated public final class X509TrustAll { public static boolean ignoreSSLCerts = false; @Deprecated public static void restoreSSLCertificate() { ignoreSSLCerts = false; } @Deprecated public static void ignoreSSLCertificate() { ignoreSSLCerts = true; } @Deprecated public static void restoreSSLCertificate(IAcsClient client) { ignoreSSLCerts = false; } @Deprecated public static void ignoreSSLCertificate(IAcsClient client) { ignoreSSLCerts = true; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/clients/ApacheHttpClient.java
package com.aliyuncs.v5.http.clients; import com.aliyuncs.v5.exceptions.ClientException; import com.aliyuncs.v5.http.*; import com.aliyuncs.v5.utils.EnvironmentUtils; import com.aliyuncs.v5.utils.IOUtils; import com.aliyuncs.v5.utils.StringUtils; import org.apache.http.Header; import org.apache.http.HttpHost; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.entity.EntityBuilder; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.client.methods.RequestBuilder; import org.apache.http.config.RegistryBuilder; import org.apache.http.conn.ConnectionKeepAliveStrategy; import org.apache.http.conn.socket.ConnectionSocketFactory; import org.apache.http.conn.socket.PlainConnectionSocketFactory; import org.apache.http.conn.ssl.DefaultHostnameVerifier; import org.apache.http.conn.ssl.NoopHostnameVerifier; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.ContentType; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.DefaultConnectionKeepAliveStrategy; import org.apache.http.impl.client.DefaultHttpRequestRetryHandler; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.apache.http.protocol.HttpContext; import org.apache.http.util.EntityUtils; import javax.net.ssl.*; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.security.KeyStore; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; public class ApacheHttpClient extends IHttpClient { protected static final String CONTENT_TYPE = "Content-Type"; protected static final String ACCEPT_ENCODING = "Accept-Encoding"; private static final String EXT_PARAM_KEY_BUILDER = "apache.httpclient.builder"; private static final int DEFAULT_THREAD_KEEP_ALIVE_TIME = 60; private ExecutorService executorService; private CloseableHttpClient httpClient; private PoolingHttpClientConnectionManager connectionManager; private AtomicBoolean initialized = new AtomicBoolean(false); private CountDownLatch latch = new CountDownLatch(1); private static volatile ApacheHttpClient client; /** * use ApacheHttpClient.getInstance() instead */ @Deprecated public static ApacheHttpClient getInstance(HttpClientConfig config) throws ClientException { throw new IllegalStateException("use ApacheHttpClient.getInstance() instead"); } public static ApacheHttpClient getInstance() { if (client == null) { synchronized (ApacheHttpClient.class) { if (client == null) { client = new ApacheHttpClient(); } } } return client; } private ApacheHttpClient() { super(); } private SSLConnectionSocketFactory createSSLConnectionSocketFactory() throws ClientException { try { List<TrustManager> trustManagerList = new ArrayList<TrustManager>(); X509TrustManager[] trustManagers = clientConfig.getX509TrustManagers(); if (null != trustManagers) { trustManagerList.addAll(Arrays.asList(trustManagers)); } // get trustManager using default certification from jdk TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); tmf.init((KeyStore) null); trustManagerList.addAll(Arrays.asList(tmf.getTrustManagers())); final List<X509TrustManager> finalTrustManagerList = new ArrayList<X509TrustManager>(); for (TrustManager tm : trustManagerList) { if (tm instanceof X509TrustManager) { finalTrustManagerList.add((X509TrustManager) tm); } } CompositeX509TrustManager compositeX509TrustManager = new CompositeX509TrustManager(finalTrustManagerList); compositeX509TrustManager.setIgnoreSSLCert(clientConfig.isIgnoreSSLCerts()); KeyManager[] keyManagers = null; if (clientConfig.getKeyManagers() != null) { keyManagers = clientConfig.getKeyManagers(); } SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(keyManagers, new TrustManager[]{compositeX509TrustManager}, clientConfig.getSecureRandom()); HostnameVerifier hostnameVerifier = null; if (clientConfig.isIgnoreSSLCerts()) { hostnameVerifier = new NoopHostnameVerifier(); } else if (clientConfig.getHostnameVerifier() != null) { hostnameVerifier = clientConfig.getHostnameVerifier(); } else { hostnameVerifier = new DefaultHostnameVerifier(); } SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(sslContext, hostnameVerifier); return sslConnectionSocketFactory; } catch (Exception e) { throw new ClientException("SDK.InitFailed", "Init https with SSL socket failed", e); } } private void initConnectionManager() throws ClientException { // http RegistryBuilder<ConnectionSocketFactory> socketFactoryRegistryBuilder = RegistryBuilder.create(); socketFactoryRegistryBuilder.register("http", new PlainConnectionSocketFactory()); // https SSLConnectionSocketFactory sslConnectionSocketFactory = createSSLConnectionSocketFactory(); socketFactoryRegistryBuilder.register("https", sslConnectionSocketFactory); // connPool connectionManager = new PoolingHttpClientConnectionManager(socketFactoryRegistryBuilder.build()); connectionManager.setMaxTotal(clientConfig.getMaxRequests()); connectionManager.setDefaultMaxPerRoute(clientConfig.getMaxRequestsPerHost()); } private HttpClientBuilder initHttpClientBuilder() { HttpClientBuilder builder; if (clientConfig.containsExtParam(EXT_PARAM_KEY_BUILDER)) { builder = (HttpClientBuilder) clientConfig.getExtParam(EXT_PARAM_KEY_BUILDER); } else { builder = HttpClientBuilder.create(); } return builder; } private void initExecutor() { // async if (clientConfig.getExecutorService() == null) { executorService = new ThreadPoolExecutor(0, clientConfig.getMaxRequests(), DEFAULT_THREAD_KEEP_ALIVE_TIME, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), new DefaultAsyncThreadFactory()); } else { executorService = clientConfig.getExecutorService(); } } @Override protected void init(final HttpClientConfig config0) throws ClientException { if (!initialized.compareAndSet(false, true)) { try { latch.await(); } catch (InterruptedException e) { throw new ClientException("SDK.InitFailed", "Init apacheHttpClient failed", e); } return; } final HttpClientConfig config = (config0 != null ? config0 : HttpClientConfig.getDefault()); this.clientConfig = config; HttpClientBuilder builder = initHttpClientBuilder(); // default request config RequestConfig defaultConfig = RequestConfig.custom().setConnectTimeout((int) config .getConnectionTimeoutMillis()).setSocketTimeout((int) config.getReadTimeoutMillis()) .setConnectionRequestTimeout((int) config.getWriteTimeoutMillis()).build(); builder.setDefaultRequestConfig(defaultConfig); initConnectionManager(); builder.setConnectionManager(connectionManager); ApacheIdleConnectionCleaner.registerConnectionManager(connectionManager, config.getMaxIdleTimeMillis()); initExecutor(); builder.setRetryHandler(new DefaultHttpRequestRetryHandler(0, false)); // keepAlive if (config.getKeepAliveDurationMillis() > 0) { builder.setKeepAliveStrategy(new ConnectionKeepAliveStrategy() { @Override public long getKeepAliveDuration(org.apache.http.HttpResponse response, HttpContext context) { long duration = DefaultConnectionKeepAliveStrategy.INSTANCE.getKeepAliveDuration(response, context); if (duration > 0 && duration < config.getKeepAliveDurationMillis()) { return duration; } else { return config.getKeepAliveDurationMillis(); } } }); } httpClient = builder.build(); latch.countDown(); } private HttpUriRequest parseToHttpRequest(HttpRequest apiReq) throws IOException, ClientException { RequestBuilder builder = RequestBuilder.create(apiReq.getSysMethod().name()); builder.setUri(apiReq.getSysUrl()); if (apiReq.getSysMethod().hasContent() && apiReq.getHttpContent() != null && apiReq.getHttpContent().length > 0) { EntityBuilder bodyBuilder = EntityBuilder.create(); String contentType = apiReq.getHeaderValue(CONTENT_TYPE); if (StringUtils.isEmpty(contentType)) { contentType = apiReq.getContentTypeValue(apiReq.getHttpContentType(), apiReq.getSysEncoding()); } bodyBuilder.setContentType(ContentType.parse(contentType)); bodyBuilder.setBinary(apiReq.getHttpContent()); builder.setEntity(bodyBuilder.build()); } builder.addHeader(ACCEPT_ENCODING, "identity"); // calcProxy will modify the "Proxy-Authorization" header of the request HttpHost proxy = calcProxy(apiReq); for (Map.Entry<String, String> entry : apiReq.getSysHeaders().entrySet()) { if ("Content-Length".equalsIgnoreCase(entry.getKey())) { continue; } builder.addHeader(entry.getKey(), entry.getValue()); } int connectTimeout; int readTimeout; if (null != apiReq.getSysConnectTimeout()) { connectTimeout = apiReq.getSysConnectTimeout(); } else { connectTimeout = (int) clientConfig.getConnectionTimeoutMillis(); } if (null != apiReq.getSysReadTimeout()) { readTimeout = apiReq.getSysReadTimeout(); } else { readTimeout = (int) clientConfig.getReadTimeoutMillis(); } RequestConfig requestConfig = RequestConfig.custom().setProxy(proxy).setConnectTimeout(connectTimeout).setSocketTimeout( readTimeout).setConnectionRequestTimeout((int) clientConfig.getWriteTimeoutMillis()).build(); builder.setConfig(requestConfig); return builder.build(); } private HttpHost calcProxy(HttpRequest apiReq) throws MalformedURLException, ClientException { boolean needProxy = HttpUtil.needProxy(new URL(apiReq.getSysUrl()).getHost(), clientConfig.getNoProxy(), EnvironmentUtils.getNoProxy()); if (!needProxy) { return null; } URL url = new URL(apiReq.getSysUrl()); HttpHost proxy = null; if ("https".equalsIgnoreCase(url.getProtocol())) { proxy = HttpUtil.getApacheProxy(clientConfig.getHttpsProxy(), EnvironmentUtils.getHttpsProxy(), apiReq); } else { proxy = HttpUtil.getApacheProxy(clientConfig.getHttpProxy(), EnvironmentUtils.getHttpProxy(), apiReq); } return proxy; } private HttpResponse parseToHttpResponse(org.apache.http.HttpResponse httpResponse) throws IOException { HttpResponse result = new HttpResponse(); // status code result.setStatus(httpResponse.getStatusLine().getStatusCode()); result.setReasonPhrase(httpResponse.getStatusLine().getReasonPhrase()); boolean existed = ((httpResponse.getEntity() != null && (httpResponse.getEntity().getContentLength() > 0 || httpResponse .getEntity().isChunked()))); if (existed) { // content type Header contentTypeHeader = httpResponse.getEntity().getContentType(); ContentType contentType = ContentType.parse(contentTypeHeader.getValue()); FormatType formatType = FormatType.mapAcceptToFormat(contentType.getMimeType()); result.setHttpContentType(formatType); String charset = "utf-8"; if (contentType.getCharset() != null) { charset = contentType.getCharset().toString(); } // body result.setHttpContent(EntityUtils.toByteArray(httpResponse.getEntity()), charset, formatType); } // headers for (Header header : httpResponse.getAllHeaders()) { result.putHeaderParameter(header.getName(), header.getValue()); } return result; } @Override public final HttpResponse syncInvoke(HttpRequest apiRequest) throws IOException, ClientException { HttpUriRequest httpRequest = parseToHttpRequest(apiRequest); CloseableHttpResponse httpResponse = null; try { httpResponse = httpClient.execute(httpRequest); return parseToHttpResponse(httpResponse); } finally { IOUtils.closeQuietly(httpResponse); } } @Override public final Future<HttpResponse> asyncInvoke(final HttpRequest apiRequest, final CallBack callback) { return executorService.submit(new Callable<HttpResponse>() { @Override public HttpResponse call() throws Exception { HttpResponse result; try { result = syncInvoke(apiRequest); } catch (Exception e) { if (callback != null) { callback.onFailure(apiRequest, e); } throw e; } if (callback != null) { callback.onResponse(apiRequest, result); } return result; } }); } /** * use HttpClientConfig.setIgnoreSSLCerts(true) instead */ @Override public void ignoreSSLCertificate() { throw new IllegalStateException("Apache httpclient does not support modify sslFactory after inited, " + "use HttpClientConfig.setIgnoreSSLCerts(true) while building client"); } /** * use HttpClientConfig.setIgnoreSSLCerts(false) instead */ @Override public void restoreSSLCertificate() { throw new IllegalStateException("Apache httpclient does not support modify sslFactory after inited, " + "use HttpClientConfig.setIgnoreSSLCerts(true) while building client"); } @Override public boolean isSingleton() { return true; } @Override public void close() throws IOException { client = null; if (initialized.compareAndSet(true, false)) { executorService.shutdown(); ApacheIdleConnectionCleaner.removeConnectionManager(connectionManager); connectionManager.shutdown(); IOUtils.closeQuietly(httpClient); } } private class DefaultAsyncThreadFactory implements ThreadFactory { private AtomicInteger counter = new AtomicInteger(0); @Override public Thread newThread(Runnable runnable) { return new Thread(runnable, "Aliyun_SDK_Async_ThreadPool_" + counter.incrementAndGet()); } } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/clients/ApacheIdleConnectionCleaner.java
package com.aliyuncs.v5.http.clients; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.conn.HttpClientConnectionManager; import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; public class ApacheIdleConnectionCleaner extends Thread { private static final int DEFAULT_PERIOD_SEC = 60; private static int periodSec = DEFAULT_PERIOD_SEC; private static final Map<HttpClientConnectionManager, Long> CONNMGRMAP = new ConcurrentHashMap<HttpClientConnectionManager, Long>(); private static volatile ApacheIdleConnectionCleaner instance; private volatile boolean isShuttingDown; private static final Log LOG = LogFactory.getLog(ApacheIdleConnectionCleaner.class); public static int getPeriodSec() { return periodSec; } public static void setPeriodSec(int periodSec) { ApacheIdleConnectionCleaner.periodSec = periodSec; } private ApacheIdleConnectionCleaner() { super("sdk-apache-idle-connection-cleaner"); setDaemon(true); } public static void registerConnectionManager(HttpClientConnectionManager connMgr, Long idleTimeMills) { if (instance == null) { synchronized (ApacheIdleConnectionCleaner.class) { if (instance == null) { instance = new ApacheIdleConnectionCleaner(); instance.start(); } } } CONNMGRMAP.put(connMgr, idleTimeMills); } public static void removeConnectionManager(HttpClientConnectionManager connectionManager) { CONNMGRMAP.remove(connectionManager); if (CONNMGRMAP.isEmpty()) { shutdown(); } } public static void shutdown() { if (instance != null) { instance.isShuttingDown = true; instance.interrupt(); CONNMGRMAP.clear(); instance = null; } } @Override public void run() { while (true) { if (isShuttingDown) { LOG.debug("Shutting down."); return; } try { Thread.sleep(periodSec * 1000); for (Entry<HttpClientConnectionManager, Long> entry : CONNMGRMAP.entrySet()) { try { entry.getKey().closeIdleConnections(entry.getValue(), TimeUnit.MILLISECONDS); } catch (Exception t) { LOG.warn("close idle connections failed", t); } } } catch (InterruptedException e) { LOG.debug("interrupted.", e); } } } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/http/clients/CompatibleUrlConnClient.java
package com.aliyuncs.v5.http.clients; import com.aliyuncs.v5.exceptions.ClientException; import com.aliyuncs.v5.http.*; import com.aliyuncs.v5.utils.EnvironmentUtils; import org.apache.http.conn.ssl.DefaultHostnameVerifier; import org.apache.http.conn.ssl.NoopHostnameVerifier; import javax.net.ssl.*; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.Proxy; import java.net.URL; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.Future; public class CompatibleUrlConnClient extends IHttpClient { protected static final String CONTENT_TYPE = "Content-Type"; protected static final String ACCEPT_ENCODING = "Accept-Encoding"; public CompatibleUrlConnClient(HttpClientConfig clientConfig) throws ClientException { super(clientConfig); } public static HttpResponse compatibleGetResponse(HttpRequest request) throws IOException, ClientException { CompatibleUrlConnClient client = new CompatibleUrlConnClient(null); HttpResponse response = client.syncInvoke(request); client.close(); return response; } @Override protected void init(HttpClientConfig clientConfig) { // do nothing } @Override public HttpResponse syncInvoke(HttpRequest request) throws IOException, ClientException { InputStream content = null; HttpResponse response = null; HttpURLConnection httpConn = buildHttpConnection(request); OutputStream out = null; try { httpConn.connect(); if (null != request.getHttpContent() && request.getHttpContent().length > 0) { out = httpConn.getOutputStream(); if (request.getSysMethod().hasContent()) { out.write(request.getHttpContent()); } out.flush(); } content = httpConn.getInputStream(); response = new HttpResponse(httpConn.getURL().toString()); parseHttpConn(response, httpConn, content); return response; } catch (IOException e) { content = httpConn.getErrorStream(); response = new HttpResponse(httpConn.getURL().toString()); parseHttpConn(response, httpConn, content); return response; } finally { if (content != null) { content.close(); } httpConn.disconnect(); } } @Override public Future<HttpResponse> asyncInvoke(HttpRequest apiRequest, CallBack callback) { throw new IllegalStateException("not supported"); } private boolean calcIgnoreSSLCert(HttpRequest request) { boolean ignoreSSLCert = request.isIgnoreSSLCerts() ? request.isIgnoreSSLCerts() : clientConfig.isIgnoreSSLCerts(); return ignoreSSLCert; } private CompositeX509TrustManager calcX509TrustManager(HttpRequest request) throws KeyStoreException, NoSuchAlgorithmException { X509TrustManager[] trustManagers = null; if (clientConfig.getX509TrustManagers() != null) { trustManagers = clientConfig.getX509TrustManagers(); } if (request.getX509TrustManagers() != null) { trustManagers = request.getX509TrustManagers(); } List<TrustManager> trustManagerList = new ArrayList<TrustManager>(); if (null != trustManagers) { trustManagerList.addAll(Arrays.asList(trustManagers)); } // get trustManager using default certification from jdk TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); tmf.init((KeyStore) null); trustManagerList.addAll(Arrays.asList(tmf.getTrustManagers())); final List<X509TrustManager> finalTrustManagerList = new ArrayList<X509TrustManager>(); for (TrustManager tm : trustManagerList) { if (tm instanceof X509TrustManager) { finalTrustManagerList.add((X509TrustManager) tm); } } CompositeX509TrustManager compositeX509TrustManager = new CompositeX509TrustManager(finalTrustManagerList); compositeX509TrustManager.setIgnoreSSLCert(calcIgnoreSSLCert(request)); return compositeX509TrustManager; } private KeyManager[] calcKeyManager(HttpRequest request) { KeyManager[] keyManagers = null; if (clientConfig.getKeyManagers() != null) { keyManagers = clientConfig.getKeyManagers(); } if (request.getKeyManagers() != null) { keyManagers = request.getKeyManagers(); } return keyManagers; } private SSLSocketFactory createSSLSocketFactory(HttpRequest request) throws ClientException { try { CompositeX509TrustManager compositeX509TrustManager = calcX509TrustManager(request); KeyManager[] keyManagers = calcKeyManager(request); SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(keyManagers, new TrustManager[]{compositeX509TrustManager}, clientConfig.getSecureRandom()); return sslContext.getSocketFactory(); } catch (Exception e) { throw new ClientException("SDK.InitFailed", "Init https with SSL socket failed", e); } } private HostnameVerifier createHostnameVerifier(HttpRequest request) { boolean ignoreSSLCert = request.isIgnoreSSLCerts() ? request.isIgnoreSSLCerts() : clientConfig.isIgnoreSSLCerts(); if (ignoreSSLCert) { return new NoopHostnameVerifier(); } else if (clientConfig.getHostnameVerifier() != null) { return clientConfig.getHostnameVerifier(); } else { return new DefaultHostnameVerifier(); } } private void checkHttpRequest(HttpRequest request) { String strUrl = request.getSysUrl(); if (null == strUrl) { throw new IllegalArgumentException("URL is null for HttpRequest."); } if (null == request.getSysMethod()) { throw new IllegalArgumentException("Method is not set for HttpRequest."); } } private Proxy calcProxy(URL url, HttpRequest request) throws ClientException { String targetHost = url.getHost(); boolean needProxy = HttpUtil.needProxy(targetHost, clientConfig.getNoProxy(), EnvironmentUtils.getNoProxy()); if (!needProxy) { return Proxy.NO_PROXY; } Proxy proxy; if ("https".equalsIgnoreCase(url.getProtocol())) { String httpsProxy = EnvironmentUtils.getHttpsProxy(); proxy = HttpUtil.getJDKProxy(clientConfig.getHttpsProxy(), httpsProxy, request); } else { String httpProxy = EnvironmentUtils.getHttpProxy(); proxy = HttpUtil.getJDKProxy(clientConfig.getHttpProxy(), httpProxy, request); } return proxy; } private HttpURLConnection initHttpConnection(URL url, HttpRequest request) throws ClientException, IOException { HttpURLConnection httpConn = null; Proxy proxy = calcProxy(url, request); if ("https".equalsIgnoreCase(url.getProtocol())) { SSLSocketFactory sslSocketFactory = createSSLSocketFactory(request); HttpsURLConnection httpsConn = (HttpsURLConnection) url.openConnection(proxy); httpsConn.setSSLSocketFactory(sslSocketFactory); HostnameVerifier hostnameVerifier = createHostnameVerifier(request); httpsConn.setHostnameVerifier(hostnameVerifier); httpConn = httpsConn; } if (httpConn == null) { httpConn = (HttpURLConnection) url.openConnection(proxy); } httpConn.setRequestMethod(request.getSysMethod().toString()); httpConn.setInstanceFollowRedirects(false); httpConn.setDoOutput(true); httpConn.setDoInput(true); httpConn.setUseCaches(false); setConnectionTimeout(httpConn, request); setConnectionRequestProperty(httpConn, request); return httpConn; } private void setConnectionTimeout(HttpURLConnection httpConn, HttpRequest request) { if (request.getSysConnectTimeout() != null) { httpConn.setConnectTimeout(request.getSysConnectTimeout()); } else { httpConn.setConnectTimeout((int) clientConfig.getConnectionTimeoutMillis()); } if (request.getSysReadTimeout() != null) { httpConn.setReadTimeout(request.getSysReadTimeout()); } else { httpConn.setReadTimeout((int) clientConfig.getReadTimeoutMillis()); } } private void setConnectionRequestProperty(HttpURLConnection httpConn, HttpRequest request) { Map<String, String> mappedHeaders = request.getSysHeaders(); httpConn.setRequestProperty(ACCEPT_ENCODING, "identity"); for (Entry<String, String> entry : mappedHeaders.entrySet()) { httpConn.setRequestProperty(entry.getKey(), entry.getValue()); } if (null != request.getHeaderValue(CONTENT_TYPE)) { httpConn.setRequestProperty(CONTENT_TYPE, request.getHeaderValue(CONTENT_TYPE)); } else { String contentTypeValue = request.getContentTypeValue(request.getHttpContentType(), request .getSysEncoding()); if (null != contentTypeValue) { httpConn.setRequestProperty(CONTENT_TYPE, contentTypeValue); } } } private HttpURLConnection buildHttpConnection(HttpRequest request) throws IOException, ClientException { checkHttpRequest(request); String strUrl = request.getSysUrl(); URL url = null; String[] urlArray = null; if (MethodType.POST.equals(request.getSysMethod()) && null == request.getHttpContent()) { urlArray = strUrl.split("\\?"); url = new URL(urlArray[0]); } else { url = new URL(strUrl); } System.setProperty("sun.net.http.allowRestrictedHeaders", "true"); HttpURLConnection httpConn = initHttpConnection(url, request); if (MethodType.POST.equals(request.getSysMethod()) && null != urlArray && urlArray.length == 2) { httpConn.getOutputStream().write(urlArray[1].getBytes()); } return httpConn; } private void parseHttpConn(HttpResponse response, HttpURLConnection httpConn, InputStream content) throws IOException { byte[] buff = readContent(content); response.setStatus(httpConn.getResponseCode()); response.setReasonPhrase(httpConn.getResponseMessage()); Map<String, List<String>> headers = httpConn.getHeaderFields(); for (Entry<String, List<String>> entry : headers.entrySet()) { String key = entry.getKey(); if (null == key) { continue; } List<String> values = entry.getValue(); StringBuilder builder = new StringBuilder(values.get(0)); for (int i = 1; i < values.size(); i++) { builder.append(","); builder.append(values.get(i)); } response.putHeaderParameter(key, builder.toString()); } String type = response.getHeaderValue("Content-Type"); if (null != buff && null != type) { response.setSysEncoding("UTF-8"); String[] split = type.split(";"); response.setHttpContentType(FormatType.mapAcceptToFormat(split[0].trim())); if (split.length > 1 && split[1].contains("=")) { String[] codings = split[1].split("="); response.setSysEncoding(codings[1].trim().toUpperCase()); } } response.setHttpContent(buff, response.getSysEncoding(), response.getHttpContentType()); } private byte[] readContent(InputStream content) throws IOException { if (content == null) { return null; } ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); byte[] buff = new byte[1024]; while (true) { final int read = content.read(buff); if (read == -1) { break; } outputStream.write(buff, 0, read); } return outputStream.toByteArray(); } /** * use HttpClientConfig.setIgnoreSSLCerts(true) instead */ @Override public void ignoreSSLCertificate() { throw new IllegalStateException("use HttpClientConfig.setIgnoreSSLCerts(true) instead"); } /** * use HttpClientConfig.setIgnoreSSLCerts(false) instead */ @Override public void restoreSSLCertificate() { throw new IllegalStateException("use HttpClientConfig.setIgnoreSSLCerts(false) instead"); } @Override public boolean isSingleton() { return false; } @Override public void close() { // do nothing } /** * use HttpClientConfig.setIgnoreSSLCerts(true/false) instead */ @Deprecated public static final class HttpsCertIgnoreHelper { /** * use HttpClientConfig.setIgnoreSSLCerts(false) instead */ @Deprecated public static void restoreSSLCertificate() { X509TrustAll.ignoreSSLCerts = false; } /** * use HttpClientConfig.setIgnoreSSLCerts(true) instead */ @Deprecated public static void ignoreSSLCertificate() { X509TrustAll.ignoreSSLCerts = true; } } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/profile/DefaultProfile.java
package com.aliyuncs.v5.profile; import com.aliyuncs.v5.auth.*; import com.aliyuncs.v5.endpoint.DefaultEndpointResolver; import com.aliyuncs.v5.exceptions.ClientException; import com.aliyuncs.v5.http.FormatType; import com.aliyuncs.v5.http.HttpClientConfig; import org.slf4j.Logger; import static com.aliyuncs.v5.utils.LogUtils.DEFAULT_LOG_FORMAT; @SuppressWarnings("deprecation") public class DefaultProfile implements IClientProfile { private static DefaultProfile profile = null; private String regionId = null; private FormatType acceptFormat = null; private ICredentialProvider icredential = null; private Credential credential; private String certPath; private HttpClientConfig httpClientConfig = HttpClientConfig.getDefault(); private boolean usingInternalLocationService = false; private boolean usingVpcEndpoint = false; private Logger logger; private String logFormat = DEFAULT_LOG_FORMAT; private boolean isCloseTrace = false; private DefaultProfile() { } private DefaultProfile(String regionId) { this.regionId = regionId; } private DefaultProfile(String regionId, Credential creden) { this.credential = creden; this.regionId = regionId; } private DefaultProfile(String region, ICredentialProvider icredential) { this.regionId = region; this.icredential = icredential; } public synchronized static DefaultProfile getProfile() { if (null == profile) { profile = new DefaultProfile(); } return profile; } public synchronized static DefaultProfile getProfile(String regionId, ICredentialProvider icredential) { profile = new DefaultProfile(regionId, icredential); return profile; } public synchronized static DefaultProfile getProfile(String regionId, String accessKeyId, String secret) { Credential creden = new Credential(accessKeyId, secret); profile = new DefaultProfile(regionId, creden); return profile; } public synchronized static DefaultProfile getProfile(String regionId, String accessKeyId, String secret, String stsToken) { Credential creden = new Credential(accessKeyId, secret, stsToken); profile = new DefaultProfile(regionId, creden); return profile; } public synchronized static DefaultProfile getProfile(String regionId) { return new DefaultProfile(regionId); } /** * @Deprecated : Use addEndpoint(String regionId, String product, String endpoint) instead of this */ @Deprecated public synchronized static void addEndpoint(String endpointName, String regionId, String product, String domain) throws ClientException { addEndpoint(endpointName, regionId, product, domain, true); } /** * @Deprecated : Use addEndpoint(String regionId, String product, String endpoint) instead of this */ @Deprecated public synchronized static void addEndpoint(String endpointName, String regionId, String product, String domain, boolean isNeverExpire) { // endpointName, isNeverExpire take no effect addEndpoint(regionId, product, domain); } public synchronized static void addEndpoint(String regionId, String product, String endpoint) { DefaultEndpointResolver.predefinedEndpointResolver.putEndpointEntry(regionId, product, endpoint); } @Override public synchronized String getRegionId() { return regionId; } @Override public synchronized FormatType getFormat() { return acceptFormat; } @Override public synchronized Credential getCredential() { if (null == credential && null != icredential) { credential = icredential.fresh(); } return credential; } @Override @Deprecated public ISigner getSigner() { return null; } @Override public void setCredentialsProvider(AlibabaCloudCredentialsProvider credentialsProvider) { if (credential != null) { return; } credential = new CredentialsBackupCompatibilityAdaptor(credentialsProvider); } @Override public String getCertPath() { return certPath; } @Override public void setCertPath(String certPath) { this.certPath = certPath; } @Override public HttpClientConfig getHttpClientConfig() { return httpClientConfig; } @Override public void setHttpClientConfig(HttpClientConfig httpClientConfig) { this.httpClientConfig = httpClientConfig; } @Override public void enableUsingInternalLocationService() { usingInternalLocationService = true; } @Override public boolean isUsingInternalLocationService() { return usingInternalLocationService; } @Override public boolean isUsingVpcEndpoint() { return usingVpcEndpoint; } @Override public void enableUsingVpcEndpoint() { this.usingVpcEndpoint = true; } /** * @deprecated : use enableUsingInternalLocationService instead of this. */ @Override @Deprecated public void setUsingInternalLocationService() { enableUsingInternalLocationService(); } @Override public Logger getLogger() { return logger; } @Override public void setLogger(Logger logger) { this.logger = logger; } @Override public String getLogFormat() { return logFormat; } @Override public void setLogFormat(String logFormat) { this.logFormat = logFormat; } @Override public boolean isCloseTrace() { return isCloseTrace; } @Override public void setCloseTrace(boolean closeTrace) { isCloseTrace = closeTrace; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/profile/IClientProfile.java
package com.aliyuncs.v5.profile; import com.aliyuncs.v5.auth.AlibabaCloudCredentialsProvider; import com.aliyuncs.v5.auth.Credential; import com.aliyuncs.v5.auth.ISigner; import com.aliyuncs.v5.http.FormatType; import com.aliyuncs.v5.http.HttpClientConfig; import org.slf4j.Logger; @SuppressWarnings("deprecation") public interface IClientProfile { /** * @Deprecated : Use Signer.getSigner(AlibabaCloudCredentials credentials) instead of this */ @Deprecated ISigner getSigner(); String getRegionId(); FormatType getFormat(); /** * @Deprecated : Use AlibabaCloudCredentialsProvider getCredentials() instead of this */ @Deprecated Credential getCredential(); /** * This method exists because ClientProfile holds too much modules like endpoint management * * @param credentialsProvider */ void setCredentialsProvider(AlibabaCloudCredentialsProvider credentialsProvider); /** * use HttpClientConfig.getCertPath instead */ @Deprecated String getCertPath(); /** * use HttpClientConfig.setCertPath instead * * @param certPath */ @Deprecated void setCertPath(String certPath); /** * http client configs */ HttpClientConfig getHttpClientConfig(); void setHttpClientConfig(HttpClientConfig httpClientConfig); void enableUsingInternalLocationService(); boolean isUsingInternalLocationService(); boolean isUsingVpcEndpoint(); void enableUsingVpcEndpoint(); /** * @Deprecated : Use enableUsingInternalLocationService instead of this */ @Deprecated void setUsingInternalLocationService(); Logger getLogger(); void setLogger(Logger logger); String getLogFormat(); void setLogFormat(String logFormat); boolean isCloseTrace(); void setCloseTrace(boolean closeTrace); }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/reader/JsonReader.java
package com.aliyuncs.v5.reader; import java.text.CharacterIterator; import java.text.StringCharacterIterator; import java.util.HashMap; import java.util.Map; @Deprecated public class JsonReader implements Reader { private static final Object ARRAY_END_TOKEN = new Object(); private static final Object OBJECT_END_TOKEN = new Object(); private static final Object COMMA_TOKEN = new Object(); private static final Object COLON_TOKEN = new Object(); private static final int FIRST_POSITION = 0; private static final int CURRENT_POSITION = 1; private static final int NEXT_POSITION = 2; private static Map<Character, Character> escapes = new HashMap<Character, Character>(); static { escapes.put(Character.valueOf('\\'), Character.valueOf('\\')); escapes.put(Character.valueOf('/'), Character.valueOf('/')); escapes.put(Character.valueOf('"'), Character.valueOf('"')); escapes.put(Character.valueOf('t'), Character.valueOf('\t')); escapes.put(Character.valueOf('n'), Character.valueOf('\n')); escapes.put(Character.valueOf('r'), Character.valueOf('\r')); escapes.put(Character.valueOf('b'), Character.valueOf('\b')); escapes.put(Character.valueOf('f'), Character.valueOf('\f')); } private CharacterIterator ct; private char c; private Object token; private StringBuffer stringBuffer = new StringBuffer(); private Map<String, String> map = new HashMap<String, String>(); public static String trimFromLast(String str, String stripString) { int pos = str.lastIndexOf(stripString); if (pos > -1) { return str.substring(0, pos); } else { return str; } } @Override public Map<String, String> read(String response, String endpoint) { return read(new StringCharacterIterator(response), endpoint, FIRST_POSITION); } @Override public Map<String, String> readForHideArrayItem(String response, String endpoint) { return readForHideItem(new StringCharacterIterator(response), endpoint, FIRST_POSITION); } public Map<String, String> read(CharacterIterator ci, String endpoint, int start) { ct = ci; switch (start) { case FIRST_POSITION: c = ct.first(); break; case CURRENT_POSITION: c = ct.current(); break; case NEXT_POSITION: c = ct.next(); break; default: break; } readJson(endpoint); return map; } public Map<String, String> readForHideItem(CharacterIterator ci, String endpoint, int start) { ct = ci; switch (start) { case FIRST_POSITION: c = ct.first(); break; case CURRENT_POSITION: c = ct.current(); break; case NEXT_POSITION: c = ct.next(); break; } readJsonForHideItem(endpoint); return map; } private Object readJson(String baseKey) { skipWhiteSpace(); char ch = c; nextChar(); switch (ch) { case '{': processObject(baseKey); break; case '}': token = OBJECT_END_TOKEN; break; case '[': if (c == '"') { processList(baseKey); break; } else { processArray(baseKey); break; } case ']': token = ARRAY_END_TOKEN; break; case '"': token = processString(); break; case ',': token = COMMA_TOKEN; break; case ':': token = COLON_TOKEN; break; case 't': nextChar(); nextChar(); nextChar(); token = Boolean.TRUE; break; case 'n': nextChar(); nextChar(); nextChar(); token = null; break; case 'f': nextChar(); nextChar(); nextChar(); nextChar(); token = Boolean.FALSE; break; default: c = ct.previous(); if (Character.isDigit(c) || c == '-') { token = processNumber(); } } return token; } private Object readJsonForHideItem(String baseKey) { skipWhiteSpace(); char ch = c; nextChar(); switch (ch) { case '{': processObjectForHideItemName(baseKey); break; case '}': token = OBJECT_END_TOKEN; break; case '[': if (c == '"') { processListForHideItem(baseKey); break; } else { processArrayForHideItem(baseKey); break; } case ']': token = ARRAY_END_TOKEN; break; case '"': token = processString(); break; case ',': token = COMMA_TOKEN; break; case ':': token = COLON_TOKEN; break; case 't': nextChar(); nextChar(); nextChar(); token = Boolean.TRUE; break; case 'n': nextChar(); nextChar(); nextChar(); token = null; break; case 'f': nextChar(); nextChar(); nextChar(); nextChar(); token = Boolean.FALSE; break; default: c = ct.previous(); if (Character.isDigit(c) || c == '-') { token = processNumber(); } } return token; } private void processObject(String baseKey) { String key = baseKey + "." + readJson(baseKey); while (!token.equals(OBJECT_END_TOKEN)) { readJson(key); if (!token.equals(OBJECT_END_TOKEN)) { Object object = readJson(key); if (object instanceof String || object instanceof Number || object instanceof Boolean) { map.put(key, String.valueOf(object)); } if (readJson(key) == COMMA_TOKEN) { key = String.valueOf(readJson(key)); key = baseKey + "." + key; } } } } private void processObjectForHideItemName(String baseKey) { String key = baseKey + "." + readJsonForHideItem(baseKey); while (!token.equals(OBJECT_END_TOKEN)) { readJsonForHideItem(key); if (!token.equals(OBJECT_END_TOKEN)) { Object object = readJsonForHideItem(key); if (object instanceof String || object instanceof Number || object instanceof Boolean) { map.put(key, String.valueOf(object)); } if (readJson(key) == COMMA_TOKEN) { key = String.valueOf(readJson(key)); key = baseKey + "." + key; } } } } private void processList(String baseKey) { Object value = readJson(baseKey); int index = 0; while (!token.equals(ARRAY_END_TOKEN)) { String key = trimFromLast(baseKey, ".") + "[" + (index++) + "]"; map.put(key, String.valueOf(value)); if (readJson(baseKey) == COMMA_TOKEN) { value = readJson(baseKey); } } map.put(trimFromLast(baseKey, ".") + ".Length", String.valueOf(index)); } private void processListForHideItem(String baseKey) { Object value = readJsonForHideItem(baseKey); int index = 0; while (!token.equals(ARRAY_END_TOKEN)) { String key = baseKey + "[" + (index++) + "]"; map.put(key, String.valueOf(value)); if (readJsonForHideItem(baseKey) == COMMA_TOKEN) { value = readJsonForHideItem(baseKey); } } map.put(baseKey + ".Length", String.valueOf(index)); } private void processArray(String baseKey) { int index = 0; String preKey = baseKey.substring(0, baseKey.lastIndexOf(".")); String key = preKey + "[" + index + "]"; Object value = readJson(key); while (!token.equals(ARRAY_END_TOKEN)) { map.put(preKey + ".Length", String.valueOf(index + 1)); if (value instanceof String) { map.put(key, String.valueOf(value)); } if (readJson(baseKey) == COMMA_TOKEN) { key = preKey + "[" + (++index) + "]"; value = readJson(key); } } } private void processArrayForHideItem(String baseKey) { int index = 0; String preKey = baseKey; String key = preKey + "[" + index + "]"; Object value = readJsonForHideItem(key); while (!token.equals(ARRAY_END_TOKEN)) { map.put(preKey + ".Length", String.valueOf(index + 1)); if (value instanceof String) { map.put(key, String.valueOf(value)); } if (readJsonForHideItem(baseKey) == COMMA_TOKEN) { key = preKey + "[" + (++index) + "]"; value = readJsonForHideItem(key); } } } private Object processNumber() { stringBuffer.setLength(0); if ('-' == c) { addChar(); } addDigits(); if ('.' == c) { addChar(); addDigits(); } if ('e' == c || 'E' == c) { addChar(); if ('+' == c || '-' == c) { addChar(); } addDigits(); } return stringBuffer.toString(); } private void addDigits() { while (Character.isDigit(c)) { addChar(); } } private void skipWhiteSpace() { while (Character.isWhitespace(c)) { nextChar(); } } private char nextChar() { c = ct.next(); return c; } private Object processString() { stringBuffer.setLength(0); while (c != '"') { if (c == '\\') { nextChar(); Object value = escapes.get(Character.valueOf(c)); if (value != null) { addChar(((Character) value).charValue()); } } else { addChar(); } } nextChar(); return stringBuffer.toString(); } private void addChar(char ch) { stringBuffer.append(ch); nextChar(); } private void addChar() { addChar(c); } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/reader/Reader.java
package com.aliyuncs.v5.reader; import com.aliyuncs.v5.exceptions.ClientException; import java.util.Map; @Deprecated public interface Reader { Map<String, String> read(String response, String endpoint) throws ClientException; Map<String, String> readForHideArrayItem(String response, String endpoint) throws ClientException; }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/reader/ReaderFactory.java
package com.aliyuncs.v5.reader; import com.aliyuncs.v5.http.FormatType; @Deprecated public class ReaderFactory { public static Reader createInstance(FormatType format) { if (FormatType.JSON == format) { return new JsonReader(); } if (FormatType.XML == format) { return new XmlReader(); } throw new IllegalStateException("Server response has a bad format type: " + format); } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/reader/XmlReader.java
package com.aliyuncs.v5.reader; import com.aliyuncs.v5.exceptions.ClientException; import com.aliyuncs.v5.utils.XmlUtils; import org.w3c.dom.Element; import org.xml.sax.SAXException; import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; @Deprecated public class XmlReader implements Reader { Map<String, String> map = new HashMap<String, String>(); @Override public Map<String, String> read(String response, String endpoint) throws ClientException { Element root; try { root = XmlUtils.getRootElementFromString(response); read(root, endpoint, false); } catch (ParserConfigurationException e) { new ClientException("SDK.InvalidXMLParser", e.toString()); } catch (SAXException e) { new ClientException("SDK.InvalidXMLFormat", e.toString()); } catch (IOException e) { new ClientException("SDK.InvalidContent", e.toString()); } return map; } @Override public Map<String, String> readForHideArrayItem(String response, String endpoint) throws ClientException { return read(response, endpoint); } private void read(Element element, String path, boolean appendPath) { path = buildPath(element, path, appendPath); List<Element> childElements = XmlUtils.getChildElements(element); if (childElements.size() == 0) { map.put(path, element.getTextContent()); return; } List<Element> listElements = XmlUtils.getChildElements(element, childElements.get(0).getNodeName()); //be list if (listElements.size() > 1 && childElements.size() == listElements.size()) { elementsAsList(childElements, path); //may be list } else if (listElements.size() == 1 && childElements.size() == 1) { //as list elementsAsList(listElements, path); //as not list read(childElements.get(0), path, true); //not list } else { for (Element childElement : childElements) { read(childElement, path, true); } } } private String buildPath(Element element, String path, boolean appendPath) { return appendPath ? path + "." + element.getNodeName() : path; } private void elementsAsList(List<Element> listElements, String path) { map.put(path + ".Length", String.valueOf(listElements.size())); for (int i = 0; i < listElements.size(); i++) { read(listElements.get(i), path + "[" + i + "]", false); } } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/regions/ProductDomain.java
package com.aliyuncs.v5.regions; public class ProductDomain { private String productName; private String domainName; public ProductDomain(String product, String domain) { this.productName = product; this.domainName = domain; } public String getProductName() { return productName; } public void setProductName(String productName) { this.productName = productName; } public String getDomainName() { return domainName; } public void setDomainName(String domainName) { this.domainName = domainName; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/transform/UnmarshallerContext.java
package com.aliyuncs.v5.transform; import com.aliyuncs.v5.http.HttpResponse; import com.aliyuncs.v5.utils.FlattenMapUtil; import java.util.List; import java.util.Map; public class UnmarshallerContext { private int httpStatus; private Map<String, String> responseMap; private HttpResponse httpResponse; public Integer integerValue(String key) { String value = responseMap.get(key); if (null == value || 0 == value.length()) { return null; } return Integer.valueOf(value); } public String stringValue(String key) { return responseMap.get(key); } public Long longValue(String key) { String value = responseMap.get(key); if (null == value || 0 == value.length()) { return null; } return Long.valueOf(responseMap.get(key)); } public Boolean booleanValue(String key) { String value = responseMap.get(key); if (null == value || 0 == value.length()) { return null; } return Boolean.valueOf(responseMap.get(key)); } public Float floatValue(String key) { String value = responseMap.get(key); if (null == value || 0 == value.length()) { return null; } return Float.valueOf(responseMap.get(key)); } public Double doubleValue(String key) { String value = responseMap.get(key); if (null == value || 0 == value.length()) { return null; } return Double.valueOf(responseMap.get(key)); } public int lengthValue(String key) { String value = responseMap.get(key); if (null == value || 0 == value.length()) { return 0; } return Integer.valueOf(responseMap.get(key)); } public List<Map<Object, Object>> listMapValue(String key) { return FlattenMapUtil.toListMap(responseMap, key); } public Map<Object, Object> mapValue(String key) { return FlattenMapUtil.toMap(responseMap, key); } public int getHttpStatus() { return httpStatus; } public void setHttpStatus(int httpStatus) { this.httpStatus = httpStatus; } public Map<String, String> getResponseMap() { return responseMap; } public void setResponseMap(Map<String, String> responseMap) { this.responseMap = responseMap; } public HttpResponse getHttpResponse() { return httpResponse; } public void setHttpResponse(HttpResponse httpResponse) { this.httpResponse = httpResponse; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/unmarshaller/JsonUnmashaller.java
package com.aliyuncs.v5.unmarshaller; import com.aliyuncs.v5.AcsResponse; import com.aliyuncs.v5.exceptions.ClientException; import com.google.gson.Gson; import com.google.gson.JsonSyntaxException; public class JsonUnmashaller implements Unmarshaller { @Override public <T extends AcsResponse> T unmarshal(Class<T> clazz, String content) throws ClientException { try { return (new Gson()).fromJson(content, clazz); } catch (JsonSyntaxException e) { throw newUnmarshalException(clazz, content, e); } } private ClientException newUnmarshalException(Class<?> clazz, String content, Exception e) { return new ClientException("SDK.UnmarshalFailed", "unmarshal response from json content failed, clazz = " + clazz.getSimpleName() + ", origin response = " + content, e); } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/unmarshaller/Unmarshaller.java
package com.aliyuncs.v5.unmarshaller; import com.aliyuncs.v5.AcsResponse; import com.aliyuncs.v5.exceptions.ClientException; public interface Unmarshaller { <T extends AcsResponse> T unmarshal(Class<T> clasz, String content) throws ClientException; }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/unmarshaller/UnmarshallerFactory.java
package com.aliyuncs.v5.unmarshaller; import com.aliyuncs.v5.http.FormatType; public class UnmarshallerFactory { public static Unmarshaller getUnmarshaller(FormatType format) throws IllegalStateException { switch (format) { case JSON: return new JsonUnmashaller(); case XML: return new XmlUnmashaller(); default: throw new IllegalStateException("Unsupported response format: " + format); } } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/unmarshaller/XmlUnmashaller.java
package com.aliyuncs.v5.unmarshaller; import com.aliyuncs.v5.AcsResponse; import com.aliyuncs.v5.exceptions.ClientException; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import java.io.StringReader; public class XmlUnmashaller implements Unmarshaller { @Override public <T extends AcsResponse> T unmarshal(Class<T> clazz, String content) throws ClientException { try { JAXBContext jc = JAXBContext.newInstance(clazz); javax.xml.bind.Unmarshaller unmarshaller = jc.createUnmarshaller(); return (T) unmarshaller.unmarshal(new StringReader(content)); } catch (JAXBException e) { throw newUnmarshalException(clazz, content, e); } } private ClientException newUnmarshalException(Class<?> clazz, String xmlContent, Exception e) { return new ClientException("SDK.UnmarshalFailed", "unmarshal response from xml content failed, clazz = " + clazz.getSimpleName() + ", origin response = " + xmlContent, e); } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/utils/AuthUtils.java
package com.aliyuncs.v5.utils; import java.io.File; import java.io.FileInputStream; import java.io.IOException; public class AuthUtils { private static volatile String clientType = System.getenv("ALIBABA_CLOUD_PROFILE"); private static volatile String environmentAccessKeyId; private static volatile String environmentAccesskeySecret; private static volatile String environmentECSMetaData; private static volatile String environmentCredentialsFile; private static volatile String privateKey; public static String getPrivateKey(String filePath) { if (null == privateKey) { synchronized (AuthUtils.class) { if (null == privateKey) { FileInputStream in = null; byte[] buffer; try { in = new FileInputStream(new File(filePath)); buffer = new byte[in.available()]; in.read(buffer); privateKey = new String(buffer, "UTF-8"); } catch (IOException e) { e.printStackTrace(); } finally { if (in != null) { try { in.close(); } catch (IOException e) { e.printStackTrace(); } } } } } } return privateKey; } public static void setPrivateKey(String key) { privateKey = key; } public static String getClientType() { if (null == clientType) { AuthUtils.clientType = "default"; return AuthUtils.clientType; } else { return AuthUtils.clientType; } } public static void setClientType(String clientType) { AuthUtils.clientType = clientType; } public static String getEnvironmentAccessKeyId() { if (null == AuthUtils.environmentAccessKeyId) { return System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"); } else { return AuthUtils.environmentAccessKeyId; } } public static void setEnvironmentAccessKeyId(String environmentAccessKeyId) { AuthUtils.environmentAccessKeyId = environmentAccessKeyId; } public static String getEnvironmentAccessKeySecret() { if (null == AuthUtils.environmentAccesskeySecret) { return System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"); } else { return AuthUtils.environmentAccesskeySecret; } } public static void setEnvironmentAccessKeySecret(String environmentAccesskeySecret) { AuthUtils.environmentAccesskeySecret = environmentAccesskeySecret; } public static String getEnvironmentECSMetaData() { if (null == AuthUtils.environmentECSMetaData) { return System.getenv("ALIBABA_CLOUD_ECS_METADATA"); } else { return AuthUtils.environmentECSMetaData; } } public static void setEnvironmentECSMetaData(String environmentECSMetaData) { AuthUtils.environmentECSMetaData = environmentECSMetaData; } public static String getEnvironmentCredentialsFile() { if (null == AuthUtils.environmentCredentialsFile) { return System.getenv("ALIBABA_CLOUD_CREDENTIALS_FILE"); } else { return AuthUtils.environmentCredentialsFile; } } public static void setEnvironmentCredentialsFile(String environmentCredentialsFile) { AuthUtils.environmentCredentialsFile = environmentCredentialsFile; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/utils/Base64Helper.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package com.aliyuncs.v5.utils; import java.io.UnsupportedEncodingException; public class Base64Helper { private static final String BASE64_CODE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789" + "+/"; private static final int[] BASE64_DECODE = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }; private static byte[] zeroPad(int length, byte[] bytes) { byte[] padded = new byte[length]; System.arraycopy(bytes, 0, padded, 0, bytes.length); return padded; } public synchronized static String encode(byte[] buff) { if (null == buff) { return null; } StringBuilder strBuilder = new StringBuilder(""); int paddingCount = (3 - (buff.length % 3)) % 3; byte[] stringArray = zeroPad(buff.length + paddingCount, buff); for (int i = 0; i < stringArray.length; i += 3) { int j = ((stringArray[i] & 0xff) << 16) + ((stringArray[i + 1] & 0xff) << 8) + (stringArray[i + 2] & 0xff); strBuilder.append(BASE64_CODE.charAt((j >> 18) & 0x3f)); strBuilder.append(BASE64_CODE.charAt((j >> 12) & 0x3f)); strBuilder.append(BASE64_CODE.charAt((j >> 6) & 0x3f)); strBuilder.append(BASE64_CODE.charAt(j & 0x3f)); } int intPos = strBuilder.length(); for (int i = paddingCount; i > 0; i--) { strBuilder.setCharAt(intPos - i, '='); } return strBuilder.toString(); } public synchronized static String encode(String string, String encoding) throws UnsupportedEncodingException { if (null == string || null == encoding) { return null; } byte[] stringArray = string.getBytes(encoding); return encode(stringArray); } public synchronized static String decode(String string, String encoding) throws UnsupportedEncodingException { if (null == string || null == encoding) { return null; } int posIndex = 0; int decodeLen = string.endsWith("==") ? (string.length() - 2) : string.endsWith("=") ? (string.length() - 1) : string.length(); byte[] buff = new byte[decodeLen * 3 / 4]; int count4 = decodeLen - decodeLen % 4; for (int i = 0; i < count4; i += 4) { int c0 = BASE64_DECODE[string.charAt(i)]; int c1 = BASE64_DECODE[string.charAt(i + 1)]; int c2 = BASE64_DECODE[string.charAt(i + 2)]; int c3 = BASE64_DECODE[string.charAt(i + 3)]; buff[posIndex++] = (byte) (((c0 << 2) | (c1 >> 4)) & 0xFF); buff[posIndex++] = (byte) ((((c1 & 0xF) << 4) | (c2 >> 2)) & 0xFF); buff[posIndex++] = (byte) ((((c2 & 3) << 6) | c3) & 0xFF); } if (2 <= decodeLen % 4) { int c0 = BASE64_DECODE[string.charAt(count4)]; int c1 = BASE64_DECODE[string.charAt(count4 + 1)]; buff[posIndex++] = (byte) (((c0 << 2) | (c1 >> 4)) & 0xFF); if (3 == decodeLen % 4) { int c2 = BASE64_DECODE[string.charAt(count4 + 2)]; buff[posIndex++] = (byte) ((((c1 & 0xF) << 4) | (c2 >> 2)) & 0xFF); } } return new String(buff, encoding); } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/utils/EnvironmentUtils.java
package com.aliyuncs.v5.utils; public class EnvironmentUtils { private static volatile String httpProxy; private static volatile String httpsProxy; private static volatile String noProxy; public static String getHttpProxy() { if (null == httpProxy) { String proxy0 = System.getenv("HTTP_PROXY"); String proxy1 = System.getenv("http_proxy"); return (!StringUtils.isEmpty(proxy0) ? proxy0 : proxy1); } else { return httpProxy; } } public static void setHttpProxy(String httpProxy) { EnvironmentUtils.httpProxy = httpProxy; } public static String getHttpsProxy() { if (null == httpsProxy) { return System.getenv("HTTPS_PROXY"); } else { return httpsProxy; } } public static void setHttpsProxy(String httpsProxy) { EnvironmentUtils.httpsProxy = httpsProxy; } public static String getNoProxy() { if (null == noProxy) { return System.getenv("NO_PROXY"); } else { return noProxy; } } public static void setNoProxy(String noProxy) { EnvironmentUtils.noProxy = noProxy; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/utils/FlattenMapUtil.java
package com.aliyuncs.v5.utils; import java.util.*; public class FlattenMapUtil { public static List<Map<Object, Object>> toListMap(Map<String, String> flattenMap, String prefix) { MapUtils mapUtils = new MapUtils(); return mapUtils.convertMapToListMap(flattenMap, prefix); } public static Map<Object, Object> toMap(Map<String, String> flattenMap, String prefix) { MapUtils mapUtils = new MapUtils(); return mapUtils.convertMapToMap(flattenMap, prefix); } public static Object put(Map<String, String> flattenMap, Object object, String[] subKeys, int subKeysIndex) { if (subKeysIndex >= subKeys.length) { return object; } String key = subKeys[subKeysIndex]; if (key.endsWith("]")) { int index = parseIndex(key); if (index == -1) { return null; } ArrayList<Object> arrayList; if (object == null) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < subKeysIndex; i++) { sb.append(subKeys[i]).append("."); } sb.append(key); int length = parseLength(flattenMap, sb.toString()); if (length == -1) { return null; } arrayList = new ArrayList<Object>(Collections.nCopies(length, null)); } else { arrayList = (ArrayList<Object>) object; } if (subKeys.length == subKeysIndex + 1) { arrayList.set(index, flattenMap.get(stringJoin(".", subKeys))); return arrayList; } else { arrayList.set(index, put(flattenMap, arrayList.get(index), subKeys, subKeysIndex + 1)); return arrayList; } } else { HashMap<Object, Object> hashMap; if (object == null) { hashMap = new HashMap<Object, Object>(); } else { hashMap = (HashMap<Object, Object>) object; } if (subKeys.length == subKeysIndex + 1) { hashMap.put(key, flattenMap.get(stringJoin(".", subKeys))); return hashMap; } else { hashMap.put(key, put(flattenMap, hashMap.get(key), subKeys, subKeysIndex + 1)); return hashMap; } } } public static Object putForMap(Map<String, String> flattenMap, Object object, String[] subKeys, int subKeysIndex) { if (subKeysIndex >= subKeys.length) { return object; } String key = subKeys[subKeysIndex]; if (key.endsWith("]")) { int index = parseIndex(key); if (index == -1) { return null; } if (object != null && !(object instanceof HashMap)) { return null; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < subKeysIndex; i++) { sb.append(subKeys[i]).append("."); } sb.append(key); int length = parseLength(flattenMap, sb.toString()); if (length == -1) { return null; } String name = parseArrayName(key); ArrayList<Object> arrayList; HashMap<Object, Object> hashMap; if (object != null) { hashMap = (HashMap<Object, Object>) object; if (!(hashMap.get(name) instanceof ArrayList)) { arrayList = new ArrayList<Object>(Collections.nCopies(length, null)); hashMap.put(name, arrayList); } else { arrayList = (ArrayList<Object>) hashMap.get(name); } } else { hashMap = new HashMap<Object, Object>(); arrayList = new ArrayList<Object>(Collections.nCopies(length, null)); hashMap.put(name, arrayList); object = hashMap; } if (subKeys.length == subKeysIndex + 1) { arrayList.set(index, flattenMap.get(stringJoin(".", subKeys))); return object; } else { arrayList.set(index, putForMap(flattenMap, arrayList.get(index), subKeys, subKeysIndex + 1)); return object; } } else { HashMap<Object, Object> hashMap; if (object == null) { hashMap = new HashMap<Object, Object>(); } else { hashMap = (HashMap<Object, Object>) object; } if (subKeys.length == subKeysIndex + 1) { hashMap.put(key, flattenMap.get(stringJoin(".", subKeys))); return hashMap; } else { hashMap.put(key, putForMap(flattenMap, hashMap.get(key), subKeys, subKeysIndex + 1)); return hashMap; } } } public static int parseIndex(String key) { int start = key.indexOf("["); int end = key.indexOf("]"); if (start == -1 || end == -1 || end <= start) { return -1; } try { return Integer.parseInt(key.substring(start + 1, end)); } catch (Exception e) { return -1; } } public static int parseLength(Map<String, String> flattenMap, String key) { int end = key.lastIndexOf("["); if (end == -1) { return -1; } try { return Integer.parseInt(flattenMap.get(key.substring(0, end) + ".Length")); } catch (Exception e) { return -1; } } public static String parseArrayName(String key) { if (key == null) { return null; } int end = key.lastIndexOf("["); if (end == -1) { return null; } return key.substring(0, end); } public static String stringJoin(String delimiter, String... sequences) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < sequences.length; i++) { sb.append(sequences[i]); if (i < sequences.length - 1) { sb.append(delimiter); } } return sb.toString(); } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/utils/HttpHeadersInjectAdapter.java
package com.aliyuncs.v5.utils; import com.aliyuncs.v5.AcsRequest; import io.opentracing.propagation.TextMap; import java.util.Iterator; import java.util.Map; public class HttpHeadersInjectAdapter implements TextMap { private AcsRequest request ; public HttpHeadersInjectAdapter(AcsRequest request) { this.request = request; } @Override public void put(String key, String value) { request.putHeaderParameter(key, value); } @Override public Iterator<Map.Entry<String, String>> iterator() { throw new UnsupportedOperationException("This class should be used only with tracer#inject()"); } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/utils/IOUtils.java
package com.aliyuncs.v5.utils; import java.io.Closeable; import java.io.IOException; public class IOUtils { public static void closeQuietly(Closeable closeable) { try { if (closeable != null) { closeable.close(); } } catch (IOException ioe) { // ignore } } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/utils/LogUtils.java
package com.aliyuncs.v5.utils; import com.aliyuncs.v5.exceptions.ClientException; import com.aliyuncs.v5.http.HttpRequest; import com.aliyuncs.v5.http.HttpResponse; import lombok.Getter; import lombok.Setter; import java.net.InetAddress; import java.net.MalformedURLException; import java.net.URL; import java.net.UnknownHostException; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; public class LogUtils { public final static String REQUEST = "{request}"; public final static String RESPONSE = "{response}"; public final static String TS = "{ts}"; public final static String DATE_ISO_8601 = "{date_iso_8601}"; public final static String DATE_COMMON_LOG = "{date_common_log}"; public final static String HOST = "{host}"; public final static String METHOD = "{method}"; public final static String URI = "{uri}"; public final static String VERSION = "{version}"; public final static String TARGET = "{target}"; public final static String HOSTNAME = "{hostname}"; public final static String CODE = "{code}"; public final static String PHRASE = "{phrase}"; public final static String REQ_HEADERS = "{req_headers}"; public final static String RES_HEADERS = "{res_headers}"; public final static String REQ_BODY = "{req_body}"; public final static String RES_BODY = "{res_body}"; public final static String PID = "{pid}"; public final static String COST = "{cost}"; public final static String START_TIME = "{start_time}"; public final static String TIME = "{time}"; public final static String ERROR = "{error}"; public final static String DEFAULT_LOG_FORMAT = "{method} {uri} HTTP/{version} {code} {cost} {hostname} {pid} {error}"; public final static Pattern REQ_HEADER_PATTERN = Pattern.compile("\\{req_header_(.*?)\\}"); public final static Pattern RES_HEADER_PATTERN = Pattern.compile("\\{res_header_(.*?)\\}"); public static String fillContent(String format, LogUnit logUnit) { String content = format.replace(REQUEST, logUnit.getHttpRequest().toString()) .replace(TS, logUnit.getTs()) .replace(DATE_ISO_8601, logUnit.getTs()) .replace(DATE_COMMON_LOG, logUnit.getTs()) .replace(HOST, logUnit.getHost()) .replace(METHOD, logUnit.getMethod()) .replace(URI, logUnit.getUrl()) .replace(VERSION, logUnit.getVersion()) .replace(TARGET, logUnit.getTarget()) .replace(HOSTNAME, logUnit.getHostname()) .replace(ERROR, logUnit.getError()) .replace(REQ_HEADERS, logUnit.getReqHeaders()) .replace(RES_HEADERS, logUnit.getResHeaders()) .replace(REQ_BODY, logUnit.getReqBody()) .replace(PID, logUnit.getPid()) .replace(COST, logUnit.getCost()) .replace(START_TIME, logUnit.getStartTime()) .replace(TIME, logUnit.getTime()); if (null != logUnit.getHttpResponse()) { content = content.replace(RESPONSE, logUnit.getHttpResponse().toString()). replace(RES_BODY, logUnit.getResBody()). replace(PHRASE, logUnit.getPhrase()). replace(CODE, logUnit.getCode()); } Matcher m = REQ_HEADER_PATTERN.matcher(content); while (m.find()) { String headerKey = m.group(1); if (null != logUnit.getHttpRequest().getHeaderValue(headerKey)) { content = content.replace(m.group(), logUnit.getHttpRequest().getHeaderValue(headerKey)); } } m = RES_HEADER_PATTERN.matcher(content); while (m.find()) { String headerKey = m.group(1); if (null != logUnit.getHttpResponse().getHeaderValue(headerKey)) { content = content.replace(m.group(), logUnit.getHttpResponse().getHeaderValue(headerKey)); } } return content; } public static String utcNow() { TimeZone tz = TimeZone.getTimeZone("UTC"); DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss:SSS'Z'"); df.setTimeZone(tz); return df.format(new Date()); } public static String localeNow() { TimeZone tz = TimeZone.getDefault(); DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss:SSS'Z'"); df.setTimeZone(tz); return df.format(new Date()); } public static long getCurrentPID() { String processName = java.lang.management.ManagementFactory.getRuntimeMXBean().getName(); return Long.parseLong(processName.split("@")[0]); } public static String getLocalHostName() { try { return InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { e.printStackTrace(); } return "unknown host name"; } public static LogUnit createLogUnit(HttpRequest httpRequest, HttpResponse httpResponse) { return new LogUnit(httpRequest, httpResponse); } @Getter @Setter public static class LogUnit { private HttpRequest httpRequest; private HttpResponse httpResponse; private String ts; private String host; private String method; private String url; private String version = "1.1"; private String target; private String hostname; private String code; private String phrase; private String reqHeaders; private String resHeaders; private String reqBody; private String resBody; private String pid; private String cost; private String startTime; private String time; private String error; public LogUnit(HttpRequest httpRequest, HttpResponse httpResponse) { this.httpRequest = httpRequest; this.httpResponse = httpResponse; this.ts = utcNow(); try { URL url = new URL(httpRequest.getSysUrl()); this.host = url.getHost(); this.target = ""; String path = url.getPath(); String query = url.getQuery(); String ref = url.getRef(); if (null != path) { this.target += path; } if (null != query) { this.target += "?" + query; } if (null != ref) { this.target += "#" + ref; } } catch (MalformedURLException e) { e.printStackTrace(); } this.method = httpRequest.getSysMethod().name(); this.url = httpRequest.getSysUrl(); this.hostname = getLocalHostName(); this.reqHeaders = httpRequest.getSysHeaders().toString(); try { this.reqBody = httpRequest.getHttpContentString(); if (null != httpResponse) { this.resHeaders = httpResponse.getSysHeaders().toString(); this.code = String.valueOf(httpResponse.getStatus()); this.phrase = (httpResponse.getReasonPhrase() != null ? httpResponse.getReasonPhrase() : ""); this.resBody = httpResponse.getHttpContentString(); } } catch (ClientException e) { e.printStackTrace(); } this.pid = String.valueOf(getCurrentPID()); this.time = localeNow(); } } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/utils/MapUtils.java
package com.aliyuncs.v5.utils; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class MapUtils { public List<Map<Object, Object>> convertMapToListMap(Map<String, String> flattenMap, String prefix) { List<Map<Object, Object>> list = new ArrayList<Map<Object, Object>>(); for (Map.Entry<String, String> entry : flattenMap.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (key.contains(prefix)) { String[] keys = key.replace(prefix, "").split("\\."); String pre = prefix + keys[0]; if (keys[0].contains("[")) { String mapKey = key.replace(pre + ".", ""); int index = Integer.parseInt(keys[0].replace("[", "").replace("]", "")); list = setList(list, index, mapKey, value); } } } return list; } public Map<Object, Object> convertMapToMap(Map<String, String> flattenMap, String prefix) { Map<Object, Object> map = new HashMap<Object, Object>(); for (Map.Entry<String, String> entry : flattenMap.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (key.contains(prefix)) { String[] keys = key.replace(prefix, "").split("\\."); String pre = prefix + keys[0]; String mapKey = key.replace(pre + ".", ""); map = setMap(map, mapKey, value); } } return map; } public static String getMapString(Map<String, String> map) { if (map == null) { return ""; } StringBuilder sb = new StringBuilder("{"); for (Map.Entry<String, String> entry : map.entrySet()) { sb.append("\"").append(entry.getKey()).append("\":\"").append(entry.getValue()).append("\""); } sb.append("}"); return sb.toString(); } private List<Map<Object, Object>> setList(List targetList, int index, String key, String value) { List list = targetList; if (null != key && key.contains("[") && !key.contains(".")) { if (null == list) { list = new ArrayList(); } while (list.size() <= index) { list.add(""); } list.set(index, value); } else { if (null == list) { list = new ArrayList<Map<Object, Object>>(); } while (list.size() <= index) { list.add(new HashMap<Object, Object>()); } list.set(index, setMap((Map<Object, Object>) list.get(index), key, value)); } return list; } private Map<Object, Object> setMap(Map<Object, Object> targetMap, String key, String value) { Map<Object, Object> map = targetMap; if (null == map) { map = new HashMap<Object, Object>(); } if (key.contains("[")) { String[] keys = key.split("\\."); String listKey = key.substring(0, key.indexOf("[")); int index = Integer.parseInt(key.substring(key.indexOf("[") + 1, key.indexOf("]"))); List listObj = (List) map.get(listKey); listObj = setList(listObj, index, key.replace(keys[0] + ".", ""), value); map.put(listKey, listObj); } else if (key.contains(".")) { String[] keys = key.split("\\."); String mapKey = keys[0]; // exclude *.Length if (!(map.get(mapKey) instanceof List) && !"Length".equals(keys[1])) { map.put(mapKey, setMap((Map<Object, Object>) map.get(mapKey), key.replace(keys[0] + ".", ""), value)); } } else { map.put(key, value); } return map; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/utils/ParameterHelper.java
package com.aliyuncs.v5.utils; import com.google.gson.Gson; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.security.MessageDigest; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; public class ParameterHelper { private final static String TIME_ZONE = "GMT"; private final static String FORMAT_ISO8601 = "yyyy-MM-dd'T'HH:mm:ss'Z'"; private final static String FORMAT_RFC2616 = "EEE, dd MMM yyyy HH:mm:ss zzz"; public ParameterHelper() { } public static String getUniqueNonce() { StringBuffer uniqueNonce = new StringBuffer(); UUID uuid = UUID.randomUUID(); uniqueNonce.append(uuid.toString()); uniqueNonce.append(System.currentTimeMillis()); uniqueNonce.append(Thread.currentThread().getId()); return uniqueNonce.toString(); } public static String getISO8601Time(Date date) { SimpleDateFormat df = new SimpleDateFormat(FORMAT_ISO8601); df.setTimeZone(new SimpleTimeZone(0, TIME_ZONE)); return df.format(date); } public static String getRFC2616Date(Date date) { SimpleDateFormat df = new SimpleDateFormat(FORMAT_RFC2616, Locale.ENGLISH); df.setTimeZone(new SimpleTimeZone(0, TIME_ZONE)); return df.format(date); } public static Date parse(String strDate) throws ParseException { if (null == strDate || "".equals(strDate)) { return null; } // The format contains 4 ' if (strDate.length() == FORMAT_ISO8601.length() - 4) { return parseISO8601(strDate); } else if (strDate.length() == FORMAT_RFC2616.length()) { return parseRFC2616(strDate); } return null; } public static Date parseISO8601(String strDate) throws ParseException { if (null == strDate || "".equals(strDate)) { return null; } // The format contains 4 ' symbol if (strDate.length() != (FORMAT_ISO8601.length() - 4)) { return null; } SimpleDateFormat df = new SimpleDateFormat(FORMAT_ISO8601); df.setTimeZone(new SimpleTimeZone(0, TIME_ZONE)); return df.parse(strDate); } public static Date parseRFC2616(String strDate) throws ParseException { if (null == strDate || "".equals(strDate) || strDate.length() != FORMAT_RFC2616.length()) { return null; } SimpleDateFormat df = new SimpleDateFormat(FORMAT_RFC2616, Locale.ENGLISH); df.setTimeZone(new SimpleTimeZone(0, TIME_ZONE)); return df.parse(strDate); } public static String md5Sum(byte[] buff) { try { MessageDigest md = MessageDigest.getInstance("MD5"); byte[] messageDigest = md.digest(buff); return Base64Helper.encode(messageDigest); } catch (Exception e) { // TODO: should not eat the excepiton } return null; } public static byte[] getXmlData(Map<String, String> params) throws UnsupportedEncodingException { StringBuilder xml = new StringBuilder(); xml.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); Iterator<Map.Entry<String, String>> entries = params.entrySet().iterator(); while (entries.hasNext()) { Map.Entry<String, String> entry = entries.next(); xml.append("<" + entry.getKey() + ">"); xml.append(entry.getValue()); xml.append("</" + entry.getKey() + ">"); } return xml.toString().getBytes("UTF-8"); } public static byte[] getJsonData(Map<String, String> params) throws UnsupportedEncodingException { String json = new Gson().toJson(params); return json.getBytes("UTF-8"); } public static byte[] getFormData(Map<String, String> params) throws UnsupportedEncodingException { StringBuilder result = new StringBuilder(); boolean first = true; for (Map.Entry<String, String> entry : params.entrySet()) { if (first) { first = false; } else { result.append("&"); } result.append(URLEncoder.encode(entry.getKey(), "UTF-8")); result.append("="); result.append(URLEncoder.encode(entry.getValue(), "UTF-8")); } return result.toString().getBytes("UTF-8"); } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/utils/StringUtils.java
package com.aliyuncs.v5.utils; public class StringUtils { public static boolean isEmpty(final CharSequence cs) { return cs == null || cs.length() == 0; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/utils/TraceUtils.java
package com.aliyuncs.v5.utils; import io.opentracing.Span; import io.opentracing.tag.Tags; import java.io.PrintWriter; import java.io.StringWriter; import java.util.HashMap; import java.util.Map; public class TraceUtils { public static void onError(Throwable throwable, Span span) { Tags.ERROR.set(span, Boolean.TRUE); if (throwable != null) { span.log(errorLogs(throwable)); } } private static Map<String, Object> errorLogs(Throwable throwable) { Map<String, Object> errorLogs = new HashMap<String, Object>(10); errorLogs.put("event", Tags.ERROR.getKey()); errorLogs.put("error.object", throwable); errorLogs.put("error.kind", throwable.getClass().getName()); String message = throwable.getCause() != null ? throwable.getCause().getMessage() : throwable.getMessage(); if (message != null) { errorLogs.put("message", message); } StringWriter sw = new StringWriter(); throwable.printStackTrace(new PrintWriter(sw)); errorLogs.put("stack", sw.toString()); return errorLogs; } }
0
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5
java-sources/com/aliyun/aliyun-java-sdk-core-v5/5.0.2/com/aliyuncs/v5/utils/XmlUtils.java
package com.aliyuncs.v5.utils; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; import java.io.StringReader; import java.util.ArrayList; import java.util.List; public final class XmlUtils { public static Document getDocument(String payload) throws ParserConfigurationException, SAXException, IOException { if (payload == null || payload.length() < 1) { return null; } StringReader sr = new StringReader(payload); InputSource source = new InputSource(sr); Document doc = null; try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = dbf.newDocumentBuilder(); doc = builder.parse(source); } finally { IOUtils.closeQuietly(source.getByteStream()); } return doc; } public static Element getRootElementFromString(String payload) throws ParserConfigurationException, SAXException, IOException { Document doc = getDocument(payload); if (doc == null) { return null; } return doc.getDocumentElement(); } public static List<Element> getChildElements(Element parent, String tagName) { if (null == parent) { return null; } NodeList nodes = parent.getElementsByTagName(tagName); List<Element> elements = new ArrayList<Element>(); for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); if (node.getParentNode() == parent) { elements.add((Element) node); } } return elements; } public static List<Element> getChildElements(Element parent) { if (null == parent) { return null; } NodeList nodes = parent.getChildNodes(); List<Element> elements = new ArrayList<Element>(); for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { elements.add((Element) node); } } return elements; } }
0
java-sources/com/aliyun/aliyun-java-sdk-couponnew/1.0.2/com/aliyuncs/couponnew/model
java-sources/com/aliyun/aliyun-java-sdk-couponnew/1.0.2/com/aliyuncs/couponnew/model/v20190401/GetCouponFullTemplatePageRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.couponnew.model.v20190401; import com.aliyuncs.RpcAcsRequest; /** * @author auto create * @version */ public class GetCouponFullTemplatePageRequest extends RpcAcsRequest<GetCouponFullTemplatePageResponse> { public GetCouponFullTemplatePageRequest() { super("CouponNew", "2019-04-01", "GetCouponFullTemplatePage"); } private String fromApp; private String param; private Integer pageNo; private Integer pageSize; public String getFromApp() { return this.fromApp; } public void setFromApp(String fromApp) { this.fromApp = fromApp; if(fromApp != null){ putQueryParameter("FromApp", fromApp); } } public String getParam() { return this.param; } public void setParam(String param) { this.param = param; if(param != null){ putQueryParameter("Param", param); } } public Integer getPageNo() { return this.pageNo; } public void setPageNo(Integer pageNo) { this.pageNo = pageNo; if(pageNo != null){ putQueryParameter("PageNo", pageNo.toString()); } } public Integer getPageSize() { return this.pageSize; } public void setPageSize(Integer pageSize) { this.pageSize = pageSize; if(pageSize != null){ putQueryParameter("PageSize", pageSize.toString()); } } @Override public Class<GetCouponFullTemplatePageResponse> getResponseClass() { return GetCouponFullTemplatePageResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-couponnew/1.0.2/com/aliyuncs/couponnew/model
java-sources/com/aliyun/aliyun-java-sdk-couponnew/1.0.2/com/aliyuncs/couponnew/model/v20190401/GetCouponFullTemplatePageResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.couponnew.model.v20190401; import com.aliyuncs.AcsResponse; import com.aliyuncs.couponnew.transform.v20190401.GetCouponFullTemplatePageResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetCouponFullTemplatePageResponse extends AcsResponse { private String requestId; private Boolean success; private String code; private String message; private String data; public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public Boolean getSuccess() { return this.success; } public void setSuccess(Boolean success) { this.success = success; } public String getCode() { return this.code; } public void setCode(String code) { this.code = code; } public String getMessage() { return this.message; } public void setMessage(String message) { this.message = message; } public String getData() { return this.data; } public void setData(String data) { this.data = data; } @Override public GetCouponFullTemplatePageResponse getInstance(UnmarshallerContext context) { return GetCouponFullTemplatePageResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-couponnew/1.0.2/com/aliyuncs/couponnew/model
java-sources/com/aliyun/aliyun-java-sdk-couponnew/1.0.2/com/aliyuncs/couponnew/model/v20190401/GetHasCouponUidListRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.couponnew.model.v20190401; import com.aliyuncs.RpcAcsRequest; /** * @author auto create * @version */ public class GetHasCouponUidListRequest extends RpcAcsRequest<GetHasCouponUidListResponse> { public GetHasCouponUidListRequest() { super("CouponNew", "2019-04-01", "GetHasCouponUidList"); } private String fromApp; private String param; private String idempotentToken; public String getFromApp() { return this.fromApp; } public void setFromApp(String fromApp) { this.fromApp = fromApp; if(fromApp != null){ putQueryParameter("FromApp", fromApp); } } public String getParam() { return this.param; } public void setParam(String param) { this.param = param; if(param != null){ putQueryParameter("Param", param); } } public String getIdempotentToken() { return this.idempotentToken; } public void setIdempotentToken(String idempotentToken) { this.idempotentToken = idempotentToken; if(idempotentToken != null){ putQueryParameter("IdempotentToken", idempotentToken); } } @Override public Class<GetHasCouponUidListResponse> getResponseClass() { return GetHasCouponUidListResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-couponnew/1.0.2/com/aliyuncs/couponnew/model
java-sources/com/aliyun/aliyun-java-sdk-couponnew/1.0.2/com/aliyuncs/couponnew/model/v20190401/GetHasCouponUidListResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.couponnew.model.v20190401; import com.aliyuncs.AcsResponse; import com.aliyuncs.couponnew.transform.v20190401.GetHasCouponUidListResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetHasCouponUidListResponse extends AcsResponse { private String requestId; private Boolean success; private String code; private String message; private Boolean isIdempotentResp; private String data; public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public Boolean getSuccess() { return this.success; } public void setSuccess(Boolean success) { this.success = success; } public String getCode() { return this.code; } public void setCode(String code) { this.code = code; } public String getMessage() { return this.message; } public void setMessage(String message) { this.message = message; } public Boolean getIsIdempotentResp() { return this.isIdempotentResp; } public void setIsIdempotentResp(Boolean isIdempotentResp) { this.isIdempotentResp = isIdempotentResp; } public String getData() { return this.data; } public void setData(String data) { this.data = data; } @Override public GetHasCouponUidListResponse getInstance(UnmarshallerContext context) { return GetHasCouponUidListResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-couponnew/1.0.2/com/aliyuncs/couponnew/transform
java-sources/com/aliyun/aliyun-java-sdk-couponnew/1.0.2/com/aliyuncs/couponnew/transform/v20190401/GetCouponFullTemplatePageResponseUnmarshaller.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.couponnew.transform.v20190401; import com.aliyuncs.couponnew.model.v20190401.GetCouponFullTemplatePageResponse; import com.aliyuncs.transform.UnmarshallerContext; public class GetCouponFullTemplatePageResponseUnmarshaller { public static GetCouponFullTemplatePageResponse unmarshall(GetCouponFullTemplatePageResponse getCouponFullTemplatePageResponse, UnmarshallerContext context) { getCouponFullTemplatePageResponse.setRequestId(context.stringValue("GetCouponFullTemplatePageResponse.RequestId")); getCouponFullTemplatePageResponse.setSuccess(context.booleanValue("GetCouponFullTemplatePageResponse.Success")); getCouponFullTemplatePageResponse.setCode(context.stringValue("GetCouponFullTemplatePageResponse.Code")); getCouponFullTemplatePageResponse.setMessage(context.stringValue("GetCouponFullTemplatePageResponse.Message")); getCouponFullTemplatePageResponse.setData(context.stringValue("GetCouponFullTemplatePageResponse.Data")); return getCouponFullTemplatePageResponse; } }
0
java-sources/com/aliyun/aliyun-java-sdk-couponnew/1.0.2/com/aliyuncs/couponnew/transform
java-sources/com/aliyun/aliyun-java-sdk-couponnew/1.0.2/com/aliyuncs/couponnew/transform/v20190401/GetHasCouponUidListResponseUnmarshaller.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.couponnew.transform.v20190401; import com.aliyuncs.couponnew.model.v20190401.GetHasCouponUidListResponse; import com.aliyuncs.transform.UnmarshallerContext; public class GetHasCouponUidListResponseUnmarshaller { public static GetHasCouponUidListResponse unmarshall(GetHasCouponUidListResponse getHasCouponUidListResponse, UnmarshallerContext context) { getHasCouponUidListResponse.setRequestId(context.stringValue("GetHasCouponUidListResponse.RequestId")); getHasCouponUidListResponse.setSuccess(context.booleanValue("GetHasCouponUidListResponse.Success")); getHasCouponUidListResponse.setCode(context.stringValue("GetHasCouponUidListResponse.Code")); getHasCouponUidListResponse.setMessage(context.stringValue("GetHasCouponUidListResponse.Message")); getHasCouponUidListResponse.setIsIdempotentResp(context.booleanValue("GetHasCouponUidListResponse.IsIdempotentResp")); getHasCouponUidListResponse.setData(context.stringValue("GetHasCouponUidListResponse.Data")); return getHasCouponUidListResponse; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/Endpoint.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr; import java.util.HashMap; public class Endpoint { public static HashMap<String, String> endpointMap = new HashMap<String, String>() {}; public static String endpointRegionalType = "regional"; }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/CancelRepoBuildRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class CancelRepoBuildRequest extends RoaAcsRequest<CancelRepoBuildResponse> { private String buildId; private String repoNamespace; private String repoName; public CancelRepoBuildRequest() { super("cr", "2016-06-07", "CancelRepoBuild", "acr"); setUriPattern("/repos/[RepoNamespace]/[RepoName]/build/[BuildId]/cancel"); setMethod(MethodType.POST); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getBuildId() { return this.buildId; } public void setBuildId(String buildId) { this.buildId = buildId; if(buildId != null){ putPathParameter("BuildId", buildId); } } public String getRepoNamespace() { return this.repoNamespace; } public void setRepoNamespace(String repoNamespace) { this.repoNamespace = repoNamespace; if(repoNamespace != null){ putPathParameter("RepoNamespace", repoNamespace); } } public String getRepoName() { return this.repoName; } public void setRepoName(String repoName) { this.repoName = repoName; if(repoName != null){ putPathParameter("RepoName", repoName); } } @Override public Class<CancelRepoBuildResponse> getResponseClass() { return CancelRepoBuildResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/CancelRepoBuildResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.CancelRepoBuildResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class CancelRepoBuildResponse extends AcsResponse { @Override public CancelRepoBuildResponse getInstance(UnmarshallerContext context) { return CancelRepoBuildResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/CreateNamespaceRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class CreateNamespaceRequest extends RoaAcsRequest<CreateNamespaceResponse> { public CreateNamespaceRequest() { super("cr", "2016-06-07", "CreateNamespace", "acr"); setUriPattern("/namespace"); setMethod(MethodType.PUT); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } @Override public Class<CreateNamespaceResponse> getResponseClass() { return CreateNamespaceResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/CreateNamespaceResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.CreateNamespaceResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class CreateNamespaceResponse extends AcsResponse { @Override public CreateNamespaceResponse getInstance(UnmarshallerContext context) { return CreateNamespaceResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/CreateRepoBuildRuleRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class CreateRepoBuildRuleRequest extends RoaAcsRequest<CreateRepoBuildRuleResponse> { private String repoNamespace; private String repoName; public CreateRepoBuildRuleRequest() { super("cr", "2016-06-07", "CreateRepoBuildRule", "acr"); setUriPattern("/repos/[RepoNamespace]/[RepoName]/rules"); setMethod(MethodType.PUT); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getRepoNamespace() { return this.repoNamespace; } public void setRepoNamespace(String repoNamespace) { this.repoNamespace = repoNamespace; if(repoNamespace != null){ putPathParameter("RepoNamespace", repoNamespace); } } public String getRepoName() { return this.repoName; } public void setRepoName(String repoName) { this.repoName = repoName; if(repoName != null){ putPathParameter("RepoName", repoName); } } @Override public Class<CreateRepoBuildRuleResponse> getResponseClass() { return CreateRepoBuildRuleResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/CreateRepoBuildRuleResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.CreateRepoBuildRuleResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class CreateRepoBuildRuleResponse extends AcsResponse { @Override public CreateRepoBuildRuleResponse getInstance(UnmarshallerContext context) { return CreateRepoBuildRuleResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/CreateRepoRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class CreateRepoRequest extends RoaAcsRequest<CreateRepoResponse> { public CreateRepoRequest() { super("cr", "2016-06-07", "CreateRepo", "acr"); setUriPattern("/repos"); setMethod(MethodType.PUT); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } @Override public Class<CreateRepoResponse> getResponseClass() { return CreateRepoResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/CreateRepoResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.CreateRepoResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class CreateRepoResponse extends AcsResponse { @Override public CreateRepoResponse getInstance(UnmarshallerContext context) { return CreateRepoResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/CreateRepoWebhookRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class CreateRepoWebhookRequest extends RoaAcsRequest<CreateRepoWebhookResponse> { private String repoNamespace; private String repoName; public CreateRepoWebhookRequest() { super("cr", "2016-06-07", "CreateRepoWebhook", "acr"); setUriPattern("/repos/[RepoNamespace]/[RepoName]/webhooks"); setMethod(MethodType.PUT); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getRepoNamespace() { return this.repoNamespace; } public void setRepoNamespace(String repoNamespace) { this.repoNamespace = repoNamespace; if(repoNamespace != null){ putPathParameter("RepoNamespace", repoNamespace); } } public String getRepoName() { return this.repoName; } public void setRepoName(String repoName) { this.repoName = repoName; if(repoName != null){ putPathParameter("RepoName", repoName); } } @Override public Class<CreateRepoWebhookResponse> getResponseClass() { return CreateRepoWebhookResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/CreateRepoWebhookResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.CreateRepoWebhookResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class CreateRepoWebhookResponse extends AcsResponse { @Override public CreateRepoWebhookResponse getInstance(UnmarshallerContext context) { return CreateRepoWebhookResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/CreateUserInfoRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class CreateUserInfoRequest extends RoaAcsRequest<CreateUserInfoResponse> { public CreateUserInfoRequest() { super("cr", "2016-06-07", "CreateUserInfo", "acr"); setUriPattern("/users"); setMethod(MethodType.PUT); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } @Override public Class<CreateUserInfoResponse> getResponseClass() { return CreateUserInfoResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/CreateUserInfoResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.CreateUserInfoResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class CreateUserInfoResponse extends AcsResponse { @Override public CreateUserInfoResponse getInstance(UnmarshallerContext context) { return CreateUserInfoResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/DeleteImageRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class DeleteImageRequest extends RoaAcsRequest<DeleteImageResponse> { private String repoNamespace; private String repoName; private String tag; public DeleteImageRequest() { super("cr", "2016-06-07", "DeleteImage", "acr"); setUriPattern("/repos/[RepoNamespace]/[RepoName]/tags/[Tag]"); setMethod(MethodType.DELETE); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getRepoNamespace() { return this.repoNamespace; } public void setRepoNamespace(String repoNamespace) { this.repoNamespace = repoNamespace; if(repoNamespace != null){ putPathParameter("RepoNamespace", repoNamespace); } } public String getRepoName() { return this.repoName; } public void setRepoName(String repoName) { this.repoName = repoName; if(repoName != null){ putPathParameter("RepoName", repoName); } } public String getTag() { return this.tag; } public void setTag(String tag) { this.tag = tag; if(tag != null){ putPathParameter("Tag", tag); } } @Override public Class<DeleteImageResponse> getResponseClass() { return DeleteImageResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/DeleteImageResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.DeleteImageResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class DeleteImageResponse extends AcsResponse { @Override public DeleteImageResponse getInstance(UnmarshallerContext context) { return DeleteImageResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/DeleteNamespaceRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class DeleteNamespaceRequest extends RoaAcsRequest<DeleteNamespaceResponse> { private String namespace; public DeleteNamespaceRequest() { super("cr", "2016-06-07", "DeleteNamespace", "acr"); setUriPattern("/namespace/[Namespace]"); setMethod(MethodType.DELETE); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getNamespace() { return this.namespace; } public void setNamespace(String namespace) { this.namespace = namespace; if(namespace != null){ putPathParameter("Namespace", namespace); } } @Override public Class<DeleteNamespaceResponse> getResponseClass() { return DeleteNamespaceResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/DeleteNamespaceResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.DeleteNamespaceResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class DeleteNamespaceResponse extends AcsResponse { @Override public DeleteNamespaceResponse getInstance(UnmarshallerContext context) { return DeleteNamespaceResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/DeleteRepoBuildRuleRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class DeleteRepoBuildRuleRequest extends RoaAcsRequest<DeleteRepoBuildRuleResponse> { private Long buildRuleId; private String repoNamespace; private String repoName; public DeleteRepoBuildRuleRequest() { super("cr", "2016-06-07", "DeleteRepoBuildRule", "acr"); setUriPattern("/repos/[RepoNamespace]/[RepoName]/rules/[BuildRuleId]"); setMethod(MethodType.DELETE); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public Long getBuildRuleId() { return this.buildRuleId; } public void setBuildRuleId(Long buildRuleId) { this.buildRuleId = buildRuleId; if(buildRuleId != null){ putPathParameter("BuildRuleId", buildRuleId.toString()); } } public String getRepoNamespace() { return this.repoNamespace; } public void setRepoNamespace(String repoNamespace) { this.repoNamespace = repoNamespace; if(repoNamespace != null){ putPathParameter("RepoNamespace", repoNamespace); } } public String getRepoName() { return this.repoName; } public void setRepoName(String repoName) { this.repoName = repoName; if(repoName != null){ putPathParameter("RepoName", repoName); } } @Override public Class<DeleteRepoBuildRuleResponse> getResponseClass() { return DeleteRepoBuildRuleResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/DeleteRepoBuildRuleResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.DeleteRepoBuildRuleResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class DeleteRepoBuildRuleResponse extends AcsResponse { @Override public DeleteRepoBuildRuleResponse getInstance(UnmarshallerContext context) { return DeleteRepoBuildRuleResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/DeleteRepoRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class DeleteRepoRequest extends RoaAcsRequest<DeleteRepoResponse> { private String repoNamespace; private String repoName; public DeleteRepoRequest() { super("cr", "2016-06-07", "DeleteRepo", "acr"); setUriPattern("/repos/[RepoNamespace]/[RepoName]"); setMethod(MethodType.DELETE); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getRepoNamespace() { return this.repoNamespace; } public void setRepoNamespace(String repoNamespace) { this.repoNamespace = repoNamespace; if(repoNamespace != null){ putPathParameter("RepoNamespace", repoNamespace); } } public String getRepoName() { return this.repoName; } public void setRepoName(String repoName) { this.repoName = repoName; if(repoName != null){ putPathParameter("RepoName", repoName); } } @Override public Class<DeleteRepoResponse> getResponseClass() { return DeleteRepoResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/DeleteRepoResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.DeleteRepoResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class DeleteRepoResponse extends AcsResponse { @Override public DeleteRepoResponse getInstance(UnmarshallerContext context) { return DeleteRepoResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/DeleteRepoWebhookRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class DeleteRepoWebhookRequest extends RoaAcsRequest<DeleteRepoWebhookResponse> { private Long webhookId; private String repoNamespace; private String repoName; public DeleteRepoWebhookRequest() { super("cr", "2016-06-07", "DeleteRepoWebhook", "acr"); setUriPattern("/repos/[RepoNamespace]/[RepoName]/webhooks/[WebhookId]"); setMethod(MethodType.DELETE); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public Long getWebhookId() { return this.webhookId; } public void setWebhookId(Long webhookId) { this.webhookId = webhookId; if(webhookId != null){ putPathParameter("WebhookId", webhookId.toString()); } } public String getRepoNamespace() { return this.repoNamespace; } public void setRepoNamespace(String repoNamespace) { this.repoNamespace = repoNamespace; if(repoNamespace != null){ putPathParameter("RepoNamespace", repoNamespace); } } public String getRepoName() { return this.repoName; } public void setRepoName(String repoName) { this.repoName = repoName; if(repoName != null){ putPathParameter("RepoName", repoName); } } @Override public Class<DeleteRepoWebhookResponse> getResponseClass() { return DeleteRepoWebhookResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/DeleteRepoWebhookResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.DeleteRepoWebhookResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class DeleteRepoWebhookResponse extends AcsResponse { @Override public DeleteRepoWebhookResponse getInstance(UnmarshallerContext context) { return DeleteRepoWebhookResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetAuthorizationTokenRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class GetAuthorizationTokenRequest extends RoaAcsRequest<GetAuthorizationTokenResponse> { public GetAuthorizationTokenRequest() { super("cr", "2016-06-07", "GetAuthorizationToken", "acr"); setUriPattern("/tokens"); setMethod(MethodType.GET); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } @Override public Class<GetAuthorizationTokenResponse> getResponseClass() { return GetAuthorizationTokenResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetAuthorizationTokenResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.GetAuthorizationTokenResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetAuthorizationTokenResponse extends AcsResponse { @Override public GetAuthorizationTokenResponse getInstance(UnmarshallerContext context) { return GetAuthorizationTokenResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetImageLayerRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class GetImageLayerRequest extends RoaAcsRequest<GetImageLayerResponse> { private String repoNamespace; private String repoName; private String tag; public GetImageLayerRequest() { super("cr", "2016-06-07", "GetImageLayer", "acr"); setUriPattern("/repos/[RepoNamespace]/[RepoName]/tags/[Tag]/layers"); setMethod(MethodType.GET); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getRepoNamespace() { return this.repoNamespace; } public void setRepoNamespace(String repoNamespace) { this.repoNamespace = repoNamespace; if(repoNamespace != null){ putPathParameter("RepoNamespace", repoNamespace); } } public String getRepoName() { return this.repoName; } public void setRepoName(String repoName) { this.repoName = repoName; if(repoName != null){ putPathParameter("RepoName", repoName); } } public String getTag() { return this.tag; } public void setTag(String tag) { this.tag = tag; if(tag != null){ putPathParameter("Tag", tag); } } @Override public Class<GetImageLayerResponse> getResponseClass() { return GetImageLayerResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetImageLayerResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.GetImageLayerResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetImageLayerResponse extends AcsResponse { @Override public GetImageLayerResponse getInstance(UnmarshallerContext context) { return GetImageLayerResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetImageManifestRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class GetImageManifestRequest extends RoaAcsRequest<GetImageManifestResponse> { private Integer schemaVersion; private String repoNamespace; private String repoName; private String tag; public GetImageManifestRequest() { super("cr", "2016-06-07", "GetImageManifest", "acr"); setUriPattern("/repos/[RepoNamespace]/[RepoName]/tags/[Tag]/manifest"); setMethod(MethodType.GET); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public Integer getSchemaVersion() { return this.schemaVersion; } public void setSchemaVersion(Integer schemaVersion) { this.schemaVersion = schemaVersion; if(schemaVersion != null){ putQueryParameter("SchemaVersion", schemaVersion.toString()); } } public String getRepoNamespace() { return this.repoNamespace; } public void setRepoNamespace(String repoNamespace) { this.repoNamespace = repoNamespace; if(repoNamespace != null){ putPathParameter("RepoNamespace", repoNamespace); } } public String getRepoName() { return this.repoName; } public void setRepoName(String repoName) { this.repoName = repoName; if(repoName != null){ putPathParameter("RepoName", repoName); } } public String getTag() { return this.tag; } public void setTag(String tag) { this.tag = tag; if(tag != null){ putPathParameter("Tag", tag); } } @Override public Class<GetImageManifestResponse> getResponseClass() { return GetImageManifestResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetImageManifestResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.GetImageManifestResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetImageManifestResponse extends AcsResponse { @Override public GetImageManifestResponse getInstance(UnmarshallerContext context) { return GetImageManifestResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetNamespaceListRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class GetNamespaceListRequest extends RoaAcsRequest<GetNamespaceListResponse> { private String authorize; private String status; public GetNamespaceListRequest() { super("cr", "2016-06-07", "GetNamespaceList", "acr"); setUriPattern("/namespace"); setMethod(MethodType.GET); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getAuthorize() { return this.authorize; } public void setAuthorize(String authorize) { this.authorize = authorize; if(authorize != null){ putQueryParameter("Authorize", authorize); } } public String getStatus() { return this.status; } public void setStatus(String status) { this.status = status; if(status != null){ putQueryParameter("Status", status); } } @Override public Class<GetNamespaceListResponse> getResponseClass() { return GetNamespaceListResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetNamespaceListResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.GetNamespaceListResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetNamespaceListResponse extends AcsResponse { @Override public GetNamespaceListResponse getInstance(UnmarshallerContext context) { return GetNamespaceListResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetNamespaceRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class GetNamespaceRequest extends RoaAcsRequest<GetNamespaceResponse> { private String namespace; public GetNamespaceRequest() { super("cr", "2016-06-07", "GetNamespace", "acr"); setUriPattern("/namespace/[Namespace]"); setMethod(MethodType.GET); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getNamespace() { return this.namespace; } public void setNamespace(String namespace) { this.namespace = namespace; if(namespace != null){ putPathParameter("Namespace", namespace); } } @Override public Class<GetNamespaceResponse> getResponseClass() { return GetNamespaceResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetNamespaceResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.GetNamespaceResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetNamespaceResponse extends AcsResponse { @Override public GetNamespaceResponse getInstance(UnmarshallerContext context) { return GetNamespaceResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetRegionListRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class GetRegionListRequest extends RoaAcsRequest<GetRegionListResponse> { public GetRegionListRequest() { super("cr", "2016-06-07", "GetRegionList", "acr"); setUriPattern("/regions"); setMethod(MethodType.GET); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } @Override public Class<GetRegionListResponse> getResponseClass() { return GetRegionListResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetRegionListResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.GetRegionListResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetRegionListResponse extends AcsResponse { @Override public GetRegionListResponse getInstance(UnmarshallerContext context) { return GetRegionListResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetRepoBuildListRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class GetRepoBuildListRequest extends RoaAcsRequest<GetRepoBuildListResponse> { private String repoNamespace; private String repoName; private Integer pageSize; private Integer page; public GetRepoBuildListRequest() { super("cr", "2016-06-07", "GetRepoBuildList", "acr"); setUriPattern("/repos/[RepoNamespace]/[RepoName]/build"); setMethod(MethodType.GET); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getRepoNamespace() { return this.repoNamespace; } public void setRepoNamespace(String repoNamespace) { this.repoNamespace = repoNamespace; if(repoNamespace != null){ putPathParameter("RepoNamespace", repoNamespace); } } public String getRepoName() { return this.repoName; } public void setRepoName(String repoName) { this.repoName = repoName; if(repoName != null){ putPathParameter("RepoName", repoName); } } public Integer getPageSize() { return this.pageSize; } public void setPageSize(Integer pageSize) { this.pageSize = pageSize; if(pageSize != null){ putQueryParameter("PageSize", pageSize.toString()); } } public Integer getPage() { return this.page; } public void setPage(Integer page) { this.page = page; if(page != null){ putQueryParameter("Page", page.toString()); } } @Override public Class<GetRepoBuildListResponse> getResponseClass() { return GetRepoBuildListResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetRepoBuildListResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.GetRepoBuildListResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetRepoBuildListResponse extends AcsResponse { @Override public GetRepoBuildListResponse getInstance(UnmarshallerContext context) { return GetRepoBuildListResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetRepoBuildRuleListRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class GetRepoBuildRuleListRequest extends RoaAcsRequest<GetRepoBuildRuleListResponse> { private String repoNamespace; private String repoName; public GetRepoBuildRuleListRequest() { super("cr", "2016-06-07", "GetRepoBuildRuleList", "acr"); setUriPattern("/repos/[RepoNamespace]/[RepoName]/rules"); setMethod(MethodType.GET); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getRepoNamespace() { return this.repoNamespace; } public void setRepoNamespace(String repoNamespace) { this.repoNamespace = repoNamespace; if(repoNamespace != null){ putPathParameter("RepoNamespace", repoNamespace); } } public String getRepoName() { return this.repoName; } public void setRepoName(String repoName) { this.repoName = repoName; if(repoName != null){ putPathParameter("RepoName", repoName); } } @Override public Class<GetRepoBuildRuleListResponse> getResponseClass() { return GetRepoBuildRuleListResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetRepoBuildRuleListResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.GetRepoBuildRuleListResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetRepoBuildRuleListResponse extends AcsResponse { @Override public GetRepoBuildRuleListResponse getInstance(UnmarshallerContext context) { return GetRepoBuildRuleListResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetRepoBuildStatusRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class GetRepoBuildStatusRequest extends RoaAcsRequest<GetRepoBuildStatusResponse> { private String buildId; private String repoNamespace; private String repoName; public GetRepoBuildStatusRequest() { super("cr", "2016-06-07", "GetRepoBuildStatus", "acr"); setUriPattern("/repos/[RepoNamespace]/[RepoName]/build/[BuildId]/status"); setMethod(MethodType.GET); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getBuildId() { return this.buildId; } public void setBuildId(String buildId) { this.buildId = buildId; if(buildId != null){ putPathParameter("BuildId", buildId); } } public String getRepoNamespace() { return this.repoNamespace; } public void setRepoNamespace(String repoNamespace) { this.repoNamespace = repoNamespace; if(repoNamespace != null){ putPathParameter("RepoNamespace", repoNamespace); } } public String getRepoName() { return this.repoName; } public void setRepoName(String repoName) { this.repoName = repoName; if(repoName != null){ putPathParameter("RepoName", repoName); } } @Override public Class<GetRepoBuildStatusResponse> getResponseClass() { return GetRepoBuildStatusResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetRepoBuildStatusResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.GetRepoBuildStatusResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetRepoBuildStatusResponse extends AcsResponse { @Override public GetRepoBuildStatusResponse getInstance(UnmarshallerContext context) { return GetRepoBuildStatusResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetRepoListByNamespaceRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class GetRepoListByNamespaceRequest extends RoaAcsRequest<GetRepoListByNamespaceResponse> { private String repoNamespace; private Integer pageSize; private Integer page; private String status; public GetRepoListByNamespaceRequest() { super("cr", "2016-06-07", "GetRepoListByNamespace", "acr"); setUriPattern("/repos/[RepoNamespace]"); setMethod(MethodType.GET); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getRepoNamespace() { return this.repoNamespace; } public void setRepoNamespace(String repoNamespace) { this.repoNamespace = repoNamespace; if(repoNamespace != null){ putPathParameter("RepoNamespace", repoNamespace); } } public Integer getPageSize() { return this.pageSize; } public void setPageSize(Integer pageSize) { this.pageSize = pageSize; if(pageSize != null){ putQueryParameter("PageSize", pageSize.toString()); } } public Integer getPage() { return this.page; } public void setPage(Integer page) { this.page = page; if(page != null){ putQueryParameter("Page", page.toString()); } } public String getStatus() { return this.status; } public void setStatus(String status) { this.status = status; if(status != null){ putQueryParameter("Status", status); } } @Override public Class<GetRepoListByNamespaceResponse> getResponseClass() { return GetRepoListByNamespaceResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetRepoListByNamespaceResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.GetRepoListByNamespaceResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetRepoListByNamespaceResponse extends AcsResponse { @Override public GetRepoListByNamespaceResponse getInstance(UnmarshallerContext context) { return GetRepoListByNamespaceResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetRepoListRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class GetRepoListRequest extends RoaAcsRequest<GetRepoListResponse> { private Integer pageSize; private Integer page; private String status; public GetRepoListRequest() { super("cr", "2016-06-07", "GetRepoList", "acr"); setUriPattern("/repos"); setMethod(MethodType.GET); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public Integer getPageSize() { return this.pageSize; } public void setPageSize(Integer pageSize) { this.pageSize = pageSize; if(pageSize != null){ putQueryParameter("PageSize", pageSize.toString()); } } public Integer getPage() { return this.page; } public void setPage(Integer page) { this.page = page; if(page != null){ putQueryParameter("Page", page.toString()); } } public String getStatus() { return this.status; } public void setStatus(String status) { this.status = status; if(status != null){ putQueryParameter("Status", status); } } @Override public Class<GetRepoListResponse> getResponseClass() { return GetRepoListResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetRepoListResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.GetRepoListResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetRepoListResponse extends AcsResponse { @Override public GetRepoListResponse getInstance(UnmarshallerContext context) { return GetRepoListResponseUnmarshaller.unmarshall(this, context); } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetRepoRequest.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.RoaAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.cr.Endpoint; /** * @author auto create * @version */ public class GetRepoRequest extends RoaAcsRequest<GetRepoResponse> { private String repoNamespace; private String repoName; public GetRepoRequest() { super("cr", "2016-06-07", "GetRepo", "acr"); setUriPattern("/repos/[RepoNamespace]/[RepoName]"); setMethod(MethodType.GET); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getRepoNamespace() { return this.repoNamespace; } public void setRepoNamespace(String repoNamespace) { this.repoNamespace = repoNamespace; if(repoNamespace != null){ putPathParameter("RepoNamespace", repoNamespace); } } public String getRepoName() { return this.repoName; } public void setRepoName(String repoName) { this.repoName = repoName; if(repoName != null){ putPathParameter("RepoName", repoName); } } @Override public Class<GetRepoResponse> getResponseClass() { return GetRepoResponse.class; } }
0
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model
java-sources/com/aliyun/aliyun-java-sdk-cr/4.1.5/com/aliyuncs/cr/model/v20160607/GetRepoResponse.java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.cr.model.v20160607; import com.aliyuncs.AcsResponse; import com.aliyuncs.cr.transform.v20160607.GetRepoResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetRepoResponse extends AcsResponse { @Override public GetRepoResponse getInstance(UnmarshallerContext context) { return GetRepoResponseUnmarshaller.unmarshall(this, context); } }