@Override public TableResult postProcessResponse(HttpURLConnection connection, TableOperation operation, CloudTableClient client, OperationContext context, TableResult result) throws Exception { if (operation.opType == TableOperationType.INSERT && operation.getEchoContent()) { result = operation.parseResponse(this.getConnection().getInputStream(), this.getResult() .getStatusCode(), this.getConnection().getHeaderField(TableConstants.HeaderConstants.ETAG), opContext, options); } return result; }
@Override public TableResult postProcessResponse(HttpURLConnection connection, TableOperation operation, CloudTableClient client, OperationContext context, TableResult result) throws Exception { if (operation.opType == TableOperationType.INSERT && operation.getEchoContent()) { result = operation.parseResponse(this.getConnection().getInputStream(), this.getResult() .getStatusCode(), this.getConnection().getHeaderField(TableConstants.HeaderConstants.ETAG), opContext, options); } return result; }
if (currOp.getEchoContent() && currMimePart.httpStatusCode != HttpURLConnection.HTTP_CREATED) { else if (!currOp.getEchoContent() && currMimePart.httpStatusCode != HttpURLConnection.HTTP_NO_CONTENT) { if ((currOp.getOperationType() == TableOperationType.INSERT && currOp.getEchoContent()) || currOp.getOperationType() == TableOperationType.RETRIEVE) { byteStream = new ByteArrayInputStream(currMimePart.payload.getBytes());
if (currOp.getEchoContent() && currMimePart.httpStatusCode != HttpURLConnection.HTTP_CREATED) { else if (!currOp.getEchoContent() && currMimePart.httpStatusCode != HttpURLConnection.HTTP_NO_CONTENT) { if ((currOp.getOperationType() == TableOperationType.INSERT && currOp.getEchoContent()) || currOp.getOperationType() == TableOperationType.RETRIEVE) { byteStream = new ByteArrayInputStream(currMimePart.payload.getBytes());
@Override public HttpURLConnection buildRequest(CloudTableClient client, TableOperation operation, OperationContext context) throws Exception { this.setSendStream(new ByteArrayInputStream(entityBytes)); this.setLength((long) entityBytes.length); return TableRequest.insert( client.getTransformedEndPoint(opContext).getUri(this.getCurrentLocation()), options, null, opContext, tableName, generateRequestIdentity(isTableEntry, tableIdentity), operation.opType != TableOperationType.INSERT ? operation.getEntity().getEtag() : null, operation.getEchoContent(), operation.opType.getUpdateType()); }
@Override public HttpURLConnection buildRequest(CloudTableClient client, TableOperation operation, OperationContext context) throws Exception { this.setSendStream(new ByteArrayInputStream(entityBytes)); this.setLength((long) entityBytes.length); return TableRequest.insert( client.getTransformedEndPoint(opContext).getUri(this.getCurrentLocation()), options, null, opContext, tableName, generateRequestIdentity(isTableEntry, tableIdentity), operation.opType != TableOperationType.INSERT ? operation.getEntity().getEtag() : null, operation.getEchoContent(), operation.opType.getUpdateType()); }
@Override public TableResult preProcessResponse(TableOperation operation, CloudTableClient client, OperationContext context) throws Exception { if (operation.opType == TableOperationType.INSERT) { if (operation.getEchoContent() && this.getResult().getStatusCode() == HttpURLConnection.HTTP_CREATED) { // Insert should receive created if echo content is on return new TableResult(); } else if (!operation.getEchoContent() && this.getResult().getStatusCode() == HttpURLConnection.HTTP_NO_CONTENT) { // Insert should receive no content if echo content is off return operation.parseResponse(null, this.getResult().getStatusCode(), this.getConnection() .getHeaderField(TableConstants.HeaderConstants.ETAG), opContext, options); } } else if (this.getResult().getStatusCode() == HttpURLConnection.HTTP_NO_CONTENT) { // InsertOrMerge and InsertOrReplace should always receive no content return operation.parseResponse(null, this.getResult().getStatusCode(), this.getConnection() .getHeaderField(TableConstants.HeaderConstants.ETAG), opContext, options); } throw TableServiceException.generateTableServiceException(this.getResult(), operation, this.getConnection().getErrorStream(), options.getTablePayloadFormat()); }
@Override public TableResult preProcessResponse(TableOperation operation, CloudTableClient client, OperationContext context) throws Exception { if (operation.opType == TableOperationType.INSERT) { if (operation.getEchoContent() && this.getResult().getStatusCode() == HttpURLConnection.HTTP_CREATED) { // Insert should receive created if echo content is on return new TableResult(); } else if (!operation.getEchoContent() && this.getResult().getStatusCode() == HttpURLConnection.HTTP_NO_CONTENT) { // Insert should receive no content if echo content is off return operation.parseResponse(null, this.getResult().getStatusCode(), this.getConnection() .getHeaderField(TableConstants.HeaderConstants.ETAG), opContext, options); } } else if (this.getResult().getStatusCode() == HttpURLConnection.HTTP_NO_CONTENT) { // InsertOrMerge and InsertOrReplace should always receive no content return operation.parseResponse(null, this.getResult().getStatusCode(), this.getConnection() .getHeaderField(TableConstants.HeaderConstants.ETAG), opContext, options); } throw TableServiceException.generateTableServiceException(this.getResult(), operation, this.getConnection().getErrorStream(), options.getTablePayloadFormat()); }
op.getEchoContent() ? TableConstants.HeaderConstants.RETURN_CONTENT : TableConstants.HeaderConstants.RETURN_NO_CONTENT);
op.getEchoContent() ? TableConstants.HeaderConstants.RETURN_CONTENT : TableConstants.HeaderConstants.RETURN_NO_CONTENT);