/** * Returns an {@link AvpRepresentation} of the AVP with the given code and given Vendor-Id, if found. * * @param avpCode the code of the AVP * @param vendorId the Vendor-Id of the AVP * @return */ private static AvpRepresentation getAvpRepresentation(int avpCode, long vendorId) { return AvpDictionary.INSTANCE.getAvp(avpCode); }
/** * Returns an {@link AvpRepresentation} of the AVP with the given code and given Vendor-Id, if found. * * @param avpCode the code of the AVP * @param vendorId the Vendor-Id of the AVP * @return */ private static AvpRepresentation getAvpRepresentation(int avpCode, long vendorId) { return AvpDictionary.INSTANCE.getAvp(avpCode); }
public AvpRepresentation getAvp(int code) { return getAvp(code, 0); }
public AvpRepresentation getAvp(int code) { return getAvp(code, 0); }
private static DiameterAvpType getAvpType(int avpCode, long vendorId) { AvpRepresentation avpRep = AvpDictionary.INSTANCE.getAvp(avpCode, vendorId); return avpRep != null ? DiameterAvpType.fromString(avpRep.getType()) : null; }
private static DiameterAvpType getAvpType(int avpCode, long vendorId) { AvpRepresentation avpRep = AvpDictionary.INSTANCE.getAvp(avpCode, vendorId); return avpRep != null ? DiameterAvpType.fromString(avpRep.getType()) : null; }
public static void addAvp(Object parent, String avpName, AvpSet set, Object avp) { AvpRepresentation rep = AvpDictionary.INSTANCE.getAvp(avpName); if(rep != null) { addAvp(parent, rep.getCode(), rep.getVendorId(), set, avp); } else { throw new IllegalArgumentException("Unknown AVP with name '" + avpName + "'. Unable to add it."); } }
public static void addAvp(Object parent, String avpName, AvpSet set, Object avp) { AvpRepresentation rep = AvpDictionary.INSTANCE.getAvp(avpName); if(rep != null) { addAvp(parent, rep.getCode(), rep.getVendorId(), set, avp); } else { throw new IllegalArgumentException("Unknown AVP with name '" + avpName + "'. Unable to add it."); } }
public static Object getAvp(String avpName, AvpSet set) { AvpRepresentation avpRep = AvpDictionary.INSTANCE.getAvp(avpName); if(avpRep != null) { return getAvp(avpRep.getCode(), avpRep.getVendorId(), set); } return null; }
protected Object getAvp(String avpName) { AvpRepresentation avpRep = AvpDictionary.INSTANCE.getAvp(avpName); if(avpRep != null) { return getAvp(avpRep.getCode(), avpRep.getVendorId()); } return null; }
protected Object getAvp(String avpName) { AvpRepresentation avpRep = AvpDictionary.INSTANCE.getAvp(avpName); if(avpRep != null) { return getAvp(avpRep.getCode(), avpRep.getVendorId()); } return null; }
public static Object getAvp(String avpName, AvpSet set) { AvpRepresentation avpRep = AvpDictionary.INSTANCE.getAvp(avpName); if(avpRep != null) { return getAvp(avpRep.getCode(), avpRep.getVendorId(), set); } return null; }
protected Object getAvp(String avpName) { AvpRepresentation avpRep = AvpDictionary.INSTANCE.getAvp(avpName); if(avpRep != null) { return getAvp(avpRep.getCode(), avpRep.getVendorId()); } return null; }
protected Object getAvp(String avpName) { AvpRepresentation avpRep = AvpDictionary.INSTANCE.getAvp(avpName); if(avpRep != null) { return getAvp(avpRep.getCode(), avpRep.getVendorId()); } return null; }
public static Object getAvpAsCustom(int avpCode, long vendorId, AvpSet set, Class clazz) { try { Avp avp = set.getAvp(avpCode, vendorId); if (avp != null) { AvpRepresentation rep = AvpDictionary.INSTANCE.getAvp(avpCode, vendorId); Constructor c = null; c = clazz.getConstructor(int.class, long.class, int.class, int.class, byte[].class); return c.newInstance(rep.getCode(), rep.getVendorId(), rep.getRuleMandatoryAsInt(), rep.getRuleProtectedAsInt(), avp.getRawData()); } } catch (Exception e) { if(logger.isDebugEnabled()) { logger.debug("Failed to obtain AVP with code " + avpCode + " and Vendor-Id " + vendorId + " as type Custom (Class '" + clazz.getName() + "').", e); } } return null; }
public static Object getAvpAsCustom(int avpCode, long vendorId, AvpSet set, Class clazz) { try { Avp avp = set.getAvp(avpCode, vendorId); if (avp != null) { AvpRepresentation rep = AvpDictionary.INSTANCE.getAvp(avpCode, vendorId); Constructor c = null; c = clazz.getConstructor(int.class, long.class, int.class, int.class, byte[].class); return c.newInstance(rep.getCode(), rep.getVendorId(), rep.getRuleMandatoryAsInt(), rep.getRuleProtectedAsInt(), avp.getRawData()); } } catch (Exception e) { if(logger.isDebugEnabled()) { logger.debug("Failed to obtain AVP with code " + avpCode + " and Vendor-Id " + vendorId + " as type Custom (Class '" + clazz.getName() + "').", e); } } return null; }
/** * Adds AVP to {@link AvpSet} as Unsigned64 with the given code and given Vendor-Id. * * @param parent the Message/Grouped AVP where AVP will be added to, for validation purposes. if null, no validation is performed. * @param avpCode the code of the AVP * @param vendorId the Vendor-Id of the AVP * @param set the AvpSet to add AVP * @param value the value of the AVP to add */ public static void setAvpAsUnsigned64(Object parent, int avpCode, long vendorId, AvpSet set, long value) { AvpRepresentation rep = AvpDictionary.INSTANCE.getAvp(avpCode, vendorId); if (rep != null) { setAvpAsUnsigned64(parent, avpCode, vendorId, set, rep.isMandatory(), rep.isProtected(), value); } else { setAvpAsUnsigned64(parent, avpCode, vendorId, set, _DEFAULT_MANDATORY, _DEFAULT_PROTECTED, value); } }
/** * Adds AVP to {@link AvpSet} as Float64 with the given code and given Vendor-Id. * * @param parent the Message/Grouped AVP where AVP will be added to, for validation purposes. if null, no validation is performed. * @param avpCode the code of the AVP * @param vendorId the Vendor-Id of the AVP * @param set the AvpSet to add AVP * @param value the value of the AVP to add */ public static void setAvpAsFloat64(Object parent, int avpCode, long vendorId, AvpSet set, double value) { AvpRepresentation rep = AvpDictionary.INSTANCE.getAvp(avpCode, vendorId); if (rep != null) { setAvpAsFloat64(parent, avpCode, vendorId, set, rep.isMandatory(), rep.isProtected(), value); } else { setAvpAsFloat64(parent, avpCode, vendorId, set, _DEFAULT_MANDATORY, _DEFAULT_PROTECTED, value); } }
/** * Adds AVP to {@link AvpSet} as Integer32 with the given code and given Vendor-Id. * * @param parent the Message/Grouped AVP where AVP will be added to, for validation purposes. if null, no validation is performed. * @param avpCode the code of the AVP * @param vendorId the Vendor-Id of the AVP * @param set the AvpSet to add AVP * @param value the value of the AVP to add */ public static void setAvpAsInteger32(Object parent, int avpCode, long vendorId, AvpSet set, int value) { AvpRepresentation rep = AvpDictionary.INSTANCE.getAvp(avpCode, vendorId); if (rep != null) { setAvpAsInteger32(parent, avpCode, vendorId, set, rep.isMandatory(), rep.isProtected(), value); } else { setAvpAsInteger32(parent, avpCode, vendorId, set, _DEFAULT_MANDATORY, _DEFAULT_PROTECTED, value); } }
/** * Adds AVP to {@link AvpSet} as Float64 with the given code and given Vendor-Id. * * @param parent the Message/Grouped AVP where AVP will be added to, for validation purposes. if null, no validation is performed. * @param avpCode the code of the AVP * @param vendorId the Vendor-Id of the AVP * @param set the AvpSet to add AVP * @param value the value of the AVP to add */ public static void setAvpAsFloat64(Object parent, int avpCode, long vendorId, AvpSet set, double value) { AvpRepresentation rep = AvpDictionary.INSTANCE.getAvp(avpCode, vendorId); if (rep != null) { setAvpAsFloat64(parent, avpCode, vendorId, set, rep.isMandatory(), rep.isProtected(), value); } else { setAvpAsFloat64(parent, avpCode, vendorId, set, _DEFAULT_MANDATORY, _DEFAULT_PROTECTED, value); } }