e49b758b54ecee4f7f9a628cf81259f73121344c
[netvirt.git] / natservice / api / src / main / java / org / opendaylight / netvirt / natservice / api / SnatServiceManager.java
1 /*
2  * Copyright (c) 2017 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 package org.opendaylight.netvirt.natservice.api;
9
10 import java.math.BigInteger;
11
12 import java.util.concurrent.ExecutionException;
13 import javax.annotation.Nullable;
14 import org.opendaylight.genius.infra.Datastore.Configuration;
15 import org.opendaylight.genius.infra.TypedReadWriteTransaction;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ext.routers.Routers;
17
18 public interface SnatServiceManager {
19
20     enum Action {
21         SNAT_ALL_SWITCH_ENBL,
22         SNAT_ALL_SWITCH_DISBL,
23         SNAT_ROUTER_ENBL,
24         SNAT_ROUTER_DISBL,
25         SNAT_ROUTER_UPDATE,
26         CNT_ROUTER_ALL_SWITCH_ENBL,
27         CNT_ROUTER_ALL_SWITCH_DISBL,
28         CNT_ROUTER_ENBL,
29         CNT_ROUTER_DISBL
30     }
31
32     void addNatServiceListener(SnatServiceListener aclServiceListner);
33
34     void removeNatServiceListener(SnatServiceListener aclServiceListner);
35
36     void notify(TypedReadWriteTransaction<Configuration> confTx, Routers router, @Nullable Routers oldRouter,
37         BigInteger primarySwitchId, @Nullable BigInteger dpnId, Action action)
38         throws ExecutionException, InterruptedException;
39
40 }