* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.protocol.impl.core.connection;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.RemovalCause;
import java.util.concurrent.Future;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeUnit;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;
protected Cache<RpcResponseKey, ResponseExpectedRpcListener<?>> responseCache;
- AbstractConnectionAdapter(@Nonnull final Channel channel, @Nullable final InetSocketAddress address,
+ AbstractConnectionAdapter(@NonNull final Channel channel, @Nullable final InetSocketAddress address,
@Nullable final int channelOutboundQueueSize) {
- this.channel = Preconditions.checkNotNull(channel);
+ this.channel = requireNonNull(channel);
this.address = address;
responseCache = CacheBuilder.newBuilder().concurrencyLevel(1)
protected <I extends OfHeader, O extends OfHeader> ListenableFuture<RpcResult<O>>
sendToSwitchExpectRpcResultFuture(final I input, final Class<O> responseClazz,
final String failureInfo) {
- final RpcResponseKey key = new RpcResponseKey(input.getXid(), responseClazz.getName());
+ final RpcResponseKey key = new RpcResponseKey(input.getXid().toJava(), responseClazz.getName());
final ResponseExpectedRpcListener<O> listener = new ResponseExpectedRpcListener<>(input, failureInfo,
responseCache, key);
return enqueueMessage(listener);