+ private final ApplicationConfig appConfig;
+
+ @Autowired
+ public A1ClientFactory(ApplicationConfig appConfig) {
+ this.appConfig = appConfig;
+ }
+
+ /**
+ * Creates an A1 client with the correct A1 protocol for the provided Ric.
+ *
+ * <p>
+ * It detects the protocol version by trial and error, since there is no getVersion method specified in the A1
+ * api yet.
+ *
+ * <p>
+ * As a side effect it also sets the protocol version in the provided Ric. This means that after the first
+ * successful creation it won't have to try which protocol to use, but can create the client directly.
+ *
+ * @param ric The Ric to get a client for.
+ * @return a client with the correct protocol, or a ServiceException if none of the protocols are supported by the
+ * Ric.
+ */