Enum Class RevisedErrorHandling
- All Implemented Interfaces:
Serializable
,Comparable<RevisedErrorHandling>
,Constable
Enumeration of possible treatments an UPDATE message and attributes can get based on the configuration of a peer.
- Author:
- Robert Varga
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic RevisedErrorHandling
from
(@Nullable PeerSpecificParserConstraint constraint) Determine Revised Error Handling from the contents of aPeerSpecificParserConstraint
.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.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.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
Returns the enum constant of this class with the specified name.static RevisedErrorHandling[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
Do not use RFC7606 Revised Error Handling. -
INTERNAL
Use RFC7606 Revised Error Handling, the peer is an internal neighbor. -
EXTERNAL
Use RFC7606 Revised Error Handling, the peer is an external neighbor.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
from
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
-