assertNoControllerConfig(ric, version);
return new OscA1Client(ric.getConfig(), this.appConfig.getWebClientConfig());
} else if (version == A1ProtocolType.SDNC_OSC_STD_V1_1 || version == A1ProtocolType.SDNC_OSC_OSC_V1) {
- return new SdncOscA1Client(version, ric.getConfig(), getControllerConfig(ric));
+ return new SdncOscA1Client(version, ric.getConfig(), getControllerConfig(ric),
+ this.appConfig.getWebClientConfig());
} else if (version == A1ProtocolType.SDNC_ONAP) {
- return new SdncOnapA1Client(ric.getConfig(), getControllerConfig(ric));
+ return new SdncOnapA1Client(ric.getConfig(), getControllerConfig(ric), this.appConfig.getWebClientConfig());
} else {
logger.error("Unhandled protocol: {}", version);
throw new ServiceException("Unhandled protocol");
import org.immutables.value.Value;
import org.oransc.policyagent.configuration.ControllerConfig;
import org.oransc.policyagent.configuration.RicConfig;
+import org.oransc.policyagent.configuration.WebClientConfig;
import org.oransc.policyagent.repository.Policy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private final RicConfig ricConfig;
private final AsyncRestClient restClient;
- public SdncOnapA1Client(RicConfig ricConfig, ControllerConfig controllerConfig) {
- this(ricConfig, controllerConfig, new AsyncRestClient(controllerConfig.baseUrl() + "/restconf/operations"));
+ public SdncOnapA1Client(RicConfig ricConfig, ControllerConfig controllerConfig, WebClientConfig clientConfig) {
+ this(ricConfig, controllerConfig,
+ new AsyncRestClient(controllerConfig.baseUrl() + "/restconf/operations", clientConfig));
logger.debug("SdncOnapA1Client for ric: {}, a1ControllerBaseUrl: {}", ricConfig.name(),
controllerConfig.baseUrl());
}
import org.json.JSONObject;
import org.oransc.policyagent.configuration.ControllerConfig;
import org.oransc.policyagent.configuration.RicConfig;
+import org.oransc.policyagent.configuration.WebClientConfig;
import org.oransc.policyagent.repository.Policy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*
* @throws IllegalArgumentException when the protocolType is wrong.
*/
- public SdncOscA1Client(A1ProtocolType protocolType, RicConfig ricConfig, ControllerConfig controllerConfig) {
+ public SdncOscA1Client(A1ProtocolType protocolType, RicConfig ricConfig, ControllerConfig controllerConfig,
+ WebClientConfig clientConfig) {
this(protocolType, ricConfig, controllerConfig,
- new AsyncRestClient(controllerConfig.baseUrl() + "/restconf/operations"));
+ new AsyncRestClient(controllerConfig.baseUrl() + "/restconf/operations", clientConfig));
logger.debug("SdncOscA1Client for ric: {}, a1Controller: {}", ricConfig.name(), controllerConfig);
}
@Test
void createClientWithWrongProtocol_thenErrorIsThrown() {
try {
- new SdncOscA1Client(A1ProtocolType.STD_V1_1, null, null, null);
+ new SdncOscA1Client(A1ProtocolType.STD_V1_1, null, null, new AsyncRestClient("", null));
fail("Should have thrown exception.");
} catch (IllegalArgumentException e) {
return;