@SuppressWarnings("squid:S2629") // Invoke method(s) only conditionally
public class SdncOscA1Client implements A1Client {
@SuppressWarnings("squid:S2629") // Invoke method(s) only conditionally
public class SdncOscA1Client implements A1Client {
+ /**
+ * Constructor
+ *
+ * @param protocolType the southbound protocol of the controller. Supported
+ * protocols are SDNC_OSC_STD_V1_1 and SDNC_OSC_OSC_V1
+ * @param ricConfig
+ * @param controllerBaseUrl the base URL of the SDNC controller
+ * @param username username to accesss the SDNC controller
+ * @param password password to accesss the SDNC controller
+ */
public SdncOscA1Client(A1ProtocolType protocolType, RicConfig ricConfig, String controllerBaseUrl, String username,
String password) {
this(protocolType, ricConfig, username, password,
public SdncOscA1Client(A1ProtocolType protocolType, RicConfig ricConfig, String controllerBaseUrl, String username,
String password) {
this(protocolType, ricConfig, username, password,
OscA1Client.UriBuilder uri = new OscA1Client.UriBuilder(ricConfig);
final String ricUrl = uri.createPolicyTypesUri();
return post(GET_POLICY_RPC, ricUrl, Optional.empty()) //
OscA1Client.UriBuilder uri = new OscA1Client.UriBuilder(ricConfig);
final String ricUrl = uri.createPolicyTypesUri();
return post(GET_POLICY_RPC, ricUrl, Optional.empty()) //
return getPolicyTypeIdentities() //
.flatMapMany(Flux::fromIterable)
.flatMap(type -> post(GET_POLICY_RPC, uriBuilder.createGetPolicyIdsUri(type), Optional.empty())) //
return getPolicyTypeIdentities() //
.flatMapMany(Flux::fromIterable)
.flatMap(type -> post(GET_POLICY_RPC, uriBuilder.createGetPolicyIdsUri(type), Optional.empty())) //
StdA1ClientVersion1.UriBuilder uri = new StdA1ClientVersion1.UriBuilder(ricConfig);
final String ricUrl = uri.createGetPolicyIdsUri();
return post(GET_POLICY_RPC, ricUrl, Optional.empty()) //
StdA1ClientVersion1.UriBuilder uri = new StdA1ClientVersion1.UriBuilder(ricConfig);
final String ricUrl = uri.createGetPolicyIdsUri();
return post(GET_POLICY_RPC, ricUrl, Optional.empty()) //
} else if (this.protocolType == A1ProtocolType.SDNC_OSC_OSC_V1) {
OscA1Client.UriBuilder uri = new OscA1Client.UriBuilder(ricConfig);
return getPolicyTypeIdentities() //
.flatMapMany(Flux::fromIterable)
.flatMap(type -> post(GET_POLICY_RPC, uri.createGetPolicyIdsUri(type), Optional.empty())) //
} else if (this.protocolType == A1ProtocolType.SDNC_OSC_OSC_V1) {
OscA1Client.UriBuilder uri = new OscA1Client.UriBuilder(ricConfig);
return getPolicyTypeIdentities() //
.flatMapMany(Flux::fromIterable)
.flatMap(type -> post(GET_POLICY_RPC, uri.createGetPolicyIdsUri(type), Optional.empty())) //
return restClient
.postWithAuthHeader(controllerUrl(rpcName), inputJsonString, a1ControllerUsername, a1ControllerPassword)
return restClient
.postWithAuthHeader(controllerUrl(rpcName), inputJsonString, a1ControllerUsername, a1ControllerPassword)