public class StunServerDescriptor
extends java.lang.Object
implements java.io.Serializable
String
form suitable for storage in an accounts
properties Map.Modifier and Type | Field and Description |
---|---|
static int |
MAX_STUN_SERVER_COUNT
The maximum number of stun servers that we would allow.
|
static java.lang.String |
PROTOCOL_SSLTCP
TCP with SSL protocol (only for Google Talk TURN server).
|
static java.lang.String |
PROTOCOL_TCP
TCP protocol.
|
static java.lang.String |
PROTOCOL_UDP
UDP protocol.
|
Constructor and Description |
---|
StunServerDescriptor(java.lang.String address,
int port,
boolean supportTurn,
java.lang.String username,
java.lang.String password)
Creates an instance of StunServer by specifying all parameters.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAddress()
Returns the IP address or FQDN of this server.
|
byte[] |
getPassword()
Returns the password associated to this server username.
|
int |
getPort()
Returns the port of this server.
|
java.lang.String |
getProtocol()
Returns the protocol associated to this server.
|
byte[] |
getUsername()
Returns the username associated to this server.
|
boolean |
isOldTurn()
Returns true if the TURN protocol supported is not the RFC5766 ones.
|
boolean |
isTurnSupported()
Indicates if TURN is supported by this server.
|
static StunServerDescriptor |
loadDescriptor(java.util.Map<java.lang.String,java.lang.String> props,
java.lang.String namePrefix)
Loads this descriptor from the specified
Map .The method is meant
for use with account property maps. |
void |
setAddress(java.lang.String address)
Sets the IP address or FQDN of this server.
|
void |
setOldTurn(boolean val)
Set the old TURN support.
|
void |
setPassword(java.lang.String password)
Sets the password associated to this server username.
|
void |
setPort(int port)
Sets the port corresponding to this server.
|
void |
setProtocol(java.lang.String protocol)
Sets the protocol associated to this server.
|
void |
setTurnSupported(boolean turnSupported)
Specifies whether this server can also act as a TURN relay.
|
void |
setUsername(java.lang.String username)
Sets the username associated to this server.
|
void |
storeDescriptor(java.util.Map<java.lang.String,java.lang.String> props,
java.lang.String namePrefix)
Stores this descriptor into the specified
Map .The method is meant
for use with account property maps. |
java.lang.String |
toString()
Returns a String representation of this descriptor
|
public static final int MAX_STUN_SERVER_COUNT
public static final java.lang.String PROTOCOL_UDP
public static final java.lang.String PROTOCOL_TCP
public static final java.lang.String PROTOCOL_SSLTCP
public StunServerDescriptor(java.lang.String address, int port, boolean supportTurn, java.lang.String username, java.lang.String password)
address
- the IP address or FQDN of the STUN serverport
- the port of the serversupportTurn
- indicates if this STUN server supports TURNusername
- the user name for authenticatingpassword
- the passwordpublic java.lang.String getAddress()
public void setAddress(java.lang.String address)
address
- the IP address or FQDN to setpublic int getPort()
public void setPort(int port)
port
- the port to setpublic boolean isTurnSupported()
public void setTurnSupported(boolean turnSupported)
turnSupported
- true to indicate that TURN is supported,
false - otherwisepublic byte[] getUsername()
public void setUsername(java.lang.String username)
username
- the username to setpublic byte[] getPassword()
public void setPassword(java.lang.String password)
password
- the password to setpublic void storeDescriptor(java.util.Map<java.lang.String,java.lang.String> props, java.lang.String namePrefix)
Map
.The method is meant
for use with account property maps. It also allows prepending an account
prefix to all property names so that multiple descriptors can be stored
in a single Map
.props
- the account properties Map
that we'd like to store
this descriptor in.namePrefix
- the prefix that we should prepend to every property
name.public static StunServerDescriptor loadDescriptor(java.util.Map<java.lang.String,java.lang.String> props, java.lang.String namePrefix)
Map
.The method is meant
for use with account property maps. It also allows prepending an account
prefix to all property names so that multiple descriptors can be read
in a single Map
.props
- the account properties Map
that we'd like to load
this descriptor from.namePrefix
- the prefix that we should prepend to every property
name.public boolean isOldTurn()
public void setOldTurn(boolean val)
val
- value to setpublic java.lang.String getProtocol()
public void setProtocol(java.lang.String protocol)
protocol
- protocol to setpublic java.lang.String toString()
toString
in class java.lang.Object
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.