|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.red5.server.AttributeStore
org.red5.server.Client
public class Client
Client is an abstraction representing user connected to Red5 application. Clients are tied to connections and registered in ClientRegistry
Field Summary | |
---|---|
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 Logger |
log
|
protected static String |
PERMISSIONS
Name of connection attribute holding the permissions. |
protected WeakReference<ClientRegistry> |
registry
Client registry where Client is registered |
Fields inherited from class org.red5.server.AttributeStore |
---|
attributes |
Fields inherited from interface org.red5.server.api.IClient |
---|
ID |
Constructor Summary | |
---|---|
Client(String id,
ClientRegistry registry)
Creates client, sets creation time and registers it in ClientRegistry DW: nope, does not currently register it in ClientRegistry! |
Method Summary | |
---|---|
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 |
Methods inherited from class org.red5.server.AttributeStore |
---|
filterNull, getAttribute, getAttribute, getAttributeNames, getAttributes, getBoolAttribute, getByteAttribute, getDoubleAttribute, getIntAttribute, getListAttribute, getLongAttribute, getMapAttribute, getSetAttribute, getShortAttribute, getStringAttribute, hasAttribute, removeAttribute, removeAttributes, setAttribute, setAttributes, setAttributes, size |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.red5.server.api.IAttributeStore |
---|
getAttribute, getAttribute, getAttributeNames, getAttributes, hasAttribute, removeAttribute, removeAttributes, setAttribute, setAttributes, setAttributes, size |
Field Detail |
---|
protected static 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
Constructor Detail |
---|
@ConstructorProperties(value={"id","registry"}) public Client(String id, ClientRegistry registry)
id
- Client idregistry
- ClientRegistryMethod Detail |
---|
public 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
- Scope
public void setCreationTime(long creationTime)
creationTime
- public long getCreationTime()
getCreationTime
in interface IClient
public void setId(String id)
setId
in interface IClient
id
- client idpublic String getId()
getId
in interface IClient
public Collection<IScope> getScopes()
IClient
getScopes
in interface 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 data
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- Object to check against
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |