Search in sources :

Example 1 with ConnectionInfoBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfoBuilder in project genius by opendaylight.

the class OvsdbTestUtil method getConnectionInfo.

/* methods */
public static ConnectionInfo getConnectionInfo(int port, String strIpAddress) {
    IpAddress ipAddress = IpAddressBuilder.getDefaultInstance(strIpAddress);
    PortNumber portNumber = new PortNumber(port);
    ConnectionInfo connectionInfo = new ConnectionInfoBuilder().setRemoteIp(ipAddress).setRemotePort(portNumber).build();
    return connectionInfo;
}
Also used : ConnectionInfoBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfoBuilder) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress) ConnectionInfo(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo) PortNumber(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber)

Example 2 with ConnectionInfoBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfoBuilder in project genius by opendaylight.

the class OvsdbSouthboundTestUtil method getConnectionInfo.

public static ConnectionInfo getConnectionInfo(final String addressStr, final String portStr) {
    InetAddress inetAddress = null;
    try {
        inetAddress = InetAddress.getByName(addressStr);
    } catch (UnknownHostException e) {
        LOG.warn("Could not allocate InetAddress", e);
    }
    IpAddress address = createIpAddress(inetAddress);
    PortNumber port = new PortNumber(Integer.parseInt(portStr));
    LOG.info("connectionInfo: {}", new ConnectionInfoBuilder().setRemoteIp(address).setRemotePort(port).build());
    return new ConnectionInfoBuilder().setRemoteIp(address).setRemotePort(port).build();
}
Also used : UnknownHostException(java.net.UnknownHostException) ConnectionInfoBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfoBuilder) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress) PortNumber(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber) InetAddress(java.net.InetAddress)

Aggregations

IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)2 PortNumber (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber)2 ConnectionInfoBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfoBuilder)2 InetAddress (java.net.InetAddress)1 UnknownHostException (java.net.UnknownHostException)1 ConnectionInfo (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo)1