if (!msgRep.isAllowed(avpCode, vendorId)) { throw new AvpNotAllowedException("Avp defined by code: " + avpCode + ", vendorId: " + vendorId + " is not allowed in message - code: " + msg.getCommandCode() + ", appId: " + msg.getApplicationId() + ", isRequest: " + msg.isRequest(), avpCode, vendorId); if (msgRep.isCountValidForMultiplicity(msg.getAvps(), avpCode, vendorId,1)) { // 1 --> +1
@Override public void validate(DiameterMessage msg) throws AvpNotAllowedException { Dictionary dictionary = DictionarySingleton.getDictionary(); if (dictionary.isConfigured() && dictionary.isEnabled()) { DiameterCommand com = msg.getCommand(); MessageRepresentation rep = dictionary.getMessage(com.getCode(), com.getApplicationId(), com.isRequest()); if (rep != null) { DiameterMessageImpl impl = (DiameterMessageImpl) msg; try { rep.validate(impl.getGenericData(), ValidatorLevel.ALL); } catch (org.jdiameter.api.validation.AvpNotAllowedException e) { throw new AvpNotAllowedException("Failed to validate message.", e, e.getAvpCode(), e.getVendorId()); } } } }
if (!msgRep.isAllowed(avpCode, vendorId)) { throw new AvpNotAllowedException("Avp defined by code: " + avpCode + ", vendorId: " + vendorId + " is not allowed in message - code: " + msg.getCommandCode() + ", appId: " + msg.getApplicationId() + ", isRequest: " + msg.isRequest(), avpCode, vendorId); if (msgRep.isCountValidForMultiplicity(msg.getAvps(), avpCode, vendorId,1)) { // 1 --> +1