Openfire 3.5.0.rc1 Javadoc

org.jivesoftware.openfire.stun
Class STUNService

java.lang.Object
  extended by org.jivesoftware.openfire.container.BasicModule
      extended by org.jivesoftware.openfire.stun.STUNService
All Implemented Interfaces:
Module

public class STUNService
extends BasicModule

STUN server and service module. It provides address discovery for p2p sessions to be used for media transmission and receiving of UDP packets. It's especially useful for clients behind NAT devices.

Author:
Thiago Camargo

Constructor Summary
STUNService()
          Constructs a new STUN Service
 
Method Summary
 void addExternalServer(String server, String port)
           
 void destroy()
          Destroys the module.
 List<InetAddress> getAddresses()
           
 List<StunServerAddress> getExternalServers()
           
 String getName()
          Obtain the name of the module.
 String getPrimaryAddress()
          Get the primary Address used by the STUN server
 int getPrimaryPort()
          Get the primary Port used by the STUN server
 String getSecondaryAddress()
          Get the secondary Address used by the STUN server
 int getSecondaryPort()
          Get the secondary Port used by the STUN server
 void initialize(XMPPServer server)
          Initializes the basic module.
 boolean isEnabled()
          Returns true if the service is enabled.
 boolean isLocalEnabled()
          Returns true if the local STUN server is enabled.
 void removeExternalServer(int index)
           
 void setEnabled(boolean enabled, boolean localEnabled)
          Set the service enable status.
 void setLocalEnabled(boolean enabled)
          Set the Local STUN Server enable status.
 void start()
          Starts the basic module.
 void stop()
          Stops the basic module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

STUNService

public STUNService()
Constructs a new STUN Service

Method Detail

destroy

public void destroy()
Description copied from class: BasicModule

Destroys the module.

Does nothing in the basic module.

Specified by:
destroy in interface Module
Overrides:
destroy in class BasicModule

initialize

public void initialize(XMPPServer server)
Description copied from class: BasicModule

Initializes the basic module.

Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.

Specified by:
initialize in interface Module
Overrides:
initialize in class BasicModule
Parameters:
server - the server hosting this module.

start

public void start()
Description copied from class: BasicModule

Starts the basic module.

Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.

Specified by:
start in interface Module
Overrides:
start in class BasicModule

stop

public void stop()
Description copied from class: BasicModule

Stops the basic module.

Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.

Specified by:
stop in interface Module
Overrides:
stop in class BasicModule

getName

public String getName()
Description copied from class: BasicModule

Obtain the name of the module.

Specified by:
getName in interface Module
Overrides:
getName in class BasicModule
Returns:
The name of the module

getExternalServers

public List<StunServerAddress> getExternalServers()

addExternalServer

public void addExternalServer(String server,
                              String port)

removeExternalServer

public void removeExternalServer(int index)

isEnabled

public boolean isEnabled()
Returns true if the service is enabled.

Returns:
enabled

isLocalEnabled

public boolean isLocalEnabled()
Returns true if the local STUN server is enabled.

Returns:
enabled

setEnabled

public void setEnabled(boolean enabled,
                       boolean localEnabled)
Set the service enable status.

Parameters:
enabled - boolean to enable or disable
localEnabled - local Server enable or disable

setLocalEnabled

public void setLocalEnabled(boolean enabled)
Set the Local STUN Server enable status.

Parameters:
enabled - boolean to enable or disable

getSecondaryPort

public int getSecondaryPort()
Get the secondary Port used by the STUN server

Returns:
secondary Port used by the STUN server

getPrimaryPort

public int getPrimaryPort()
Get the primary Port used by the STUN server

Returns:
primary Port used by the STUN server

getSecondaryAddress

public String getSecondaryAddress()
Get the secondary Address used by the STUN server

Returns:
secondary Address used by the STUN server

getPrimaryAddress

public String getPrimaryAddress()
Get the primary Address used by the STUN server

Returns:
primary Address used by the STUN server

getAddresses

public List<InetAddress> getAddresses()

Openfire 3.5.0.rc1 Javadoc

Copyright © 2003-2007 Jive Software.