Add new cds-access-api proxies
[controller.git] / opendaylight / md-sal / cds-access-api / src / main / java / org / opendaylight / controller / cluster / access / concepts / AbstractRequestFailureProxy.java
index e715c94f011d89e7497c6e21bf5edff855099070..8089856ed296b04179a5bf26bdd2f9b4b3a19d14 100644 (file)
@@ -7,10 +7,6 @@
  */
 package org.opendaylight.controller.cluster.access.concepts;
 
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.io.Serial;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.concepts.WritableIdentifier;
 
@@ -20,38 +16,15 @@ import org.opendaylight.yangtools.concepts.WritableIdentifier;
  * @param <T> Target identifier type
  */
 public abstract class AbstractRequestFailureProxy<T extends WritableIdentifier, C extends RequestFailure<T, C>>
-        extends AbstractResponseProxy<T, C> {
-    @Serial
+        extends AbstractResponseProxy<T, C> implements RequestFailure.SerialForm<T, C> {
+    @java.io.Serial
     private static final long serialVersionUID = 1L;
 
-    private RequestException cause;
-
     protected AbstractRequestFailureProxy() {
         // For Externalizable
     }
 
     protected AbstractRequestFailureProxy(final @NonNull C failure) {
         super(failure);
-        this.cause = failure.getCause();
-    }
-
-    @Override
-    public void writeExternal(final ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-        out.writeObject(cause);
-    }
-
-    @Override
-    public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
-        super.readExternal(in);
-        cause = (RequestException) in.readObject();
-    }
-
-    @Override
-    final C createResponse(final T target, final long sequence) {
-        return createFailure(target, sequence, cause);
     }
-
-    protected abstract @NonNull C createFailure(@NonNull T target, long sequence,
-            @NonNull RequestException failureCause);
-}
+}
\ No newline at end of file