use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSUdfOperation method deleteUdf.
public void deleteUdf(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, null);
params.put(RequestParameters.SUBRESOURCE_UDF_NAME, udfName);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.DELETE).setParameters(params).setOriginalRequest(genericRequest).build();
doOperation(request, emptyResponseParser, null, null);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class OSSUdfOperation method upgradeUdfApplication.
/**
* UDF Application CLT
*/
public void upgradeUdfApplication(UpgradeUdfApplicationRequest upgradeUdfApplicationRequest) throws OSSException, ClientException {
assertParameterNotNull(upgradeUdfApplicationRequest, "upgradeUdfApplicationRequest");
String udfName = upgradeUdfApplicationRequest.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);
params.put(RequestParameters.SUBRESOURCE_COMP, RequestParameters.COMP_UPGRADE);
byte[] rawContent = RequestMarshallers.upgradeUdfApplicationRequestMarshaller.marshall(upgradeUdfApplicationRequest);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.POST).setParameters(params).setInputSize(rawContent.length).setInputStream(new ByteArrayInputStream(rawContent)).setOriginalRequest(upgradeUdfApplicationRequest).build();
doOperation(request, emptyResponseParser, null, null);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class LiveChannelOperation method setLiveChannelStatus.
public void setLiveChannelStatus(SetLiveChannelRequest setLiveChannelRequest) throws OSSException, ClientException {
assertParameterNotNull(setLiveChannelRequest, "setLiveChannelRequest");
String bucketName = setLiveChannelRequest.getBucketName();
String liveChannelName = setLiveChannelRequest.getLiveChannelName();
assertParameterNotNull(bucketName, "bucketName");
ensureBucketNameValid(bucketName);
assertParameterNotNull(liveChannelName, "liveChannelName");
ensureLiveChannelNameValid(liveChannelName);
Map<String, String> parameters = new HashMap<String, String>();
parameters.put(RequestParameters.SUBRESOURCE_LIVE, null);
parameters.put(RequestParameters.SUBRESOURCE_STATUS, setLiveChannelRequest.getLiveChannelStatus().toString());
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.PUT).setBucket(bucketName).setKey(liveChannelName).setParameters(parameters).setOriginalRequest(setLiveChannelRequest).build();
doOperation(request, emptyResponseParser, bucketName, liveChannelName);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class LiveChannelOperation method getLiveChannelInfo.
public LiveChannelInfo getLiveChannelInfo(LiveChannelGenericRequest liveChannelGenericRequest) throws OSSException, ClientException {
assertParameterNotNull(liveChannelGenericRequest, "liveChannelGenericRequest");
String bucketName = liveChannelGenericRequest.getBucketName();
String liveChannelName = liveChannelGenericRequest.getLiveChannelName();
assertParameterNotNull(bucketName, "bucketName");
ensureBucketNameValid(bucketName);
assertParameterNotNull(liveChannelName, "liveChannelName");
ensureLiveChannelNameValid(liveChannelName);
Map<String, String> parameters = new HashMap<String, String>();
parameters.put(RequestParameters.SUBRESOURCE_LIVE, null);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.GET).setBucket(bucketName).setKey(liveChannelName).setParameters(parameters).setOriginalRequest(liveChannelGenericRequest).build();
return doOperation(request, getLiveChannelInfoResponseParser, bucketName, liveChannelName, true);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class LiveChannelOperation method generateVodPlaylist.
public void generateVodPlaylist(GenerateVodPlaylistRequest generateVodPlaylistRequest) throws OSSException, ClientException {
assertParameterNotNull(generateVodPlaylistRequest, "generateVodPlaylistRequest");
String bucketName = generateVodPlaylistRequest.getBucketName();
String liveChannelName = generateVodPlaylistRequest.getLiveChannelName();
String playlistName = generateVodPlaylistRequest.getPlaylistName();
Long startTime = generateVodPlaylistRequest.getStratTime();
Long endTime = generateVodPlaylistRequest.getEndTime();
assertParameterNotNull(bucketName, "bucketName");
ensureBucketNameValid(bucketName);
assertParameterNotNull(liveChannelName, "liveChannelName");
ensureLiveChannelNameValid(liveChannelName);
assertParameterNotNull(playlistName, "playlistName");
assertParameterNotNull(startTime, "stratTime");
assertParameterNotNull(endTime, "endTime");
Map<String, String> parameters = new HashMap<String, String>();
parameters.put(RequestParameters.SUBRESOURCE_VOD, null);
parameters.put(RequestParameters.SUBRESOURCE_START_TIME, startTime.toString());
parameters.put(RequestParameters.SUBRESOURCE_END_TIME, endTime.toString());
String key = liveChannelName + "/" + playlistName;
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.POST).setBucket(bucketName).setKey(key).setParameters(parameters).setInputStream(new ByteArrayInputStream(new byte[0])).setInputSize(0).setOriginalRequest(generateVodPlaylistRequest).build();
doOperation(request, emptyResponseParser, bucketName, key);
}
Aggregations