12
12
import com .azure .cosmos .implementation .DiagnosticsClientContext ;
13
13
import com .azure .cosmos .implementation .Document ;
14
14
import com .azure .cosmos .implementation .FeedResponseDiagnostics ;
15
- import com .azure .cosmos .implementation .ImplementationBridgeHelpers ;
16
15
import com .azure .cosmos .implementation .InternalObjectNode ;
17
16
import com .azure .cosmos .implementation .JsonSerializable ;
18
17
import com .azure .cosmos .implementation .MetadataDiagnosticsContext ;
19
18
import com .azure .cosmos .implementation .QueryMetrics ;
20
19
import com .azure .cosmos .implementation .ReplicationPolicy ;
21
- import com .azure .cosmos .implementation .RequestOptions ;
22
20
import com .azure .cosmos .implementation .RequestTimeline ;
23
21
import com .azure .cosmos .implementation .Resource ;
24
22
import com .azure .cosmos .implementation .ResourceResponse ;
35
33
import com .azure .cosmos .implementation .directconnectivity .Uri ;
36
34
import com .azure .cosmos .implementation .directconnectivity .rntbd .RntbdChannelAcquisitionTimeline ;
37
35
import com .azure .cosmos .implementation .directconnectivity .rntbd .RntbdEndpointStatistics ;
38
- import com .azure .cosmos .implementation .patch .PatchOperation ;
39
36
import com .azure .cosmos .implementation .query .QueryInfo ;
40
37
import com .azure .cosmos .implementation .query .metrics .ClientSideMetrics ;
41
38
import com .azure .cosmos .implementation .routing .PartitionKeyInternal ;
42
- import com .azure .cosmos .models .CosmosBulkExecutionOptions ;
43
39
import com .azure .cosmos .models .CosmosItemResponse ;
44
40
import com .azure .cosmos .models .CosmosStoredProcedureProperties ;
45
41
import com .azure .cosmos .models .FeedResponse ;
@@ -714,110 +710,6 @@ public static Duration getRequestTimeoutFromGatewayConnectionConfig(GatewayConne
714
710
return gatewayConnectionConfig .getRequestTimeout ();
715
711
}
716
712
717
- @ Warning (value = INTERNAL_USE_ONLY_WARNING )
718
- public static String getOperationValueForCosmosItemOperationType (CosmosItemOperationType cosmosItemOperationType ) {
719
- return cosmosItemOperationType .getOperationValue ();
720
- }
721
-
722
- @ Warning (value = INTERNAL_USE_ONLY_WARNING )
723
- public static RequestOptions toRequestOptions (TransactionalBatchRequestOptions transactionalBatchRequestOptions ) {
724
- return transactionalBatchRequestOptions .toRequestOptions ();
725
- }
726
-
727
- @ Warning (value = INTERNAL_USE_ONLY_WARNING )
728
- public static TransactionalBatchOperationResult createTransactionBatchResult (
729
- String eTag ,
730
- double requestCharge ,
731
- ObjectNode resourceObject ,
732
- int statusCode ,
733
- Duration retryAfter ,
734
- int subStatusCode ,
735
- CosmosItemOperation cosmosItemOperation ) {
736
-
737
- return new TransactionalBatchOperationResult (
738
- eTag ,
739
- requestCharge ,
740
- resourceObject ,
741
- statusCode ,
742
- retryAfter ,
743
- subStatusCode ,
744
- cosmosItemOperation );
745
- }
746
-
747
- @ Warning (value = INTERNAL_USE_ONLY_WARNING )
748
- public static CosmosBulkItemResponse createCosmosBulkItemResponse (
749
- TransactionalBatchOperationResult result ,
750
- TransactionalBatchResponse response ) {
751
-
752
- return new CosmosBulkItemResponse (
753
- result .getETag (),
754
- result .getRequestCharge (),
755
- result .getResourceObject (),
756
- result .getStatusCode (),
757
- result .getRetryAfterDuration (),
758
- result .getSubStatusCode (),
759
- response .getResponseHeaders (),
760
- response .getDiagnostics ());
761
- }
762
-
763
- @ Warning (value = INTERNAL_USE_ONLY_WARNING )
764
- public static <TContext > CosmosBulkOperationResponse <TContext > createCosmosBulkOperationResponse (
765
- CosmosItemOperation operation ,
766
- CosmosBulkItemResponse response ,
767
- TContext batchContext ) {
768
-
769
- return new CosmosBulkOperationResponse <>(
770
- operation ,
771
- response ,
772
- batchContext );
773
- }
774
-
775
- @ Warning (value = INTERNAL_USE_ONLY_WARNING )
776
- public static <TContext > CosmosBulkOperationResponse <TContext > createCosmosBulkOperationResponse (
777
- CosmosItemOperation operation ,
778
- Exception exception ,
779
- TContext batchContext ) {
780
-
781
- return new CosmosBulkOperationResponse <>(
782
- operation ,
783
- exception ,
784
- batchContext );
785
- }
786
-
787
- @ Warning (value = INTERNAL_USE_ONLY_WARNING )
788
- public static TransactionalBatchResponse createTransactionBatchResponse (
789
- int responseStatusCode ,
790
- int responseSubStatusCode ,
791
- String errorMessage ,
792
- Map <String , String > responseHeaders ,
793
- CosmosDiagnostics cosmosDiagnostics ) {
794
-
795
- return new TransactionalBatchResponse (
796
- responseStatusCode ,
797
- responseSubStatusCode ,
798
- errorMessage ,
799
- responseHeaders ,
800
- cosmosDiagnostics );
801
- }
802
-
803
- @ Warning (value = INTERNAL_USE_ONLY_WARNING )
804
- public static void addTransactionBatchResultInResponse (
805
- TransactionalBatchResponse transactionalBatchResponse ,
806
- List <TransactionalBatchOperationResult > transactionalBatchOperationResults ) {
807
-
808
- transactionalBatchResponse .addAll (transactionalBatchOperationResults );
809
- }
810
-
811
- @ Warning (value = INTERNAL_USE_ONLY_WARNING )
812
- public static List <PatchOperation > getPatchOperationsFromCosmosPatch (CosmosPatchOperations cosmosPatchOperations ) {
813
- return cosmosPatchOperations .getPatchOperations ();
814
- }
815
-
816
- @ Warning (value = INTERNAL_USE_ONLY_WARNING )
817
- public static int getPayloadLength (TransactionalBatchResponse transactionalBatchResponse ) {
818
- return transactionalBatchResponse .getResponseLength ();
819
- }
820
-
821
713
@ Warning (value = INTERNAL_USE_ONLY_WARNING )
822
714
public static SqlQuerySpec getOfferQuerySpecFromResourceId (CosmosAsyncContainer container , String resourceId ) {
823
715
return container .getDatabase ().getOfferQuerySpecFromResourceId (resourceId );
@@ -836,88 +728,4 @@ public static RetryContext getRetryContext(CosmosDiagnostics cosmosDiagnostics)
836
728
return null ;
837
729
}
838
730
}
839
-
840
- // This is only temporary, and will be removed once we delete BulkExecutionOptions
841
- @ Warning (value = INTERNAL_USE_ONLY_WARNING )
842
- public static CosmosBulkExecutionOptions createCosmosBulkExecutionOptions (BulkExecutionOptions bulkExecutionOptions ) {
843
- return bulkExecutionOptions .toCosmosBulkExecutionOptions ();
844
- }
845
-
846
- // This is only temporary, and will be removed once we delete CosmosItemOperationType
847
- @ Warning (value = INTERNAL_USE_ONLY_WARNING )
848
- public static CosmosItemOperationType toDeprecatedCosmosItemOperationType (com .azure .cosmos .models .CosmosItemOperationType cosmosItemOperationType ) {
849
- switch (cosmosItemOperationType ) {
850
- case CREATE :
851
- return CosmosItemOperationType .CREATE ;
852
- case DELETE :
853
- return CosmosItemOperationType .DELETE ;
854
- case PATCH :
855
- return CosmosItemOperationType .PATCH ;
856
- case READ :
857
- return CosmosItemOperationType .READ ;
858
- case UPSERT :
859
- return CosmosItemOperationType .UPSERT ;
860
- case REPLACE :
861
- return CosmosItemOperationType .REPLACE ;
862
- default :
863
- throw new UnsupportedOperationException ("CosmosOperationType : " + cosmosItemOperationType + " is not supported" );
864
- }
865
- }
866
-
867
- // This is only temporary, and will be removed once we delete CosmosItemOperation
868
- @ Warning (value = INTERNAL_USE_ONLY_WARNING )
869
- public static CosmosItemOperation toDeprecatedCosmosItemOperation (com .azure .cosmos .models .CosmosItemOperation cosmosItemOperation ) {
870
- return new CosmosItemOperation () {
871
- @ Override
872
- public String getId () {
873
- return cosmosItemOperation .getId ();
874
- }
875
-
876
- @ Override
877
- public PartitionKey getPartitionKeyValue () {
878
- return cosmosItemOperation .getPartitionKeyValue ();
879
- }
880
-
881
- @ Override
882
- public com .azure .cosmos .CosmosItemOperationType getOperationType () {
883
- return toDeprecatedCosmosItemOperationType (cosmosItemOperation .getOperationType ());
884
- }
885
-
886
- @ Override
887
- public <T > T getItem () {
888
- return cosmosItemOperation .getItem ();
889
- }
890
-
891
- @ Override
892
- public <T > T getContext () {
893
- return cosmosItemOperation .getContext ();
894
- }
895
- };
896
- }
897
-
898
-
899
- // This is only temporary, and will be removed once we delete CosmosBulkItemResponse
900
- @ Warning (value = INTERNAL_USE_ONLY_WARNING )
901
- public static CosmosBulkItemResponse toDeprecatedCosmosBulkItemResponse (com .azure .cosmos .models .CosmosBulkItemResponse cosmosBulkItemResponse ) {
902
- return new CosmosBulkItemResponse (cosmosBulkItemResponse .getETag (),
903
- cosmosBulkItemResponse .getRequestCharge (),
904
- ImplementationBridgeHelpers
905
- .CosmosBulkItemResponseHelper
906
- .getCosmosBulkItemResponseAccessor ()
907
- .getResourceObject (cosmosBulkItemResponse ),
908
- cosmosBulkItemResponse .getStatusCode (),
909
- cosmosBulkItemResponse .getRetryAfterDuration (),
910
- cosmosBulkItemResponse .getSubStatusCode (),
911
- cosmosBulkItemResponse .getResponseHeaders (),
912
- cosmosBulkItemResponse .getCosmosDiagnostics ());
913
- }
914
-
915
- // This is only temporary, and will be removed once we delete CosmosBulkOperationResponse
916
- @ Warning (value = INTERNAL_USE_ONLY_WARNING )
917
- public static <TContext > CosmosBulkOperationResponse <TContext > toDeprecatedCosmosBulkOperationResponse (com .azure .cosmos .models .CosmosBulkOperationResponse <TContext > cosmosBulkOperationResponse ) {
918
- return new CosmosBulkOperationResponse <TContext >(toDeprecatedCosmosItemOperation (cosmosBulkOperationResponse .getOperation ()),
919
- toDeprecatedCosmosBulkItemResponse (cosmosBulkOperationResponse .getResponse ()),
920
- cosmosBulkOperationResponse .getException (),
921
- cosmosBulkOperationResponse .getBatchContext ());
922
- }
923
731
}
0 commit comments