Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Doc adjustement to transient parameter"
[nonrtric.git]
/
policy-agent
/
src
/
main
/
java
/
org
/
oransc
/
policyagent
/
clients
/
StdA1ClientVersion1.java
diff --git
a/policy-agent/src/main/java/org/oransc/policyagent/clients/StdA1ClientVersion1.java
b/policy-agent/src/main/java/org/oransc/policyagent/clients/StdA1ClientVersion1.java
index
7480b93
..
4ebc25c
100644
(file)
--- a/
policy-agent/src/main/java/org/oransc/policyagent/clients/StdA1ClientVersion1.java
+++ b/
policy-agent/src/main/java/org/oransc/policyagent/clients/StdA1ClientVersion1.java
@@
-24,11
+24,15
@@
import java.util.Arrays;
import java.util.List;
import org.oransc.policyagent.configuration.RicConfig;
import java.util.List;
import org.oransc.policyagent.configuration.RicConfig;
+import org.oransc.policyagent.configuration.WebClientConfig;
import org.oransc.policyagent.repository.Policy;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import org.oransc.policyagent.repository.Policy;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
+/**
+ * Client for accessing standard A1 REST API version 1.1
+ */
public class StdA1ClientVersion1 implements A1Client {
public static class UriBuilder implements A1UriBuilder {
public class StdA1ClientVersion1 implements A1Client {
public static class UriBuilder implements A1UriBuilder {
@@
-39,20
+43,32
@@
public class StdA1ClientVersion1 implements A1Client {
this.ricConfig = ricConfig;
}
this.ricConfig = ricConfig;
}
+ /**
+ * /A1-P/v1/policies/{policyId}
+ */
@Override
public String createPutPolicyUri(String type, String policyId) {
return policiesBaseUri() + policyId;
}
@Override
public String createPutPolicyUri(String type, String policyId) {
return policiesBaseUri() + policyId;
}
+ /**
+ * /A1-P/v1/policies
+ */
public String createGetPolicyIdsUri() {
return baseUri() + "/policies";
}
public String createGetPolicyIdsUri() {
return baseUri() + "/policies";
}
+ /**
+ * /A1-P/v1/policies/{policyId}
+ */
@Override
public String createDeleteUri(String type, String policyId) {
return policiesBaseUri() + policyId;
}
@Override
public String createDeleteUri(String type, String policyId) {
return policiesBaseUri() + policyId;
}
+ /**
+ * /A1-P/v1/policies/{policyId}/status
+ */
public String createGetPolicyStatusUri(String type, String policyId) {
return policiesBaseUri() + policyId + "/status";
}
public String createGetPolicyStatusUri(String type, String policyId) {
return policiesBaseUri() + policyId + "/status";
}
@@
-69,8
+85,8
@@
public class StdA1ClientVersion1 implements A1Client {
private final AsyncRestClient restClient;
private final UriBuilder uri;
private final AsyncRestClient restClient;
private final UriBuilder uri;
- public StdA1ClientVersion1(RicConfig ricConfig) {
- this(new AsyncRestClient(""), ricConfig);
+ public StdA1ClientVersion1(RicConfig ricConfig
, WebClientConfig webClientConfig
) {
+ this(new AsyncRestClient(""
, webClientConfig
), ricConfig);
}
public StdA1ClientVersion1(AsyncRestClient restClient, RicConfig ricConfig) {
}
public StdA1ClientVersion1(AsyncRestClient restClient, RicConfig ricConfig) {
@@
-86,8
+102,7
@@
public class StdA1ClientVersion1 implements A1Client {
@Override
public Mono<String> putPolicy(Policy policy) {
@Override
public Mono<String> putPolicy(Policy policy) {
- return restClient.put(uri.createPutPolicyUri(policy.type().name(), policy.id()), policy.json()) //
- .flatMap(JsonHelper::validateJson);
+ return restClient.put(uri.createPutPolicyUri(policy.type().name(), policy.id()), policy.json());
}
@Override
}
@Override
@@
-124,7
+139,7
@@
public class StdA1ClientVersion1 implements A1Client {
private Flux<String> getPolicyIds() {
return restClient.get(uri.createGetPolicyIdsUri()) //
private Flux<String> getPolicyIds() {
return restClient.get(uri.createGetPolicyIdsUri()) //
- .flatMapMany(JsonHelper::parseJsonArrayOfString);
+ .flatMapMany(
Sdnc
JsonHelper::parseJsonArrayOfString);
}
private Mono<String> deletePolicyById(String policyId) {
}
private Mono<String> deletePolicyById(String policyId) {