Merge "Bug 8497 - Provide config knob to disable the Forwarding Rule Manager reconcil...
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / services / AbstractExperimenterMultipartService.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowplugin.impl.services;
10
11 import java.util.concurrent.Future;
12 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
13 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
14 import org.opendaylight.openflowplugin.extension.api.core.extension.ExtensionConverterProvider;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInput;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestOutput;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
18 import org.opendaylight.yangtools.yang.common.RpcResult;
19
20 public abstract class AbstractExperimenterMultipartService<T extends OfHeader> extends AbstractMultipartService<SendExperimenterMpRequestInput, T> {
21
22     private final ExtensionConverterProvider extensionConverterProvider;
23
24     protected AbstractExperimenterMultipartService(RequestContextStack requestContextStack, DeviceContext deviceContext,
25                                                    ExtensionConverterProvider extensionConverterProvider) {
26         super(requestContextStack, deviceContext);
27         this.extensionConverterProvider = extensionConverterProvider;
28     }
29
30     /**
31      * Get extension converter provider
32      * @return extension converter provider
33      */
34     protected ExtensionConverterProvider getExtensionConverterProvider() {
35         return extensionConverterProvider;
36     }
37
38     /**
39      * Process experimenter input and result experimenter output
40      * @param input experimenter input
41      * @return experimenter output
42      */
43     public abstract Future<RpcResult<SendExperimenterMpRequestOutput>> handleAndReply(SendExperimenterMpRequestInput input);
44
45 }