3
3
*/
4
4
package com .oracle .bmc .audit ;
5
5
6
- import com .oracle .bmc .ClientConfiguration ;
7
- import com .oracle .bmc .auth .*;
8
- import com .oracle .bmc .http .ClientConfigurator ;
9
- import com .oracle .bmc .http .internal .*;
10
- import com .oracle .bmc .http .signing .*;
11
- import com .oracle .bmc .http .signing .internal .*;
12
- import com .oracle .bmc .responses .*;
13
- import com .oracle .bmc .util .internal .*;
14
-
15
- import com .google .common .base .Function ;
16
- import com .google .common .base .Optional ;
17
-
18
- import java .util .concurrent .Future ;
19
-
20
- import javax .ws .rs .client .*;
21
- import javax .ws .rs .core .*;
22
-
23
6
import com .oracle .bmc .audit .internal .http .*;
24
7
import com .oracle .bmc .audit .requests .*;
25
8
import com .oracle .bmc .audit .responses .*;
26
9
27
- import com .oracle .bmc .*;
28
-
29
- import lombok .AccessLevel ;
30
- import lombok .Getter ;
31
- import lombok .extern .slf4j .Slf4j ;
32
-
33
10
@ javax .annotation .Generated (value = "OracleSDKGenerator" , comments = "API Version: 20160918" )
34
- @ Slf4j
11
+ @ lombok . extern . slf4j . Slf4j
35
12
public class AuditAsyncClient implements AuditAsync {
36
13
/**
37
14
* Service instance for Audit.
38
15
*/
39
- public static final Service SERVICE = Services .create ("AUDIT" , "audit" );
16
+ public static final com .oracle .bmc .Service SERVICE =
17
+ com .oracle .bmc .Services .create ("AUDIT" , "audit" );
40
18
41
- @ Getter (value = AccessLevel .PACKAGE )
42
- private final RestClient client ;
19
+ @ lombok . Getter (value = lombok . AccessLevel .PACKAGE )
20
+ private final com . oracle . bmc . http . internal . RestClient client ;
43
21
44
22
/**
45
23
* Creates a new service instance using the given authentication provider.
46
24
* @param authenticationDetailsProvider The authentication details provider, required.
47
25
*/
48
- public AuditAsyncClient (BasicAuthenticationDetailsProvider authenticationDetailsProvider ) {
26
+ public AuditAsyncClient (
27
+ com .oracle .bmc .auth .BasicAuthenticationDetailsProvider authenticationDetailsProvider ) {
49
28
this (authenticationDetailsProvider , null );
50
29
}
51
30
@@ -55,8 +34,8 @@ public AuditAsyncClient(BasicAuthenticationDetailsProvider authenticationDetails
55
34
* @param configuration The client configuration, optional.
56
35
*/
57
36
public AuditAsyncClient (
58
- BasicAuthenticationDetailsProvider authenticationDetailsProvider ,
59
- ClientConfiguration configuration ) {
37
+ com . oracle . bmc . auth . BasicAuthenticationDetailsProvider authenticationDetailsProvider ,
38
+ com . oracle . bmc . ClientConfiguration configuration ) {
60
39
this (authenticationDetailsProvider , configuration , null );
61
40
}
62
41
@@ -68,14 +47,15 @@ public AuditAsyncClient(
68
47
* @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional.
69
48
*/
70
49
public AuditAsyncClient (
71
- BasicAuthenticationDetailsProvider authenticationDetailsProvider ,
72
- ClientConfiguration configuration ,
73
- ClientConfigurator clientConfigurator ) {
50
+ com . oracle . bmc . auth . BasicAuthenticationDetailsProvider authenticationDetailsProvider ,
51
+ com . oracle . bmc . ClientConfiguration configuration ,
52
+ com . oracle . bmc . http . ClientConfigurator clientConfigurator ) {
74
53
this (
75
54
authenticationDetailsProvider ,
76
55
configuration ,
77
56
clientConfigurator ,
78
- new DefaultRequestSignerFactory (SigningStrategy .STANDARD ));
57
+ new com .oracle .bmc .http .signing .internal .DefaultRequestSignerFactory (
58
+ com .oracle .bmc .http .signing .SigningStrategy .STANDARD ));
79
59
}
80
60
81
61
/**
@@ -89,13 +69,15 @@ public AuditAsyncClient(
89
69
* @param requestSignerFactory The request signer factory used to create the request signer for this service.
90
70
*/
91
71
public AuditAsyncClient (
92
- AbstractAuthenticationDetailsProvider authenticationDetailsProvider ,
93
- ClientConfiguration configuration ,
94
- ClientConfigurator clientConfigurator ,
95
- RequestSignerFactory requestSignerFactory ) {
96
- RestClientFactory restClientFactory =
97
- RestClientFactoryBuilder .builder ().clientConfigurator (clientConfigurator ).build ();
98
- RequestSigner requestSigner =
72
+ com .oracle .bmc .auth .AbstractAuthenticationDetailsProvider authenticationDetailsProvider ,
73
+ com .oracle .bmc .ClientConfiguration configuration ,
74
+ com .oracle .bmc .http .ClientConfigurator clientConfigurator ,
75
+ com .oracle .bmc .http .signing .RequestSignerFactory requestSignerFactory ) {
76
+ com .oracle .bmc .http .internal .RestClientFactory restClientFactory =
77
+ com .oracle .bmc .http .internal .RestClientFactoryBuilder .builder ()
78
+ .clientConfigurator (clientConfigurator )
79
+ .build ();
80
+ com .oracle .bmc .http .signing .RequestSigner requestSigner =
99
81
requestSignerFactory .createRequestSigner (SERVICE , authenticationDetailsProvider );
100
82
this .client = restClientFactory .create (requestSigner , configuration );
101
83
}
@@ -107,8 +89,8 @@ public void setEndpoint(String endpoint) {
107
89
}
108
90
109
91
@ Override
110
- public void setRegion (Region region ) {
111
- Optional <String > endpoint = region .getEndpoint (SERVICE );
92
+ public void setRegion (com . oracle . bmc . Region region ) {
93
+ com . google . common . base . Optional <String > endpoint = region .getEndpoint (SERVICE );
112
94
if (endpoint .isPresent ()) {
113
95
setEndpoint (endpoint .get ());
114
96
} else {
@@ -121,11 +103,11 @@ public void setRegion(Region region) {
121
103
public void setRegion (String regionId ) {
122
104
regionId = regionId .toLowerCase ();
123
105
try {
124
- Region region = Region .fromRegionId (regionId );
106
+ com . oracle . bmc . Region region = com . oracle . bmc . Region .fromRegionId (regionId );
125
107
setRegion (region );
126
108
} catch (IllegalArgumentException e ) {
127
109
LOG .info ("Unknown regionId '{}', falling back to default endpoint format" , regionId );
128
- String endpoint = Region .formatDefaultRegionEndpoint (SERVICE , regionId );
110
+ String endpoint = com . oracle . bmc . Region .formatDefaultRegionEndpoint (SERVICE , regionId );
129
111
setEndpoint (endpoint );
130
112
}
131
113
}
@@ -136,18 +118,22 @@ public void close() {
136
118
}
137
119
138
120
@ Override
139
- public Future <ListEventsResponse > listEvents (
121
+ public java . util . concurrent . Future <ListEventsResponse > listEvents (
140
122
ListEventsRequest request ,
141
- AsyncHandler <ListEventsRequest , ListEventsResponse > handler ) {
123
+ com . oracle . bmc . responses . AsyncHandler <ListEventsRequest , ListEventsResponse > handler ) {
142
124
LOG .trace ("Called async listEvents" );
143
125
request = ListEventsConverter .interceptRequest (request );
144
- Invocation .Builder ib = ListEventsConverter .fromRequest (client , request );
145
- Function <Response , ListEventsResponse > transformer = ListEventsConverter .fromResponse ();
146
-
147
- Consumer <Response > onSuccess = new SuccessConsumer <>(handler , transformer , request );
148
- Consumer <Throwable > onError = new ErrorConsumer <>(handler , request );
149
-
150
- Future <Response > responseFuture = client .get (ib , request , onSuccess , onError );
151
- return new TransformingFuture <>(responseFuture , transformer );
126
+ javax .ws .rs .client .Invocation .Builder ib = ListEventsConverter .fromRequest (client , request );
127
+ com .google .common .base .Function <javax .ws .rs .core .Response , ListEventsResponse > transformer =
128
+ ListEventsConverter .fromResponse ();
129
+
130
+ com .oracle .bmc .util .internal .Consumer <javax .ws .rs .core .Response > onSuccess =
131
+ new com .oracle .bmc .http .internal .SuccessConsumer <>(handler , transformer , request );
132
+ com .oracle .bmc .util .internal .Consumer <Throwable > onError =
133
+ new com .oracle .bmc .http .internal .ErrorConsumer <>(handler , request );
134
+
135
+ java .util .concurrent .Future <javax .ws .rs .core .Response > responseFuture =
136
+ client .get (ib , request , onSuccess , onError );
137
+ return new com .oracle .bmc .util .internal .TransformingFuture <>(responseFuture , transformer );
152
138
}
153
139
}
0 commit comments