|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IClient
The client object represents a single client. One client may have multiple
connections to different scopes on the same host. In some ways the client
object is like a HTTP session. You can create IClient objects with
IClientRegistry.newClient(Object[])
NOTE: I removed session, since client serves the same purpose as a client
with attributes
| Field Summary | |
|---|---|
static String |
ID
The key used to store the client object in a http session. |
| Method Summary | |
|---|---|
void |
disconnect()
Closes all the connections. |
Set<IConnection> |
getConnections()
Get a set of connections. |
Set<IConnection> |
getConnections(IScope scope)
Get a set of connections of a given scope. |
long |
getCreationTime()
Get the creation time for this client object. |
String |
getId()
Get the unique ID for this client. |
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. |
boolean |
hasPermission(IConnection conn,
String permissionName)
Check if the client has a permission in the given context. |
void |
setId(String id)
Sets the clients id |
void |
setPermissions(IConnection conn,
Collection<String> permissions)
Set the permissions for this client in a given context. |
| Methods inherited from interface org.red5.server.api.IAttributeStore |
|---|
getAttribute, getAttribute, getAttributeNames, getAttributes, hasAttribute, removeAttribute, removeAttributes, setAttribute, setAttributes, setAttributes |
| Methods inherited from interface org.red5.server.api.IBWControllable |
|---|
getBandwidthConfigure, getParentBWControllable, setBandwidthConfigure |
| Field Detail |
|---|
static final String ID
| Method Detail |
|---|
void setId(String id)
id - client idString getId()
params object of
IApplication.appConnect(IConnection, Object[]) method, that
contains 2nd all the rest values you pass to
NetConnection.connect method.
Example:
At client side:
NetConnection.connect( "http://localhost/killerapp/", "user123" );
then at server side:
public boolean appConnect( IConnection connection, Object[] params ){
try {
connection.getClient().setId( (String) params[0] );
} catch(Exception e){
log.error("{}", e);
}
}
getId in interface ClientMBeanlong getCreationTime()
getCreationTime in interface ClientMBeanCollection<IScope> getScopes()
getScopes in interface ClientMBeanSet<IConnection> getConnections()
getConnections in interface ClientMBeanSet<IConnection> getConnections(IScope scope)
scope - scope to get connections for
void disconnect()
disconnect in interface ClientMBean
void setPermissions(IConnection conn,
Collection<String> permissions)
conn - Connection specifying the context to set the permissions for.permissions - Permissions the client has in this context or null for no permissions.Collection<String> getPermissions(IConnection conn)
conn - Connection specifying the context to get the permissions for.
boolean hasPermission(IConnection conn,
String permissionName)
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||