BUG-3888 : fix comparing ASnumbers
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / spi / BGPSessionPreferences.java
index 79cf1e121f480b3af48fbf9d3b00b213ba0b9c28..47b5f164cd9c293b1a56e7826d3b99c40a7f3111 100644 (file)
@@ -25,18 +25,23 @@ public final class BGPSessionPreferences {
 
     private final List<BgpParameters> params;
 
+    private final AsNumber remoteAs;
+
     /**
      * Creates a new DTO for Open message.
      *
      * @param as local AS number
      * @param hold preferred hold timer value, in seconds
      * @param bgpId local BGP Identifier
+     * @param remoteAs expected remote As Number
      * @param params list of advertised parameters
      */
-    public BGPSessionPreferences(final AsNumber as, final int hold, final Ipv4Address bgpId, final List<BgpParameters> params) {
+    public BGPSessionPreferences(final AsNumber as, final int hold, final Ipv4Address bgpId, final AsNumber remoteAs,
+        final List<BgpParameters> params) {
         this.as = as;
         this.hold = hold;
         this.bgpId = bgpId;
+        this.remoteAs = remoteAs;
         this.params = params;
     }
 
@@ -67,6 +72,15 @@ public final class BGPSessionPreferences {
         return this.bgpId;
     }
 
+    /**
+     * Returns expected remote AS number.
+     *
+     * @return AS number
+     */
+    public AsNumber getExpectedRemoteAs() {
+        return this.remoteAs;
+    }
+
     /**
      * Gets a list of advertised bgp parameters.
      *