X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2Fprotobuff%2Fclient%2Fmessages%2FPayload.java;h=b970ba4485bb759707cca1f0bb1bfbe3db82eeb2;hb=e66759266dc43d5f58b2837aca5047b42c205e4a;hp=d721494e15fcde76eb9b4f4e4f42a8e3e41bdd87;hpb=25a9b4bf890e000359c46e74a13db8dbb6f0a697;p=controller.git diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/raft/protobuff/client/messages/Payload.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/raft/protobuff/client/messages/Payload.java index d721494e15..b970ba4485 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/raft/protobuff/client/messages/Payload.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/raft/protobuff/client/messages/Payload.java @@ -8,74 +8,16 @@ package org.opendaylight.controller.cluster.raft.protobuff.client.messages; - -import com.google.protobuf.GeneratedMessage; -import java.util.Map; -import org.opendaylight.controller.protobuff.messages.cluster.raft.AppendEntriesMessages; - /** * An instance of a Payload class is meant to be used as the Payload for * AppendEntries. - *

* + *

* When an actor which is derived from RaftActor attempts to persistData it * must pass an instance of the Payload class. Similarly when state needs to * be applied to the derived RaftActor it will be passed an instance of the * Payload class. - *

- * - * To define your own payload do the following, - *

    - *
  1. Create your own protocol buffer message which extends the AppendEntries Payload
  2. - *
  3. Extend this Payload class
  4. - *
  5. Implement encode
  6. - *
  7. Implement decode
  8. - *
- * - * Your own protocol buffer message can be create like so,
- *
- * {@code
- *
- * import "AppendEntriesMessages.proto";
- *
- * package org.opendaylight.controller.cluster.raft;
- *
- * option java_package = "org.opendaylight.controller.cluster.raft.protobuff.messages";
- * option java_outer_classname = "MockPayloadMessages";
- *
- * extend AppendEntries.ReplicatedLogEntry.Payload {
- *      optional string value = 2;
- * }
- * }
- * 
- * */ public abstract class Payload { - - public String getClientPayloadClassName() { - return this.getClass().getName(); - } - - /** - * Encode the payload data as a protocol buffer extension. - *

- * TODO: Add more meat in here - * @param - * @return Map of - */ - @Deprecated - public abstract Map encode(); - - /** - * Decode the protocol buffer payload into a specific Payload as defined - * by the class extending RaftActor - * - * @param payload The payload in protocol buffer format - * @return - */ - @Deprecated - public abstract Payload decode( - AppendEntriesMessages.AppendEntries.ReplicatedLogEntry.Payload payload); - public abstract int size(); }