X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fcds-access-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fcommands%2FConnectClientSuccessProxyV1.java;h=8dd40ac2c43d9c6dc0846bb3c2aff66ea2fdbc5d;hb=HEAD;hp=6c9ae2a19ad4eb4840d9e5ab903b98d4995f286a;hpb=a73c52b4740be611728b4f9c70c67b2b36cf3916;p=controller.git diff --git a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ConnectClientSuccessProxyV1.java b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ConnectClientSuccessProxyV1.java deleted file mode 100644 index 6c9ae2a19a..0000000000 --- a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ConnectClientSuccessProxyV1.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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 akka.actor.ActorRef; -import akka.actor.ActorSelection; -import akka.serialization.JavaSerializer; -import akka.serialization.Serialization; -import java.io.DataInput; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -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. - * - * @author Robert Varga - */ -final class ConnectClientSuccessProxyV1 extends AbstractSuccessProxy { - private static final long serialVersionUID = 1L; - - private List alternates; - private ActorRef backend; - private long maxMessages; - - public ConnectClientSuccessProxyV1() { - // For Externalizable - } - - ConnectClientSuccessProxyV1(final ConnectClientSuccess success) { - super(success); - this.alternates = success.getAlternates(); - this.backend = success.getBackend(); - // We are ignoring the DataTree, it is not serializable anyway - } - - @Override - public void writeExternal(final ObjectOutput out) throws IOException { - super.writeExternal(out); - - out.writeUTF(Serialization.serializedActorPath(backend)); - - out.writeInt(alternates.size()); - for (ActorSelection b : alternates) { - out.writeObject(b.toSerializationFormat()); - } - - out.writeLong(maxMessages); - } - - @Override - public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException { - super.readExternal(in); - - backend = JavaSerializer.currentSystem().value().provider().resolveActorRef(in.readUTF()); - - final int backendsSize = in.readInt(); - if (backendsSize < 1) { - throw new IOException("Illegal number of backends " + backendsSize); - } - - alternates = new ArrayList<>(backendsSize); - for (int i = 0; i < backendsSize; ++i) { - alternates.add(ActorSelection.apply(ActorRef.noSender(), (String)in.readObject())); - } - - maxMessages = in.readLong(); - } - - @Override - protected ConnectClientSuccess createSuccess(final ClientIdentifier target) { - return new ConnectClientSuccess(target, backend, alternates, Optional.empty(), maxMessages); - } - - @Override - protected ClientIdentifier readTarget(final DataInput in) throws IOException { - return ClientIdentifier.readFrom(in); - } -}