|
Openfire 3.3.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread org.jivesoftware.openfire.mediaproxy.MediaProxySession
public abstract class MediaProxySession
A media proxy session enables two clients to exchange UDP traffic. Each client connects to a UDP port and then the proxy is responsible for exchanging traffic. Each session uses a total of four ports: two for traffic exchange, and two control ports.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected org.jivesoftware.openfire.mediaproxy.Channel |
channelAtoB
|
protected org.jivesoftware.openfire.mediaproxy.Channel |
channelAtoBControl
|
protected org.jivesoftware.openfire.mediaproxy.Channel |
channelBtoA
|
protected org.jivesoftware.openfire.mediaproxy.Channel |
channelBtoAControl
|
protected InetAddress |
hostA
|
protected InetAddress |
hostB
|
protected InetAddress |
localAddress
|
protected int |
localPortA
|
protected int |
localPortB
|
protected int |
portA
|
protected int |
portB
|
protected DatagramSocket |
socketA
|
protected DatagramSocket |
socketAControl
|
protected DatagramSocket |
socketB
|
protected DatagramSocket |
socketBControl
|
protected Thread |
threadAtoB
|
protected Thread |
threadAtoBControl
|
protected Thread |
threadBtoA
|
protected Thread |
threadBtoAControl
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
MediaProxySession(String id,
String creator,
String localAddress,
String hostA,
int portA,
String hostB,
int portB,
int minPort,
int maxPort)
Creates a new static UDP channel between Host A and Host B. |
Method Summary | |
---|---|
void |
addAgentListener(SessionListener sessionListener)
Adds a listener for Session events |
void |
clearAgentListeners()
Removes every Session events listeners |
boolean |
datagramReceived(DatagramPacket datagramPacket)
Implement DatagramListener to timestamp last packet arrived |
void |
dispatchAgentStopped()
Dispatch Stop Event |
String |
getCreator()
Get the agent creator. |
protected int |
getFreePort()
Obtain a free port with a nested control port we can use. |
InetAddress |
getHostA()
Get the Host A IP |
InetAddress |
getHostB()
Get the Host B IP |
InetAddress |
getLocalhost()
Get localhost of the Session |
int |
getLocalPortA()
Get the localport that listen for Host A Packets |
int |
getLocalPortB()
Get the localport that listen for Host B Packets |
String |
getPass()
Get the pass of this Session A pass can be used to authorize an Session modification |
int |
getPortA()
Get the Port A IP |
int |
getPortB()
Get the Port B IP |
String |
getSID()
Get the ID of the Session |
long |
getTimestamp()
Get last packet arrived timestamp |
void |
removeAgentListener(SessionListener sessionListener)
Removes an Session events listener |
void |
run()
Thread override method |
void |
sendFromPortA(String host,
int port)
|
void |
sendFromPortB(String host,
int port)
|
void |
setHostA(InetAddress hostA)
Set the Host A IP |
void |
setHostB(InetAddress hostB)
Set the Host B IP |
void |
setPortA(int portA)
Set port A value |
void |
setPortB(int portB)
Set port B value |
void |
stopAgent()
Stop the Session |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jivesoftware.openfire.mediaproxy.ProxyCandidate |
---|
start |
Field Detail |
---|
protected InetAddress localAddress
protected InetAddress hostA
protected InetAddress hostB
protected int portA
protected int portB
protected int localPortA
protected int localPortB
protected DatagramSocket socketA
protected DatagramSocket socketAControl
protected DatagramSocket socketB
protected DatagramSocket socketBControl
protected org.jivesoftware.openfire.mediaproxy.Channel channelAtoB
protected org.jivesoftware.openfire.mediaproxy.Channel channelAtoBControl
protected org.jivesoftware.openfire.mediaproxy.Channel channelBtoA
protected org.jivesoftware.openfire.mediaproxy.Channel channelBtoAControl
protected Thread threadAtoB
protected Thread threadAtoBControl
protected Thread threadBtoA
protected Thread threadBtoAControl
Constructor Detail |
---|
public MediaProxySession(String id, String creator, String localAddress, String hostA, int portA, String hostB, int portB, int minPort, int maxPort)
id
- of the Session (Could be a Jingle session ID)creator
- the session creator name or descriptionlocalAddress
- the localhost IP that will listen for UDP packetshostA
- 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 ChannelminPort
- the minimal port value to be used by the servermaxPort
- the maximun port value to be used by the serverMethod Detail |
---|
protected int getFreePort()
public String getSID()
getSID
in interface ProxyCandidate
public String getPass()
getPass
in interface ProxyCandidate
public String getCreator()
public long getTimestamp()
public void run()
run
in interface Runnable
run
in class Thread
public void stopAgent()
stopAgent
in interface ProxyCandidate
public InetAddress getLocalhost()
getLocalhost
in interface ProxyCandidate
public InetAddress getHostA()
getHostA
in interface ProxyCandidate
public InetAddress getHostB()
getHostB
in interface ProxyCandidate
public void setPortA(int portA)
setPortA
in interface ProxyCandidate
portA
- the port number for Apublic void setPortB(int portB)
setPortB
in interface ProxyCandidate
portB
- the port number for Bpublic void setHostA(InetAddress hostA)
setHostA
in interface ProxyCandidate
hostA
- the host for Apublic void setHostB(InetAddress hostB)
setHostB
in interface ProxyCandidate
hostB
- the host for Bpublic int getPortA()
getPortA
in interface ProxyCandidate
public int getPortB()
getPortB
in interface ProxyCandidate
public int getLocalPortA()
getLocalPortA
in interface ProxyCandidate
public int getLocalPortB()
getLocalPortB
in interface ProxyCandidate
public void sendFromPortA(String host, int port)
sendFromPortA
in interface ProxyCandidate
public void sendFromPortB(String host, int port)
sendFromPortB
in interface ProxyCandidate
public boolean datagramReceived(DatagramPacket datagramPacket)
datagramReceived
in interface DatagramListener
datagramPacket
-
public void addAgentListener(SessionListener sessionListener)
sessionListener
- public void removeAgentListener(SessionListener sessionListener)
sessionListener
- public void clearAgentListeners()
public void dispatchAgentStopped()
|
Openfire 3.3.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |