Package org.red5.server.api
Interface IClient
- All Superinterfaces:
AttributeStoreMXBean
,IAttributeStore
- All Known Implementing Classes:
Client
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- Author:
- The Red5 Project, Luke Hubbard (luke@codegent.com)
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Performs a bandwidth checking routine.checkBandwidthUp
(Object[] params) Performs a bandwidth checking callback for the client.void
Closes all the connections.Get a set of connections.getConnections
(IScope scope) Get a set of connections of a given scope.long
Get the creation time for this client object.getId()
Get the unique ID for this client.getPermissions
(IConnection conn) Return the permissions in a given context.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.boolean
Returns whether or not a bandwidth check has been requested.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, size
-
Field Details
-
ID
The key used to store the client object in a http session.- See Also:
-
-
Method Details
-
getId
String getId()Get the unique ID for this client. This will be generated by the server if not passed upon connection from client-side Flex/Flash app. To assign a custom ID to the client useparams
object ofIApplication.appConnect(IConnection, Object[])
method, that contains 2nd all the rest values you pass toNetConnection.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().setAttribute("param0", (String) params[0]); } catch (Exception e) { log.error("{}", e); } }
- Returns:
- client id
-
getCreationTime
long getCreationTime()Get the creation time for this client object.- Returns:
- Creation time in milliseconds
-
getScopes
Collection<IScope> getScopes()Get a set of scopes the client is connected to.- Returns:
- Set of scopes
-
getConnections
Set<IConnection> getConnections()Get a set of connections.- Returns:
- Set of connections
-
getConnections
Get a set of connections of a given scope.- Parameters:
scope
- scope to get connections for- Returns:
- Set of connections to the passed scope
-
disconnect
void disconnect()Closes all the connections. -
setPermissions
Set the permissions for this client in a given context.- Parameters:
conn
- Connection specifying the context to set the permissions for.permissions
- Permissions the client has in this context ornull
for no permissions.
-
getPermissions
Return the permissions in a given context.- Parameters:
conn
- Connection specifying the context to get the permissions for.- Returns:
- Permission names.
-
hasPermission
Check if the client has a permission in the given context.- Parameters:
conn
- Connection specifying the context to check the permissions forpermissionName
- Name of the permission to check- Returns:
true
if the client has the permission, otherwisefalse
-
checkBandwidth
void checkBandwidth()Performs a bandwidth checking routine. Information may be found here: http://www.adobe.com/devnet/flashmediaserver/articles/dynamic_stream_switching_04.html -
checkBandwidthUp
Performs a bandwidth checking callback for the client. Information may be found here: http://www.adobe.com/devnet/flashmediaserver/articles/dynamic_stream_switching_04.html- Parameters:
params
- parameters- Returns:
- bandwidth results
-
isBandwidthChecked
boolean isBandwidthChecked()Returns whether or not a bandwidth check has been requested.- Returns:
- true if requested and false otherwise
-