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

java.lang.Object
  extended by org.littleshoot.stun.stack.message.attributes.AbstractStunAttribute
      extended by org.littleshoot.stun.stack.message.attributes.ErrorCodeAttribute
All Implemented Interfaces:
StunAttribute

public class ErrorCodeAttribute
extends AbstractStunAttribute

The STUN ERROR CODE attribute.


Constructor Summary
ErrorCodeAttribute(int errorClass, int errorNumber, String reasonPhrase)
          Creates a new STUN error code attribute.
ErrorCodeAttribute(int code, String reasonPhrase)
          Creates a new STUN error code attribute.
 
Method Summary
 void accept(StunAttributeVisitor visitor)
          Allows attributes to accept visitors.
 int getErrorClass()
          The class of the error, from 3 to 6, inclusive.
 int getErrorCode()
          Returns the full error code.
 int getErrorNumber()
          The number of the error, from 0 to 99, inclusive.
 CharSequence getReasonPhrase()
          Accessor for the reason phrase.
 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
 

Constructor Detail

ErrorCodeAttribute

public ErrorCodeAttribute(int code,
                          String reasonPhrase)
Creates a new STUN error code attribute.

Parameters:
code - The error code.
reasonPhrase - The reason for the error.

ErrorCodeAttribute

public ErrorCodeAttribute(int errorClass,
                          int errorNumber,
                          String reasonPhrase)
Creates a new STUN error code attribute.

Parameters:
errorClass - The error class from 3 to 6.
errorNumber - The error number from 0 to 99.
reasonPhrase - The reason for the error.
Method Detail

getErrorCode

public int getErrorCode()
Returns the full error code.

Returns:
The full error code, including the class and the number.

getErrorClass

public int getErrorClass()
The class of the error, from 3 to 6, inclusive.

Returns:
The class of the error.

getErrorNumber

public int getErrorNumber()
The number of the error, from 0 to 99, inclusive.

Returns:
The number of the error.

getReasonPhrase

public CharSequence getReasonPhrase()
Accessor for the reason phrase.

Returns:
The reason phrase.

accept

public void accept(StunAttributeVisitor visitor)
Description copied from interface: StunAttribute
Allows attributes to accept visitors.

Parameters:
visitor - The visitor to accept.

toString

public String toString()
Overrides:
toString in class AbstractStunAttribute


Copyright © 2013 LittleShoot. All Rights Reserved.