bddc16a233d16ad3ad4d0863b78f6bb853f74b81
[honeycomb.git] / v3po / v3po2vpp / src / main / java / io / fd / honeycomb / translate / v3po / interfaces / acl / common / AclTableContextManager.java
1 /*
2  * Copyright (c) 2016 Cisco and/or its affiliates.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package io.fd.honeycomb.translate.v3po.interfaces.acl.common;
18
19 import com.google.common.base.Optional;
20 import io.fd.honeycomb.translate.MappingContext;
21 import javax.annotation.Nonnull;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.acl.context.rev161214.mapping.entry.context.attributes.acl.mapping.entry.context.mapping.table.MappingEntry;
23
24 /**
25  * Manages interface metadata for ietf-acl model.
26  */
27 public interface AclTableContextManager {
28
29     /**
30      * Obtains mapping entry for given interface.
31      *
32      * @param index          interface index
33      * @param mappingContext mapping context providing context data for current transaction
34      * @return ietf-acl metadata for given interface
35      */
36     Optional<MappingEntry> getEntry(final int index, @Nonnull final MappingContext mappingContext);
37
38     /**
39      * Adds mapping entry.
40      *
41      * @param entry          to be added
42      * @param mappingContext mapping context providing context data for current transaction
43      */
44     void addEntry(@Nonnull final MappingEntry entry, @Nonnull final MappingContext mappingContext);
45
46     /**
47      * Removes entry for given interface (if present).
48      *
49      * @param index          interface index
50      * @param mappingContext mapping context providing context data for current transaction
51      */
52     void removeEntry(final int index, @Nonnull final MappingContext mappingContext);
53 }