Remove trailing whitespace
[openflowjava.git] / openflow-protocol-api / src / main / java / org / opendaylight / openflowjava / protocol / api / connection / ConnectionAdapter.java
index 888a73910a3baf08a2656d54e7dcbc5c8858cd39..82b7a89667245fbf996d0de0d0d03cee9fbddbec 100644 (file)
@@ -1,17 +1,20 @@
-/**
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
+
 package org.opendaylight.openflowjava.protocol.api.connection;
 
+import java.net.InetSocketAddress;
 import java.util.concurrent.Future;
 
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolListener;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.SystemNotificationsListener;
 
 /**
  * @author mirehak
@@ -23,22 +26,41 @@ public interface ConnectionAdapter extends OpenflowProtocolService {
      * disconnect corresponding switch
      * @return future set to true, when disconnect completed
      */
-    public Future<Boolean> disconnect();
-    
+    Future<Boolean> disconnect();
+
     /**
      * @return true, if connection to switch is alive
      */
-    public boolean isAlive();
-    
+    boolean isAlive();
+
+    /**
+     * @return address of the remote end - address of a switch if connected
+     */
+    InetSocketAddress getRemoteAddress();
     /**
      * @param messageListener here will be pushed all messages from switch
      */
-    public void setMessageListener(OpenflowProtocolListener messageListener);
-    
+    void setMessageListener(OpenflowProtocolListener messageListener);
+
     /**
-     * @param version version of OpenFlow protocol to be used for communication with switch 
-     * (set after version negotiation) - in wire protocol format e.g. 4 (or 0x04) for OF 1.3   
-     * 
+     * @param systemListener here will be pushed all system messages from library
      */
-    public void setVersion(int version);
+    void setSystemListener(SystemNotificationsListener systemListener);
+
+    /**
+     * Throws exception if any of required listeners is missing
+     */
+    void checkListeners();
+
+    /**
+     * notify listener about connection ready-to-use event
+     */
+    void fireConnectionReadyNotification();
+
+    /**
+     * set listener for connection became ready-to-use event
+     * @param connectionReadyListener
+     */
+    void setConnectionReadyListener(ConnectionReadyListener connectionReadyListener);
+
 }