You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/upgrade-to-v3.md
+41-39Lines changed: 41 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,47 +15,49 @@ The following section lists out the breaking changes requiring code changes from
15
15
16
16
### Shorter package names
17
17
18
-
1. Replace any reference to `com.microsoft.graph.models.generated` and `com.microsoft.graph.models.extensions` by `com.microsoft.graph.models`.
19
-
1. Replace any reference to `com.microsoft.graph.requests.extensions` by `com.microsoft.graph.requests`.
18
+
To upgrade your application do the following.
19
+
20
+
- Replace any reference to `com.microsoft.graph.models.generated` and `com.microsoft.graph.models.extensions` by `com.microsoft.graph.models`.
21
+
- Replace any reference to `com.microsoft.graph.requests.extensions` by `com.microsoft.graph.requests`.
20
22
21
23
### Cleanup of unecessary interfaces
22
24
23
-
To provide a cleaner API surface and avoid shipping potentially breaking changes when properties are added, some interfaces have been removed:
25
+
To provide a cleaner API surface and avoid shipping potentially breaking changes when properties are added, some interfaces have been removed. To upgrade your application do the following.
24
26
25
-
1. Replace any reference to `IGraphServiceClient` by `GraphServiceClient`.
26
-
1. Replace any reference to `IEntityCollectionPage` by `EntityCollectionPage` (e.g. `IEventCollectionPage`).
27
+
- Replace any reference to `IGraphServiceClient` by `GraphServiceClient`.
28
+
- Replace any reference to `IEntityCollectionPage` by `EntityCollectionPage` (e.g. `IEventCollectionPage`).
27
29
28
30
### Azure identity
29
31
30
-
The Microsoft Graph Java SDK now leverages azure-identity to improve the authentication experience. This new library provides support for [more authentication flows](https://docs.microsoft.com/graph/sdks/choose-authentication-providers?tabs=Java) and improves the configuration experience:
32
+
The Microsoft Graph Java SDK now leverages azure-identity to improve the authentication experience. This new library provides support for [more authentication flows](https://docs.microsoft.com/graph/sdks/choose-authentication-providers?tabs=Java) and improves the configuration experience. To upgrade your application do the following.
31
33
32
-
1. Remove any dependency on `microsoft-graph-auth` and replace them by one of the providers available in azure-identity.
33
-
1. Remove any dependency on `microsoft-graph-android-auth` and replace them by one of the providers available in azure-identity.
34
-
1. Reconsider the need for custom authentication providers (implementation of `IAuthenticationProvider` or `ICoreAuthenticationProvider`) that might be part of your project and use a provider available in azure-identity whenever possible.
34
+
- Remove any dependency on `microsoft-graph-auth` and replace them by one of the providers available in azure-identity.
35
+
- Remove any dependency on `microsoft-graph-android-auth` and replace them by one of the providers available in azure-identity.
36
+
- Reconsider the need for custom authentication providers (implementation of `IAuthenticationProvider` or `ICoreAuthenticationProvider`) that might be part of your project and use a provider available in azure-identity whenever possible.
35
37
36
38
Check out [this document](./upgrade-to-v3-auth.md) to find examples on how to upgrade your authentication providers to azure-identity providers.
37
39
38
40
### Single authentication provider interface
39
41
40
-
Due to historical reasons, the SDK provided two authentication provider interfaces `ICoreAuthenticationProvider` and `IAuthenticationProvider`. This was creating confusion and duplication and has been resolved to a single `IAuthenticationProvider` interface. If you implemented any of those interfaces you should:
42
+
Due to historical reasons, the SDK provided two authentication provider interfaces `ICoreAuthenticationProvider` and `IAuthenticationProvider`. This was creating confusion and duplication and has been resolved to a single `IAuthenticationProvider` interface. To upgrade your application do the following.
41
43
42
-
1. Replace any reference to `ICoreAuthenticationProvider` by `IAuthenticationProvider`.
43
-
1. Update the implementation to match the new interface.
44
-
1. Replace any reference to `com.microsoft.graph`.
44
+
- Replace any reference to `ICoreAuthenticationProvider` by `IAuthenticationProvider`.
45
+
- Update the implementation to match the new interface.
46
+
- Replace any reference to `com.microsoft.graph`.
45
47
46
48
> Note: if your project implements its own authentication provider, you might want to review the list of providers available with Azure identity to review whether a custom provider is still required. If a custom provider is still required, you should extend `BaseAuthenticationProvider` which provides a method to check whether a spefic request should be authenticated based on its URL.
47
49
48
50
### Modern date and time API
49
51
50
-
To provide a modern, more reliable, and faster date and time API, `Calendar` properties have been replaced by `OffsetDateTime` properties:
52
+
To provide a modern, more reliable, and faster date and time API, `Calendar` properties have been replaced by `OffsetDateTime` properties. To upgrade your application do the following.
51
53
52
-
1. Replace any `Calendar` assignment by `OffsetDateTime`.
54
+
- Replace any `Calendar` assignment by `OffsetDateTime`.
53
55
54
56
### Fluent method parameter sets and support for optional parameters
55
57
56
-
To provide support for optional parameters for OData methods (actions, functions), the SDK now makes use of parameter classes with fluent builders:
58
+
To provide support for optional parameters for OData methods (actions, functions), the SDK now makes use of parameter classes with fluent builders. To upgrade your application do the following.
57
59
58
-
1. Replace any OData method reference by it's parameter set equivalent.
60
+
- Replace any OData method reference by it's parameter set equivalent.
59
61
60
62
Example:
61
63
@@ -84,9 +86,9 @@ To provide support for optional parameters for OData methods (actions, functions
84
86
85
87
### Futures vs Callbacks
86
88
87
-
To provide a standard and modern way of executing requests asynchronuously to SDK users, the custom defined `ICallback` interface has been removed and the API now returns `CompletableFuture`.
89
+
To provide a standard and modern way of executing requests asynchronuously to SDK users, the custom defined `ICallback` interface has been removed and the API now returns `CompletableFuture`. To upgrade your application do the following.
88
90
89
-
1. Replace any of the code built the following way
91
+
- Replace any of the code built the following way
90
92
91
93
```Java
92
94
graphClient
@@ -116,16 +118,16 @@ To provide a standard and modern way of executing requests asynchronuously to SD
116
118
117
119
### Non-generated code moved to the core library
118
120
119
-
The service library (microsoft-graph) was designed to contain only code that has been generated automatically from the API metadata. All code that has been manually handcrafted should live in the core library (microsoft-graph-core).This principle makes reusability of code easier for consumers and it was not respected until thisnew version of the SDK. All the code living under anything but `com.microsoft.graph.models` or `com.microsoft.graph.requests` have been moved to the same package name in the core asset. This move should be transparent to consumers, except for the following that needs to be updated:
121
+
The service library (microsoft-graph) was designed to contain only code that has been generated automatically from the API metadata. All code that has been manually handcrafted should live in the core library (microsoft-graph-core).This principle makes reusability of code easier for consumers and it was not respected until thisnew version of the SDK. All the code living under anything but `com.microsoft.graph.models` or `com.microsoft.graph.requests` have been moved to the same package name in the core asset. This move should be transparent to consumers, except for the following that needs to be updated. To upgrade your application do the following.
120
122
121
-
1. Replace any reference to `ChunkUploadProvider` from `com.microsoft.graph.requests.extensions` to `com.microsoft.graph.concurrency`.
122
-
1.Replace any reference to `CustomRequestBuilder`, `DateOnly`, `TimeOfDay`, and `Multipart` from `com.microsoft.graph.(models|requests).extensions` to `com.microsoft.graph.core`.
123
+
- Replace any reference to `ChunkUploadProvider` from `com.microsoft.graph.requests.extensions` to `com.microsoft.graph.concurrency`.
124
+
-Replace any reference to `CustomRequestBuilder`, `DateOnly`, `TimeOfDay`, and `Multipart` from `com.microsoft.graph.(models|requests).extensions` to `com.microsoft.graph.core`.
123
125
124
126
### Removal of connection configuration
125
127
126
-
As the connection configuration evolved over time, the connection configuration infrastructure had become redundant with the native library configuration capabilities:
128
+
As the connection configuration evolved over time, the connection configuration infrastructure had become redundant with the native library configuration capabilities. To upgrade your application do the following.
127
129
128
-
1.Remove any reference to `IConnectionConfiguration` and re-implement the configuration using [Customize the MicrosoftGraphSDK service client](https://docs.microsoft.com/graph/sdks/customize-client?tabs=java).
130
+
-Remove any reference to `IConnectionConfiguration` and re-implement the configuration using [Customize the MicrosoftGraphSDK service client](https://docs.microsoft.com/graph/sdks/customize-client?tabs=java).
129
131
130
132
### Dependencies upgrade
131
133
@@ -136,25 +138,25 @@ No action needs to be taken unless the project has a direct reference to an olde
136
138
137
139
### float properties have been replaced by Float
138
140
139
-
As the OData specification mandates support fornull values for numeric values, any property that previously was implemented using a float primitive type is now using a Float object type:
141
+
As the OData specification mandates support fornull values for numeric values, any property that previously was implemented using a float primitive type is now using a Float object type. To upgrade your application do the following.
140
142
141
-
1.Replace any assignment from float to Float and check fornull values.
143
+
-Replace any assignment from float to Float and check fornull values.
142
144
143
145
### Merge of GraphServiceClient and BaseGraphServiceClient
144
146
145
-
To simplify the object model of the SDK, `BaseGraphServiceClient` has been merged into `GraphServiceClient`:
147
+
To simplify the object model of the SDK, `BaseGraphServiceClient` has been merged into `GraphServiceClient`.To upgrade your application do the following.
146
148
147
-
1.Replace any reference to `BaseGraphServiceClient` by `GraphServiceClient`.
149
+
-Replace any reference to `BaseGraphServiceClient` by `GraphServiceClient`.
148
150
149
151
### Generic refactoring
150
152
151
153
Requests, request builders, and responses have been refactored to take advantage of generic types. This maximizes code reusability improving performances, binary size and more. These changes should be transparent to most SDK consumers but it's possible to impact developers calling the SDK using reflection techniques.
152
154
153
155
## Batch object model improvements
154
156
155
-
The object model for JSON batching has been improved to provide a cleaner API surface to SDK users:
157
+
The object model for JSON batching has been improved to provide a cleaner API surface to SDK users. To upgrade your application do the following.
156
158
157
-
1. Replace any of the following patterns
159
+
- Replace any of the following patterns
158
160
159
161
```Java
160
162
final MSBatchRequestContent batchRequestContent = new MSBatchRequestContent();
@@ -182,10 +184,10 @@ The object model for JSON batching has been improved to provide a cleaner API su
182
184
183
185
### IJsonBackedObject interface
184
186
185
-
The interface has been simplified to remove the `getRawObject` and `getSerializer` methods. This avoid entity and collection objects storing a copy of the JSON on top of the properties they already have, which improves drastically the memory impacts:
187
+
The interface has been simplified to remove the `getRawObject` and `getSerializer` methods. This avoid entity and collection objects storing a copy of the JSON on top of the properties they already have, which improves drastically the memory impacts. To upgrade your application do the following.
186
188
187
-
1. Replace any reference to `getRawObject` by `additionalDataManager`.
188
-
1. Replace any reference to `getSerializer` by `graphClient.getSerializer` or create a new instance of the serializer.
189
+
- Replace any reference to `getRawObject` by `additionalDataManager`.
190
+
- Replace any reference to `getSerializer` by `graphClient.getSerializer` or create a new instance of the serializer.
189
191
190
192
### Improved delta API
191
193
@@ -194,9 +196,9 @@ When using [change tracking/delta APIs](https://docs.microsoft.com/graph/delta-q
194
196
- A next link whenever there are more change results to iterate through.
195
197
- A delta link whenever there are no more change results to iterate through at this instant. This is the link your application should use to get new changes in the future.
196
198
197
-
This new version improves the Java API provided to developers.
199
+
This new version improves the Java API provided to developers. To upgrade your application do the following.
0 commit comments