import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceRegistry;
-import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.TxFacade;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.opendaylight.yangtools.yang.common.RpcError;
abstract class AbstractService<I, O> {
private static final Logger LOG = LoggerFactory.getLogger(AbstractService.class);
- private static final long WAIT_TIME = 2000;
- private static final BigInteger PRIMARY_CONNECTION = BigInteger.ZERO;
private final short version;
private final BigInteger datapathId;
private final RequestContextStack requestContextStack;
private final DeviceContext deviceContext;
private final MessageSpy messageSpy;
- private final NodeId nodeId;
private EventIdentifier eventIdentifier;
AbstractService(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
this.datapathId = deviceInfo.getDatapathId();
this.version = deviceInfo.getVersion();
this.messageSpy = deviceContext.getMessageSpy();
- this.nodeId = deviceInfo.getNodeId();
}
public EventIdentifier getEventIdentifier() {
return datapathId;
}
- @Deprecated
- public NodeId getNodeId() {
- return nodeId;
- }
-
public RequestContextStack getRequestContextStack() {
return requestContextStack;
}
return messageSpy;
}
- protected abstract OfHeader buildRequest(Xid xid, I input) throws Exception;
+ protected abstract OfHeader buildRequest(Xid xid, I input) throws ServiceException;
protected abstract FutureCallback<OfHeader> createCallback(RequestContext<O> context, Class<?> requestType);
- public final ListenableFuture<RpcResult<O>> handleServiceCall(@Nonnull final I input) {
+ public ListenableFuture<RpcResult<O>> handleServiceCall(@Nonnull final I input) {
Preconditions.checkNotNull(input);
final Class<?> requestType;