Move build method to each control msg, realize createBuilder method
Change-Id: Iff9e60cc5f929e031b0d927e0bdc08fed826e0db
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapNotify.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapNotify.java
index 261b863..1020195 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapNotify.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapNotify.java
@@ -63,7 +63,7 @@
@Override
public Builder createBuilder() {
- return null;
+ return new DefaultNotifyBuilder();
}
@Override
@@ -135,7 +135,7 @@
}
@Override
- public LispMessage build() {
+ public LispMapNotify build() {
return new DefaultLispMapNotify(nonce, keyId, authenticationData,
recordCount, mapRecords);
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRegister.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRegister.java
index f041d2b..8363e83 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRegister.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRegister.java
@@ -71,7 +71,7 @@
@Override
public Builder createBuilder() {
- return null;
+ return new DefaultRegisterBuilder();
}
@Override
@@ -167,7 +167,7 @@
}
@Override
- public LispMessage build() {
+ public LispMapRegister build() {
return new DefaultLispMapRegister(nonce, keyId, authenticationData,
recordCount, mapRecords, proxyMapReply, wantMapNotify);
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapReply.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapReply.java
index 94322e1..f2a5689 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapReply.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapReply.java
@@ -58,7 +58,7 @@
@Override
public Builder createBuilder() {
- return null;
+ return new DefaultReplyBuilder();
}
@Override
@@ -130,7 +130,7 @@
}
@Override
- public LispMessage build() {
+ public LispMapReply build() {
return new DefaultLispMapReply(nonce, recordCount, probe, etr, security);
}
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRequest.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRequest.java
index 313f926..1ec7dc6 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRequest.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRequest.java
@@ -83,7 +83,7 @@
@Override
public Builder createBuilder() {
- return null;
+ return new DefaultRequestBuilder();
}
@Override
@@ -228,7 +228,7 @@
}
@Override
- public LispMessage build() {
+ public LispMapRequest build() {
return new DefaultLispMapRequest(nonce, recordCount, sourceEid, itrRlocs,
eidRecords, authoritative, mapDataPresent, probe, smr, pitr, smrInvoked);
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapNotify.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapNotify.java
index 65c0703..50e4ad1 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapNotify.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapNotify.java
@@ -135,5 +135,12 @@
* @return NotifyBuilder object
*/
NotifyBuilder addRecord(LispMapRecord record);
+
+ /**
+ * Builds LISP map notify message.
+ *
+ * @return LISP map notify message
+ */
+ LispMapNotify build();
}
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRegister.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRegister.java
index 4703cba..0ce42db 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRegister.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRegister.java
@@ -165,5 +165,12 @@
* @return RegisterBuilder object
*/
RegisterBuilder addRecord(LispMapRecord record);
+
+ /**
+ * Builds LISP map register message.
+ *
+ * @return LISP map register message
+ */
+ LispMapRegister build();
}
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReply.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReply.java
index a128814..4a96d40 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReply.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReply.java
@@ -129,5 +129,12 @@
* @return ReplyBuilder object
*/
ReplyBuilder withNonce(long nonce);
+
+ /**
+ * Builds LISP map reply message.
+ *
+ * @return LISP map reply message
+ */
+ LispMapReply build();
}
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRequest.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRequest.java
index 0783368..059a9c4 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRequest.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRequest.java
@@ -224,5 +224,12 @@
* @return RequestBuilder object
*/
RequestBuilder addEidRecord(LispEidRecord record);
+
+ /**
+ * Builds LISP map request message.
+ *
+ * @return LISP map request message
+ */
+ LispMapRequest build();
}
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMessage.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMessage.java
index 7a74bbb..6962b3b 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMessage.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMessage.java
@@ -49,13 +49,6 @@
interface Builder {
/**
- * Builds LISP message.
- *
- * @return LISP message
- */
- LispMessage build();
-
- /**
* Obtains LISP message type.
*
* @return LISP message type