-/**
+/*
* Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
-import java.math.BigInteger;
import java.util.Collection;
import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
return input.build();
}
- public Future<BigInteger> getGenerationIdFromDevice(final Short version) {
+ public ListenableFuture<Uint64> getGenerationIdFromDevice(final Uint8 version) {
LOG.info("getGenerationIdFromDevice called for device: {}", getDeviceInfo().getNodeId().getValue());
// send a dummy no-change role request to get the generation-id of the switch
final RoleRequestInputBuilder roleRequestInputBuilder = new RoleRequestInputBuilder();
roleRequestInputBuilder.setRole(toOFJavaRole(OfpRole.NOCHANGE));
roleRequestInputBuilder.setVersion(version);
- roleRequestInputBuilder.setGenerationId(BigInteger.ZERO);
+ roleRequestInputBuilder.setGenerationId(Uint64.ZERO);
- final SettableFuture<BigInteger> finalFuture = SettableFuture.create();
+ final SettableFuture<Uint64> finalFuture = SettableFuture.create();
final ListenableFuture<RpcResult<RoleRequestOutput>> genIdListenableFuture =
handleServiceCall(roleRequestInputBuilder);
Futures.addCallback(genIdListenableFuture, new FutureCallback<RpcResult<RoleRequestOutput>>() {
}
- public Future<RpcResult<SetRoleOutput>> submitRoleChange(final OfpRole ofpRole,
- final Short version,
- final BigInteger generationId) {
+ public ListenableFuture<RpcResult<SetRoleOutput>> submitRoleChange(final OfpRole ofpRole, final Uint8 version,
+ final Uint64 generationId) {
LOG.info("submitRoleChange called for device:{}, role:{}",
getDeviceInfo().getNodeId(), ofpRole);
final RoleRequestInputBuilder roleRequestInputBuilder = new RoleRequestInputBuilder();
if (roleRequestOutput != null) {
final SetRoleOutputBuilder setRoleOutputBuilder = new SetRoleOutputBuilder();
setRoleOutputBuilder
- .setTransactionId(new TransactionId(BigInteger.valueOf(roleRequestOutput.getXid())));
+ .setTransactionId(new TransactionId(Uint64.valueOf(roleRequestOutput.getXid())));
finalFuture.set(RpcResultBuilder.<SetRoleOutput>success()
.withResult(setRoleOutputBuilder.build()).build());