org.red5.server
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 ConcurrentMap<IConnection,IScope> |
connToScope
Scopes this client connected to
|
protected long |
creationTime
Creation time as Timestamp
|
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
DW: nope, does not currently register 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()
if overriding equals then also do 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.
|
List<String> |
iterateScopeNameList()
Iterate through the scopes and their attributes.
|
protected void |
register(IConnection conn)
Associate connection with client
|
void |
setCreationTime(long creationTime)
Sets the time at which the client was created.
|
void |
setId(String id)
Sets the client id
|
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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAttribute, getAttribute, getAttributeNames, getAttributes, hasAttribute, removeAttribute, removeAttributes, setAttribute, setAttributes, setAttributes
protected static org.slf4j.Logger log
protected static final String PERMISSIONS
protected ConcurrentMap<IConnection,IScope> connToScope
protected long creationTime
protected String id
protected WeakReference<ClientRegistry> registry
protected boolean bandwidthChecked
@ConstructorProperties(value={"id","registry"}) public Client(String id, ClientRegistry registry)
id
- Client idregistry
- ClientRegistrypublic void disconnect()
disconnect
in interface IClient
public Set<IConnection> getConnections()
getConnections
in interface IClient
public Set<IConnection> getConnections(IScope scope)
getConnections
in interface IClient
scope
- Scopepublic void setCreationTime(long creationTime)
creationTime
- public long getCreationTime()
getCreationTime
in interface IClient
public void setId(String id)
public String getId()
public Collection<IScope> getScopes()
IClient
public List<String> iterateScopeNameList()
protected 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 IClient
public Collection<String> getPermissions(IConnection conn)
getPermissions
in interface IClient
conn
- Connection specifying the context to get the permissions for.public boolean hasPermission(IConnection conn, String permissionName)
hasPermission
in interface IClient
conn
- Connection specifying the context to check the permissions for.permissionName
- Name of the permission to check.true
if the client has the permission, otherwise false
public void setPermissions(IConnection conn, Collection<String> permissions)
setPermissions
in interface IClient
conn
- Connection specifying the context to set the permissions for.permissions
- Permissions the client has in this context or null
for no permissions.public void checkBandwidth()
checkBandwidth
in interface IClient
public Map<String,Object> checkBandwidthUp(Object[] params)
checkBandwidthUp
in interface IClient
public static Client from(CompositeData cd)
cd
- composite datapublic int hashCode()
public boolean equals(Object obj)
Copyright © 2006-2012 The Red5 Project