-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Record playback integration #2870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f6836d2
7d56cb6
f9c6e72
64c78fc
0485c56
1eaf454
7c3df71
ee00473
189cc5d
f7807f2
83ab63b
df02aa9
b6aa7f2
ea8e318
9a72a2e
1b4c865
93fd28b
713d80d
6c1c2fe
732e53a
8e15dc7
d8c093a
54db087
0da6a50
ef078ad
68bd688
dcb3003
4c9e3e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,17 +45,18 @@ public BatchServiceClient protocolLayer() { | |
|
|
||
| private BatchClient(BatchCredentials credentials) { | ||
| RestClient restClient = new RestClient.Builder() | ||
| .withBaseUrl(credentials.baseUrl()) | ||
| .withCredentials(credentials) | ||
| .withSerializerAdapter(new AzureJacksonAdapter()) | ||
| .withResponseBuilderFactory(new ResponseBuilder.Factory() { | ||
| private final AzureResponseBuilder.Factory baseFactory = new AzureResponseBuilder.Factory(); | ||
| @Override | ||
| public <T, E extends RestException> ResponseBuilder<T, E> newInstance(SerializerAdapter<?> serializerAdapter) { | ||
| return baseFactory.<T, E>newInstance(serializerAdapter).withThrowOnGet404(true); | ||
| } | ||
| }) | ||
| .build(); | ||
| .withBaseUrl(credentials.baseUrl()) | ||
| .withCredentials(credentials) | ||
| .withSerializerAdapter(new AzureJacksonAdapter()) | ||
| .withResponseBuilderFactory(new ResponseBuilder.Factory() { | ||
| private final AzureResponseBuilder.Factory baseFactory = new AzureResponseBuilder.Factory(); | ||
| @Override | ||
| public <T, E extends RestException> ResponseBuilder<T, E> newInstance(SerializerAdapter<?> serializerAdapter) { | ||
| return baseFactory.<T, E>newInstance(serializerAdapter).withThrowOnGet404(true); | ||
| } | ||
| }) | ||
| .build(); | ||
|
|
||
| this.protocolLayer = new BatchServiceClientImpl(restClient).withBatchUrl(credentials.baseUrl()); | ||
| this.customBehaviors = new LinkedList<>(); | ||
| this.customBehaviors.add(new ClientRequestIdInterceptor()); | ||
|
|
@@ -70,6 +71,21 @@ public <T, E extends RestException> ResponseBuilder<T, E> newInstance(Serializer | |
| this.computeNodeOperations = new ComputeNodeOperations(this, customBehaviors()); | ||
| } | ||
|
|
||
| private BatchClient(RestClient restClient, String baseUrl) { | ||
| this.protocolLayer = new BatchServiceClientImpl(restClient).withBatchUrl(baseUrl); | ||
| this.customBehaviors = new LinkedList<>(); | ||
| this.customBehaviors.add(new ClientRequestIdInterceptor()); | ||
| this.certificateOperations = new CertificateOperations(this, customBehaviors()); | ||
| this.jobOperations = new JobOperations(this, customBehaviors()); | ||
| this.taskOperations = new TaskOperations(this, customBehaviors()); | ||
| this.jobScheduleOperations = new JobScheduleOperations(this, customBehaviors()); | ||
| this.poolOperations = new PoolOperations(this, customBehaviors()); | ||
| this.fileOperations = new FileOperations(this, customBehaviors()); | ||
| this.applicationOperations = new ApplicationOperations(this, customBehaviors()); | ||
| this.accountOperations = new AccountOperations(this, customBehaviors()); | ||
| this.computeNodeOperations = new ComputeNodeOperations(this, customBehaviors()); | ||
| } | ||
|
|
||
| /** | ||
| * Creates an instance of {@link BatchClient} associated with the specified credentials. | ||
| * | ||
|
|
@@ -80,6 +96,18 @@ public static BatchClient open(BatchCredentials credentials) { | |
| return new BatchClient(credentials); | ||
| } | ||
|
|
||
| /** | ||
| * Creates an instance of {@link BatchClient} associated with the specified restClient and baseurl. | ||
| * | ||
| * @param restClient A {@link RestClient} object specifying the definition of rest client used to | ||
| * interact with batch endpoint. | ||
| * @param baseUrl A String object specifying the the batch end point. | ||
| * @return The new {@link BatchClient} instance. | ||
| */ | ||
| static BatchClient open(RestClient restClient, String baseUrl) { | ||
| return new BatchClient(restClient, baseUrl); | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need new public API? This could probably be package-protected?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keyvault has a public client constructor with RestClient as a parameter.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still don't understand why we need this new public API? Can it be package-protected (i.e. with no modifier and therefore not public API)?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There seems to be github glitch.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not protected, package-protected (with no modifier)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you mean package-private (no modifier) ?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to package-private. |
||
|
|
||
| /** | ||
| * Gets a {@link CertificateOperations} object for performing certificate-related operations on the associated account. | ||
| * | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this redundant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No,
Both are referencing to different versions of the azure-mgmt-resources in the parent pom.
Both the versions are needed.