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 TypeMethodDescriptionvoidAdds a client to the registry.getClient.Returns a list of Clients.protected Collection<IClient> Return collection of clientsbooleanCheck if a client with a given id exists.protected booleanCheck 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 idvoidremoveClient(IClient client) Removes client from registry
-
Constructor Details
-
ClientRegistry
public ClientRegistry()Constructor for ClientRegistry.
-
ClientRegistry
Constructor for ClientRegistry.
- Parameters:
name- aStringobject
-
-
Method Details
-
addClient
Adds a client to the registry. Add client to registry- Specified by:
addClientin interfaceIClientRegistry- Parameters:
client- client
-
getClient
getClient.
- Specified by:
getClientin interfaceClientRegistryMXBean- Parameters:
id- aStringobject- Returns:
- a
Clientobject - Throws:
ClientNotFoundException- if any.
-
getClientList
Returns a list of Clients.- Specified by:
getClientListin interfaceClientRegistryMXBean- Returns:
- a
ClientListobject
-
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:
hasClientin interfaceClientRegistryMXBean- Specified by:
hasClientin 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:
lookupClientin 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:
newClientin interfaceIClientRegistry- Parameters:
params- Client params- Returns:
- Client object
- Throws:
ClientNotFoundException- if client not foundClientRejectedException- if client rejected
-
nextId
Return next client id- Specified by:
nextIdin interfaceClientRegistryMXBean- Returns:
- Next client id
-
previousId
Return previous client id- Specified by:
previousIdin interfaceClientRegistryMXBean- Returns:
- Previous client id
-
removeClient
Removes client from registry- Parameters:
client- Client to remove
-