/** * The values of valueOffset and valueLength are only used by some value types, for others * they are will always be the same or meaningless. * @param buffer * @param valueOffset * @param valueLength */ public void getBytes(ByteBuffer buffer, int valueOffset, int valueLength) { getBytes(buffer); }
public String toDebugString() { return toString(); }
public void packAttribute(ByteBuffer buffer, RadiusAttribute a) { AttributeValue attributeValue = a.getValue(); int length = attributeValue.getLength(); int padding = ((length + 0x03) & ~(0x03)) - length; packHeader(buffer, a); attributeValue.getBytes(buffer); while (padding-- > 0) putUnsignedByte(buffer, 0); }
public Object getValue(long type) { RadiusAttribute attribute = get(type); if (attribute != null) { AttributeValue value = attribute.getValue(); if (value != null) { return value.getValueObject(); } } return null; }
public void packHeader(ByteBuffer buffer, VSAttribute a) { packHeader(buffer, a, a.getValue().getLength()); }
/** * @param b The new attribute value to be set */ public void setValue(byte b[]) { attributeValue.setValue(b); }
protected void setup(Serializable o, int op) { setup(); attributeOp = op; if (o == null) return; if (o instanceof AttributeValue) { attributeValue = (AttributeValue) o; } else { attributeValue.setValueObject(o); } }
public static RadiusAttribute copyAttribute(RadiusAttribute a, boolean pool) { Long key = new Long(a.getFormattedType()); RadiusAttribute attr = null; try { if (pool) { attr = borrow(key); } if (attr == null) { attr = newAttribute(key); } } catch (Exception e) { e.printStackTrace(); } attr.getValue().copy(a.getValue()); return attr; }
public Object getValue(long type) { RadiusAttribute attribute = get(type); if (attribute != null) { AttributeValue value = attribute.getValue(); if (value != null) { return value.getValueObject(); } } return null; }
public void packHeader(ByteBuffer buffer, VSAttribute a) { packHeader(buffer, a, a.getValue().getLength()); }
/** * @param value The new attribute value to be set */ public void setValue(String value) { attributeValue.setValue(value); }
protected void setup(Serializable o, int op) { setup(); attributeOp = op; if (o == null) return; if (o instanceof AttributeValue) { attributeValue = (AttributeValue) o; } else { attributeValue.setValueObject(o); } }
public static RadiusAttribute copyAttribute(RadiusAttribute a, boolean pool) { Long key = new Long(a.getFormattedType()); RadiusAttribute attr = null; try { if (pool) { attr = borrow(key); } if (attr == null) { attr = newAttribute(key); } } catch (Exception e) { e.printStackTrace(); } attr.getValue().copy(a.getValue()); return attr; }
/** * The values of valueOffset and valueLength are only used by some value types, for others * they are will always be the same or meaningless. * @param buffer * @param valueOffset * @param valueLength */ public void getBytes(ByteBuffer buffer, int valueOffset, int valueLength) { getBytes(buffer); }
/** * @param aName The name of the attribute to find * @return Returns the Object value of the found attribute, otherwise null * @throws UnknownAttributeException */ public Object getAttributeValue(String aName) throws UnknownAttributeException { RadiusAttribute attribute = findAttribute(aName); if (attribute != null) { AttributeValue value = attribute.getValue(); if (value != null) { return value.getValueObject(); } } return null; }
public void packAttribute(ByteBuffer buffer, RadiusAttribute a) { AttributeValue attributeValue = a.getValue(); int length = attributeValue.getLength(); int padding = ((length + 0x03) & ~(0x03)) - length; packHeader(buffer, a); attributeValue.getBytes(buffer); while (padding-- > 0) putUnsignedByte(buffer, 0); }
public String toDebugString() { return toString(); }
/** * Packs a RadiusAttribute header into a DataOutputStream * @param out The DataOutputStream to write to * @param a The RadiusAttribute to pack * @throws IOException public void packHeader(OutputStream out, RadiusAttribute a) throws IOException { if (a instanceof VSAttribute) { packHeader(out, (VSAttribute)a); return; } AttributeValue attributeValue = a.getValue(); writeUnsignedByte(out, (int) a.getType()); writeUnsignedByte(out, attributeValue.getLength() + HEADER_LENGTH); } */ public void packHeader(ByteBuffer buffer, RadiusAttribute a) { packHeader(buffer, a, a.getValue().getLength()); }
/** * @param b The new attribute value to be set */ public void setValue(byte b[]) { attributeValue.setValue(b); }
public static RadiusAttribute newAttribute(Long key, Serializable value, boolean pool) { RadiusAttribute attr = null; try { if (pool) { attr = borrow(key); } if (attr == null) { attr = newAttribute(key); } } catch (Exception e) { e.printStackTrace(); } attr.getValue().setValueObject(value); return attr; }