- public SdncOscA1Client(RicConfig ricConfig, String username, String password, AsyncRestClient restClient) {
- this.ricConfig = ricConfig;
- this.a1ControllerUsername = username;
- this.a1ControllerPassword = password;
+ static com.google.gson.Gson gson = new GsonBuilder() //
+ .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_DASHES) //
+ .create(); //
+
+ private static final String GET_POLICY_RPC = "getA1Policy";
+ private static final String UNHANDELED_PROTOCOL = "Bug, unhandeled protocoltype: ";
+ 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
+ *
+ * @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, ControllerConfig controllerConfig) {
+ this(protocolType, ricConfig, controllerConfig,
+ new AsyncRestClient(controllerConfig.baseUrl() + "/restconf/operations"));
+ logger.debug("SdncOscA1Client for ric: {}, a1Controller: {}", ricConfig.name(), controllerConfig);
+ }
+
+ public SdncOscA1Client(A1ProtocolType protocolType, RicConfig ricConfig, ControllerConfig controllerConfig,
+ AsyncRestClient restClient) {