/** * @param code * @param vendorId * @return */ private AvpRepresentation getMapKey(int code, long vendorId) { return new AvpRepresentation(code, vendorId); }
/** * @param code * @param vendorId * @return */ private AvpRepresentation getMapKey(int code, long vendorId) { return new AvpRepresentation(code, vendorId); }
public void parseDictionary(InputStream is) throws Exception { // we override default conf here. this.stackDictionary = (DictionaryImpl) DictionarySingleton.getDictionary(is); this.avpMap.clear(); this.nameToCodeMap.clear(); //dont like that.... // fill AVP Map for (org.jdiameter.api.validation.AvpRepresentation value:this.stackDictionary.getAvpMap().values()) { AvpRepresentation avp = new AvpRepresentation((AvpRepresentationImpl) value); this.avpMap.put(avp, avp); this.nameToCodeMap.put(avp.getName(), avp); } }
public void parseDictionary(InputStream is) throws Exception { // we override default conf here. this.stackDictionary = (DictionaryImpl) DictionarySingleton.getDictionary(); this.avpMap.clear(); this.nameToCodeMap.clear(); //dont like that.... // fill AVP Map Map<org.jdiameter.api.validation.AvpRepresentation, org.jdiameter.api.validation.AvpRepresentation> map = this.stackDictionary.getAvpMap(); for(org.jdiameter.api.validation.AvpRepresentation key:map.keySet()) { AvpRepresentationImpl value = (AvpRepresentationImpl) map.get(key); AvpRepresentation avp = new AvpRepresentation(value); this.avpMap.put(avp, avp); this.nameToCodeMap.put(avp.getName(),avp); } }
AvpRepresentation(AvpRepresentationImpl clone) { this(-1, clone.getCode(), clone.getVendorId(), clone.getMultiplicityIndicator(), clone.getName()); this.allowed = clone.isAllowed(); this.grouped = clone.isGrouped(); this.positionIndex = clone.getPositionIndex(); this.weak = clone.isWeak(); this._mandatory = clone.isMandatory(); this._protected = clone.isProtected(); this.description = clone.getDescription(); this.mayEncrypt = clone.isMayEncrypt(); this.ruleMandatory = clone.getRuleMandatory(); this.ruleProtected = clone.getRuleProtected(); this.ruleVendorBit = clone.getRuleVendorBit(); this.type = clone.getType(); if (this.multiplicityIndicator.equals(_MP_NOT_ALLOWED)) this.allowed = false; // copy others. if (isGrouped()) { for (Object o : clone.getChildren()) { AvpRepresentationImpl avpImpl = (AvpRepresentationImpl) o; this.children.add(new AvpRepresentation(avpImpl)); } this.children = Collections.unmodifiableList(this.children); } }
AvpRepresentation(AvpRepresentationImpl clone) { this(-1, clone.getCode(), clone.getVendorId(), clone.getMultiplicityIndicator(), clone.getName()); this.allowed = clone.isAllowed(); this.grouped = clone.isGrouped(); this.positionIndex = clone.getPositionIndex(); this.weak = clone.isWeak(); this._mandatory = clone.isMandatory(); this._protected = clone.isProtected(); this.description = clone.getDescription(); this.mayEncrypt = clone.isMayEncrypt(); this.ruleMandatory = clone.getRuleMandatory(); this.ruleProtected = clone.getRuleProtected(); this.ruleVendorBit = clone.getRuleVendorBit(); this.type = clone.getType(); if (this.multiplicityIndicator.equals(_MP_NOT_ALLOWED)) { this.allowed = false; } // copy others. if (isGrouped()) { for (Object o : clone.getChildren()) { AvpRepresentationImpl avpImpl = (AvpRepresentationImpl) o; this.children.add(new AvpRepresentation(avpImpl)); } this.children = Collections.unmodifiableList(this.children); } }