2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.bgp.parser.parameter;
12 import org.opendaylight.protocol.bgp.parser.BGPTableType;
16 * Graceful restart capability parameter as described in:
18 * <a href="http://tools.ietf.org/html/rfc4724#section-3">Graceful Restart Capability</a>
20 public final class GracefulCapability extends CapabilityParameter {
23 * Capability code for GR)
25 private static final int CODE = 64;
27 private final boolean restartFlag;
29 private final int restartTimerValue;
31 private final Map<BGPTableType, Boolean> tableTypes;
34 * Creates new Graceful restart capability.
36 * @param restartFlag should be false
37 * @param restartTimerValue should be 0
38 * @param tableTypes supported AFI/SAFI along with Forwarding state flag (should be true)
40 public GracefulCapability(final boolean restartFlag, final int restartTimerValue, final Map<BGPTableType, Boolean> tableTypes) {
42 this.restartFlag = restartFlag;
43 this.restartTimerValue = restartTimerValue;
44 this.tableTypes = tableTypes;
48 * Was router restarted?
50 * @return the restartFlag
52 public boolean isRestartFlag() {
53 return this.restartFlag;
57 * Currently should be always 0.
59 * @return the restartTimerValue
61 public int getRestartTimerValue() {
62 return this.restartTimerValue;
66 * Return supported AFI/SAFI along with Forwarding state flag.
68 * @return the tableTypes
70 public Map<BGPTableType, Boolean> getTableTypes() {
71 return this.tableTypes;