Package com.bea.wcp.diameter
Class Answer
java.lang.Object
com.bea.wcp.diameter.Message
com.bea.wcp.diameter.Answer
Diameter answer message. Answer extends Message with the ability to get
and set the ResultCode for the answer.
- Author:
- Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
-
Field Summary
Fields inherited from class com.bea.wcp.diameter.Message
FLAG_ERROR, FLAG_POTENTIALLY_RETRANSMITTED, FLAG_PROXIABLE, FLAG_REQUEST, FLAGS_MASK, HEADER_SIZE, VERSION -
Constructor Summary
ConstructorsConstructorDescriptionAnswer(Request req, ResultCode rc) Creates a new Answer for the specified Request and ResultCode.Answer(ByteBuffer bb, com.bea.wcp.diameter.transport.Connection c) Creates a new Answer that is parsed from the specified message bytes. -
Method Summary
Modifier and TypeMethodDescriptionvoidcommit()Commits a message currently being sent.Returns the original Request used to create this Answer, or null if this answer was not originated by this node.Returns the ResultCode for this answer.Returns the Session associated with this message, or null if none.booleanvoidPerforms initial validation of a message to include validation of AVPs required to determine if the request/answer should be forwarded.protected voidpreValidateAvp(Avp avp) Fully decodes and validates the specified AVP.voidsend()If this Answer was created for a Request, then sends the answer using the connection from the associated Request.voidAllows relay or proxy applications to modify result code of an answer message being forwarded.Methods inherited from class com.bea.wcp.diameter.Message
addAvp, addAvp, addAvp, appendXml, decode, decodeAvps, encode, encode, extractAndSetSessionIdAvp, getAppId, getAppId, getAvp, getAvp, getAvpList, getCode, getCode, getCommand, getConnection, getEffectiveSessionId, getEndToEndId, getHopByHopId, getLength, getOriginHost, getOriginRealm, getSessionId, getVersion, isAnswer, isError, isPotentiallyRetransmitted, isProxiable, isRequest, popProxyInfo, toLoggableString, toString, validate, validateAvp
-
Constructor Details
-
Answer
Creates a new Answer for the specified Request and ResultCode.- Parameters:
req- the original Requestrc- the ResultCode for the answer
-
Answer
Creates a new Answer that is parsed from the specified message bytes.- Parameters:
bb- the message bytesc- the connection used to receive the answer message
-
-
Method Details
-
preValidate
Description copied from class:MessagePerforms initial validation of a message to include validation of AVPs required to determine if the request/answer should be forwarded. If we determine the message should be handled locally, then the remaining AVPs will be validated by 'validate()'.- Overrides:
preValidatein classMessage- Throws:
MessageException- if validation failed
-
preValidateAvp
Description copied from class:MessageFully decodes and validates the specified AVP. Message implementations can override this to provide additional validation or to cache AVP results.- Overrides:
preValidateAvpin classMessage- Parameters:
avp- the AVP to be validated- Throws:
AvpException- if the AVP was invalid
-
getResultCode
Returns the ResultCode for this answer. This corresponds to either the Result-Code AVP or Experimental-Result AVP. -
setResultCode
Allows relay or proxy applications to modify result code of an answer message being forwarded. This is only possible if existing result code value does not already indicate an error. If result code is changed, and this host is different from the origin-host, then set the Error-Reporting-Host AVP as well. See RFC 3588 section 6.2.2 for more details. -
send
If this Answer was created for a Request, then sends the answer using the connection from the associated Request.- Specified by:
sendin classMessage- Throws:
IOException- if an I/O error occurred while sending the answerIllegalStateException- if this Answer has no associated Request
-
commit
Description copied from class:MessageCommits a message currently being sent.- Specified by:
commitin classMessage- Throws:
IOException
-
isCommitted
public boolean isCommitted()- Specified by:
isCommittedin classMessage
-
getRequest
Returns the original Request used to create this Answer, or null if this answer was not originated by this node. -
getSession
Description copied from class:MessageReturns the Session associated with this message, or null if none.- Specified by:
getSessionin classMessage
-