org.littleshoot.stun.stack.message.attributes
Class AbstractStunAttribute

java.lang.Object
  extended by org.littleshoot.stun.stack.message.attributes.AbstractStunAttribute
All Implemented Interfaces:
StunAttribute
Direct Known Subclasses:
AbstractStunAddressAttribute, ConnectionStatusAttribute, DataAttribute, ErrorCodeAttribute, IceControlledAttribute, IceControllingAttribute, IcePriorityAttribute, IceUseCandidateAttribute, StunServerAttribute

public abstract class AbstractStunAttribute
extends Object
implements StunAttribute

Abstracts out common STUN attribute functionality.


Constructor Summary
AbstractStunAttribute(StunAttributeType attributeType, int bodyLength)
          Creates a new attribute.
 
Method Summary
 StunAttributeType getAttributeType()
          Accessor for the type of the attribute.
 int getBodyLength()
          Returns the length of the attribute in bytes.
 int getTotalLength()
          Gets the total length of the attribute including the header and the body in bytes.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.littleshoot.stun.stack.message.attributes.StunAttribute
accept
 

Constructor Detail

AbstractStunAttribute

public AbstractStunAttribute(StunAttributeType attributeType,
                             int bodyLength)
Creates a new attribute.

Parameters:
attributeType - The type of the attribute.
bodyLength - The length of the attribute body in bytes.
Method Detail

getBodyLength

public int getBodyLength()
Description copied from interface: StunAttribute
Returns the length of the attribute in bytes.

Specified by:
getBodyLength in interface StunAttribute
Returns:
The length of the attribute in bytes;

getTotalLength

public int getTotalLength()
Description copied from interface: StunAttribute
Gets the total length of the attribute including the header and the body in bytes.

Specified by:
getTotalLength in interface StunAttribute
Returns:
The total length of the attribute including the header and the body.

getAttributeType

public StunAttributeType getAttributeType()
Description copied from interface: StunAttribute
Accessor for the type of the attribute.

Specified by:
getAttributeType in interface StunAttribute
Returns:
The type of the attribute.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 LittleShoot. All Rights Reserved.