Remove ovsdb related in resources
[netvirt.git] / openstack / net-virt / src / main / java / org / opendaylight / netvirt / openstack / netvirt / api / SecurityServicesManager.java
1 /*
2  * Copyright (c) 2014, 2015 Red Hat, Inc. and others. All rights reserved.
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
9 package org.opendaylight.netvirt.openstack.netvirt.api;
10
11 import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
12 import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
13 import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
14 import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
16 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
17
18 import java.util.List;
19
20 /**
21  * Open vSwitch isolates Tenant Networks using VLANs on the Integration Bridge.
22  * This class manages the provisioning of these VLANs
23  */
24 public interface SecurityServicesManager {
25     /**
26      * Is port security ready.
27      *
28      * @param intf the intf
29      * @return the boolean
30      */
31     boolean isPortSecurityReady(OvsdbTerminationPointAugmentation intf);
32     /**
33      * Gets security group in port.
34      *
35      * @param intf the intf
36      * @return the list of security group in port, returns empty list if no group associated.
37      */
38     List<NeutronSecurityGroup> getSecurityGroupInPortList(OvsdbTerminationPointAugmentation intf);
39     /**
40      * Gets the DHCP server port corresponding to a network.
41      *
42      * @param intf the intf
43      * @return the dhcp server port
44      */
45     NeutronPort getDhcpServerPort(OvsdbTerminationPointAugmentation intf);
46     /**
47      * Gets the NeutronPort from the cleanup cache.
48      *
49      * @param intf the intf
50      * @return the NeutronPort stored in the cleanupCache of NeutronL3Adapter
51      */
52     NeutronPort getNeutronPortFromCache(OvsdbTerminationPointAugmentation intf);
53
54     /**
55       * Check if the given interface corresponds to a DHCP server port.
56       *
57       * @param intf the intf
58       * @return Return the DHCP neutron port
59       */
60     NeutronPort getNeutronPortFromDhcpIntf(OvsdbTerminationPointAugmentation intf);
61
62     /**
63      * Is the port a compute port.
64      *
65      * @param intf the intf
66      * @return  whether it is a compute port or not
67      */
68     boolean isComputePort(OvsdbTerminationPointAugmentation intf);
69
70     /**
71      * Is this the last port in the subnet to which interface belongs to.
72      * @param node The node to which the intf is connected.
73      * @param intf the intf
74      * @return whether last port in the subnet
75      */
76     boolean isLastPortinSubnet(Node node, OvsdbTerminationPointAugmentation intf);
77
78     /**
79      * Is this the last port in the bridge to which interface belongs to.
80      * @param node The node to which the intf is connected.
81      * @param intf the intf
82      * @return whether last port in bridge
83      */
84     boolean isLastPortinBridge(Node node, OvsdbTerminationPointAugmentation intf);
85     /**
86      * Returns the  list of ip address assigned to the interface.
87      * @param intf the intf
88      * @return the list of ip address associated with the vm
89      */
90     List<Neutron_IPs> getIpAddressList(OvsdbTerminationPointAugmentation intf);
91     /**
92      * Get the list of vm belonging to a security group.
93      * @param portUuid the uuid of the port.
94      * @param securityGroupUuid the UUID of the remote security group.
95      * @return the list of all vm belonging to the security group UUID passed.
96      */
97     List<Neutron_IPs> getVmListForSecurityGroup(String portUuid,
98                                                 String securityGroupUuid);
99     /**
100      * Add or remove the security groups  from the port.
101      * @param port the neutron port.
102      * @param securityGroup the security group associated with the port.
103      * @param write whether to add/delete flow.
104      */
105     void syncSecurityGroup(NeutronPort port, List<NeutronSecurityGroup> securityGroup, boolean write);
106     /**
107      * Add or remove individual security  rules from the port.
108      * @param port the neutron port.
109      * @param securityRule the security group associated with the port.
110      * @param vmIp The list of remote vm ips.
111      * @param write whether to add/delete flow.
112      */
113     void syncSecurityRule(NeutronPort port, NeutronSecurityRule securityRule,Neutron_IPs vmIp, boolean write);
114     /**
115      * Is connection tracking enabled or not by the user (default is false).
116      * @return whether connection tracking enabled.
117      */
118     boolean isConntrackEnabled();
119 }