[ONOS-5945] Add LispMapReferral message type with unit tests
Change-Id: I4f93140fccdbe96c4f0911e8aa325e6e3ffaee2f
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReferral.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReferral.java
index e78cfc4..36f8e50 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReferral.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReferral.java
@@ -15,6 +15,8 @@
*/
package org.onosproject.lisp.msg.protocols;
+import java.util.List;
+
/**
* LISP map referral message interface.
* <p>
@@ -50,7 +52,55 @@
* +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* }</pre>
*/
-public interface LispMapReferral {
+public interface LispMapReferral extends LispMessage {
- // TODO: need to implement LispMapReferral
+ /**
+ * Obtains record count value.
+ *
+ * @return record count value
+ */
+ int getRecordCount();
+
+ /**
+ * Obtains nonce value.
+ *
+ * @return nonce
+ */
+ long getNonce();
+
+ /**
+ * Obtains a collection of referral records.
+ *
+ * @return a collection of referral records
+ */
+ List<LispReferralRecord> getReferralRecords();
+
+ /**
+ * A builder of LISP map referral message.
+ */
+ interface MapReferralBuilder extends Builder {
+
+ /**
+ * Sets nonce value.
+ *
+ * @param nonce nonce value
+ * @return MapReferralBuilder object
+ */
+ MapReferralBuilder withNonce(long nonce);
+
+ /**
+ * Sets a collection of referral records.
+ *
+ * @param records a collection of referral records
+ * @return MapReferralBuilder object
+ */
+ MapReferralBuilder withReferralRecords(List<LispReferralRecord> records);
+
+ /**
+ * Builds LISP map referral message.
+ *
+ * @return LISP map referral message
+ */
+ LispMapReferral build();
+ }
}