4122dba7a3b6d823c07e68003625d3ac18acb425
[netvirt.git] / openstack / net-virt / src / main / java / org / opendaylight / netvirt / openstack / netvirt / api / SecurityGroupCacheManger.java
1 /*
2  * Copyright (c) 2014, 2015 HP, 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.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
12
13 /**
14  *  This interface maintain a mapping between the security group and the ports
15  *  have this security group as a remote security group. Whenever a new port is
16  *  added with a security group associated with it, a rule will be added to allow
17  *  traffic from/to the vm from  the vms which has the former as a remote sg in its rule.
18  *
19  *  @author Aswin Suryanarayanan.
20  */
21
22 public interface SecurityGroupCacheManger {
23
24     /**
25      * Notifies that a new port in the security group with securityGroupUuid.
26      * @param securityGroupUuid the uuid of the security group associated with the port.
27      * @param portUuid the uuid of the port.
28      */
29     void portAdded(String securityGroupUuid, String portUuid);
30     /**
31      * Notifies that a port is removed with the securityGroupUuid.
32      * @param securityGroupUuid the uuid of the security group associated with the port.
33      * @param portUuid the uuid of the port.
34      */
35     void portRemoved(String securityGroupUuid, String portUuid);
36     /**
37      * A port with portUuid has a reference remote security group remoteSgUuid will be added
38      * to the cache maintained.
39      * @param remoteSgUuid the remote security group uuid.
40      * @param portUuid the uuid of the port.
41      * @param nodeId the NodeId of the node.
42      */
43     void addToCache(String remoteSgUuid, String portUuid, NodeId nodeId);
44     /**A port with portUUID has a reference remote security group remoteSgUuid will be removed
45      * from the cache maintained.
46      * @param remoteSgUuid the remote security group uuid.
47      * @param portUuid portUUID the uuid of the port.
48      * @param nodeId the NodeId of the node.
49      */
50     void removeFromCache(String remoteSgUuid, String portUuid, NodeId nodeId);
51 }