// BORON was 5
// NEON_SR2 was 6
// SODIUM_SR1 was 7
+ // MAGNESIUM was 8
+
/**
- * Oldest ABI version we support. The messages remain the same as {@code BORON}, but messages bearing QNames in any
- * shape are using {@link NormalizedNodeStreamVersion#MAGNESIUM}, which improves encoding.
- *
- * @deprecated Support for this version is going to be removed in the next major version.
- */
- @Deprecated(since = "7.0.0", forRemoval = true)
- MAGNESIUM(8) {
- @Override
- public NormalizedNodeStreamVersion getStreamVersion() {
- return NormalizedNodeStreamVersion.MAGNESIUM;
- }
- },
- /**
- * Revised ABI version. The messages remain the same as {@link #MAGNESIUM}, the serialization proxies in use are
- * flat objects without any superclasses.
+ * Oldest ABI version we support. The messages remain the same as {@code MAGNESIUM}, the serialization proxies in
+ * use are flat objects without any superclasses.
*/
CHLORINE_SR2(9) {
@Override
*/
public static @NonNull ABIVersion valueOf(final short value) throws FutureVersionException, PastVersionException {
return switch (Short.toUnsignedInt(value)) {
- case 0, 1, 2, 3, 4, 6, 7 -> throw new PastVersionException(value, MAGNESIUM);
- case 8 -> MAGNESIUM;
+ case 0, 1, 2, 3, 4, 6, 7, 8 -> throw new PastVersionException(value, CHLORINE_SR2);
case 9 -> CHLORINE_SR2;
default -> throw new FutureVersionException(value, CHLORINE_SR2);
};
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-import org.opendaylight.controller.cluster.access.concepts.AbstractRequestProxy;
-import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
-
-/**
- * Abstract base class for serialization proxies associated with {@link LocalHistoryRequest}s.
- *
- * @param <T> Message type
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-abstract class AbstractLocalHistoryRequestProxy<T extends LocalHistoryRequest<T>>
- extends AbstractRequestProxy<LocalHistoryIdentifier, T> implements LocalHistoryRequest.SerialForm<T> {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- protected AbstractLocalHistoryRequestProxy() {
- // For Externalizable
- }
-
- AbstractLocalHistoryRequestProxy(final T request) {
- super(request);
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2017 Pantheon Technologies, s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Abstract base class for serialization proxies associated with {@link AbstractReadTransactionRequest}s. It implements
- * the initial (Boron) serialization format.
- *
- * @param <T> Message type
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-abstract class AbstractReadPathTransactionRequestProxyV1<T extends AbstractReadPathTransactionRequest<T>>
- extends AbstractReadTransactionRequestProxyV1<T> implements AbstractReadPathTransactionRequest.SerialForm<T> {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- protected AbstractReadPathTransactionRequestProxyV1() {
- // For Externalizable
- }
-
- AbstractReadPathTransactionRequestProxyV1(final T request) {
- super(request);
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Abstract base class for serialization proxies associated with {@link AbstractReadTransactionRequest}s. It implements
- * the initial (Boron) serialization format.
- *
- * @param <T> Message type
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-abstract class AbstractReadTransactionRequestProxyV1<T extends AbstractReadTransactionRequest<T>>
- extends AbstractTransactionRequestProxy<T> implements AbstractReadTransactionRequest.SerialForm<T> {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- protected AbstractReadTransactionRequestProxyV1() {
- // For Externalizable
- }
-
- AbstractReadTransactionRequestProxyV1(final T request) {
- super(request);
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-import org.opendaylight.controller.cluster.access.concepts.AbstractRequestProxy;
-import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
-
-/**
- * Abstract base class for serialization proxies associated with {@link TransactionRequest}s.
- *
- * @param <T> Message type
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-abstract class AbstractTransactionRequestProxy<T extends TransactionRequest<T>>
- extends AbstractRequestProxy<TransactionIdentifier, T> implements TransactionRequest.SerialForm<T> {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- AbstractTransactionRequestProxy() {
- // For Externalizable
- }
-
- AbstractTransactionRequestProxy(final T request) {
- super(request);
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-import org.opendaylight.controller.cluster.access.concepts.AbstractSuccessProxy;
-import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
-
-/**
- * Abstract base class for serialization proxies associated with {@link TransactionSuccess}es.
- *
- * @param <T> Message type
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-abstract class AbstractTransactionSuccessProxy<T extends TransactionSuccess<T>>
- extends AbstractSuccessProxy<TransactionIdentifier, T> implements TransactionSuccess.SerialForm<T> {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- AbstractTransactionSuccessProxy() {
- // For Externalizable
- }
-
- AbstractTransactionSuccessProxy(final T request) {
- super(request);
- }
-}
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new CCF(this) : new ConnectClientFailureProxyV1(this);
+ return new CCF(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-import org.opendaylight.controller.cluster.access.concepts.AbstractRequestFailureProxy;
-import org.opendaylight.controller.cluster.access.concepts.ClientIdentifier;
-
-/**
- * Serialization proxy for use with {@link ConnectClientFailure}. This class implements initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class ConnectClientFailureProxyV1 extends AbstractRequestFailureProxy<ClientIdentifier, ConnectClientFailure>
- implements ConnectClientFailure.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 2688639416324657256L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public ConnectClientFailureProxyV1() {
- // For Externalizable
- }
-
- ConnectClientFailureProxyV1(final ConnectClientFailure failure) {
- super(failure);
- }
-}
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new CCR(this) : new ConnectClientRequestProxyV1(this);
+ return new CCR(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-import org.opendaylight.controller.cluster.access.concepts.AbstractRequestProxy;
-import org.opendaylight.controller.cluster.access.concepts.ClientIdentifier;
-
-/**
- * Externalizable proxy for use with {@link ConnectClientRequest}. It implements the initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class ConnectClientRequestProxyV1 extends AbstractRequestProxy<ClientIdentifier, ConnectClientRequest>
- implements ConnectClientRequest.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 8439729661327852159L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public ConnectClientRequestProxyV1() {
- // for Externalizable
- }
-
- ConnectClientRequestProxyV1(final ConnectClientRequest request) {
- super(request);
- }
-}
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new CCS(this) : new ConnectClientSuccessProxyV1(this);
+ return new CCS(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-import org.opendaylight.controller.cluster.access.concepts.AbstractSuccessProxy;
-import org.opendaylight.controller.cluster.access.concepts.ClientIdentifier;
-
-/**
- * Externalizable proxy for use with {@link ConnectClientSuccess}. It implements the initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class ConnectClientSuccessProxyV1 extends AbstractSuccessProxy<ClientIdentifier, ConnectClientSuccess>
- implements ConnectClientSuccess.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public ConnectClientSuccessProxyV1() {
- // For Externalizable
- }
-
- ConnectClientSuccessProxyV1(final ConnectClientSuccess success) {
- super(success);
- }
-}
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new CHR(this) : new CreateLocalHistoryRequestProxyV1(this);
+ return new CHR(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link CreateLocalHistoryRequest}. It implements the initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class CreateLocalHistoryRequestProxyV1 extends AbstractLocalHistoryRequestProxy<CreateLocalHistoryRequest>
- implements CreateLocalHistoryRequest.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public CreateLocalHistoryRequestProxyV1() {
- // For Externalizable
- }
-
- CreateLocalHistoryRequestProxyV1(final CreateLocalHistoryRequest request) {
- super(request);
- }
-}
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new DHR(this) : new DestroyLocalHistoryRequestProxyV1(this);
+ return new DHR(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link DestroyLocalHistoryRequest}. It implements the initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class DestroyLocalHistoryRequestProxyV1 extends AbstractLocalHistoryRequestProxy<DestroyLocalHistoryRequest>
- implements DestroyLocalHistoryRequest.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public DestroyLocalHistoryRequestProxyV1() {
- // For Externalizable
- }
-
- DestroyLocalHistoryRequestProxyV1(final DestroyLocalHistoryRequest request) {
- super(request);
- }
-}
import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
+
/**
* Externalizable proxy for use with {@link ExistsTransactionSuccess}. It implements the Chlorine SR2 serialization
* format.
*/
-final class ETS implements ExistsTransactionSuccess.SerialForm {
+final class ETS implements TransactionSuccess.SerialForm<ExistsTransactionSuccess> {
@java.io.Serial
private static final long serialVersionUID = 1L;
this.message = requireNonNull(message);
}
+ @Override
+ public void writeExternal(final ObjectOutput out, final ExistsTransactionSuccess msg) throws IOException {
+ out.writeBoolean(msg.getExists());
+ }
+
+ @Override
+ public ExistsTransactionSuccess readExternal(final ObjectInput in, final TransactionIdentifier target,
+ final long sequence) throws IOException {
+ return new ExistsTransactionSuccess(target, sequence, in.readBoolean());
+ }
+
@Override
public Object readResolve() {
return message();
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new ETR(this) : new ExistsTransactionRequestProxyV1(this);
+ return new ETR(this);
}
}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link ExistsTransactionRequest}. It implements the initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class ExistsTransactionRequestProxyV1 extends AbstractReadPathTransactionRequestProxyV1<ExistsTransactionRequest>
- implements ExistsTransactionRequest.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public ExistsTransactionRequestProxyV1() {
- // For Externalizable
- }
-
- ExistsTransactionRequestProxyV1(final ExistsTransactionRequest request) {
- super(request);
- }
-}
package org.opendaylight.controller.cluster.access.commands;
import com.google.common.base.MoreObjects.ToStringHelper;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
import org.opendaylight.controller.cluster.access.ABIVersion;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
* {@link #getExists()}.
*/
public final class ExistsTransactionSuccess extends TransactionSuccess<ExistsTransactionSuccess> {
- interface SerialForm extends TransactionSuccess.SerialForm<ExistsTransactionSuccess> {
- @Override
- default ExistsTransactionSuccess readExternal(final ObjectInput in, final TransactionIdentifier target,
- final long sequence) throws IOException {
- return new ExistsTransactionSuccess(target, sequence, in.readBoolean());
- }
-
- @Override
- default void writeExternal(final ObjectOutput out, final ExistsTransactionSuccess msg) throws IOException {
- out.writeBoolean(msg.getExists());
- }
- }
-
@java.io.Serial
private static final long serialVersionUID = 1L;
}
@Override
- protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new ETS(this) : new ExistsTransactionSuccessProxyV1(this);
+ protected ETS externalizableProxy(final ABIVersion version) {
+ return new ETS(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link ExistsTransactionSuccess}. It implements the initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class ExistsTransactionSuccessProxyV1 extends AbstractTransactionSuccessProxy<ExistsTransactionSuccess>
- implements ExistsTransactionSuccess.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public ExistsTransactionSuccessProxyV1() {
- // For Externalizable
- }
-
- ExistsTransactionSuccessProxyV1(final ExistsTransactionSuccess request) {
- super(request);
- }
-}
import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
+import java.io.ObjectInput;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
+
/**
* Externalizable proxy for use with {@link IncrementTransactionSequenceSuccess}. It implements the Chlorine SR2
* serialization format.
*/
-final class ITSS implements IncrementTransactionSequenceSuccess.SerialForm {
+final class ITSS implements TransactionSuccess.SerialForm<IncrementTransactionSequenceSuccess> {
@java.io.Serial
private static final long serialVersionUID = 1L;
this.message = requireNonNull(message);
}
+ @Override
+ public IncrementTransactionSequenceSuccess readExternal(final ObjectInput it, final TransactionIdentifier target,
+ final long sequence) {
+ return new IncrementTransactionSequenceSuccess(target, sequence);
+ }
+
@Override
public Object readResolve() {
return message();
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new ITSR(this) : new IncrementTransactionSequenceRequestProxyV1(this);
+ return new ITSR(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2017 Pantheon Technologies, s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class IncrementTransactionSequenceRequestProxyV1
- extends AbstractReadTransactionRequestProxyV1<IncrementTransactionSequenceRequest>
- implements IncrementTransactionSequenceRequest.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = -7345885599575376005L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public IncrementTransactionSequenceRequestProxyV1() {
- // For Externalizable
- }
-
- IncrementTransactionSequenceRequestProxyV1(final IncrementTransactionSequenceRequest request) {
- super(request);
- }
-}
*/
package org.opendaylight.controller.cluster.access.commands;
-import java.io.ObjectInput;
import org.opendaylight.controller.cluster.access.ABIVersion;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
* Successful reply to an {@link IncrementTransactionSequenceRequest}.
*/
public final class IncrementTransactionSequenceSuccess extends TransactionSuccess<IncrementTransactionSequenceSuccess> {
- interface SerialForm extends TransactionSuccess.SerialForm<IncrementTransactionSequenceSuccess> {
- @Override
- default IncrementTransactionSequenceSuccess readExternal(final ObjectInput it,
- final TransactionIdentifier target, final long sequence) {
- return new IncrementTransactionSequenceSuccess(target, sequence);
- }
- }
-
@java.io.Serial
private static final long serialVersionUID = 1L;
}
@Override
- protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new ITSS(this) : new IncrementTransactionSequenceSuccessProxyV1(this);
+ protected ITSS externalizableProxy(final ABIVersion version) {
+ return new ITSS(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link IncrementTransactionSequenceSuccess}. It implements the initial (Boron)
- * serialization format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class IncrementTransactionSequenceSuccessProxyV1
- extends AbstractTransactionSuccessProxy<IncrementTransactionSequenceSuccess>
- implements IncrementTransactionSequenceSuccess.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public IncrementTransactionSequenceSuccessProxyV1() {
- // For Externalizable
- }
-
- IncrementTransactionSequenceSuccessProxyV1(final IncrementTransactionSequenceSuccess request) {
- super(request);
- }
-}
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new HF(this) : new LocalHistoryFailureProxyV1(this);
+ return new HF(this);
}
}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-import org.opendaylight.controller.cluster.access.concepts.AbstractRequestFailureProxy;
-import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
-
-/**
- * Externalizable proxy for use with {@link LocalHistoryFailure}. It implements the initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class LocalHistoryFailureProxyV1
- extends AbstractRequestFailureProxy<LocalHistoryIdentifier, LocalHistoryFailure>
- implements LocalHistoryFailure.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public LocalHistoryFailureProxyV1() {
- // For Externalizable
- }
-
- LocalHistoryFailureProxyV1(final LocalHistoryFailure failure) {
- super(failure);
- }
-}
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new HS(this) : new LocalHistorySuccessProxyV1(this);
+ return new HS(this);
}
}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-import org.opendaylight.controller.cluster.access.concepts.AbstractSuccessProxy;
-import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
-
-/**
- * Serialization proxy associated with {@link LocalHistorySuccess}.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class LocalHistorySuccessProxyV1 extends AbstractSuccessProxy<LocalHistoryIdentifier, LocalHistorySuccess>
- implements LocalHistorySuccess.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public LocalHistorySuccessProxyV1() {
- // For Externalizable
- }
-
- LocalHistorySuccessProxyV1(final LocalHistorySuccess success) {
- super(success);
- }
-}
import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
+import java.io.IOException;
+import java.io.ObjectInput;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
+
/**
* Externalizable proxy for use with {@link ModifyTransactionSuccess}. It implements the Chlorine SR2 serialization
* format.
*/
-final class MTS implements ModifyTransactionSuccess.SerialForm {
+final class MTS implements TransactionSuccess.SerialForm<ModifyTransactionSuccess> {
@java.io.Serial
private static final long serialVersionUID = 1L;
this.message = requireNonNull(message);
}
+ @Override
+ public ModifyTransactionSuccess readExternal(final ObjectInput in, final TransactionIdentifier target,
+ final long sequence) throws IOException {
+ return new ModifyTransactionSuccess(target, sequence);
+ }
+
@Override
public Object readResolve() {
return message();
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new MTR(this) : new ModifyTransactionRequestProxyV1(this);
+ return new MTR(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link ExistsTransactionRequest}. It implements the initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class ModifyTransactionRequestProxyV1 extends AbstractTransactionRequestProxy<ModifyTransactionRequest>
- implements ModifyTransactionRequest.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public ModifyTransactionRequestProxyV1() {
- // For Externalizable
- }
-
- ModifyTransactionRequestProxyV1(final ModifyTransactionRequest request) {
- super(request);
- }
-}
*/
package org.opendaylight.controller.cluster.access.commands;
-import java.io.IOException;
-import java.io.ObjectInput;
import org.opendaylight.controller.cluster.access.ABIVersion;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
* Response to a {@link ModifyTransactionRequest} which does not have a {@link PersistenceProtocol}.
*/
public final class ModifyTransactionSuccess extends TransactionSuccess<ModifyTransactionSuccess> {
- interface SerialForm extends TransactionSuccess.SerialForm<ModifyTransactionSuccess> {
- @Override
- default ModifyTransactionSuccess readExternal(final ObjectInput in, final TransactionIdentifier target,
- final long sequence) throws IOException {
- return new ModifyTransactionSuccess(target, sequence);
- }
- }
-
@java.io.Serial
private static final long serialVersionUID = 1L;
}
@Override
- protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new MTS(this) : new ModifyTransactionSuccessProxyV1(this);
+ protected MTS externalizableProxy(final ABIVersion version) {
+ return new MTS(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link ModifyTransactionSuccess}. It implements the initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class ModifyTransactionSuccessProxyV1 extends AbstractTransactionSuccessProxy<ModifyTransactionSuccess>
- implements ModifyTransactionSuccess.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public ModifyTransactionSuccessProxyV1() {
- // For Externalizable
- }
-
- ModifyTransactionSuccessProxyV1(final ModifyTransactionSuccess success) {
- super(success);
- }
-}
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new PHR(this) : new PurgeLocalHistoryRequestProxyV1(this);
+ return new PHR(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link PurgeLocalHistoryRequest}. It implements the initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class PurgeLocalHistoryRequestProxyV1 extends AbstractLocalHistoryRequestProxy<PurgeLocalHistoryRequest>
- implements PurgeLocalHistoryRequest.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public PurgeLocalHistoryRequestProxyV1() {
- // For Externalizable
- }
-
- PurgeLocalHistoryRequestProxyV1(final PurgeLocalHistoryRequest request) {
- super(request);
- }
-}
import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Optional;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataInput;
+
/**
* Externalizable proxy for use with {@link ReadTransactionSuccess}. It implements the Chlorine SR2 serialization
* format.
*/
-final class RTS implements ReadTransactionSuccess.SerialForm {
+final class RTS implements TransactionSuccess.SerialForm<ReadTransactionSuccess> {
@java.io.Serial
private static final long serialVersionUID = 1L;
this.message = requireNonNull(message);
}
+ @Override
+ public ReadTransactionSuccess readExternal(final ObjectInput in, final TransactionIdentifier target,
+ final long sequence) throws IOException {
+ final Optional<NormalizedNode> data;
+ if (in.readBoolean()) {
+ data = Optional.of(NormalizedNodeDataInput.newDataInput(in).readNormalizedNode());
+ } else {
+ data = Optional.empty();
+ }
+ return new ReadTransactionSuccess(target, sequence, data);
+ }
+
+ @Override
+ public void writeExternal(final ObjectOutput out, final ReadTransactionSuccess msg) throws IOException {
+ TransactionSuccess.SerialForm.super.writeExternal(out, msg);
+
+ final var data = msg.getData();
+ if (data.isPresent()) {
+ out.writeBoolean(true);
+ try (var nnout = msg.getVersion().getStreamVersion().newDataOutput(out)) {
+ nnout.writeNormalizedNode(data.orElseThrow());
+ }
+ } else {
+ out.writeBoolean(false);
+ }
+ }
+
@Override
public Object readResolve() {
return message();
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new RTR(this) : new ReadTransactionRequestProxyV1(this);
+ return new RTR(this);
}
}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link ReadTransactionRequest}. It implements the initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class ReadTransactionRequestProxyV1 extends AbstractReadPathTransactionRequestProxyV1<ReadTransactionRequest>
- implements ReadTransactionRequest.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public ReadTransactionRequestProxyV1() {
- // For Externalizable
- }
-
- ReadTransactionRequestProxyV1(final ReadTransactionRequest request) {
- super(request);
- }
-}
import static java.util.Objects.requireNonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
import java.util.Optional;
import org.opendaylight.controller.cluster.access.ABIVersion;
import org.opendaylight.controller.cluster.access.concepts.SliceableMessage;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataInput;
/**
* Successful reply to an {@link ReadTransactionRequest}. It indicates presence of requested data via
*/
public final class ReadTransactionSuccess extends TransactionSuccess<ReadTransactionSuccess>
implements SliceableMessage {
- interface SerialForm extends TransactionSuccess.SerialForm<ReadTransactionSuccess> {
- @Override
- default ReadTransactionSuccess readExternal(final ObjectInput in, final TransactionIdentifier target,
- final long sequence) throws IOException {
- final Optional<NormalizedNode> data;
- if (in.readBoolean()) {
- data = Optional.of(NormalizedNodeDataInput.newDataInput(in).readNormalizedNode());
- } else {
- data = Optional.empty();
- }
- return new ReadTransactionSuccess(target, sequence, data);
- }
-
- @Override
- default void writeExternal(final ObjectOutput out, final ReadTransactionSuccess msg) throws IOException {
- TransactionSuccess.SerialForm.super.writeExternal(out, msg);
-
- final var data = msg.getData();
- if (data.isPresent()) {
- out.writeBoolean(true);
- try (var nnout = msg.getVersion().getStreamVersion().newDataOutput(out)) {
- nnout.writeNormalizedNode(data.orElseThrow());
- }
- } else {
- out.writeBoolean(false);
- }
- }
- }
-
@java.io.Serial
private static final long serialVersionUID = 1L;
}
@Override
- protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new RTS(this) : new ReadTransactionSuccessProxyV1(this);
+ protected RTS externalizableProxy(final ABIVersion version) {
+ return new RTS(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link ReadTransactionSuccess}. It implements the initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class ReadTransactionSuccessProxyV1 extends AbstractTransactionSuccessProxy<ReadTransactionSuccess>
- implements ReadTransactionSuccess.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public ReadTransactionSuccessProxyV1() {
- // For Externalizable
- }
-
- ReadTransactionSuccessProxyV1(final ReadTransactionSuccess request) {
- super(request);
- }
-}
import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
+import java.io.ObjectInput;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
+
/**
* Externalizable proxy for use with {@link SkipTransactionsResponse}. It implements the Chlorine SR2 serialization
* format.
*/
-final class STS implements SkipTransactionsResponse.SerialForm {
+final class STS implements TransactionSuccess.SerialForm<SkipTransactionsResponse> {
@java.io.Serial
private static final long serialVersionUID = 1L;
this.message = requireNonNull(message);
}
+ @Override
+ public SkipTransactionsResponse readExternal(final ObjectInput in, final TransactionIdentifier target,
+ final long sequence) {
+ return new SkipTransactionsResponse(target, sequence);
+ }
+
@Override
public Object readResolve() {
return message();
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new STR(this) : new SkipTransactionsRequestV1(this);
+ return new STR(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link SkipTransactionsRequest}. It implements the initial
- * (Phosphorus SR1) serialization format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class SkipTransactionsRequestV1 extends AbstractTransactionRequestProxy<SkipTransactionsRequest>
- implements SkipTransactionsRequest.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = -7493419007644462643L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public SkipTransactionsRequestV1() {
- // For Externalizable
- }
-
- SkipTransactionsRequestV1(final SkipTransactionsRequest request) {
- super(request);
- }
-}
*/
package org.opendaylight.controller.cluster.access.commands;
-import java.io.ObjectInput;
import org.opendaylight.controller.cluster.access.ABIVersion;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
*/
// FIXME: rename to SkipTransactionsSuccess
public final class SkipTransactionsResponse extends TransactionSuccess<SkipTransactionsResponse> {
- interface SerialForm extends TransactionSuccess.SerialForm<SkipTransactionsResponse> {
- @Override
- default SkipTransactionsResponse readExternal(final ObjectInput in, final TransactionIdentifier target,
- final long sequence) {
- return new SkipTransactionsResponse(target, sequence);
- }
- }
-
@java.io.Serial
private static final long serialVersionUID = 1L;
}
@Override
- protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new STS(this) : new SkipTransactionsResponseProxyV1(this);
+ protected STS externalizableProxy(final ABIVersion version) {
+ return new STS(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link SkipTransactionsResponse}. It implements the initial (Phosphorus SR1)
- * serialization format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class SkipTransactionsResponseProxyV1 extends AbstractTransactionSuccessProxy<SkipTransactionsResponse>
- implements SkipTransactionsResponse.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public SkipTransactionsResponseProxyV1() {
- // For Externalizable
- }
-
- SkipTransactionsResponseProxyV1(final SkipTransactionsResponse success) {
- super(success);
- }
-}
import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
+import java.io.ObjectInput;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
+
/**
* Externalizable proxy for use with {@link TransactionAbortSuccess}. It implements the Chlorine SR2 serialization
* format.
*/
-final class TAS implements TransactionAbortSuccess.SerialForm {
+final class TAS implements TransactionSuccess.SerialForm<TransactionAbortSuccess> {
@java.io.Serial
private static final long serialVersionUID = 1L;
this.message = requireNonNull(message);
}
+ @Override
+ public TransactionAbortSuccess readExternal(final ObjectInput in, final TransactionIdentifier target,
+ final long sequence) {
+ return new TransactionAbortSuccess(target, sequence);
+ }
+
@Override
public Object readResolve() {
return message();
import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
+import java.io.ObjectInput;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
+
/**
* Externalizable proxy for use with {@link TransactionCanCommitSuccess}. It implements the Chlorine SR2 serialization
* format.
*/
-final class TCCS implements TransactionCanCommitSuccess.SerialForm {
+final class TCCS implements TransactionSuccess.SerialForm<TransactionCanCommitSuccess> {
@java.io.Serial
private static final long serialVersionUID = 1L;
this.message = requireNonNull(message);
}
+ @Override
+ public TransactionCanCommitSuccess readExternal(final ObjectInput in, final TransactionIdentifier target,
+ final long sequence) {
+ return new TransactionCanCommitSuccess(target, sequence);
+ }
+
@Override
public Object readResolve() {
return message();
import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
+import java.io.ObjectInput;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
+
/**
* Externalizable proxy for use with {@link TransactionCommitSuccess}. It implements the Chlorine SR2 serialization
* format.
*/
-final class TCS implements TransactionCommitSuccess.SerialForm {
+final class TCS implements TransactionSuccess.SerialForm<TransactionCommitSuccess> {
@java.io.Serial
private static final long serialVersionUID = 1L;
this.message = requireNonNull(message);
}
+ @Override
+ public TransactionCommitSuccess readExternal(final ObjectInput in, final TransactionIdentifier target,
+ final long sequence) {
+ return new TransactionCommitSuccess(target, sequence);
+ }
+
@Override
public Object readResolve() {
return message();
import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
+import java.io.IOException;
+import java.io.ObjectInput;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
+
/**
* Externalizable proxy for use with {@link TransactionPreCommitSuccess}. It implements the Chlorine SR2 serialization
* format.
*/
-final class TPCS implements TransactionPreCommitSuccess.SerialForm {
+final class TPCS implements TransactionSuccess.SerialForm<TransactionPreCommitSuccess> {
@java.io.Serial
private static final long serialVersionUID = 1L;
this.message = requireNonNull(message);
}
+ @Override
+ public TransactionPreCommitSuccess readExternal(final ObjectInput in, final TransactionIdentifier target,
+ final long sequence) throws IOException {
+ return new TransactionPreCommitSuccess(target, sequence);
+ }
+
@Override
public Object readResolve() {
return message();
import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
+import java.io.ObjectInput;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
+
/**
* Externalizable proxy for use with {@link TransactionPurgeResponse}. It implements the Chlorine SR2 serialization
* format.
*/
-final class TPS implements TransactionPurgeResponse.SerialForm {
+final class TPS implements TransactionSuccess.SerialForm<TransactionPurgeResponse> {
@java.io.Serial
private static final long serialVersionUID = 1L;
this.message = requireNonNull(message);
}
+ @Override
+ public TransactionPurgeResponse readExternal(final ObjectInput in, final TransactionIdentifier target,
+ final long sequence) {
+ return new TransactionPurgeResponse(target, sequence);
+ }
+
@Override
public Object readResolve() {
return message();
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new TAR(this) : new TransactionAbortRequestProxyV1(this);
+ return new TAR(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link TransactionAbortRequest}. It implements the initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class TransactionAbortRequestProxyV1 extends AbstractTransactionRequestProxy<TransactionAbortRequest>
- implements TransactionAbortRequest.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public TransactionAbortRequestProxyV1() {
- // For Externalizable
- }
-
- TransactionAbortRequestProxyV1(final TransactionAbortRequest request) {
- super(request);
- }
-}
*/
package org.opendaylight.controller.cluster.access.commands;
-import java.io.ObjectInput;
import org.opendaylight.controller.cluster.access.ABIVersion;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
* @author Robert Varga
*/
public final class TransactionAbortSuccess extends TransactionSuccess<TransactionAbortSuccess> {
- interface SerialForm extends TransactionSuccess.SerialForm<TransactionAbortSuccess> {
- @Override
- default TransactionAbortSuccess readExternal(final ObjectInput in, final TransactionIdentifier target,
- final long sequence) {
- return new TransactionAbortSuccess(target, sequence);
- }
- }
-
@java.io.Serial
private static final long serialVersionUID = 1L;
}
@Override
- protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new TAS(this) : new TransactionAbortSuccessProxyV1(this);
+ protected TAS externalizableProxy(final ABIVersion version) {
+ return new TAS(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link TransactionAbortSuccess}. It implements the initial (Boron)
- * serialization format.
- *
- * @author Robert Varga
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class TransactionAbortSuccessProxyV1 extends AbstractTransactionSuccessProxy<TransactionAbortSuccess>
- implements TransactionAbortSuccess.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public TransactionAbortSuccessProxyV1() {
- // For Externalizable
- }
-
- TransactionAbortSuccessProxyV1(final TransactionAbortSuccess success) {
- super(success);
- }
-}
*/
package org.opendaylight.controller.cluster.access.commands;
-import java.io.ObjectInput;
import org.opendaylight.controller.cluster.access.ABIVersion;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
* @author Robert Varga
*/
public final class TransactionCanCommitSuccess extends TransactionSuccess<TransactionCanCommitSuccess> {
- interface SerialForm extends TransactionSuccess.SerialForm<TransactionCanCommitSuccess> {
- @Override
- default TransactionCanCommitSuccess readExternal(final ObjectInput in, final TransactionIdentifier target,
- final long sequence) {
- return new TransactionCanCommitSuccess(target, sequence);
- }
- }
-
@java.io.Serial
private static final long serialVersionUID = 1L;
}
@Override
- protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new TCCS(this) : new TransactionCanCommitSuccessProxyV1(this);
+ protected TCCS externalizableProxy(final ABIVersion version) {
+ return new TCCS(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link TransactionCanCommitSuccess}. It implements the initial (Boron)
- * serialization format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class TransactionCanCommitSuccessProxyV1 extends AbstractTransactionSuccessProxy<TransactionCanCommitSuccess>
- implements TransactionCanCommitSuccess.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public TransactionCanCommitSuccessProxyV1() {
- // For Externalizable
- }
-
- TransactionCanCommitSuccessProxyV1(final TransactionCanCommitSuccess success) {
- super(success);
- }
-}
*/
package org.opendaylight.controller.cluster.access.commands;
-import java.io.ObjectInput;
import org.opendaylight.controller.cluster.access.ABIVersion;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
* @author Robert Varga
*/
public final class TransactionCommitSuccess extends TransactionSuccess<TransactionCommitSuccess> {
- interface SerialForm extends TransactionSuccess.SerialForm<TransactionCommitSuccess> {
- @Override
- default TransactionCommitSuccess readExternal(final ObjectInput in, final TransactionIdentifier target,
- final long sequence) {
- return new TransactionCommitSuccess(target, sequence);
- }
- }
-
@java.io.Serial
private static final long serialVersionUID = 1L;
}
@Override
- protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new TCS(this) : new TransactionCommitSuccessProxyV1(this);
+ protected TCS externalizableProxy(final ABIVersion version) {
+ return new TCS(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link TransactionCommitSuccess}. It implements the initial (Boron)
- * serialization format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class TransactionCommitSuccessProxyV1 extends AbstractTransactionSuccessProxy<TransactionCommitSuccess>
- implements TransactionCommitSuccess.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public TransactionCommitSuccessProxyV1() {
- // For Externalizable
- }
-
- TransactionCommitSuccessProxyV1(final TransactionCommitSuccess success) {
- super(success);
- }
-}
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new TDCR(this) : new TransactionDoCommitRequestProxyV1(this);
+ return new TDCR(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link TransactionDoCommitRequest}. It implements the initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class TransactionDoCommitRequestProxyV1 extends AbstractTransactionRequestProxy<TransactionDoCommitRequest>
- implements TransactionDoCommitRequest.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public TransactionDoCommitRequestProxyV1() {
- // For Externalizable
- }
-
- TransactionDoCommitRequestProxyV1(final TransactionDoCommitRequest request) {
- super(request);
- }
-}
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new TF(this) : new TransactionFailureProxyV1(this);
+ return new TF(this);
}
}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-import org.opendaylight.controller.cluster.access.concepts.AbstractRequestFailureProxy;
-import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
-
-/**
- * Externalizable proxy for use with {@link TransactionFailure}. It implements the initial (Boron) serialization
- * format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class TransactionFailureProxyV1 extends AbstractRequestFailureProxy<TransactionIdentifier, TransactionFailure>
- implements TransactionFailure.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public TransactionFailureProxyV1() {
- // For Externalizable
- }
-
- TransactionFailureProxyV1(final TransactionFailure failure) {
- super(failure);
- }
-}
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new TPCR(this) : new TransactionPreCommitRequestProxyV1(this);
+ return new TPCR(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link TransactionPreCommitRequest}. It implements the initial (Boron)
- * serialization format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class TransactionPreCommitRequestProxyV1 extends AbstractTransactionRequestProxy<TransactionPreCommitRequest>
- implements TransactionPreCommitRequest.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public TransactionPreCommitRequestProxyV1() {
- // For Externalizable
- }
-
- TransactionPreCommitRequestProxyV1(final TransactionPreCommitRequest request) {
- super(request);
- }
-}
*/
package org.opendaylight.controller.cluster.access.commands;
-import java.io.IOException;
-import java.io.ObjectInput;
import org.opendaylight.controller.cluster.access.ABIVersion;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
* @author Robert Varga
*/
public final class TransactionPreCommitSuccess extends TransactionSuccess<TransactionPreCommitSuccess> {
- interface SerialForm extends TransactionSuccess.SerialForm<TransactionPreCommitSuccess> {
- @Override
- default TransactionPreCommitSuccess readExternal(final ObjectInput in, final TransactionIdentifier target,
- final long sequence) throws IOException {
- return new TransactionPreCommitSuccess(target, sequence);
- }
- }
-
@java.io.Serial
private static final long serialVersionUID = 1L;
}
@Override
- protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new TPCS(this) : new TransactionPreCommitSuccessProxyV1(this);
+ protected TPCS externalizableProxy(final ABIVersion version) {
+ return new TPCS(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link TransactionPreCommitSuccess}. It implements the initial (Boron)
- * serialization format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class TransactionPreCommitSuccessProxyV1 extends AbstractTransactionSuccessProxy<TransactionPreCommitSuccess>
- implements TransactionPreCommitSuccess.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public TransactionPreCommitSuccessProxyV1() {
- // For Externalizable
- }
-
- TransactionPreCommitSuccessProxyV1(final TransactionPreCommitSuccess success) {
- super(success);
- }
-}
@Override
protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new TPR(this) : new TransactionPurgeRequestProxyV1(this);
+ return new TPR(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link TransactionPurgeRequest}. It implements the initial (Boron)
- * serialization format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class TransactionPurgeRequestProxyV1 extends AbstractTransactionRequestProxy<TransactionPurgeRequest>
- implements TransactionPurgeRequest.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public TransactionPurgeRequestProxyV1() {
- // For Externalizable
- }
-
- TransactionPurgeRequestProxyV1(final TransactionPurgeRequest request) {
- super(request);
- }
-}
*/
package org.opendaylight.controller.cluster.access.commands;
-import java.io.ObjectInput;
import org.opendaylight.controller.cluster.access.ABIVersion;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
*/
// FIXME: rename to TransactionPurgeSuccess
public final class TransactionPurgeResponse extends TransactionSuccess<TransactionPurgeResponse> {
- interface SerialForm extends TransactionSuccess.SerialForm<TransactionPurgeResponse> {
- @Override
- default TransactionPurgeResponse readExternal(final ObjectInput in, final TransactionIdentifier target,
- final long sequence) {
- return new TransactionPurgeResponse(target, sequence);
- }
- }
-
@java.io.Serial
private static final long serialVersionUID = 1L;
}
@Override
- protected SerialForm externalizableProxy(final ABIVersion version) {
- return ABIVersion.MAGNESIUM.lt(version) ? new TPS(this) : new TransactionPurgeResponseProxyV1(this);
+ protected TPS externalizableProxy(final ABIVersion version) {
+ return new TPS(this);
}
@Override
+++ /dev/null
-/*
- * Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.commands;
-
-/**
- * Externalizable proxy for use with {@link TransactionPurgeResponse}. It implements the initial (Boron)
- * serialization format.
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class TransactionPurgeResponseProxyV1 extends AbstractTransactionSuccessProxy<TransactionPurgeResponse>
- implements TransactionPurgeResponse.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public TransactionPurgeResponseProxyV1() {
- // For Externalizable
- }
-
- TransactionPurgeResponseProxyV1(final TransactionPurgeResponse success) {
- super(success);
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.concepts;
-
-import static com.google.common.base.Verify.verifyNotNull;
-import static java.util.Objects.requireNonNull;
-
-@Deprecated(since = "7.0.0", forRemoval = true)
-abstract class AbstractEnvelopeProxy<T extends Message<?, ?>, E extends Envelope<T>>
- implements Envelope.SerialForm<T, E> {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- private E envelope;
-
- AbstractEnvelopeProxy() {
- // for Externalizable
- }
-
- AbstractEnvelopeProxy(final E envelope) {
- this.envelope = requireNonNull(envelope);
- }
-
- @Override
- public final E envelope() {
- return verifyNotNull(envelope);
- }
-
- @Override
- public final void setEnvelope(final E envelope) {
- this.envelope = requireNonNull(envelope);
- }
-
- @Override
- public final Object readResolve() {
- return envelope();
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.concepts;
-
-import static com.google.common.base.Verify.verifyNotNull;
-import static java.util.Objects.requireNonNull;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.concepts.WritableIdentifier;
-
-/**
- * Abstract Externalizable proxy for use with {@link Message} subclasses.
- *
- * @param <T> Target identifier type
- * @param <C> Message class
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-abstract class AbstractMessageProxy<T extends WritableIdentifier, C extends Message<T, C>>
- implements Message.SerialForm<T, C> {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- private C message;
-
- protected AbstractMessageProxy() {
- // For Externalizable
- }
-
- AbstractMessageProxy(final @NonNull C message) {
- this.message = requireNonNull(message);
- }
-
- @Override
- public final C message() {
- return verifyNotNull(message);
- }
-
- @Override
- public final void setMessage(final C message) {
- this.message = requireNonNull(message);
- }
-
- @Override
- public final Object readResolve() {
- return message();
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.concepts;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.concepts.WritableIdentifier;
-
-/**
- * Abstract Externalizable proxy for use with {@link RequestFailure} subclasses.
- *
- * @param <T> Target identifier type
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-public abstract class AbstractRequestFailureProxy<T extends WritableIdentifier, C extends RequestFailure<T, C>>
- extends AbstractResponseProxy<T, C> implements RequestFailure.SerialForm<T, C> {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- protected AbstractRequestFailureProxy() {
- // For Externalizable
- }
-
- protected AbstractRequestFailureProxy(final @NonNull C failure) {
- super(failure);
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.concepts;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.concepts.WritableIdentifier;
-
-/**
- * Abstract Externalizable proxy for use with {@link Request} subclasses.
- *
- * @param <T> Target identifier type
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-public abstract class AbstractRequestProxy<T extends WritableIdentifier, C extends Request<T, C>>
- extends AbstractMessageProxy<T, C> implements Request.SerialForm<T, C> {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- protected AbstractRequestProxy() {
- // For Externalizable
- }
-
- protected AbstractRequestProxy(final @NonNull C request) {
- super(request);
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.concepts;
-
-@Deprecated(since = "7.0.0", forRemoval = true)
-abstract class AbstractResponseEnvelopeProxy<T extends Response<?, ?>, E extends ResponseEnvelope<T>>
- extends AbstractEnvelopeProxy<T, E> {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- AbstractResponseEnvelopeProxy() {
- // for Externalizable
- }
-
- AbstractResponseEnvelopeProxy(final E envelope) {
- super(envelope);
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.concepts;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.concepts.WritableIdentifier;
-
-/**
- * Abstract Externalizable proxy class to use with {@link Response} subclasses.
- *
- * @author Robert Varga
- *
- * @param <T> Target identifier type
- * @param <C> Message class
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-abstract class AbstractResponseProxy<T extends WritableIdentifier, C extends Response<T, C>>
- extends AbstractMessageProxy<T, C> {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- protected AbstractResponseProxy() {
- // for Externalizable
- }
-
- AbstractResponseProxy(final @NonNull C response) {
- super(response);
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.concepts;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.concepts.WritableIdentifier;
-
-/**
- * Abstract Externalizable proxy for use with {@link RequestSuccess} subclasses.
- *
- * @param <T> Target identifier type
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-public abstract class AbstractSuccessProxy<T extends WritableIdentifier, C extends RequestSuccess<T, C>>
- extends AbstractResponseProxy<T, C> {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- protected AbstractSuccessProxy() {
- // For Externalizable
- }
-
- protected AbstractSuccessProxy(final @NonNull C success) {
- super(success);
- }
-}
import java.io.ObjectOutput;
import java.io.Serializable;
import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.controller.cluster.access.ABIVersion;
import org.opendaylight.yangtools.concepts.Immutable;
import org.opendaylight.yangtools.concepts.WritableObjects;
@java.io.Serial
final Object writeReplace() {
- return ABIVersion.MAGNESIUM.lt(message.getVersion()) ? createProxy() : legacyProxy();
+ return createProxy();
}
abstract @NonNull SerialForm<T, ?> createProxy();
-
- @Deprecated(since = "7.0.0", forRemoval = true)
- abstract @NonNull AbstractEnvelopeProxy<T, ?> legacyProxy();
}
*/
package org.opendaylight.controller.cluster.access.concepts;
-import java.io.ObjectInput;
-
public final class FailureEnvelope extends ResponseEnvelope<RequestFailure<?, ?>> {
- interface SerialForm extends ResponseEnvelope.SerialForm<RequestFailure<?, ?>, FailureEnvelope> {
- @Override
- default FailureEnvelope readExternal(final ObjectInput in, final long sessionId, final long txSequence,
- final RequestFailure<?, ?> message, final long executionTimeNanos) {
- return new FailureEnvelope(message, sessionId, txSequence, executionTimeNanos);
- }
- }
-
@java.io.Serial
private static final long serialVersionUID = 1L;
FE createProxy() {
return new FE(this);
}
-
- @Override
- FailureEnvelopeProxy legacyProxy() {
- return new FailureEnvelopeProxy(this);
- }
}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.concepts;
-
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class FailureEnvelopeProxy extends AbstractResponseEnvelopeProxy<RequestFailure<?, ?>, FailureEnvelope>
- implements FailureEnvelope.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to be
- // able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public FailureEnvelopeProxy() {
- // for Externalizable
- }
-
- FailureEnvelopeProxy(final FailureEnvelope envelope) {
- super(envelope);
- }
-}
}
return switch (toVersion) {
- case MAGNESIUM, CHLORINE_SR2 -> verifyNotNull(cloneAsVersion(toVersion));
+ case CHLORINE_SR2 -> verifyNotNull(cloneAsVersion(toVersion));
default -> throw new IllegalArgumentException("Unhandled ABI version " + toVersion);
};
}
import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
+import java.io.ObjectInput;
+
/**
* Serialization proxy for {@link RequestEnvelope}.
*/
-final class RE implements RequestEnvelope.SerialForm {
+final class RE implements Envelope.SerialForm<Request<?, ?>, RequestEnvelope> {
@java.io.Serial
private static final long serialVersionUID = 1L;
this.envelope = requireNonNull(envelope);
}
+ @Override
+ public RequestEnvelope readExternal(final ObjectInput in, final long sessionId, final long txSequence,
+ final Request<?, ?> message) {
+ return new RequestEnvelope(message, sessionId, txSequence);
+ }
+
@Override
public Object readResolve() {
return envelope();
package org.opendaylight.controller.cluster.access.concepts;
import akka.actor.ActorRef;
-import java.io.ObjectInput;
public final class RequestEnvelope extends Envelope<Request<?, ?>> {
- interface SerialForm extends Envelope.SerialForm<Request<?, ?>, RequestEnvelope> {
- @Override
- default RequestEnvelope readExternal(final ObjectInput in, final long sessionId, final long txSequence,
- final Request<?, ?> message) {
- return new RequestEnvelope(message, sessionId, txSequence);
- }
- }
-
@java.io.Serial
private static final long serialVersionUID = 1L;
return new RE(this);
}
- @Override
- RequestEnvelopeProxy legacyProxy() {
- return new RequestEnvelopeProxy(this);
- }
-
/**
* Respond to this envelope with a {@link RequestFailure} caused by specified {@link RequestException}.
*
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.concepts;
-
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class RequestEnvelopeProxy extends AbstractEnvelopeProxy<Request<?, ?>, RequestEnvelope>
- implements RequestEnvelope.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public RequestEnvelopeProxy() {
- // for Externalizable
- }
-
- RequestEnvelopeProxy(final RequestEnvelope envelope) {
- super(envelope);
- }
-}
/**
* Serialization proxy for {@link SuccessEnvelope}.
*/
-final class SE implements SuccessEnvelope.SerialForm {
+final class SE implements ResponseEnvelope.SerialForm<RequestSuccess<?, ?>, SuccessEnvelope> {
@java.io.Serial
private static final long serialVersionUID = 1L;
*/
package org.opendaylight.controller.cluster.access.concepts;
-import java.io.ObjectInput;
-
public final class SuccessEnvelope extends ResponseEnvelope<RequestSuccess<?, ?>> {
- interface SerialForm extends ResponseEnvelope.SerialForm<RequestSuccess<?, ?>, SuccessEnvelope> {
- @Override
- default SuccessEnvelope readExternal(final ObjectInput in, final long sessionId, final long txSequence,
- final RequestSuccess<?, ?> message, final long executionTimeNanos) {
- return new SuccessEnvelope(message, sessionId, txSequence, executionTimeNanos);
- }
- }
-
@java.io.Serial
private static final long serialVersionUID = 1L;
SE createProxy() {
return new SE(this);
}
-
- @Override
- SuccessEnvelopeProxy legacyProxy() {
- return new SuccessEnvelopeProxy(this);
- }
-
}
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.cluster.access.concepts;
-
-@Deprecated(since = "7.0.0", forRemoval = true)
-final class SuccessEnvelopeProxy extends AbstractResponseEnvelopeProxy<RequestSuccess<?, ?>, SuccessEnvelope>
- implements SuccessEnvelope.SerialForm {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public SuccessEnvelopeProxy() {
- // for Externalizable
- }
-
- SuccessEnvelopeProxy(final SuccessEnvelope envelope) {
- super(envelope);
- }
-}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
-import static org.opendaylight.controller.cluster.access.ABIVersion.MAGNESIUM;
+import static org.opendaylight.controller.cluster.access.ABIVersion.CHLORINE_SR2;
import static org.opendaylight.controller.cluster.access.ABIVersion.TEST_FUTURE_VERSION;
import static org.opendaylight.controller.cluster.access.ABIVersion.TEST_PAST_VERSION;
@Test
public void testInvalidVersions() {
assertTrue(TEST_PAST_VERSION.compareTo(TEST_FUTURE_VERSION) < 0);
- assertTrue(TEST_PAST_VERSION.compareTo(MAGNESIUM) < 0);
- assertTrue(TEST_FUTURE_VERSION.compareTo(MAGNESIUM) > 0);
+ assertTrue(TEST_PAST_VERSION.compareTo(CHLORINE_SR2) < 0);
+ assertTrue(TEST_FUTURE_VERSION.compareTo(CHLORINE_SR2) > 0);
}
@Test
public void testMagnesiumVersion() throws Exception {
- assertEquals((short)8, MAGNESIUM.shortValue());
- assertEquals(MAGNESIUM, ABIVersion.valueOf(MAGNESIUM.shortValue()));
- assertEquals(MAGNESIUM, ABIVersion.readFrom(ByteStreams.newDataInput(writeVersion(MAGNESIUM))));
+ assertEquals((short)9, CHLORINE_SR2.shortValue());
+ assertEquals(CHLORINE_SR2, ABIVersion.valueOf(CHLORINE_SR2.shortValue()));
+ assertEquals(CHLORINE_SR2, ABIVersion.readFrom(ByteStreams.newDataInput(writeVersion(CHLORINE_SR2))));
}
@Test
private static final AbortLocalTransactionRequest OBJECT = new AbortLocalTransactionRequest(TRANSACTION, ACTOR_REF);
public AbortLocalTransactionRequestTest() {
- super(OBJECT, 0, 0);
+ super(OBJECT);
}
@Override
public abstract class AbstractLocalTransactionRequestTest<T extends AbstractLocalTransactionRequest<T>>
extends AbstractTransactionRequestTest<T> {
- protected AbstractLocalTransactionRequestTest(final T object, final int baseSize, final int legacySize) {
- super(object, baseSize, legacySize);
+ protected AbstractLocalTransactionRequestTest(final T object) {
+ super(object, -1);
}
@Test
public void cloneAsVersionTest() {
- assertSame(object(), object().cloneAsVersion(ABIVersion.MAGNESIUM));
+ assertSame(object(), object().cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION));
}
@Override
protected static final YangInstanceIdentifier PATH = YangInstanceIdentifier.empty();
protected static final boolean SNAPSHOT_ONLY = true;
- protected AbstractReadTransactionRequestTest(final T object, final int baseSize, final int legacySize) {
- super(object, baseSize, legacySize);
+ protected AbstractReadTransactionRequestTest(final T object, final int baseSize) {
+ super(object, baseSize);
}
@Test
import org.apache.commons.lang3.SerializationUtils;
import org.junit.Test;
-import org.opendaylight.controller.cluster.access.ABIVersion;
import org.opendaylight.controller.cluster.access.concepts.ClientIdentifier;
import org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier;
import org.opendaylight.controller.cluster.access.concepts.FrontendType;
private final T object;
private final int expectedSize;
- private final int legacySize;
- protected AbstractRequestFailureTest(final T object, final int baseSize, final int legacySize) {
+ protected AbstractRequestFailureTest(final T object, final int baseSize) {
this.object = requireNonNull(object);
this.expectedSize = baseSize + CAUSE_SIZE;
- this.legacySize = legacySize + CAUSE_SIZE;
}
@Test
public void serializationTest() {
final var bytes = SerializationUtils.serialize(object);
assertEquals(expectedSize, bytes.length);
- assertEquals(legacySize, SerializationUtils.serialize(object.toVersion(ABIVersion.MAGNESIUM)).length);
@SuppressWarnings("unchecked")
final var deserialize = (T) SerializationUtils.deserialize(bytes);
import org.apache.commons.lang3.SerializationUtils;
import org.eclipse.jdt.annotation.NonNull;
import org.junit.Test;
-import org.opendaylight.controller.cluster.access.ABIVersion;
import org.opendaylight.controller.cluster.access.concepts.ClientIdentifier;
import org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier;
import org.opendaylight.controller.cluster.access.concepts.FrontendType;
private final @NonNull T object;
private final int expectedSize;
- private final int legacySize;
- protected AbstractRequestSuccessTest(final T object, final int expectedSize, final int legacySize) {
+ protected AbstractRequestSuccessTest(final T object, final int expectedSize) {
this.object = requireNonNull(object);
this.expectedSize = expectedSize;
- this.legacySize = legacySize;
}
@Test
public void serializationTest() {
final var bytes = SerializationUtils.serialize(object);
assertEquals(expectedSize, bytes.length);
- assertEquals(legacySize, SerializationUtils.serialize(object.toVersion(ABIVersion.MAGNESIUM)).length);
@SuppressWarnings("unchecked")
final var deserialize = (T) SerializationUtils.deserialize(bytes);
protected static final TransactionIdentifier TRANSACTION_IDENTIFIER = new TransactionIdentifier(
HISTORY_IDENTIFIER, 0);
- protected AbstractTransactionRequestTest(final T object, final int baseSize, final int legacySize) {
- super(object, baseSize, legacySize);
+ protected AbstractTransactionRequestTest(final T object, final int baseSize) {
+ super(object, baseSize);
}
@Test
protected static final TransactionIdentifier TRANSACTION_IDENTIFIER = new TransactionIdentifier(HISTORY_IDENTIFIER,
0);
- protected AbstractTransactionSuccessTest(final T object, final int expectedSize, final int legacySize) {
- super(object, expectedSize, legacySize);
+ protected AbstractTransactionSuccessTest(final T object, final int expectedSize) {
+ super(object, expectedSize);
}
}
ACTOR_REF, MODIFICATION, null, COORDINATED);
public CommitLocalTransactionRequestTest() {
- super(OBJECT, 0, 0);
+ super(OBJECT);
}
@Test
private static final ConnectClientFailure OBJECT = new ConnectClientFailure(CLIENT_IDENTIFIER, 0, CAUSE);
public ConnectClientFailureTest() {
- super(OBJECT, 99, 392);
+ super(OBJECT, 99);
}
@Test
CLIENT_IDENTIFIER, 0, ACTOR_REF, MIN_VERSION, MAX_VERSION);
public ConnectClientRequestTest() {
- super(OBJECT, 112, 310);
+ super(OBJECT, 112);
}
@Test
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertNotNull(clone);
- assertEquals(ABIVersion.MAGNESIUM, clone.getVersion());
+ assertEquals(ABIVersion.TEST_FUTURE_VERSION, clone.getVersion());
}
@Test
DataTreeConfiguration.DEFAULT_OPERATIONAL);
private static final ActorSystem SYSTEM = ActorSystem.create("test");
private static final ActorRef ACTOR_REF = TestProbe.apply(SYSTEM).ref();
- private static final int ACTOR_REF_SIZE = ACTOR_REF.path().toSerializationFormat().length();
private static final ActorSelection ACTOR_SELECTION = ActorSelection.apply(ACTOR_REF, "foo");
private static final List<ActorSelection> ALTERNATES = ImmutableList.of(ACTOR_SELECTION);
private static final int MAX_MESSAGES = 10;
ALTERNATES, TREE, MAX_MESSAGES);
public ConnectClientSuccessTest() {
- super(OBJECT, 146 + ACTOR_REF_SIZE, 432 + ACTOR_REF_SIZE);
+ super(OBJECT, 146 + ACTOR_REF.path().toSerializationFormat().length());
}
@Before
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
assertEquals(OBJECT.getAlternates(), clone.getAlternates());
ACTOR_REF, PATH, SNAPSHOT_ONLY);
public ExistsTransactionRequestTest() {
- super(OBJECT, 108, 620);
+ super(OBJECT, 108);
}
@Test
EXISTS);
public ExistsTransactionSuccessTest() {
- super(OBJECT, 99, 487);
+ super(OBJECT, 99);
}
@Test
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
assertEquals(OBJECT.getExists(), clone.getExists());
private static final LocalHistoryFailure OBJECT = new LocalHistoryFailure(HISTORY_IDENTIFIER, 0, CAUSE);
public LocalHistoryFailureTest() {
- super(OBJECT, 99, 392);
+ super(OBJECT, 99);
}
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
assertEquals(OBJECT.getCause(), clone.getCause());
private static final LocalHistorySuccess OBJECT = new LocalHistorySuccess(HISTORY_IDENTIFIER, 0);
public LocalHistorySuccessTest() {
- super(OBJECT, 96, 382);
+ super(OBJECT, 96);
}
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
- assertEquals(ABIVersion.MAGNESIUM, clone.getVersion());
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
+ assertEquals(ABIVersion.TEST_FUTURE_VERSION, clone.getVersion());
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
}
ACTOR_REF, List.of(), PROTOCOL);
public ModifyTransactionRequestEmptyTest() {
- super(OBJECT, 108, 408);
+ super(OBJECT, 108);
}
@Test
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
assertEquals(OBJECT.getReplyTo(), clone.getReplyTo());
ACTOR_REF, MODIFICATIONS, PROTOCOL);
public ModifyTransactionRequestTest() {
- super(OBJECT, 140, 440);
+ super(OBJECT, 140);
}
@Test
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
assertEquals(OBJECT.getReplyTo(), clone.getReplyTo());
private static final ModifyTransactionSuccess OBJECT = new ModifyTransactionSuccess(TRANSACTION_IDENTIFIER, 0);
public ModifyTransactionSuccessTest() {
- super(OBJECT, 98, 486);
+ super(OBJECT, 98);
}
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
- assertEquals(ABIVersion.MAGNESIUM, clone.getVersion());
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
+ assertEquals(ABIVersion.TEST_FUTURE_VERSION, clone.getVersion());
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
}
ACTOR_REF, PATH, SNAPSHOT_ONLY);
public ReadTransactionRequestTest() {
- super(OBJECT, 108, 618);
+ super(OBJECT, 108);
}
@Test
Optional.empty());
public ReadTransactionSuccessNoDataTest() {
- super(OBJECT, 99, 485);
+ super(OBJECT, 99);
}
@Test
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
assertEquals(OBJECT.getData(), clone.getData());
Optional.of(NODE));
public ReadTransactionSuccessTest() {
- super(OBJECT, 129, 515);
+ super(OBJECT, 129);
}
@Test
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
assertEquals(OBJECT.getData(), clone.getData());
ACTOR_REF, List.of(UnsignedLong.ONE));
public SkipTransactionsRequestTest() {
- super(OBJECT, 109, 403);
+ super(OBJECT, 109);
}
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
assertEquals(OBJECT.getReplyTo(), clone.getReplyTo());
private static final SkipTransactionsResponse OBJECT = new SkipTransactionsResponse(TRANSACTION_IDENTIFIER, 0);
public SkipTransactionsResponseTest() {
- super(OBJECT, 98, 486);
+ super(OBJECT, 98);
}
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
}
ACTOR_REF);
public TransactionAbortRequestTest() {
- super(OBJECT, 101, 400);
+ super(OBJECT, 101);
}
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
assertEquals(OBJECT.getReplyTo(), clone.getReplyTo());
private static final TransactionAbortSuccess OBJECT = new TransactionAbortSuccess(TRANSACTION_IDENTIFIER, 0);
public TransactionAbortSuccessTest() {
- super(OBJECT, 98, 485);
+ super(OBJECT, 98);
}
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
}
0);
public TransactionCanCommitSuccessTest() {
- super(OBJECT, 99, 489);
+ super(OBJECT, 99);
}
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
}
private static final TransactionCommitSuccess OBJECT = new TransactionCommitSuccess(TRANSACTION_IDENTIFIER, 0);
public TransactionCommitSuccessTest() {
- super(OBJECT, 98, 486);
+ super(OBJECT, 98);
}
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
}
ACTOR_REF);
public TransactionDoCommitRequestTest() {
- super(OBJECT, 102, 403);
+ super(OBJECT, 102);
}
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
assertEquals(OBJECT.getReplyTo(), clone.getReplyTo());
private static final TransactionFailure OBJECT = new TransactionFailure(TRANSACTION_IDENTIFIER, 0, CAUSE);
public TransactionFailureTest() {
- super(OBJECT, 100, 392);
+ super(OBJECT, 100);
}
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
assertEquals(OBJECT.getCause(), clone.getCause());
ACTOR_REF);
public TransactionPreCommitRequestTest() {
- super(OBJECT, 102, 404);
+ super(OBJECT, 102);
}
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
assertEquals(OBJECT.getReplyTo(), clone.getReplyTo());
0);
public TransactionPreCommitSuccessTest() {
- super(OBJECT, 99, 489);
+ super(OBJECT, 99);
}
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
}
ACTOR_REF);
public TransactionPurgeRequestTest() {
- super(OBJECT, 101, 400);
+ super(OBJECT, 101);
}
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
assertEquals(OBJECT.getReplyTo(), clone.getReplyTo());
private static final TransactionPurgeResponse OBJECT = new TransactionPurgeResponse(TRANSACTION_IDENTIFIER, 0);
public TransactionPurgeResponseTest() {
- super(OBJECT, 98, 486);
+ super(OBJECT, 98);
}
@Test
public void cloneAsVersionTest() {
- final var clone = OBJECT.cloneAsVersion(ABIVersion.MAGNESIUM);
+ final var clone = OBJECT.cloneAsVersion(ABIVersion.TEST_FUTURE_VERSION);
assertEquals(OBJECT.getSequence(), clone.getSequence());
assertEquals(OBJECT.getTarget(), clone.getTarget());
}
import org.apache.commons.lang3.SerializationUtils;
import org.junit.Before;
import org.junit.Test;
-import org.opendaylight.controller.cluster.access.ABIVersion;
public abstract class AbstractRequestTest<T extends Request<?, T>> {
private static final ActorSystem SYSTEM = ActorSystem.create("test");
private final T object;
private final int expectedSize;
- private final int legacySize;
- protected AbstractRequestTest(final T object, final int baseSize, final int legacySize) {
+ protected AbstractRequestTest(final T object, final int baseSize) {
this.object = requireNonNull(object);
this.expectedSize = baseSize + ACTOR_REF_SIZE;
- this.legacySize = legacySize + ACTOR_REF_SIZE;
}
protected final T object() {
@Test
public void serializationTest() {
- assertEquals(legacySize, SerializationUtils.serialize(object.cloneAsVersion(ABIVersion.MAGNESIUM)).length);
-
final byte[] bytes = SerializationUtils.serialize(object);
assertEquals(expectedSize, bytes.length);
@SuppressWarnings("unchecked")
*/
package org.opendaylight.controller.cluster.access.concepts;
+import static com.google.common.base.Verify.verifyNotNull;
+import static java.util.Objects.requireNonNull;
import static org.junit.Assert.assertEquals;
import java.io.DataInput;
final var cause = new RuntimeRequestException("msg", new RuntimeException());
final int causeSize = SerializationUtils.serialize(cause).length;
return new EnvelopeDetails<>(new FailureEnvelope(new MockFailure(OBJECT, cause, 42), 1L, 2L, 11L),
- causeSize + 485);
+ causeSize + 216);
}
@Override
assertEquals(expectedCause.isRetriable(), actualCause.isRetriable());
}
- private static class MockRequestFailureProxy extends AbstractRequestFailureProxy<WritableIdentifier, MockFailure> {
+ private static class MockRequestFailureProxy implements RequestFailure.SerialForm<WritableIdentifier, MockFailure> {
@java.io.Serial
private static final long serialVersionUID = 5015515628523887221L;
+ private MockFailure message;
+
@SuppressWarnings("checkstyle:RedundantModifier")
public MockRequestFailureProxy() {
//For Externalizable
}
private MockRequestFailureProxy(final MockFailure mockFailure) {
- super(mockFailure);
+ message = requireNonNull(mockFailure);
}
@Override
public WritableIdentifier readTarget(final DataInput in) throws IOException {
return TransactionIdentifier.readFrom(in);
}
+
+ @Override
+ public MockFailure message() {
+ return verifyNotNull(message);
+ }
+
+ @Override
+ public void setMessage(final MockFailure message) {
+ this.message = requireNonNull(message);
+ }
+
+ @Override
+ public Object readResolve() {
+ return message();
+ }
}
private static class MockFailure extends RequestFailure<WritableIdentifier, MockFailure> {
}
@Override
- protected AbstractRequestFailureProxy<WritableIdentifier, MockFailure> externalizableProxy(
+ protected RequestFailure.SerialForm<WritableIdentifier, MockFailure> externalizableProxy(
final ABIVersion version) {
return new MockRequestFailureProxy(this);
}
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.opendaylight.controller.cluster.access.ABIVersion;
-import org.opendaylight.controller.cluster.access.concepts.AbstractRequestFailureProxy;
-import org.opendaylight.controller.cluster.access.concepts.AbstractRequestProxy;
import org.opendaylight.controller.cluster.access.concepts.FailureEnvelope;
import org.opendaylight.controller.cluster.access.concepts.Request;
import org.opendaylight.controller.cluster.access.concepts.RequestEnvelope;
}
@Override
- protected AbstractRequestFailureProxy<WritableIdentifier, MockFailure> externalizableProxy(
- final ABIVersion version) {
+ protected SerialForm<WritableIdentifier, MockFailure> externalizableProxy(final ABIVersion version) {
return null;
}
}
@Override
- protected AbstractRequestProxy<WritableIdentifier, MockRequest> externalizableProxy(final ABIVersion version) {
+ protected Request.SerialForm<WritableIdentifier, MockRequest> externalizableProxy(final ABIVersion version) {
return null;
}
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.opendaylight.controller.cluster.access.ABIVersion;
-import org.opendaylight.controller.cluster.access.concepts.AbstractRequestFailureProxy;
-import org.opendaylight.controller.cluster.access.concepts.AbstractRequestProxy;
import org.opendaylight.controller.cluster.access.concepts.Request;
import org.opendaylight.controller.cluster.access.concepts.RequestException;
import org.opendaylight.controller.cluster.access.concepts.RequestFailure;
}
@Override
- protected AbstractRequestFailureProxy<WritableIdentifier, MockFailure> externalizableProxy(
- final ABIVersion version) {
+ protected SerialForm<WritableIdentifier, MockFailure> externalizableProxy(final ABIVersion version) {
return null;
}
}
@Override
- protected AbstractRequestProxy<WritableIdentifier, MockRequest> externalizableProxy(final ABIVersion version) {
+ protected Request.SerialForm<WritableIdentifier, MockRequest> externalizableProxy(final ABIVersion version) {
return null;
}
// FIXME: we really need just ActorContext.findPrimaryShardAsync()
AbstractShardBackendResolver(final ClientIdentifier clientId, final ActorUtils actorUtils) {
this.actorUtils = requireNonNull(actorUtils);
- connectFunction = ExplicitAsk.toScala(t -> new ConnectClientRequest(clientId, t, ABIVersion.MAGNESIUM,
+ connectFunction = ExplicitAsk.toScala(t -> new ConnectClientRequest(clientId, t, ABIVersion.CHLORINE_SR2,
ABIVersion.current()));
}
return () -> staleBackendInfoCallbacks.remove(callback);
}
- protected void notifyStaleBackendInfoCallbacks(Long cookie) {
+ protected void notifyStaleBackendInfoCallbacks(final Long cookie) {
staleBackendInfoCallbacks.forEach(callback -> callback.accept(cookie));
}