Skip to content

Commit 97f93ae

Browse files
author
Caitlin Bales (MSFT)
authored
Merge branch 'master' into raw-type-cleanup
2 parents 39c191d + d6b1626 commit 97f93ae

File tree

251 files changed

+90
-1081
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+90
-1081
lines changed

README.md

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
# Preview Microsoft Graph SDK for Java
2+
23
This client library is currently in private preview status. This means that:
3-
- The API surface may change significantly
4-
- Non-blocking issues *may* be triaged at a slower pace
5-
- You may submit feedback through issues or PRs. You will have a better chance of your changes being implemented if they are submitted before public preview release
6-
- We do not define an SLA or support strategy for this library
4+
- The API surface may change significantly.
5+
- Non-blocking issues *may* be triaged at a slower pace.
6+
- You may submit feedback through issues or PRs. You will have a better chance of your changes being implemented if they are submitted before public preview release.
7+
- We do not define an SLA or support strategy for this library.
78

89
We welcome your feedback as we drive the quality of this to general availability.
910

10-
# Get started with the Microsoft Graph SDK for Java
11-
12-
Integrate the [Microsoft Graph API](https://graph.microsoft.io/en-us/getting-started) into your Java application!
11+
Get started with the Microsoft Graph SDK for Java by integrating the [Microsoft Graph API](https://graph.microsoft.io/en-us/getting-started) into your Java application!
1312

1413
## 1. Installation
14+
1515
### 1.1 Install via Gradle
16-
*This package will not be available via Gradle until it hits public preview. You will need to download the source and reference the package locally.*
1716

18-
Add the JCenter repository and a compile dependency for `microsoft-graph` to your project's `build.gradle`
17+
> [!NOTE]
18+
> This package will not be available via Gradle until it is in public preview. You need to download the source and reference the package locally.
19+
20+
Add the JCenter repository and a compile dependency for `microsoft-graph` to your project's `build.gradle`:
1921

2022
```gradle
2123
repository {
@@ -29,28 +31,25 @@ dependency {
2931
```
3032

3133
### 1.2 Enable ProGuard (Android)
32-
The nature of the Graph API is such that the SDK needs quite a large set of classes to describe its functionality. You will need to ensure that [ProGuard](https://developer.android.com/studio/build/shrink-code.html) is enabled on your project. Otherwise, you will incur long build times for functionality that is not necessary relevant to your particular application. If you are still hitting the 64k method limit, you can also enable [multidexing](https://developer.android.com/studio/build/multidex.html).
34+
The nature of the Graph API is such that the SDK needs quite a large set of classes to describe its functionality. You need to ensure that [ProGuard](https://developer.android.com/studio/build/shrink-code.html) is enabled on your project. Otherwise, you will incur long build times for functionality that is not necessarily relevant to your particular application. If you are still hitting the 64K method limit, you can also enable [multidexing](https://developer.android.com/studio/build/multidex.html).
3335

3436
## 2. Getting started
3537

3638
### 2.1 Register your application
3739

38-
Register your application by following [these](https://developer.microsoft.com/en-us/graph/docs/concepts/auth_register_app_v2) steps.
40+
Register your application by following the steps at [Register your app with the Azure AD v2.0 endpoint](https://developer.microsoft.com/en-us/graph/docs/concepts/auth_register_app_v2).
3941

4042
### 2.2 Create an IAuthenticationProvider object
4143

42-
An instance of the **GraphServiceClient** class handles building requests,
43-
sending them to the Microsoft Graph API, and processing the responses. To create a
44-
new instance of this class, you need to provide an instance of
45-
`IAuthenticationProvider` which can authenticate requests to Microsoft Graph.
44+
An instance of the **GraphServiceClient** class handles building requests, sending them to the Microsoft Graph API, and processing the responses. To create a new instance of this class, you need to provide an instance of `IAuthenticationProvider`, which can authenticate requests to Microsoft Graph.
4645

47-
For an example of authentication in a client application see the [MSGraph SDK Android MSA Auth for Android Adapter](https://github.com/microsoftgraph/msgraph-sdk-android-msa-auth-for-android-adapter).
46+
For an example of authentication in a client application, see the [MSGraph SDK Android MSA Auth for Android Adapter](https://github.com/microsoftgraph/msgraph-sdk-android-msa-auth-for-android-adapter).
4847

4948
### 2.3 Get a GraphServiceClient object
5049

51-
TODO: the para below needs expansion or removal. Would need to mention the different flows (authorization code flow, implicit flow, client credential flow) and give pointers on where to get sample code. Dave Moten can provide link for client credentials flow.
50+
<!--TODO: the following para needs expansion or removal. Would need to mention the different flows (authorization code flow, implicit flow, client credential flow) and give pointers on where to get sample code. Dave Moten can provide link for client credentials flow.-->
5251

53-
Once you have set the correct application ID and url, you must get a **GraphServiceClient** object to make requests against the service. The SDK will store the account information for you, but when a user logs on for the first time, it will invoke UI to get the user's account information.
52+
After you have set the correct application ID and URL, you must get a **GraphServiceClient** object to make requests against the service. The SDK stores the account information for you, but when a user signs in for the first time, it invokes the UI to get the user's account information.
5453

5554
```java
5655
IClientConfig clientConfig =
@@ -64,9 +63,9 @@ IGraphServiceClient graphClient =
6463

6564
## 3. Make requests against the service
6665

67-
Once you have a GraphServiceClient that is authenticated you can begin making calls against the service. The requests against the service look like our [REST API](https://developer.microsoft.com/en-us/graph/docs/concepts/overview).
66+
After you have a GraphServiceClient that is authenticated, you can begin making calls against the service. The requests against the service look like our [REST API](https://developer.microsoft.com/en-us/graph/docs/concepts/overview).
6867

69-
### Get the user's drive
68+
### 3.1 Get the user's drive
7069

7170
To retrieve the user's drive:
7271

@@ -89,14 +88,14 @@ For a general overview of how the SDK is designed, see [overview](https://github
8988

9089
## 4. Documentation
9190

92-
For a more detailed documentation see:
91+
For more detailed documentation, see:
9392

9493
* [Overview](https://github.com/microsoftgraph/msgraph-sdk-java/wiki/Overview)
9594
* [Extending the library](https://github.com/microsoftgraph/msgraph-sdk-java/wiki/Extending-the-Library)
9695
* [Handling Open Types, PATCH support with `null` values](https://github.com/microsoftgraph/msgraph-sdk-java/wiki/Working-with-Open-Types)
9796
* [Collections](https://github.com/microsoftgraph/msgraph-sdk-java/wiki/Working-with-Collections)
98-
* [Making Custom Requests](https://github.com/microsoftgraph/msgraph-sdk-java/wiki/Custom-Requests)
99-
* [Known Issues](https://github.com/microsoftgraph/msgraph-sdk-java/wiki/Known-Issues)
97+
* [Making custom requests](https://github.com/microsoftgraph/msgraph-sdk-java/wiki/Custom-Requests)
98+
* [Known issues](https://github.com/microsoftgraph/msgraph-sdk-java/wiki/Known-Issues)
10099
* [Contributions](https://github.com/microsoftgraph/msgraph-sdk-java/blob/master/CONTRIBUTING.md)
101100

102101
## 5. Issues
@@ -105,15 +104,15 @@ For known issues, see [issues](https://github.com/MicrosoftGraph/msgraph-sdk-jav
105104

106105
## 6. Contributions
107106

108-
The Microsoft Graph SDK is open for contribution. Please read how to contribute to this project [here](https://github.com/microsoftgraph/msgraph-sdk-java/blob/master/CONTRIBUTING.md).
107+
The Microsoft Graph SDK is open for contribution. To contribute to this project, see [Contributing](https://github.com/microsoftgraph/msgraph-sdk-java/blob/master/CONTRIBUTING.md).
109108

110-
## 7. Supported Java Versions
109+
## 7. Supported Java versions
111110
The Microsoft Graph SDK for Java library is supported at runtime for Java 7+ and [Android API revision 15](http://source.android.com/source/build-numbers.html) and greater.
112111

113112
## 8. License
114113

115114
Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the [MIT license](LICENSE).
116115

117-
## 9. Third Party Notices
116+
## 9. Third-party notices
118117

119-
[Third Party Notices](THIRD%20PARTY%20NOTICES)
118+
[Third-party notices](THIRD%20PARTY%20NOTICES)

src/main/java/com/microsoft/graph/concurrency/SimpleWaiter.java

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/main/java/com/microsoft/graph/core/BaseActionRequestBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ protected boolean hasParameter(final String name) {
5353
* @param <T> The type to which this object should be cast
5454
* @return The stored instance of T, otherwise null
5555
*/
56+
@SuppressWarnings("unchecked")
5657
protected <T> T getParameter(final String name) {
5758
return (T) bodyParams.get(name);
5859
}

src/main/java/com/microsoft/graph/core/ClientException.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
*/
2828
public class ClientException extends RuntimeException {
2929

30+
private static final long serialVersionUID = -1066560879567392559L;
31+
3032
/**
3133
* Creates the client exception.
3234
* @param message The message to display.

src/main/java/com/microsoft/graph/core/DefaultClientConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public IHttpProvider getHttpProvider() {
106106
getAuthenticationProvider(),
107107
getExecutors(),
108108
getLogger());
109-
logger.logDebug("Created DefaultHttpProvider");
109+
getLogger().logDebug("Created DefaultHttpProvider");
110110
}
111111
return httpProvider;
112112
}
@@ -120,7 +120,7 @@ public IHttpProvider getHttpProvider() {
120120
public ISerializer getSerializer() {
121121
if (serializer == null) {
122122
serializer = new DefaultSerializer(getLogger());
123-
logger.logDebug("Created DefaultSerializer");
123+
getLogger().logDebug("Created DefaultSerializer");
124124
}
125125
return serializer;
126126
}
@@ -134,7 +134,7 @@ public ISerializer getSerializer() {
134134
public IExecutors getExecutors() {
135135
if (executors == null) {
136136
executors = new DefaultExecutors(getLogger());
137-
logger.logDebug("Created DefaultExecutors");
137+
getLogger().logDebug("Created DefaultExecutors");
138138
}
139139
return executors;
140140
}

src/main/java/com/microsoft/graph/http/BaseRequestBuilder.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ public abstract class BaseRequestBuilder implements IRequestBuilder {
5050
*/
5151
private final List<Option> options = new ArrayList<>();
5252

53-
private final IJsonBackedObject body;
54-
5553
/**
5654
* Creates the request builder.
5755
*
@@ -66,23 +64,6 @@ public BaseRequestBuilder(
6664
) {
6765
this.requestUrl = requestUrl;
6866
this.client = client;
69-
this.body = null;
70-
71-
if (options != null) {
72-
this.options.addAll(options);
73-
}
74-
}
75-
76-
public BaseRequestBuilder(
77-
final String requestUrl,
78-
final IJsonBackedObject body,
79-
final IBaseClient client,
80-
final List<? extends Option> options
81-
) {
82-
this.requestUrl = requestUrl;
83-
this.client = client;
84-
this.body = body;
85-
8667
if (options != null) {
8768
this.options.addAll(options);
8869
}

src/main/java/com/microsoft/graph/http/GraphFatalServiceException.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
*/
3030
public class GraphFatalServiceException extends GraphServiceException {
3131

32+
private static final long serialVersionUID = -4974392424026672738L;
33+
3234
/**
3335
* Create a fatal Graph service exception.
3436
* @param method The method that caused the exception.

src/main/java/com/microsoft/graph/http/GraphServiceException.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
*/
4343
public class GraphServiceException extends ClientException {
4444

45+
private static final long serialVersionUID = -7416427229421064119L;
46+
4547
/**
4648
* New line delimiter.
4749
*/

src/main/java/com/microsoft/graph/logger/DefaultLogger.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
package com.microsoft.graph.logger;
2424

25-
import java.util.logging.Level;
2625
import java.util.logging.Logger;
2726

2827
/**

src/main/java/com/microsoft/graph/models/generated/BaseAlternativeSecurityId.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ public final AdditionalDataManager additionalDataManager() {
4141
return additionalDataManager;
4242
}
4343

44-
public BaseAlternativeSecurityId() {
45-
oDataType = "microsoft.graph.alternativeSecurityId";
46-
}
47-
4844
/**
4945
* The Type.
5046
*

0 commit comments

Comments
 (0)