Package com.bea.wcp.diameter
Class AvpException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.bea.wcp.diameter.DiameterException
com.bea.wcp.diameter.MessageException
com.bea.wcp.diameter.AvpException
- All Implemented Interfaces:
Serializable
Exception raised if an invalid AVP was encountered in a Diameter message.
- Author:
- Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAvpException(ResultCode rc, Attribute attr) Creates a new AvpException for the specified ResultCode and missing AVP.AvpException(ResultCode rc, Avp invalidAvp) Creates a new AvpException for the specified ResultCode and invalid AVP.AvpException(ResultCode rc, Avp[] invalidAvps) Creates a new AvpException for the specified ResultCode and invalid AVPs. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInvalidAvp(Avp avp) Adds an additional AVP to the list of failed AVPs.voidaddMissingAvp(Attribute attr) Adds an additional missing AVP to the list of failed AVPs.static AvpExceptionavpOccursTooManyTimes(Avp avp) Convenience method to return an AvpException indicating that the specified AVP occurs too many times in the message.static AvpExceptioncontradictingAvps(Avp avp1, Avp avp2) Convenience method to return an AvpException indicating indicating contradicting AVPs in a message.createAnswer(Request req) Creates a new Answer message for a Request that contained invalid AVPs.Returns the list of failed AVPs for this exception.static AvpExceptioninvalidAvpLength(Avp avp) Convenience method to return an AvpException indicating that the length of the specified AVP was invalid.static AvpExceptioninvalidAvpValue(Avp avp) Convenience method to return an AvpException indicating that the value of the specified AVP was invalid.static AvpExceptionmissingAvp(Attribute attr) Methods inherited from class com.bea.wcp.diameter.MessageException
getResultCode, unableToComplyMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
AvpException
Creates a new AvpException for the specified ResultCode and invalid AVP.- Parameters:
rc- the error ResultCodeinvalidAvp- the invalid (failed) AVP to be included
-
AvpException
Creates a new AvpException for the specified ResultCode and invalid AVPs.- Parameters:
rc- the error ResultCodeinvalidAvps- the the list of invalid (failed) AVPs to be included
-
AvpException
Creates a new AvpException for the specified ResultCode and missing AVP.- Parameters:
rc- the error ResultCodeattr- the Attribute for the missing AVP
-
-
Method Details
-
addInvalidAvp
Adds an additional AVP to the list of failed AVPs.- Parameters:
avp- the failed AVP to be added
-
addMissingAvp
Adds an additional missing AVP to the list of failed AVPs.- Parameters:
attr- the Attribute for the missing AVP
-
getFailedAvps
Returns the list of failed AVPs for this exception. -
getFailedAvp
-
createAnswer
Creates a new Answer message for a Request that contained invalid AVPs. The failed AVPs will be included in the answer as well as AVPs for the error result code and error message.- Overrides:
createAnswerin classMessageException- Parameters:
req- the Request that was invalid- Returns:
- the Answer message indicating one or more invalid AVPs
-
avpOccursTooManyTimes
Convenience method to return an AvpException indicating that the specified AVP occurs too many times in the message. -
missingAvp
-
invalidAvpLength
Convenience method to return an AvpException indicating that the length of the specified AVP was invalid. -
invalidAvpValue
Convenience method to return an AvpException indicating that the value of the specified AVP was invalid. -
contradictingAvps
Convenience method to return an AvpException indicating indicating contradicting AVPs in a message.
-