org.jdiameter.common.impl.validation
Class MessageRepresentation

java.lang.Object
  extended by org.jdiameter.common.impl.validation.MessageRepresentation
All Implemented Interfaces:
java.lang.Comparable<MessageRepresentation>

public class MessageRepresentation
extends java.lang.Object
implements java.lang.Comparable<MessageRepresentation>

Start time:10:40:36 2009-05-26
Project: diameter-parent
This class represents message/command in validation framework. It contains basic info about command along with avp list - their multiplicity and allowance.

Since:
1.5.189
Author:
Bartosz Baranowski , Alexandre Mendonca

Constructor Summary
MessageRepresentation(int commandCode, long applicationId, boolean isRequest)
           
 
Method Summary
 int compareTo(MessageRepresentation o)
           
 boolean equals(java.lang.Object obj)
           
 java.util.Map<AvpRepresentation,AvpRepresentation> getMessageAvps()
           
 int hashCode()
           
 boolean hasRepresentation(int avpCode, long avpVendor)
           
 boolean isAllowed(int code, long vendorId)
           
 boolean isCountValidForMultiplicity(int code, long vendorId, int count)
           
 void setMessageAvps(java.util.Map<AvpRepresentation,AvpRepresentation> messageAvps)
           
 void validate(org.jdiameter.api.AvpSet destination, org.jdiameter.api.Avp avp)
           
 void validate(org.jdiameter.api.Message msg)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageRepresentation

public MessageRepresentation(int commandCode,
                             long applicationId,
                             boolean isRequest)
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getMessageAvps

public java.util.Map<AvpRepresentation,AvpRepresentation> getMessageAvps()

setMessageAvps

public void setMessageAvps(java.util.Map<AvpRepresentation,AvpRepresentation> messageAvps)

validate

public void validate(org.jdiameter.api.Message msg)
              throws JAvpNotAllowedException
Throws:
JAvpNotAllowedException

validate

public void validate(org.jdiameter.api.AvpSet destination,
                     org.jdiameter.api.Avp avp)

compareTo

public int compareTo(MessageRepresentation o)
Specified by:
compareTo in interface java.lang.Comparable<MessageRepresentation>

isCountValidForMultiplicity

public boolean isCountValidForMultiplicity(int code,
                                           long vendorId,
                                           int count)
Parameters:
code -
vendorId -
count -
Returns:

isAllowed

public boolean isAllowed(int code,
                         long vendorId)
Parameters:
code -
vendorId -
Returns:

hasRepresentation

public boolean hasRepresentation(int avpCode,
                                 long avpVendor)
Parameters:
avpCode -
avpVendor -
Returns:


Copyright © 2009. All Rights Reserved.