2e22ed1a0175ae8786dbbd110f507a8db39ffd6c
[honeycomb.git] / v3po / v3po2vpp / src / main / java / io / fd / honeycomb / translate / v3po / interfaces / acl / ingress / AceWriter.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.ingress;
18
19 import io.fd.honeycomb.translate.vpp.util.WriteTimeoutException;
20 import io.fd.honeycomb.translate.write.WriteFailedException;
21 import java.util.List;
22 import javax.annotation.Nonnegative;
23 import javax.annotation.Nonnull;
24 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.Ace;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.InterfaceMode;
26 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
27 import io.fd.vpp.jvpp.VppBaseCallException;
28 import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
29
30 /**
31  * Writer responsible for translation of ietf-acl model ACEs to VPP's classify tables and sessions.
32  */
33 interface AceWriter {
34
35     /**
36      * Translates list of ACEs to chain of classify tables. Each ACE is translated into one classify table with single
37      * classify session. Also initializes input_acl_set_interface request message DTO with first classify table of the
38      * chain that was created.
39      *  @param id      uniquely identifies ietf-acl container
40      * @param aces    list of access control entries
41      * @param mode
42      * @param request input_acl_set_interface request DTO
43      */
44     void write(@Nonnull final InstanceIdentifier<?> id, @Nonnull final List<Ace> aces,
45                final InterfaceMode mode, @Nonnull final InputAclSetInterface request, @Nonnegative final int vlanTags)
46         throws WriteFailedException;
47 }