Package org.red5.server
Class ClientRegistry
java.lang.Object
org.red5.server.ClientRegistry
- All Implemented Interfaces:
IClientRegistry
,ClientRegistryMXBean
@ManagedResource(objectName="org.red5.server:type=ClientRegistry,name=default",
description="ClientRegistry")
public class ClientRegistry
extends Object
implements IClientRegistry, ClientRegistryMXBean
Registry for clients, wherein clients are mapped by their id.
- Author:
- The Red5 Project
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for ClientRegistry.ClientRegistry
(String name) Constructor for ClientRegistry. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a client to the registry.getClient.Returns a list of Clients.protected Collection
<IClient> Return collection of clientsboolean
Check if a client with a given id exists.protected boolean
Check if client registry contains clients.lookupClient
(String id) Return an existing client from a client id.Return client from next id with given paramsnextId()
Return next client idReturn previous client idvoid
removeClient
(IClient client) Removes client from registry
-
Constructor Details
-
ClientRegistry
public ClientRegistry()Constructor for ClientRegistry.
-
ClientRegistry
Constructor for ClientRegistry.
- Parameters:
name
- aString
object
-
-
Method Details
-
addClient
Adds a client to the registry. Add client to registry- Specified by:
addClient
in interfaceIClientRegistry
- Parameters:
client
- client
-
getClient
getClient.
- Specified by:
getClient
in interfaceClientRegistryMXBean
- Parameters:
id
- aString
object- Returns:
- a
Client
object - Throws:
ClientNotFoundException
- if any.
-
getClientList
Returns a list of Clients.- Specified by:
getClientList
in interfaceClientRegistryMXBean
- Returns:
- a
ClientList
object
-
hasClients
protected boolean hasClients()Check if client registry contains clients.- Returns:
True
if clients exist, otherwiseFalse
-
getClients
Return collection of clients- Returns:
- Collection of clients
-
hasClient
Check if a client with a given id exists. Check whether registry has client with given id- Specified by:
hasClient
in interfaceClientRegistryMXBean
- Specified by:
hasClient
in interfaceIClientRegistry
- Parameters:
id
- the id of the client to check for- Returns:
true
if the client exists,false
otherwise
-
lookupClient
Return an existing client from a client id. Return client by id- Specified by:
lookupClient
in interfaceIClientRegistry
- Parameters:
id
- the id of the client to return- Returns:
- the client object
- Throws:
ClientNotFoundException
- no client with the passed id exists
-
newClient
Return client from next id with given params- Specified by:
newClient
in interfaceIClientRegistry
- Parameters:
params
- Client params- Returns:
- Client object
- Throws:
ClientNotFoundException
- if client not foundClientRejectedException
- if client rejected
-
nextId
Return next client id- Specified by:
nextId
in interfaceClientRegistryMXBean
- Returns:
- Next client id
-
previousId
Return previous client id- Specified by:
previousId
in interfaceClientRegistryMXBean
- Returns:
- Previous client id
-
removeClient
Removes client from registry- Parameters:
client
- Client to remove
-