c2ce473303632b90602986b806690a5f225146e4
[controller.git] / opendaylight / protocol_plugins / stub / src / main / java / org / opendaylight / controller / protocol_plugins / stub / internal / StubNodeFactory.java
1 package org.opendaylight.controller.protocol_plugins.stub.internal;
2
3 import org.opendaylight.controller.sal.core.ConstructionException;
4 import org.opendaylight.controller.sal.utils.INodeFactory;
5 import org.opendaylight.controller.sal.core.Node;
6
7 public class StubNodeFactory implements INodeFactory
8     {
9       void init() {
10       }
11
12       /**
13        * Function called by the dependency manager when at least one dependency
14        * become unsatisfied or when the component is shutting down because for
15        * example bundle is being stopped.
16        * 
17        */
18       void destroy() {
19       }
20
21       /**
22        * Function called by dependency manager after "init ()" is called and after
23        * the services provided by the class are registered in the service registry
24        * 
25        */
26       void start() {
27       }
28
29       /**
30        * Function called by the dependency manager before the services exported by
31        * the component are unregistered, this will be followed by a "destroy ()"
32        * calls
33        * 
34        */
35       void stop() {
36       }
37       
38       public Node fromString(String nodeId, String nodeType){
39           if(nodeType.equals("STUB"))
40               try{
41                   return new Node("STUB", Integer.parseInt(nodeId));
42               } catch(ConstructionException e)
43               {
44                   return null;
45               }
46           return null;
47       }
48 }