diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2017-02-13 17:01:02 +0100 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2017-02-14 09:30:55 +0100 |
commit | bdccd390b46bddc22d5c3e6459c473d148442af1 (patch) | |
tree | fbff7ebdaa77aa0077e0486b008243eecbd2840a /dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpWriterFactory.java | |
parent | be1ce465c60ccc80abf691c41be13090f2d53a6f (diff) |
DHCP relay support (HC2VPP-71, HC2VPP-72)
Change-Id: Icea50f1444356c0c107dd31dfa47137c9866312e
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpWriterFactory.java')
-rw-r--r-- | dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpWriterFactory.java | 44 |
1 files changed, 44 insertions, 0 deletions
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> 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))); + } +} |