use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSUdfOperation method getUdfImageInfo.
public List<UdfImageInfo> getUdfImageInfo(UdfGenericRequest genericRequest) throws OSSException, ClientException {
assertParameterNotNull(genericRequest, "genericRequest");
String udfName = genericRequest.getName();
assertParameterNotNull(udfName, "udfName");
ensureBucketNameValid(udfName);
Map<String, String> params = new HashMap<String, String>();
params.put(RequestParameters.SUBRESOURCE_UDF_IMAGE, null);
params.put(RequestParameters.SUBRESOURCE_UDF_NAME, udfName);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.GET).setParameters(params).setOriginalRequest(genericRequest).build();
return doOperation(request, ResponseParsers.getUdfImageInfoResponseParser, null, null, true);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSUdfOperation method getUdfApplicationLog.
public UdfApplicationLog getUdfApplicationLog(GetUdfApplicationLogRequest getUdfApplicationLogRequest) throws OSSException, ClientException {
assertParameterNotNull(getUdfApplicationLogRequest, "resizeUdfApplicationRequest");
String udfName = getUdfApplicationLogRequest.getName();
assertParameterNotNull(udfName, "udfName");
ensureBucketNameValid(udfName);
Map<String, String> params = new HashMap<String, String>();
populateGetUdfApplicationLogParameters(params, getUdfApplicationLogRequest);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.GET).setParameters(params).setOriginalRequest(getUdfApplicationLogRequest).build();
ProgressListener listener = getUdfApplicationLogRequest.getProgressListener();
UdfApplicationLog udfApplicationLog = null;
try {
publishProgress(listener, ProgressEventType.TRANSFER_STARTED_EVENT);
udfApplicationLog = doOperation(request, new GetUdfApplicationLogResponseParser(udfName), null, null, true);
InputStream instream = udfApplicationLog.getLogContent();
ProgressInputStream progressInputStream = new ProgressInputStream(instream, listener) {
@Override
protected void onEOF() {
publishProgress(getListener(), ProgressEventType.TRANSFER_COMPLETED_EVENT);
}
};
CRC64 crc = new CRC64();
CheckedInputStream checkedInputstream = new CheckedInputStream(progressInputStream, crc);
udfApplicationLog.setLogContent(checkedInputstream);
} catch (RuntimeException e) {
publishProgress(listener, ProgressEventType.TRANSFER_FAILED_EVENT);
throw e;
}
return udfApplicationLog;
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSUdfOperation method getUdfApplicationInfo.
public UdfApplicationInfo getUdfApplicationInfo(UdfGenericRequest genericRequest) throws OSSException, ClientException {
assertParameterNotNull(genericRequest, "genericRequest");
String udfName = genericRequest.getName();
assertParameterNotNull(udfName, "udfName");
ensureBucketNameValid(udfName);
Map<String, String> params = new HashMap<String, String>();
params.put(RequestParameters.SUBRESOURCE_UDF_APPLICATION, null);
params.put(RequestParameters.SUBRESOURCE_UDF_NAME, udfName);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.GET).setParameters(params).setOriginalRequest(genericRequest).build();
return doOperation(request, ResponseParsers.getUdfApplicationInfoResponseParser, null, null, true);
}
Aggregations