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

java.lang.Object
  extended by org.littleshoot.stun.stack.message.attributes.AbstractStunAttribute
      extended by org.littleshoot.stun.stack.message.attributes.AbstractStunAddressAttribute
All Implemented Interfaces:
StunAddressAttribute, StunAttribute
Direct Known Subclasses:
MappedAddressAttribute, RelayAddressAttribute, RemoteAddressAttribute

public abstract class AbstractStunAddressAttribute
extends AbstractStunAttribute
implements StunAddressAttribute

Abstract class for all STUN attributes that include an address.


Constructor Summary
AbstractStunAddressAttribute(StunAttributeType attributeType, InetSocketAddress socketAddress)
          Creates a new mapped address attribute.
 
Method Summary
 int getAddressFamily()
          Accessor for the family of the address.
 InetSocketAddress getInetSocketAddress()
          Accessor for the address and port in the address.
 String toString()
           
 
Methods inherited from class org.littleshoot.stun.stack.message.attributes.AbstractStunAttribute
getAttributeType, getBodyLength, getTotalLength
 
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, getAttributeType, getBodyLength, getTotalLength
 

Constructor Detail

AbstractStunAddressAttribute

public AbstractStunAddressAttribute(StunAttributeType attributeType,
                                    InetSocketAddress socketAddress)
Creates a new mapped address attribute.

Parameters:
attributeType - The type of the attribute.
socketAddress - The IP and port to put in the attribute.
Method Detail

getInetSocketAddress

public InetSocketAddress getInetSocketAddress()
Description copied from interface: StunAddressAttribute
Accessor for the address and port in the address.

Specified by:
getInetSocketAddress in interface StunAddressAttribute
Returns:
The address and port.

getAddressFamily

public int getAddressFamily()
Description copied from interface: StunAddressAttribute
Accessor for the family of the address.

Specified by:
getAddressFamily in interface StunAddressAttribute
Returns:
The family of the address, either IPv4 or IPv6.

toString

public String toString()
Overrides:
toString in class AbstractStunAttribute


Copyright © 2013 LittleShoot. All Rights Reserved.