+ 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 String a1ControllerUsername;
+ private final String a1ControllerPassword;
+ 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, String controllerBaseUrl, String username,
+ String password) {
+ this(protocolType, ricConfig, username, password,
+ new AsyncRestClient(controllerBaseUrl + "/restconf/operations"));
+ logger.debug("SdncOscA1Client for ric: {}, a1ControllerBaseUrl: {}", ricConfig.name(), controllerBaseUrl);
+ }
+
+ public SdncOscA1Client(A1ProtocolType protocolType, RicConfig ricConfig, String username, String password,
+ AsyncRestClient restClient) {