public class NetworkEnvironment
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static double |
VERSION |
| Constructor and Description |
|---|
NetworkEnvironment(NetworkEnvironmentSettings settings)
Creates a new
NetworkEnvironment instance using the given NetworkEnvironmentSettings. |
| Modifier and Type | Method and Description |
|---|---|
void |
addAllNetworkEnvironmentListeners(java.util.List<NetworkEnvironmentListener> listeners)
Adds all
NetworkEnvironmentListeners contained in the given List. |
void |
addNetworkEnvironmentListener(NetworkEnvironmentListener l)
Adds the given
NetworkEnvironmentListener to this NetworkEnvironment |
void |
cancelClientSearch()
Cancels the active client search.
|
void |
clearClientList()
|
void |
dispatchEvent(java.lang.String methodName)
Invokes the method with the given name on all
NetworkEnvironmentListener registered on this NetworkEnvironment |
void |
dispatchEvent(java.lang.String methodName,
java.lang.Class<?>[] parameterTypes,
java.lang.Object... parameters)
Invokes the method with the given name on all
NetworkEnvironmentListener registered on this NetworkEnvironment |
void |
dispose()
Disposes this
NetworkEnvironment and all its sub-tasks. |
java.util.List<NetworkEnvironmentListener> |
getAllNetworkEnvironmentListeners()
Returns a
List containing all NetworkEnvironmentListeners currently installed on this NetworkEnvironment. |
int |
getClientCount()
Returns the number of currently available
Clients. |
Client |
getClientForId(java.lang.String id)
|
java.util.List<Client> |
getClientList()
|
NetworkEnvironmentListener |
getNetworkEnvironmentListener(int index)
Return the
NetworkEnvironmentListener with the given index. |
int |
getNetworkEnvironmentListenerCount()
Returns the number of
NetworkEnvironmentListener currently installed on this NetworkEnvironment. |
NetworkEnvironmentSettings |
getNetworkEnvironmentSettings()
Returns the
NetworkEnvironmentSettings used by this instance. |
void |
removeAllNetworkEnvironmentListener()
Removes all
NetworkEnvironmentListeners currently installed on this NetworkEnvironment. |
void |
removeNetworkEnvironmentListener(NetworkEnvironmentListener l)
Removes the given
NetworkEnvironmentListener from this NetworkEnvironment |
void |
startClientSearch()
Starts a active, "infinite" (365 day) search for
Clients in the local network. |
void |
startClientSearch(long howLong,
java.util.concurrent.TimeUnit unitHowLong)
Starts a active search for
Clients in the local network. |
void |
startClientSearch(long howLong,
java.util.concurrent.TimeUnit unitHowLong,
long pause,
java.util.concurrent.TimeUnit unitPause)
Starts a active search for
Clients in the local network. |
public static final double VERSION
public NetworkEnvironment(NetworkEnvironmentSettings settings) throws java.lang.Exception
NetworkEnvironment instance using the given NetworkEnvironmentSettings.settings - the NetworkEnvironmentSettings to usejava.lang.Exceptionpublic NetworkEnvironmentSettings getNetworkEnvironmentSettings()
NetworkEnvironmentSettings used by this instance.NetworkEnvironmentSettings used by this instancepublic void dispose()
throws java.lang.Exception
NetworkEnvironment and all its sub-tasks.java.lang.Exceptionpublic java.util.List<Client> getClientList()
List containing all Clients currently available on this NetworkEnvironmentpublic void addNetworkEnvironmentListener(NetworkEnvironmentListener l)
NetworkEnvironmentListener to this NetworkEnvironmentl - the NetworkEnvironmentListener to addpublic void removeNetworkEnvironmentListener(NetworkEnvironmentListener l)
NetworkEnvironmentListener from this NetworkEnvironmentl - the NetworkEnvironmentListener to removepublic int getNetworkEnvironmentListenerCount()
NetworkEnvironmentListener currently installed on this NetworkEnvironment.NetworkEnvironmentListener currently installed on this NetworkEnvironmentpublic NetworkEnvironmentListener getNetworkEnvironmentListener(int index)
NetworkEnvironmentListener with the given index.index - the index of the requested NetworkEnvironmentListenerNetworkEnvironmentListener or null if the index is invalid.getNetworkEnvironmentListenerCount()public java.util.List<NetworkEnvironmentListener> getAllNetworkEnvironmentListeners()
List containing all NetworkEnvironmentListeners currently installed on this NetworkEnvironment.List containing all NetworkEnvironmentListeners currently installed on this NetworkEnvironmentpublic void addAllNetworkEnvironmentListeners(java.util.List<NetworkEnvironmentListener> listeners)
NetworkEnvironmentListeners contained in the given List.listeners - all NetworkEnvironmentListener that sould be addedpublic void removeAllNetworkEnvironmentListener()
NetworkEnvironmentListeners currently installed on this NetworkEnvironment.public int getClientCount()
Clients.Clientspublic Client getClientForId(java.lang.String id)
public void startClientSearch()
Clients in the local network. Remember to cancel it, especially on mobile devices!public void startClientSearch(long howLong,
java.util.concurrent.TimeUnit unitHowLong)
Clients in the local network. The search is automatically cancelled after the given time.howLong - the duration of the searchunitHowLong - the TimeUnit of howLongstartClientSearch(),
startClientSearch(long, TimeUnit, long, TimeUnit)public void startClientSearch(long howLong,
java.util.concurrent.TimeUnit unitHowLong,
long pause,
java.util.concurrent.TimeUnit unitPause)
Clients in the local network. The search is automatically cancelled after the given time. The signals are
send in the given interval.howLong - the duration of the searchunitHowLong - the TimeUnit of howLongpause - the time between the signalsunitPause - the TimeUnit of pausestartClientSearch(),
startClientSearch(long, TimeUnit, long, TimeUnit)public void cancelClientSearch()
public void clearClientList()
public void dispatchEvent(java.lang.String methodName)
throws java.lang.Exception
NetworkEnvironmentListener registered on this NetworkEnvironmentmethodName - the name of the method that should be invokedjava.lang.Exceptionpublic void dispatchEvent(java.lang.String methodName,
java.lang.Class<?>[] parameterTypes,
java.lang.Object... parameters)
throws java.lang.Exception
NetworkEnvironmentListener registered on this NetworkEnvironmentmethodName - the name of the method that should be invokedparameterTypes - the list of parametersparameters - the parameter valuesjava.lang.Exception