From bdccd390b46bddc22d5c3e6459c473d148442af1 Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Mon, 13 Feb 2017 17:01:02 +0100 Subject: DHCP relay support (HC2VPP-71, HC2VPP-72) Change-Id: Icea50f1444356c0c107dd31dfa47137c9866312e Signed-off-by: Marek Gradzki --- .../io/fd/hc2vpp/dhcp/write/DhcpWriterFactory.java | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpWriterFactory.java (limited to 'dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpWriterFactory.java') diff --git a/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpWriterFactory.java b/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpWriterFactory.java new file mode 100644 index 000000000..93dc8048e --- /dev/null +++ b/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpWriterFactory.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.fd.hc2vpp.dhcp.write; + +import com.google.inject.Inject; +import io.fd.honeycomb.translate.impl.write.GenericListWriter; +import io.fd.honeycomb.translate.write.WriterFactory; +import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder; +import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import javax.annotation.Nonnull; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev170315.Dhcp; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev170315.dhcp.attributes.Relays; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev170315.dhcp.attributes.relays.Relay; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +/** + * Factory producing writers for DHCP plugin's data. + */ +public final class DhcpWriterFactory implements WriterFactory { + + private static final InstanceIdentifier RELAY_ID = InstanceIdentifier.create(Dhcp.class).child(Relays.class).child(Relay.class); + + @Inject + private FutureJVppCore vppApi; + + @Override + public void init(@Nonnull final ModifiableWriterRegistryBuilder registry) { + registry.add(new GenericListWriter<>(RELAY_ID, new DhcpRelayCustomizer(vppApi))); + } +} -- cgit 1.2.3-korg