Enum RevisedErrorHandling
- java.lang.Object
-
- java.lang.Enum<RevisedErrorHandling>
-
- org.opendaylight.protocol.bgp.parser.spi.RevisedErrorHandling
-
- All Implemented Interfaces:
Serializable
,Comparable<RevisedErrorHandling>
@NonNullByDefault public enum RevisedErrorHandling extends Enum<RevisedErrorHandling>
Enumeration of possible treatments an UPDATE message and attributes can get based on the configuration of a peer.- Author:
- Robert Varga
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RevisedErrorHandling
from(@Nullable PeerSpecificParserConstraint constraint)
Determine Revised Error Handling from the contents of aPeerSpecificParserConstraint
.BGPDocumentedException
reportError(BGPError error, byte[] data, String format, Object... args)
Report a failure to parse an attribute resulting either in treat-as-withdraw if RFC7606 is in effect, or connection teardown if it is not.BGPDocumentedException
reportError(BGPError error, @Nullable Exception cause, String format, Object... args)
Report a failure to parse an attribute resulting either in treat-as-withdraw if RFC7606 is in effect, or connection teardown if it is not.BGPDocumentedException
reportError(BGPError error, String format, Object... args)
Report a failure to parse an attribute resulting either in treat-as-withdraw if RFC7606 is in effect, or connection teardown if it is not.static RevisedErrorHandling
valueOf(String name)
Returns the enum constant of this type with the specified name.static RevisedErrorHandling[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final RevisedErrorHandling NONE
Do not use RFC7606 Revised Error Handling.
-
INTERNAL
public static final RevisedErrorHandling INTERNAL
Use RFC7606 Revised Error Handling, the peer is an internal neighbor.
-
EXTERNAL
public static final RevisedErrorHandling EXTERNAL
Use RFC7606 Revised Error Handling, the peer is an external neighbor.
-
-
Method Detail
-
values
public static RevisedErrorHandling[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (RevisedErrorHandling c : RevisedErrorHandling.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RevisedErrorHandling valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
from
public static RevisedErrorHandling from(@Nullable PeerSpecificParserConstraint constraint)
Determine Revised Error Handling from the contents of aPeerSpecificParserConstraint
.- Parameters:
constraint
- Peer-specific constraint- Returns:
- Revised Error Handling treatment message/attributes should receive.
-
reportError
public BGPDocumentedException reportError(BGPError error, @Nullable Exception cause, String format, Object... args) throws BGPDocumentedException, BGPTreatAsWithdrawException
Report a failure to parse an attribute resulting either in treat-as-withdraw if RFC7606 is in effect, or connection teardown if it is not.- Parameters:
error
-BGPError
to report in case of a session teardowncause
- Parsing failure causeformat
- Message format stringargs
- Message format arguments- Returns:
- This method does not return
- Throws:
BGPTreatAsWithdrawException
- if Revised Error Handling is in effectBGPDocumentedException
- if Revised Error Handling is in not effect
-
reportError
public BGPDocumentedException reportError(BGPError error, String format, Object... args) throws BGPDocumentedException, BGPTreatAsWithdrawException
Report a failure to parse an attribute resulting either in treat-as-withdraw if RFC7606 is in effect, or connection teardown if it is not.- Parameters:
error
-BGPError
to report in case of a session teardownformat
- Message format stringargs
- Message format arguments- Returns:
- This method does not return
- Throws:
BGPTreatAsWithdrawException
- if Revised Error Handling is in effectBGPDocumentedException
- if Revised Error Handling is in not effect
-
reportError
public BGPDocumentedException reportError(BGPError error, byte[] data, String format, Object... args) throws BGPDocumentedException, BGPTreatAsWithdrawException
Report a failure to parse an attribute resulting either in treat-as-withdraw if RFC7606 is in effect, or connection teardown if it is not.- Parameters:
error
-BGPError
to report in case of a session teardownformat
- Message format stringargs
- Message format arguments- Returns:
- This method does not return
- Throws:
BGPTreatAsWithdrawException
- if Revised Error Handling is in effectBGPDocumentedException
- if Revised Error Handling is in not effect
-
-