Search in sources :

Example 86 with NetconfSession

use of org.onosproject.netconf.NetconfSession in project onos by opennetworkinglab.

the class PolatisNetconfUtility method netconfGetConfig.

/**
 * Retrieves session reply information for get config operation.
 *
 * @param handler parent driver handler
 * @param filter the filter string of xml content
 * @return the reply string
 */
public static String netconfGetConfig(DriverHandler handler, String filter) {
    NetconfSession session = getNetconfSession(handler);
    String reply;
    try {
        reply = session.getConfig(DatastoreId.RUNNING, filter);
    } catch (NetconfException e) {
        throw new IllegalStateException(new NetconfException("Failed to retrieve configuration.", e));
    }
    return reply;
}
Also used : NetconfSession(org.onosproject.netconf.NetconfSession) NetconfException(org.onosproject.netconf.NetconfException)

Example 87 with NetconfSession

use of org.onosproject.netconf.NetconfSession in project onos by opennetworkinglab.

the class PolatisNetconfUtility method netconfGet.

/**
 * Retrieves session reply information for get operation.
 *
 * @param handler parent driver handler
 * @param filter the filter string of xml content
 * @return the reply string
 */
public static String netconfGet(DriverHandler handler, String filter) {
    NetconfSession session = getNetconfSession(handler);
    String reply;
    try {
        reply = session.get(filter, null);
    } catch (NetconfException e) {
        throw new IllegalStateException(new NetconfException("Failed to retrieve configuration.", e));
    }
    return reply;
}
Also used : NetconfSession(org.onosproject.netconf.NetconfSession) NetconfException(org.onosproject.netconf.NetconfException)

Aggregations

NetconfSession (org.onosproject.netconf.NetconfSession)87 NetconfException (org.onosproject.netconf.NetconfException)72 NetconfController (org.onosproject.netconf.NetconfController)44 DeviceId (org.onosproject.net.DeviceId)32 XPath (javax.xml.xpath.XPath)22 XPathExpressionException (javax.xml.xpath.XPathExpressionException)18 XMLConfiguration (org.apache.commons.configuration.XMLConfiguration)18 Node (org.w3c.dom.Node)18 ArrayList (java.util.ArrayList)16 HierarchicalConfiguration (org.apache.commons.configuration.HierarchicalConfiguration)16 ByteArrayInputStream (java.io.ByteArrayInputStream)15 DeviceService (org.onosproject.net.device.DeviceService)13 Device (org.onosproject.net.Device)12 DefaultDeviceDescription (org.onosproject.net.device.DefaultDeviceDescription)11 ChassisId (org.onlab.packet.ChassisId)10 FlowRule (org.onosproject.net.flow.FlowRule)10 HashMap (java.util.HashMap)9 PortDescription (org.onosproject.net.device.PortDescription)9 NodeList (org.w3c.dom.NodeList)9 ConnectPoint (org.onosproject.net.ConnectPoint)8