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