public class Client extends AttributeStore implements IClient
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
bandwidthChecked
Whether or not the bandwidth has been checked.
|
protected CopyOnWriteArraySet<IConnection> |
connections
Connections this client is associated with.
|
protected long |
creationTime
Creation time as Timestamp
|
protected AtomicBoolean |
disconnected
Disconnected state.
|
protected String |
id
Clients identifier
|
protected static org.slf4j.Logger |
log |
protected static String |
PERMISSIONS
Name of connection attribute holding the permissions.
|
protected WeakReference<ClientRegistry> |
registry
Client registry where Client is registered
|
attributes| Constructor and Description |
|---|
Client(String id,
ClientRegistry registry)
Creates client, sets creation time and registers it in ClientRegistry.
|
Client(String id,
Long creationTime,
ClientRegistry registry)
Creates client, sets creation time and registers it in ClientRegistry.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkBandwidth()
Performs a bandwidth checking routine.
|
Map<String,Object> |
checkBandwidthUp(Object[] params)
Performs a bandwidth checking callback for the client.
|
void |
disconnect()
Disconnects client from Red5 application
|
boolean |
equals(Object obj)
Check clients equality by id
|
static Client |
from(CompositeData cd)
Allows for reconstruction via CompositeData.
|
Set<IConnection> |
getConnections()
Return set of connections for this client
|
Set<IConnection> |
getConnections(IScope scope)
Return client connections to given scope
|
long |
getCreationTime()
Returns the time at which the client was created.
|
String |
getId()
Returns the client id.
|
Collection<String> |
getPermissions(IConnection conn)
Return the permissions in a given context.
|
Collection<IScope> |
getScopes()
Get a set of scopes the client is connected to.
|
int |
hashCode() |
boolean |
hasPermission(IConnection conn,
String permissionName)
Check if the client has a permission in the given context.
|
boolean |
isBandwidthChecked()
Returns whether or not a bandwidth check has been requested.
|
boolean |
isRegistered(IConnection conn)
Returns registration status of given connection.
|
List<String> |
iterateScopeNameList()
Iterate through the scopes and their attributes.
|
protected void |
register(IConnection conn)
Associate connection with client
|
void |
setPermissions(IConnection conn,
Collection<String> permissions)
Set the permissions for this client in a given context.
|
String |
toString() |
protected void |
unregister(IConnection conn)
Removes client-connection association for given connection
|
protected void |
unregister(IConnection conn,
boolean deleteIfNoConns)
Removes client-connection association for given connection
|
filterNull, getAttribute, getAttribute, getAttributeNames, getAttributes, getBoolAttribute, getByteAttribute, getDoubleAttribute, getIntAttribute, getListAttribute, getLongAttribute, getMapAttribute, getSetAttribute, getShortAttribute, getStringAttribute, hasAttribute, removeAttribute, removeAttributes, setAttribute, setAttributes, setAttributes, sizeclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAttribute, getAttribute, getAttributeNames, getAttributes, hasAttribute, removeAttribute, removeAttributes, setAttribute, setAttributes, setAttributes, sizeprotected static org.slf4j.Logger log
protected static final String PERMISSIONS
protected transient WeakReference<ClientRegistry> registry
protected transient CopyOnWriteArraySet<IConnection> connections
protected final long creationTime
protected final String id
protected boolean bandwidthChecked
protected AtomicBoolean disconnected
@ConstructorProperties(value={"id","registry"}) public Client(String id, ClientRegistry registry)
id - Client idregistry - ClientRegistry@ConstructorProperties(value={"id","creationTime","registry"}) public Client(String id, Long creationTime, ClientRegistry registry)
id - Client idcreationTime - Creation timeregistry - ClientRegistrypublic void disconnect()
disconnect in interface IClientpublic Set<IConnection> getConnections()
getConnections in interface IClientpublic Set<IConnection> getConnections(IScope scope)
getConnections in interface IClientscope - Scopepublic long getCreationTime()
getCreationTime in interface IClientpublic String getId()
public Collection<IScope> getScopes()
IClientpublic List<String> iterateScopeNameList()
public boolean isRegistered(IConnection conn)
conn - connectionprotected void register(IConnection conn)
conn - Connection objectprotected void unregister(IConnection conn)
conn - Connection objectprotected void unregister(IConnection conn, boolean deleteIfNoConns)
conn - Connection objectdeleteIfNoConns - Whether to delete this client if it no longer has any connectionspublic boolean isBandwidthChecked()
isBandwidthChecked in interface IClientpublic Collection<String> getPermissions(IConnection conn)
getPermissions in interface IClientconn - Connection specifying the context to get the permissions for.public boolean hasPermission(IConnection conn, String permissionName)
hasPermission in interface IClientconn - Connection specifying the context to check the permissions forpermissionName - Name of the permission to checktrueif the client has the permission, otherwise
false
public void setPermissions(IConnection conn, Collection<String> permissions)
setPermissions in interface IClientconn - Connection specifying the context to set the permissions for.permissions - Permissions the client has in this context or
nullfor no permissions.
public void checkBandwidth()
checkBandwidth in interface IClientpublic Map<String,Object> checkBandwidthUp(Object[] params)
checkBandwidthUp in interface IClientparams - parameterspublic static Client from(CompositeData cd)
cd - composite datapublic boolean equals(Object obj)
Copyright © 2005–2017 Red5. All rights reserved.