- private static NetconfMessage loadHelloMessageTemplate() {
- final String helloMessagePath = "/client_hello.xml";
- try (InputStream is = NetconfClientSessionNegotiatorFactory.class.getResourceAsStream(helloMessagePath)) {
- Preconditions.checkState(is != null, "Input stream from %s was null", helloMessagePath);
- return new NetconfMessage(XmlUtil.readXmlToDocument(is));
- } catch (SAXException | IOException e) {
- throw new RuntimeException("Unable to load hello message", e);
- }
+ public NetconfClientSessionNegotiatorFactory(Timer timer,
+ Optional<NetconfHelloMessageAdditionalHeader> additionalHeader,
+ long connectionTimeoutMillis, EXIOptions exiOptions) {
+ this.timer = Preconditions.checkNotNull(timer);
+ this.additionalHeader = additionalHeader;
+ this.connectionTimeoutMillis = connectionTimeoutMillis;
+ this.options = exiOptions;