public class MediaProxy extends Object implements SessionListener
Each connection relay between two parties is called a session. You can setup a MediaProxy for all network interfaces with an empty constructor, or bind it to a specific interface with the MediaProxy(String localhost) constructor. The media proxy ONLY works if you are directly connected to the Internet with a valid IP address..
Constructor and Description |
---|
MediaProxy(String ipAddress)
Contruct a MediaProxy instance that will listen on a specific network interface.
|
Modifier and Type | Method and Description |
---|---|
ProxyCandidate |
addRelayAgent(String id,
String creator)
Add a new Dynamic Session to the mediaproxy WITHOUT defined IPs and ports.
|
ProxyCandidate |
addRelayAgent(String id,
String creator,
String hostA,
int portA,
String hostB,
int portB)
Add a new Dynamic Session to the mediaproxy for defined IPs and ports.
|
long |
getIdleTime()
Returns the max time (in millis) that a session can remain open without
receiving any packets.
|
long |
getLifetime()
Returns the maximum lifetime (in seconds) of a session.
|
int |
getMaxPort()
Returns the maximum port value to listen for incoming packets.
|
int |
getMinPort()
Returns the minimum port value to listen for incoming packets.
|
String |
getPublicIP()
Get the public IP of this media proxy that listen for incomming packets.
|
MediaProxySession |
getSession(String sid)
Returns a media proxy session with the specified ID.
|
Collection<MediaProxySession> |
getSessions()
Returns the list of all currently active and running sessions.
|
void |
sessionClosed(MediaProxySession session)
Implements Session Listener stopAgent event.
|
void |
setIdleTime(long idleTime)
Sets the max time (in millis) that a session can remain open without
receiving any packets.
|
void |
setLifetime(long lifetime)
Sets the maximum lifetime (in seconds) of a session.
|
void |
setMaxPort(int maxPort)
Sets the maximum port value to listen for incoming packets.
|
void |
setMinPort(int minPort)
Sets the minimum port value to listen from incoming packets.
|
public MediaProxy(String ipAddress)
ipAddress
- the IP address on this server that will listen for packets.public String getPublicIP()
public long getIdleTime()
public void setIdleTime(long idleTime)
idleTime
- the max idle time in millis.public Collection<MediaProxySession> getSessions()
public int getMinPort()
public void setMinPort(int minPort)
minPort
- the minimum port value.public int getMaxPort()
public void setMaxPort(int maxPort)
maxPort
- the maximun port value.public long getLifetime()
public void setLifetime(long lifetime)
lifetime
- the max lifetime of a session (in seconds).public MediaProxySession getSession(String sid)
sid
- the session ID.public void sessionClosed(MediaProxySession session)
sessionClosed
in interface SessionListener
session
- the session that stoppedpublic ProxyCandidate addRelayAgent(String id, String creator, String hostA, int portA, String hostB, int portB)
id
- id of the candidate returned (Could be a Jingle session ID)creator
- the agent creator name or descriptionhostA
- the hostname or IP of the point A of the ChannelportA
- the port number point A of the ChannelhostB
- the hostname or IP of the point B of the ChannelportB
- the port number point B of the Channelpublic ProxyCandidate addRelayAgent(String id, String creator)
id
- id of the candidate returned (Could be a Jingle session ID)creator
- the agent creator name or descriptionCopyright © 2003-2008 Jive Software.