Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.0

E18767-01


com.bea.wcp.diameter
Class Answer

java.lang.Object
  extended by com.bea.wcp.diameter.Message
      extended by com.bea.wcp.diameter.Answer

Direct Known Subclasses:
ACA, CCA, Peer.CEA, RAA

public class Answer
extends Message

Diameter answer message. Answer extends Message with the ability to get and set the ResultCode for the answer.


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
Answer(java.nio.ByteBuffer bb, com.bea.wcp.diameter.transport.Connection c)
          Creates a new Answer that is parsed from the specified message bytes.
Answer(Request req, ResultCode rc)
          Creates a new Answer for the specified Request and ResultCode.

 

Method Summary
 void commit()
          Commits a message currently being sent.
 Request getRequest()
          Returns the original Request used to create this Answer, or null if this answer was not originated by this node.
 ResultCode getResultCode()
          Returns the ResultCode for this answer.
 Session getSession()
          Returns the Session associated with this message, or null if none.
 boolean isCommitted()
           
 void preValidate()
          Perform initial validation of message to include validation of AVPs required to determine if the request/answer should be forwarded.
protected  void preValidateAvp(Avp avp)
          Fully decodes and validates the specified AVP.
 void send()
          If this Answer was created for a Request, then sends the answer using the connection from the associated Request.
 void setResultCode(ResultCode rc)
          Allows 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, 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

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

Answer

public Answer(Request req,
              ResultCode rc)
Creates a new Answer for the specified Request and ResultCode.
Parameters:
req - the original Requestr
rc - the ResultCode for the answer

Answer

public Answer(java.nio.ByteBuffer bb,
              com.bea.wcp.diameter.transport.Connection c)
Creates a new Answer that is parsed from the specified message bytes.
Parameters:
bb - the message bytes
c - the connection used to receive the answer message

Method Detail

preValidate

public void preValidate()
                 throws MessageException
Description copied from class: Message
Perform initial validation of message to include validation of AVPs required to determine if the request/answer should be forwarded. If we determine the message should be locally handled, then the remaining AVPs will be validated by 'validate()'.
Overrides:
preValidate in class Message
Throws:
MessageException - if validation failed

preValidateAvp

protected void preValidateAvp(Avp avp)
                       throws AvpException
Description copied from class: Message
Fully decodes and validates the specified AVP. Message implementations can override this to provide additional validation or to cache AVP results.
Overrides:
preValidateAvp in class Message
Parameters:
avp - the AVP to be validated
Throws:
AvpException - if the AVP was invalid

getResultCode

public ResultCode getResultCode()
Returns the ResultCode for this answer. This corresponds to either the Result-Code AVP or Experimental-Result AVP.

setResultCode

public void setResultCode(ResultCode rc)
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.
Parameters:
rc - the new result code

send

public void send()
          throws java.io.IOException
If this Answer was created for a Request, then sends the answer using the connection from the associated Request.
Specified by:
send in class Message
Throws:
java.io.IOException - if an I/O error occurred while sending the answer
java.lang.IllegalStateException - if this Answer has no associated Request

commit

public void commit()
            throws java.io.IOException
Description copied from class: Message
Commits a message currently being sent.
Specified by:
commit in class Message
Throws:
java.io.IOException

isCommitted

public boolean isCommitted()
Specified by:
isCommitted in class Message

getRequest

public Request getRequest()
Returns the original Request used to create this Answer, or null if this answer was not originated by this node.

getSession

public Session getSession()
Description copied from class: Message
Returns the Session associated with this message, or null if none.
Specified by:
getSession in class Message

Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.0

E18767-01


Copyright © 2005, 2010, Oracle and/or its affiliates. All rights reserved.