当前位置: 首页>>代码示例>>Java>>正文


Java RadiusAttribute.getValue方法代码示例

本文整理汇总了Java中net.jradius.packet.attribute.RadiusAttribute.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java RadiusAttribute.getValue方法的具体用法?Java RadiusAttribute.getValue怎么用?Java RadiusAttribute.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.jradius.packet.attribute.RadiusAttribute的用法示例。


在下文中一共展示了RadiusAttribute.getValue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getKeyFromAttributeType

import net.jradius.packet.attribute.RadiusAttribute; //导入方法依赖的package包/类
protected Serializable getKeyFromAttributeType(RadiusPacket req, long type, boolean required) throws RadiusException
{
    RadiusAttribute a = req.findAttribute(type);

    if (a == null) 
    {
        if (required)
        {
            a = AttributeFactory.newAttribute(type, null, false);
            throw new RadiusException("Missing required attribute: " + a.getAttributeName());
        }
        return null;
    }

    AttributeValue v = a.getValue();
    return v.toString();
}
 
开发者ID:coova,项目名称:jradius,代码行数:18,代码来源:RadiusSessionKeyProvider.java

示例2: createNamedValueCellEditor

import net.jradius.packet.attribute.RadiusAttribute; //导入方法依赖的package包/类
private JComboBox createNamedValueCellEditor(String attributeName)
{
    JComboBox comboBox = (JComboBox)namedValueComponentCache.get(attributeName);
    if (comboBox != null) return comboBox;
    try
    {
        RadiusAttribute attribute = AttributeFactory.newAttribute(attributeName);
        NamedValue namedValue = (NamedValue)attribute.getValue();
        NamedValueMap valueMap = namedValue.getMap();
        Long[] possibleValues = valueMap.getKnownValues();
        comboBox = new JComboBox();
        for (int i=0; i<possibleValues.length;i++)
        {
            comboBox.addItem(valueMap.getNamedValue(possibleValues[i]));
        }
        namedValueComponentCache.put(attributeName, comboBox);
    }
    catch (Exception e) { e.printStackTrace(); }
    return comboBox;
}
 
开发者ID:coova,项目名称:jradius,代码行数:21,代码来源:JRadiusSimulator.java

示例3: packAttribute

import net.jradius.packet.attribute.RadiusAttribute; //导入方法依赖的package包/类
/**
 * Packs a RadiusAttribute into a DataOutputStream
 * @param out The DataOutputStream to write attributes to
 * @param a The RadiusAttribute to pack
 * @throws IOException
public void packAttribute(OutputStream out, RadiusAttribute a) throws IOException
{
    AttributeValue attributeValue = a.getValue();
    packHeader(out, a);
    attributeValue.getBytes(out);
}
 */

public void packAttribute(ByteBuffer buffer, RadiusAttribute a)
{
    AttributeValue attributeValue = a.getValue();
    
    if (a instanceof VSAttribute)
    {
    	VSAttribute vsa = (VSAttribute) a;
    	if (vsa.hasContinuationByte())
    	{
    		int headerLength = headerLength(vsa);
    		int valueLength = attributeValue.getLength();
    		int maxLength = 255 - headerLength;
    		int len;
    		if (valueLength > maxLength)
    		{
    			for (int off = 0; off < valueLength; off += maxLength)
    			{
    				len = valueLength - off;
    				if (len > maxLength) 
    				{
    					len = maxLength;
            			vsa.setContinuation();
    				}
    				else
    				{
            			vsa.unsetContinuation();
    				}
    		        packHeader(buffer, a, len);
    		        attributeValue.getBytes(buffer, off, len);
    			}
    			return;
    		}
    	}
    }
    
    packHeader(buffer, a);
    attributeValue.getBytes(buffer);
}
 
开发者ID:coova,项目名称:jradius,代码行数:52,代码来源:RadiusFormat.java

示例4: getAttributeValue

import net.jradius.packet.attribute.RadiusAttribute; //导入方法依赖的package包/类
/**
 * @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;
}
 
开发者ID:coova,项目名称:jradius,代码行数:20,代码来源:RadiusPacket.java

示例5: setAccountingStatusType

import net.jradius.packet.attribute.RadiusAttribute; //导入方法依赖的package包/类
public void setAccountingStatusType(int type)
{
    RadiusAttribute a = AttributeFactory.newAttribute(AttributeDictionary.ACCT_STATUS_TYPE, null, isRecyclable());
    NamedValue s = (NamedValue)a.getValue();
    s.setValue(new Long(type));
    overwriteAttribute(a);
}
 
开发者ID:coova,项目名称:jradius,代码行数:8,代码来源:AccountingRequest.java

示例6: packAttribute

import net.jradius.packet.attribute.RadiusAttribute; //导入方法依赖的package包/类
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);
}
 
开发者ID:coova,项目名称:jradius,代码行数:10,代码来源:DiameterFormat.java

示例7: packHeader

import net.jradius.packet.attribute.RadiusAttribute; //导入方法依赖的package包/类
public void packHeader(ByteBuffer buffer, RadiusAttribute a) 
{
    if (a instanceof VSAttribute) 
    { 
        packHeader(buffer, (VSAttribute) a); 
        return;
    }

    AttributeValue attributeValue = a.getValue();
    putUnsignedInt(buffer, a.getType());
    putUnsignedByte(buffer, 0);
    putUnsignedByte(buffer, 0); // part of the AVP Length!
    putUnsignedShort(buffer, attributeValue.getLength() + 8);
}
 
开发者ID:coova,项目名称:jradius,代码行数:15,代码来源:DiameterFormat.java

示例8: packAttribute

import net.jradius.packet.attribute.RadiusAttribute; //导入方法依赖的package包/类
@Override
public void packAttribute(ByteBuffer buffer, RadiusAttribute a) 
{
       AttributeValue attributeValue = a.getValue();
       putUnsignedByte(buffer, (int) a.getType());
       putUnsignedByte(buffer, attributeValue.getLength() + 2);
       attributeValue.getBytes(buffer);
}
 
开发者ID:coova,项目名称:jradius,代码行数:9,代码来源:TLVFormat.java

示例9: packHeader

import net.jradius.packet.attribute.RadiusAttribute; //导入方法依赖的package包/类
/**
 * @see net.jradius.packet.RadiusFormat#packHeader(java.io.OutputStream, net.jradius.packet.attribute.RadiusAttribute)
public void packHeader(OutputStream out, RadiusAttribute a) throws IOException
{
    AttributeValue attributeValue = a.getValue();
    writeUnsignedInt(out, a.getFormattedType());
    writeUnsignedInt(out, attributeValue.getLength());
    writeUnsignedInt(out, a.getAttributeOp());
}
 */

public void packHeader(ByteBuffer buffer, RadiusAttribute a)
{
    AttributeValue attributeValue = a.getValue();
    putUnsignedInt(buffer, a.getFormattedType());
    putUnsignedInt(buffer, attributeValue.getLength());
    putUnsignedInt(buffer, a.getAttributeOp());
}
 
开发者ID:coova,项目名称:jradius,代码行数:19,代码来源:FreeRadiusFormat.java


注:本文中的net.jradius.packet.attribute.RadiusAttribute.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。