aboutsummaryrefslogtreecommitdiffstats
path: root/test/mocks/pnfsimulator/src/main/java/org/onap/pnfsimulator/netconfmonitor/netconf/NetconfConfigurationReader.java
blob: 8bd1a57a016a924847d6489ed3b33eb04b5977a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package org.onap.pnfsimulator.netconfmonitor.netconf;

import com.tailf.jnc.JNCException;
import com.tailf.jnc.NetconfSession;
import java.io.IOException;

public class NetconfConfigurationReader {

    private final NetconfSession session;
    private final String netconfModelPath;

    public NetconfConfigurationReader(NetconfSession session, String netconfModelPath) {
        this.session = session;
        this.netconfModelPath = netconfModelPath;
    }

    public String read() throws IOException, JNCException {
        return session.getConfig(netconfModelPath).first().toXMLString();
    }
}