热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

com.amazonaws.transform.JsonUnmarshallerContext.getHttpResponse()方法的使用及代码示例

本文整理了Java中com.amazonaws.transform.JsonUnmarshallerContext.getHttpResponse()方法的一些代码示例

本文整理了Java中com.amazonaws.transform.JsonUnmarshallerContext.getHttpResponse()方法的一些代码示例,展示了JsonUnmarshallerContext.getHttpResponse()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonUnmarshallerContext.getHttpResponse()方法的具体详情如下:
包路径:com.amazonaws.transform.JsonUnmarshallerContext
类名称:JsonUnmarshallerContext
方法名:getHttpResponse

JsonUnmarshallerContext.getHttpResponse介绍

[英]Returns the original HttpResponse constructed for this request. Returns null by default.
[中]返回为此请求构造的原始HttpResponse。默认情况下返回null。

代码示例

代码示例来源:origin: aws/aws-sdk-java

public PutMediaResult unmarshall(JsonUnmarshallerContext context) throws Exception {
PutMediaResult putMediaResult = new PutMediaResult();
putMediaResult.setPayload(context.getHttpResponse().getContent());
return putMediaResult;
}

代码示例来源:origin: aws/aws-sdk-java

public InvokeAsyncResult unmarshall(JsonUnmarshallerContext context) throws Exception {
InvokeAsyncResult invokeAsyncResult = new InvokeAsyncResult();
invokeAsyncResult.setStatus(context.getHttpResponse().getStatusCode());
return invokeAsyncResult;
}

代码示例来源:origin: aws/aws-sdk-java

public GetIntrospectionSchemaResult unmarshall(JsonUnmarshallerContext context) throws Exception {
GetIntrospectionSchemaResult getIntrospectiOnSchemaResult= new GetIntrospectionSchemaResult();
java.io.InputStream is = context.getHttpResponse().getContent();
if (is != null) {
try {
getIntrospectionSchemaResult.setSchema(java.nio.ByteBuffer.wrap(com.amazonaws.util.IOUtils.toByteArray(is)));
} finally {
com.amazonaws.util.IOUtils.closeQuietly(is, null);
}
}
return getIntrospectionSchemaResult;
}

代码示例来源:origin: aws/aws-sdk-java

public DeleteThingShadowResult unmarshall(JsonUnmarshallerContext context) throws Exception {
DeleteThingShadowResult deleteThingShadowResult = new DeleteThingShadowResult();
java.io.InputStream is = context.getHttpResponse().getContent();
if (is != null) {
try {
deleteThingShadowResult.setPayload(java.nio.ByteBuffer.wrap(com.amazonaws.util.IOUtils.toByteArray(is)));
} finally {
com.amazonaws.util.IOUtils.closeQuietly(is, null);
}
}
return deleteThingShadowResult;
}

代码示例来源:origin: aws/aws-sdk-java

public GetThingShadowResult unmarshall(JsonUnmarshallerContext context) throws Exception {
GetThingShadowResult getThingShadowResult = new GetThingShadowResult();
java.io.InputStream is = context.getHttpResponse().getContent();
if (is != null) {
try {
getThingShadowResult.setPayload(java.nio.ByteBuffer.wrap(com.amazonaws.util.IOUtils.toByteArray(is)));
} finally {
com.amazonaws.util.IOUtils.closeQuietly(is, null);
}
}
return getThingShadowResult;
}

代码示例来源:origin: aws/aws-sdk-java

public UpdateThingShadowResult unmarshall(JsonUnmarshallerContext context) throws Exception {
UpdateThingShadowResult updateThingShadowResult = new UpdateThingShadowResult();
java.io.InputStream is = context.getHttpResponse().getContent();
if (is != null) {
try {
updateThingShadowResult.setPayload(java.nio.ByteBuffer.wrap(com.amazonaws.util.IOUtils.toByteArray(is)));
} finally {
com.amazonaws.util.IOUtils.closeQuietly(is, null);
}
}
return updateThingShadowResult;
}

代码示例来源:origin: aws/aws-sdk-java

@Override
public RawResult unmarshall(JsonUnmarshallerContext in) throws IOException {
HttpResponse respOnse= in.getHttpResponse();
RawResult result = new RawResult();
result.sdkResponseMetadata(new SdkResponseMetadata(SdkHttpMetadata.from(response)));
try {
resultContentConsumer.consume(result, response.getContent());
} finally {
response.getContent().close();
}
return result;
}
}

代码示例来源:origin: aws/aws-sdk-java

public GetMediaResult unmarshall(JsonUnmarshallerContext context) throws Exception {
GetMediaResult getMediaResult = new GetMediaResult();
if (context.isStartOfDocument()) {
if (context.getHeader("Content-Type") != null) {
context.setCurrentHeader("Content-Type");
getMediaResult.setContentType(context.getUnmarshaller(String.class).unmarshall(context));
}
}
getMediaResult.setPayload(context.getHttpResponse().getContent());
return getMediaResult;
}

代码示例来源:origin: aws/aws-sdk-java

public GetMediaForFragmentListResult unmarshall(JsonUnmarshallerContext context) throws Exception {
GetMediaForFragmentListResult getMediaForFragmentListResult = new GetMediaForFragmentListResult();
if (context.isStartOfDocument()) {
if (context.getHeader("Content-Type") != null) {
context.setCurrentHeader("Content-Type");
getMediaForFragmentListResult.setContentType(context.getUnmarshaller(String.class).unmarshall(context));
}
}
getMediaForFragmentListResult.setPayload(context.getHttpResponse().getContent());
return getMediaForFragmentListResult;
}

代码示例来源:origin: aws/aws-sdk-java

public SynthesizeSpeechResult unmarshall(JsonUnmarshallerContext context) throws Exception {
SynthesizeSpeechResult synthesizeSpeechResult = new SynthesizeSpeechResult();
if (context.isStartOfDocument()) {
if (context.getHeader("Content-Type") != null) {
context.setCurrentHeader("Content-Type");
synthesizeSpeechResult.setContentType(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.getHeader("x-amzn-RequestCharacters") != null) {
context.setCurrentHeader("x-amzn-RequestCharacters");
synthesizeSpeechResult.setRequestCharacters(context.getUnmarshaller(Integer.class).unmarshall(context));
}
}
synthesizeSpeechResult.setAudioStream(context.getHttpResponse().getContent());
return synthesizeSpeechResult;
}

代码示例来源:origin: aws/aws-sdk-java

public InvokeResult unmarshall(JsonUnmarshallerContext context) throws Exception {
InvokeResult invokeResult = new InvokeResult();
if (context.isStartOfDocument()) {
if (context.getHeader("X-Amz-Function-Error") != null) {
context.setCurrentHeader("X-Amz-Function-Error");
invokeResult.setFunctionError(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.getHeader("X-Amz-Log-Result") != null) {
context.setCurrentHeader("X-Amz-Log-Result");
invokeResult.setLogResult(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.getHeader("X-Amz-Executed-Version") != null) {
context.setCurrentHeader("X-Amz-Executed-Version");
invokeResult.setExecutedVersion(context.getUnmarshaller(String.class).unmarshall(context));
}
}
invokeResult.setStatusCode(context.getHttpResponse().getStatusCode());
java.io.InputStream is = context.getHttpResponse().getContent();
if (is != null) {
try {
invokeResult.setPayload(java.nio.ByteBuffer.wrap(com.amazonaws.util.IOUtils.toByteArray(is)));
} finally {
com.amazonaws.util.IOUtils.closeQuietly(is, null);
}
}
return invokeResult;
}

代码示例来源:origin: aws/aws-sdk-java

public GetSdkResult unmarshall(JsonUnmarshallerContext context) throws Exception {
GetSdkResult getSdkResult = new GetSdkResult();
if (context.isStartOfDocument()) {
if (context.getHeader("Content-Type") != null) {
context.setCurrentHeader("Content-Type");
getSdkResult.setContentType(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.getHeader("Content-Disposition") != null) {
context.setCurrentHeader("Content-Disposition");
getSdkResult.setContentDisposition(context.getUnmarshaller(String.class).unmarshall(context));
}
}
java.io.InputStream is = context.getHttpResponse().getContent();
if (is != null) {
try {
getSdkResult.setBody(java.nio.ByteBuffer.wrap(com.amazonaws.util.IOUtils.toByteArray(is)));
} finally {
com.amazonaws.util.IOUtils.closeQuietly(is, null);
}
}
return getSdkResult;
}

代码示例来源:origin: aws/aws-sdk-java

public GetExportResult unmarshall(JsonUnmarshallerContext context) throws Exception {
GetExportResult getExportResult = new GetExportResult();
if (context.isStartOfDocument()) {
if (context.getHeader("Content-Type") != null) {
context.setCurrentHeader("Content-Type");
getExportResult.setContentType(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.getHeader("Content-Disposition") != null) {
context.setCurrentHeader("Content-Disposition");
getExportResult.setContentDisposition(context.getUnmarshaller(String.class).unmarshall(context));
}
}
java.io.InputStream is = context.getHttpResponse().getContent();
if (is != null) {
try {
getExportResult.setBody(java.nio.ByteBuffer.wrap(com.amazonaws.util.IOUtils.toByteArray(is)));
} finally {
com.amazonaws.util.IOUtils.closeQuietly(is, null);
}
}
return getExportResult;
}

代码示例来源:origin: aws/aws-sdk-java

public GetJobOutputResult unmarshall(JsonUnmarshallerContext context) throws Exception {
GetJobOutputResult getJobOutputResult = new GetJobOutputResult();
if (context.isStartOfDocument()) {
if (context.getHeader("x-amz-sha256-tree-hash") != null) {
context.setCurrentHeader("x-amz-sha256-tree-hash");
getJobOutputResult.setChecksum(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.getHeader("Content-Range") != null) {
context.setCurrentHeader("Content-Range");
getJobOutputResult.setContentRange(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.getHeader("Accept-Ranges") != null) {
context.setCurrentHeader("Accept-Ranges");
getJobOutputResult.setAcceptRanges(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.getHeader("Content-Type") != null) {
context.setCurrentHeader("Content-Type");
getJobOutputResult.setContentType(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.getHeader("x-amz-archive-description") != null) {
context.setCurrentHeader("x-amz-archive-description");
getJobOutputResult.setArchiveDescription(context.getUnmarshaller(String.class).unmarshall(context));
}
}
getJobOutputResult.setStatus(context.getHttpResponse().getStatusCode());
getJobOutputResult.setBody(context.getHttpResponse().getContent());
return getJobOutputResult;
}

代码示例来源:origin: aws/aws-sdk-java

public InvokeEndpointResult unmarshall(JsonUnmarshallerContext context) throws Exception {
InvokeEndpointResult invokeEndpointResult = new InvokeEndpointResult();
if (context.isStartOfDocument()) {
if (context.getHeader("Content-Type") != null) {
context.setCurrentHeader("Content-Type");
invokeEndpointResult.setContentType(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.getHeader("x-Amzn-Invoked-Production-Variant") != null) {
context.setCurrentHeader("x-Amzn-Invoked-Production-Variant");
invokeEndpointResult.setInvokedProductionVariant(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.getHeader("X-Amzn-SageMaker-Custom-Attributes") != null) {
context.setCurrentHeader("X-Amzn-SageMaker-Custom-Attributes");
invokeEndpointResult.setCustomAttributes(context.getUnmarshaller(String.class).unmarshall(context));
}
}
java.io.InputStream is = context.getHttpResponse().getContent();
if (is != null) {
try {
invokeEndpointResult.setBody(java.nio.ByteBuffer.wrap(com.amazonaws.util.IOUtils.toByteArray(is)));
} finally {
com.amazonaws.util.IOUtils.closeQuietly(is, null);
}
}
return invokeEndpointResult;
}

代码示例来源:origin: aws/aws-sdk-java

getObjectResult.setStatusCode(context.getHttpResponse().getStatusCode());
getObjectResult.setBody(context.getHttpResponse().getContent());

代码示例来源:origin: aws/aws-sdk-java

public DeleteUserResult unmarshall(JsonUnmarshallerContext context) throws Exception {
DeleteUserResult deleteUserResult = new DeleteUserResult();
deleteUserResult.setStatus(context.getHttpResponse().getStatusCode());
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return deleteUserResult;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("RequestId", targetDepth)) {
context.nextToken();
deleteUserResult.setRequestId(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return deleteUserResult;
}

代码示例来源:origin: aws/aws-sdk-java

public DeleteGroupResult unmarshall(JsonUnmarshallerContext context) throws Exception {
DeleteGroupResult deleteGroupResult = new DeleteGroupResult();
deleteGroupResult.setStatus(context.getHttpResponse().getStatusCode());
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return deleteGroupResult;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("RequestId", targetDepth)) {
context.nextToken();
deleteGroupResult.setRequestId(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return deleteGroupResult;
}

代码示例来源:origin: aws/aws-sdk-java

public DeleteGroupMembershipResult unmarshall(JsonUnmarshallerContext context) throws Exception {
DeleteGroupMembershipResult deleteGroupMembershipResult = new DeleteGroupMembershipResult();
deleteGroupMembershipResult.setStatus(context.getHttpResponse().getStatusCode());
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return deleteGroupMembershipResult;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("RequestId", targetDepth)) {
context.nextToken();
deleteGroupMembershipResult.setRequestId(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return deleteGroupMembershipResult;
}

代码示例来源:origin: aws/aws-sdk-java

public CreateGroupMembershipResult unmarshall(JsonUnmarshallerContext context) throws Exception {
CreateGroupMembershipResult createGroupMembershipResult = new CreateGroupMembershipResult();
createGroupMembershipResult.setStatus(context.getHttpResponse().getStatusCode());

推荐阅读
author-avatar
青烟_I乀n-a_396
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有