Code ReOrganization and Re-Architecture changes
[ovsdb.git] / plugin / src / main / java / org / opendaylight / ovsdb / plugin / NodeFactory.java
1 /*
2  * Copyright (C) 2013 Red Hat, Inc.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Authors : Madhu Venugopal, Brent Salisbury
9  */
10 package org.opendaylight.ovsdb.plugin;
11
12 import org.opendaylight.controller.sal.core.ConstructionException;
13 import org.opendaylight.controller.sal.utils.INodeFactory;
14 import org.opendaylight.controller.sal.core.Node;
15
16 public class NodeFactory implements INodeFactory
17     {
18       void init() {
19       }
20
21       /**
22        * Function called by the dependency manager when at least one dependency
23        * become unsatisfied or when the component is shutting down because for
24        * example bundle is being stopped.
25        *
26        */
27       void destroy() {
28       }
29
30       /**
31        * Function called by dependency manager after "init ()" is called and after
32        * the services provided by the class are registered in the service registry
33        *
34        */
35       void start() {
36       }
37
38       /**
39        * Function called by the dependency manager before the services exported by
40        * the component are unregistered, this will be followed by a "destroy ()"
41        * calls
42        *
43        */
44       void stop() {
45       }
46
47       public Node fromString(String nodeType, String nodeId){
48           if(nodeType.equals("OVS"))
49               try{
50                   return new Node("OVS", nodeId);
51               } catch(ConstructionException e)
52               {
53                   return null;
54               }
55           return null;
56       }
57 }