import yang-ext {prefix ext; revision-date "2013-07-09";}
import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
- import opendaylight-flow-types {prefix types;revision-date "2013-10-26";}
+ import opendaylight-flow-types {prefix types;revision-date "2013-10-26";}
+ import opendaylight-group-types {prefix group-type;revision-date 2013-10-18;}
+ import opendaylight-meter-types {prefix meter-type;revision-date "2013-09-18";}
import flow-capable-transaction {prefix tr;}
import flow-errors {prefix error;}
uses error:error-message;
uses tr:transaction-aware;
uses tr:transaction-metadata;
+ choice object-reference {
+ case flow-ref{
+ leaf flow-ref {
+ type types:flow-ref;
+ }
+ }
+ case group-ref{
+ leaf group-ref {
+ type group-type:group-ref;
+ }
+ }
+ case meter-ref{
+ leaf meter-ref {
+ type meter-type:meter-ref;
+ }
+ }
+ }
+ leaf node {
+ ext:context-reference "inv:node-context";
+ type inv:node-ref;
+ }
+
}
notification node-experimenter-error-notification {
import java.util.concurrent.TimeUnit;
import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkState;
/**
* ZeroMq based implementation of RpcRouter. It implements RouteChangeListener of RoutingTable
public ServerImpl(int port) {
this.port = port;
- this.serverAddress = new StringBuilder(findIpAddress()).
- append(":").
- append(port).
- toString();
}
public RoutingTableProvider getRoutingTableProvider() {
"Remote RPC Server is already running");
status = State.STARTING;
+ _logger.debug("Remote RPC Server is starting...");
+
+ String hostIpAddress = findIpAddress();
+
+ //Log and silently die as per discussion in the bug (bug-362)
+ //https://bugs.opendaylight.org/show_bug.cgi?id=362
+ //
+ // A tracking enhancement defect (bug-366) is created to properly fix this issue
+ //https://bugs.opendaylight.org/show_bug.cgi?id=366
+ //checkState(hostIpAddress != null, "Remote RPC Server could not acquire host ip address");
+
+ if (hostIpAddress == null) {
+ _logger.error("Remote RPC Server could not acquire host ip address. Stopping...");
+ stop();
+ return;
+ }
+
+ this.serverAddress = new StringBuilder(hostIpAddress).
+ append(":").
+ append(port).
+ toString();
+
context = ZMQ.context(1);
remoteServices = new HashSet<QName>();//
serverPool = Executors.newSingleThreadExecutor();//main server thread
* @return
*/
private String findIpAddress() {
- String hostAddress = null;
Enumeration e = null;
try {
e = NetworkInterface.getNetworkInterfaces();
} catch (SocketException e1) {
- e1.printStackTrace();
+ _logger.error("Failed to get list of interfaces", e1);
+ //throw new RuntimeException("Failed to acquire list of interfaces", e1);
+ return null;
}
while (e.hasMoreElements()) {
Enumeration ee = n.getInetAddresses();
while (ee.hasMoreElements()) {
InetAddress i = (InetAddress) ee.nextElement();
- if ((i instanceof Inet4Address) && (i.isSiteLocalAddress()))
- hostAddress = i.getHostAddress();
+ _logger.debug("Trying address {}", i);
+ if ((i instanceof Inet4Address) && (i.isSiteLocalAddress())) {
+ String hostAddress = i.getHostAddress();
+ _logger.debug("Settled on host address {}", hostAddress);
+ return hostAddress;
+ }
}
}
- return hostAddress;
+ _logger.error("Failed to find a suitable host address");
+ return null;
}
/**