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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ConcurrentMap<String,IClient> Clients mapprivate org.slf4j.Loggerprivate StringThe identifier for this client registryprivate AtomicIntegerNext client id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidAdd the client to the registryvoidAdd client to registryReturns a list of Clients.protected Collection<IClient>Return collection of clientsbooleanCheck whether registry has client with given idprotected booleanCheck if client registry contains clients.lookupClient(String id) Return client by idReturn client from next id with given paramsnextId()Return next client idReturn previous client idprotected voidremoveClient(IClient client) Removes client from registry
-
Field Details
-
log
private org.slf4j.Logger log -
clients
Clients map -
nextId
Next client id -
name
The identifier for this client registry
-
-
Constructor Details
-
ClientRegistry
public ClientRegistry() -
ClientRegistry
-
-
Method Details
-
addClient
Add client to registry- Specified by:
addClientin interfaceIClientRegistry- Parameters:
client- Client to add
-
addClient
Add the client to the registry -
getClient
- Specified by:
getClientin interfaceClientRegistryMXBean- Throws:
ClientNotFoundException
-
getClientList
Returns a list of Clients.- Specified by:
getClientListin interfaceClientRegistryMXBean
-
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 whether registry has client with given id- Specified by:
hasClientin interfaceClientRegistryMXBean- Specified by:
hasClientin interfaceIClientRegistry- Parameters:
id- Client id- Returns:
- true if client with given id was register with this registry, false otherwise
-
lookupClient
Return client by id- Specified by:
lookupClientin interfaceIClientRegistry- Parameters:
id- Client id- Returns:
- Client object associated with given id
- Throws:
ClientNotFoundException- if we can't find client
-
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
-