use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class CORSOperation method optionsObject.
/**
* Options object.
*/
public ResponseMessage optionsObject(OptionsRequest optionsRequest) {
assertParameterNotNull(optionsRequest, "optionsRequest");
String bucketName = optionsRequest.getBucketName();
assertParameterNotNull(bucketName, "bucketName");
ensureBucketNameValid(bucketName);
@SuppressWarnings("deprecation") RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.OPTIONS).setBucket(bucketName).setKey(optionsRequest.getObjectName()).addHeader(OSSHeaders.ORIGIN, optionsRequest.getOrigin()).addHeader(OSSHeaders.ACCESS_CONTROL_REQUEST_METHOD, optionsRequest.getRequestMethod().name()).addHeader(OSSHeaders.ACCESS_CONTROL_REQUEST_HEADER, optionsRequest.getRequestHeaders()).setOriginalRequest(optionsRequest).build();
return doOperation(request, emptyResponseParser, bucketName, null);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class LiveChannelOperation method getLiveChannelStat.
public LiveChannelStat getLiveChannelStat(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);
parameters.put(RequestParameters.SUBRESOURCE_COMP, RequestParameters.STAT);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.GET).setBucket(bucketName).setKey(liveChannelName).setParameters(parameters).setOriginalRequest(liveChannelGenericRequest).build();
return doOperation(request, getLiveChannelStatResponseParser, bucketName, liveChannelName, true);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class LiveChannelOperation method getLiveChannelHistory.
public List<LiveRecord> getLiveChannelHistory(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);
parameters.put(RequestParameters.SUBRESOURCE_COMP, RequestParameters.HISTORY);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.GET).setBucket(bucketName).setKey(liveChannelName).setParameters(parameters).setOriginalRequest(liveChannelGenericRequest).build();
return doOperation(request, getLiveChannelHistoryResponseParser, bucketName, liveChannelName, true);
}
use of com.aliyun.oss.common.comm.RequestMessage in project aliyun-oss-java-sdk by aliyun.
the class LiveChannelOperation method deleteLiveChannel.
public void deleteLiveChannel(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.DELETE).setBucket(bucketName).setKey(liveChannelName).setParameters(parameters).setOriginalRequest(liveChannelGenericRequest).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 createLiveChannel.
public CreateLiveChannelResult createLiveChannel(CreateLiveChannelRequest createLiveChannelRequest) throws OSSException, ClientException {
assertParameterNotNull(createLiveChannelRequest, "createLiveChannelRequest");
String bucketName = createLiveChannelRequest.getBucketName();
String liveChannelName = createLiveChannelRequest.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);
byte[] rawContent = createLiveChannelRequestMarshaller.marshall(createLiveChannelRequest);
Map<String, String> headers = new HashMap<String, String>();
addRequestRequiredHeaders(headers, rawContent);
RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.PUT).setBucket(bucketName).setKey(liveChannelName).setParameters(parameters).setHeaders(headers).setInputSize(rawContent.length).setInputStream(new ByteArrayInputStream(rawContent)).setOriginalRequest(createLiveChannelRequest).build();
List<ResponseHandler> reponseHandlers = new ArrayList<ResponseHandler>();
reponseHandlers.add(new OSSCallbackErrorResponseHandler());
return doOperation(request, createLiveChannelResponseParser, bucketName, liveChannelName, true);
}
Aggregations