package org.opendaylight.protocol.bgp.rib.impl.spi;
import java.util.List;
-
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130918.open.BgpParameters;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.open.message.BgpParameters;
/**
* DTO for BGP Session preferences, that contains BGP Open message.
*/
public final class BGPSessionPreferences {
- private final int as;
+ private final AsNumber as;
+
+ private final int hold;
+
+ private final Ipv4Address bgpId;
- private final int hold;
+ private final List<BgpParameters> params;
- private final Ipv4Address bgpId;
+ private final AsNumber remoteAs;
- private final List<BgpParameters> params;
+ /**
+ * 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 AsNumber remoteAs,
+ final List<BgpParameters> params) {
+ this.as = as;
+ this.hold = hold;
+ this.bgpId = bgpId;
+ this.remoteAs = remoteAs;
+ this.params = params;
+ }
- /**
- * Creates a new DTO for Open message.
- *
- * @param prefs BGP Open message
- */
- public BGPSessionPreferences(final int as, final int hold, final Ipv4Address bgpId, final List<BgpParameters> params) {
- this.as = as;
- this.hold = hold;
- this.bgpId = bgpId;
- this.params = params;
- }
+ /**
+ * Returns my AS number.
+ *
+ * @return AS number
+ */
+ public AsNumber getMyAs() {
+ return this.as;
+ }
- /**
- * Returns my AS number.
- *
- * @return AS number
- */
- public int getMyAs() {
- return this.as;
- }
+ /**
+ * Returns initial value of HoldTimer.
+ *
+ * @return initial value of HoldTimer
+ */
+ public int getHoldTime() {
+ return this.hold;
+ }
- /**
- * Returns initial value of HoldTimer.
- *
- * @return initial value of HoldTimer
- */
- public int getHoldTime() {
- return this.hold;
- }
+ /**
+ * Returns my BGP Identifier.
+ *
+ * @return BGP identifier
+ */
+ public Ipv4Address getBgpId() {
+ return this.bgpId;
+ }
- /**
- * Returns my BGP Identifier.
- *
- * @return BGP identifier
- */
- public Ipv4Address getBgpId() {
- return this.bgpId;
- }
+ /**
+ * Returns expected remote AS number.
+ *
+ * @return AS number
+ */
+ public AsNumber getExpectedRemoteAs() {
+ return this.remoteAs;
+ }
- public List<BgpParameters> getParams() {
- return this.params;
- }
+ /**
+ * Gets a list of advertised bgp parameters.
+ *
+ * @return a list of advertised bgp parameters
+ */
+ public List<BgpParameters> getParams() {
+ return this.params;
+ }
}