- public SdncOscA1Client(RicConfig ricConfig, String baseUrl, String username, String password) {
- this(ricConfig, username, password, new AsyncRestClient(baseUrl + "/restconf/operations"));
- if (logger.isDebugEnabled()) {
- logger.debug("SdncOscA1Client for ric: {}, a1ControllerBaseUrl: {}", ricConfig.name(), baseUrl);
- }
+ private static final String GET_POLICY_RPC = "getA1Policy";
+ private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+ private final ControllerConfig controllerConfig;
+ private final AsyncRestClient restClient;
+ private final RicConfig ricConfig;
+ private final A1ProtocolType protocolType;
+
+ /**
+ * Constructor that creates the REST client to use.
+ *
+ * @param protocolType the southbound protocol of the controller. Supported protocols are SDNC_OSC_STD_V1_1 and
+ * SDNC_OSC_OSC_V1
+ * @param ricConfig the configuration of the Ric to communicate with
+ * @param controllerConfig the configuration of the SDNC controller to use
+ *
+ * @throws IllegalArgumentException when the protocolType is wrong.
+ */
+ public SdncOscA1Client(A1ProtocolType protocolType, RicConfig ricConfig, ControllerConfig controllerConfig) {
+ this(protocolType, ricConfig, controllerConfig,
+ new AsyncRestClient(controllerConfig.baseUrl() + "/restconf/operations"));
+ logger.debug("SdncOscA1Client for ric: {}, a1Controller: {}", ricConfig.name(), controllerConfig);