2 * Copyright (c) 2018 Bell Canada, Pantheon Technologies and/or its affiliates.
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:
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package io.fd.hc2vpp.srv6.util.function;
19 import com.google.inject.Inject;
20 import com.google.inject.Provider;
21 import io.fd.hc2vpp.common.translate.util.NamingContext;
22 import io.fd.hc2vpp.srv6.util.function.lookup.EndDT4FunctionBinder;
23 import io.fd.hc2vpp.srv6.util.function.lookup.EndDT6FunctionBinder;
24 import io.fd.hc2vpp.srv6.util.function.lookup.EndTFunctionBinder;
25 import io.fd.hc2vpp.srv6.util.function.nofunction.EndFunctionBinder;
26 import io.fd.hc2vpp.srv6.util.function.xconnect.EndDX2FunctionBinder;
27 import io.fd.hc2vpp.srv6.util.function.xconnect.EndDX4FunctionBinder;
28 import io.fd.hc2vpp.srv6.util.function.xconnect.EndDX6FunctionBinder;
29 import io.fd.hc2vpp.srv6.util.function.xconnect.EndXFunctionBinder;
30 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
31 import javax.inject.Named;
33 public class LocalSidFunctionReadBindingRegistryProvider implements Provider<LocalSidFunctionReadBindingRegistry> {
36 @Named("interface-context")
37 private NamingContext interfaceContext;
40 private FutureJVppCore api;
41 private final LocalSidFunctionReadBindingRegistry registry = new LocalSidFunctionReadBindingRegistry();
44 public LocalSidFunctionReadBindingRegistry get() {
45 registry.registerReadFunctionType(new EndFunctionBinder(api));
46 registry.registerReadFunctionType(new EndTFunctionBinder(api));
47 registry.registerReadFunctionType(new EndDT4FunctionBinder(api));
48 registry.registerReadFunctionType(new EndDT6FunctionBinder(api));
49 registry.registerReadFunctionType(new EndXFunctionBinder(api, interfaceContext));
50 registry.registerReadFunctionType(new EndDX2FunctionBinder(api, interfaceContext));
51 registry.registerReadFunctionType(new EndDX4FunctionBinder(api, interfaceContext));
52 registry.registerReadFunctionType(new EndDX6FunctionBinder(api, interfaceContext));