Implements Agent#isOver() in IceProcessingState (like isEstablished()).
This commit is contained in:
parent
eb0e3d3fb8
commit
945c0ccd65
@ -681,9 +681,9 @@ public class Agent
|
|||||||
*/
|
*/
|
||||||
public boolean isOver()
|
public boolean isOver()
|
||||||
{
|
{
|
||||||
return state == IceProcessingState.COMPLETED
|
IceProcessingState state = getState();
|
||||||
|| state == IceProcessingState.TERMINATED
|
|
||||||
|| state == IceProcessingState.FAILED;
|
return (state != null) && state.isOver();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -35,6 +35,7 @@ package org.ice4j.ice;
|
|||||||
* refer to with "Terminated".
|
* refer to with "Terminated".
|
||||||
*
|
*
|
||||||
* @author Emil Ivov
|
* @author Emil Ivov
|
||||||
|
* @author Lyubomir Marinov
|
||||||
*/
|
*/
|
||||||
public enum IceProcessingState
|
public enum IceProcessingState
|
||||||
{
|
{
|
||||||
@ -99,6 +100,21 @@ public enum IceProcessingState
|
|||||||
return stateName;
|
return stateName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines whether an {@link Agent} in this state has finished its ICE
|
||||||
|
* processing.
|
||||||
|
*
|
||||||
|
* @return {@code true} if an {@code Agent} in this state has finished its
|
||||||
|
* ICE processing; otherwise, {@code false}
|
||||||
|
*/
|
||||||
|
public boolean isOver()
|
||||||
|
{
|
||||||
|
return
|
||||||
|
COMPLETED.equals(this)
|
||||||
|
|| FAILED.equals(this)
|
||||||
|
|| TERMINATED.equals(this);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns <tt>true</tt> iff the state is one in which a connection
|
* Returns <tt>true</tt> iff the state is one in which a connection
|
||||||
* has been established, that is either <tt>COMPLETED</tt> or
|
* has been established, that is either <tt>COMPLETED</tt> or
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user