/*
 * Copyright (c) 2014 Cisco Systems, Inc. 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.controller.protocol_plugins.stub.internal;

import org.opendaylight.controller.sal.core.ConstructionException;
import org.opendaylight.controller.sal.utils.INodeFactory;
import org.opendaylight.controller.sal.core.Node;

public class StubNodeFactory implements INodeFactory
    {
      void init() {
      }

      /**
       * Function called by the dependency manager when at least one dependency
       * become unsatisfied or when the component is shutting down because for
       * example bundle is being stopped.
       *
       */
      void destroy() {
      }

      /**
       * Function called by dependency manager after "init ()" is called and after
       * the services provided by the class are registered in the service registry
       *
       */
      void start() {
      }

      /**
       * Function called by the dependency manager before the services exported by
       * the component are unregistered, this will be followed by a "destroy ()"
       * calls
       *
       */
      void stop() {
      }

      public Node fromString(String nodeType, String nodeId){
          if(nodeType.equals("STUB"))
              try{
                  return new Node("STUB", Integer.parseInt(nodeId));
              } catch(ConstructionException e)
              {
                  return null;
              }
          return null;
      }
}

@@ -603,17 +603,11 @@
 tory
-%0A   
  %7B%0A
-  
     
@@ -624,33 +624,27 @@
 ) %7B%0A    
-  
 %7D%0A%0A    
- 
- 
 /**%0A
-  
      * F
@@ -718,18 +718,16 @@
 cy%0A     
-  
 * become
@@ -795,18 +795,16 @@
 or%0A     
-  
 * exampl
@@ -830,18 +830,16 @@
 topped.%0A
-  
      *%0A 
@@ -834,39 +834,35 @@
 ed.%0A     *%0A     
-  
 */%0A
-  
     void destroy
@@ -862,26 +862,24 @@
 destroy() %7B%0A
-  
     %7D%0A%0A     
@@ -873,32 +873,28 @@
 %0A    %7D%0A%0A    
-  
 /**%0A
-  
      * Funct
@@ -962,18 +962,16 @@
 d after%0A
-  
      * t
@@ -1044,38 +1044,34 @@
 gistry%0A     
-  *%0A  
+*%0A
      */%0A
       void s
@@ -1050,34 +1050,32 @@
 %0A     *%0A     */%0A
-  
     void start()
@@ -1085,25 +1085,19 @@
     
-  
 %7D%0A%0A    
- 
- 
 /**%0A
-  
     
@@ -1178,18 +1178,16 @@
 by%0A     
-  
 * the co
@@ -1261,18 +1261,16 @@
     
-  
 * calls%0A
     
@@ -1265,18 +1265,16 @@
 * calls%0A
-  
      *%0A 
@@ -1277,23 +1277,19 @@
  *%0A     
-  
 */%0A
-  
     void
@@ -1302,23 +1302,19 @@
 ) %7B%0A    
-  
 %7D%0A%0A
-  
     publ
@@ -1373,18 +1373,16 @@
         
-  
 if(nodeT
@@ -1400,19 +1400,19 @@
 %22STUB%22))
-%0A  
+ %7B%0A
         
@@ -1418,20 +1418,19 @@
      try
+ 
 %7B%0A
-  
         
@@ -1500,18 +1500,16 @@
         
-  
 %7D catch(
@@ -1536,27 +1536,11 @@
 n e)
-%0A             
  %7B%0A
-  
     
@@ -1566,24 +1566,32 @@
 null;%0A      
+      %7D%0A
         %7D%0A  
@@ -1584,26 +1584,24 @@
 %7D%0A        %7D%0A
-  
         retu
@@ -1605,22 +1605,20 @@
 eturn null;%0A
-  
     %7D%0A%7D%0A

Fix checkstyle if-statements must use braces adsal/protocol_plugins