|
||||||||||
| 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.BaseConnection
public abstract class BaseConnection
Base abstract class for connections. Adds connection specific functionality like work with clients to AttributeStore.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.red5.server.api.IConnection |
|---|
IConnection.Encoding |
| Field Summary | |
|---|---|
protected Set<IBasicScope> |
basicScopes
Set of basic scopes. |
protected IClient |
client
Client bound to connection |
protected boolean |
closed
Is the connection closed? |
protected AtomicLong |
droppedMessages
Number of dropped messages |
protected String |
host
Connection host |
protected Map<String,Object> |
params
Connection params passed from client with NetConnection.connect call |
protected String |
path
Path of scope client connected to |
protected AtomicLong |
readMessages
Number of read messages |
protected String |
remoteAddress
Connection remote address |
protected List<String> |
remoteAddresses
Connection remote addresses |
protected int |
remotePort
Remote port |
protected Scope |
scope
Scope that connection belongs to |
protected String |
sessionId
Connection session identifier |
protected String |
type
Connection type |
protected AtomicLong |
writtenMessages
Number of written messages |
| Fields inherited from class org.red5.server.AttributeStore |
|---|
attributes |
| Fields inherited from interface org.red5.server.api.IConnection |
|---|
PERSISTENT, POLLING, TRANSIENT |
| Constructor Summary | |
|---|---|
BaseConnection(String type,
String host,
String remoteAddress,
int remotePort,
String path,
String sessionId,
Map<String,Object> params)
|
|
| Method Summary | |
|---|---|
void |
close()
Closes connection |
boolean |
connect(IScope newScope)
Connect to another scope on server |
boolean |
connect(IScope newScope,
Object[] params)
Connect to another scope on server with given parameters |
void |
dispatchEvent(IEvent event)
Dispatches event |
Iterator<IBasicScope> |
getBasicScopes()
Get the basic scopes this connection has subscribed. |
IClient |
getClient()
Get the client object associated with this connection. |
long |
getClientBytesRead()
Return number of written bytes the client reports to have received. |
Map<String,Object> |
getConnectParams()
Return connection parameters |
long |
getDroppedMessages()
Total number of messages that have been dropped. |
String |
getHost()
Get the hostname that the client is connected to. |
String |
getPath()
Get the path for this connection. |
long |
getPendingMessages()
Total number of messages that are pending to be sent to the connection. |
long |
getPendingVideoMessages(int streamId)
|
abstract long |
getReadBytes()
Total number of bytes read from the connection. |
Lock |
getReadLock()
|
long |
getReadMessages()
Total number of messages read from the connection. |
String |
getRemoteAddress()
Get the IP address the client is connected from. |
List<String> |
getRemoteAddresses()
Get the IP addresses the client is connected from. |
int |
getRemotePort()
Get the port the client is connected from. |
IScope |
getScope()
Get the scope this is connected to. |
String |
getSessionId()
Get the session id, this may be null. |
String |
getType()
Get the connection type. |
Lock |
getWriteLock()
|
abstract long |
getWrittenBytes()
Total number of bytes written to the connection. |
long |
getWrittenMessages()
Total number of messages written to the connection. |
boolean |
handleEvent(IEvent event)
Handles event |
void |
initialize(IClient client)
Initializes client |
boolean |
isConnected()
Check whether connection is alive |
void |
notifyEvent(IEvent event)
Notified on event |
void |
registerBasicScope(IBasicScope basicScope)
Registers basic scope |
void |
unregisterBasicScope(IBasicScope basicScope)
Unregister basic scope |
| 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.red5.server.api.IConnection |
|---|
getEncoding, getLastPingTime, ping |
| Methods inherited from interface org.red5.server.api.ICastingAttributeStore |
|---|
getBoolAttribute, getByteAttribute, getDoubleAttribute, getIntAttribute, getListAttribute, getLongAttribute, getMapAttribute, getSetAttribute, getShortAttribute, getStringAttribute |
| Methods inherited from interface org.red5.server.api.IAttributeStore |
|---|
getAttribute, getAttribute, getAttributeNames, getAttributes, hasAttribute, removeAttribute, removeAttributes, setAttribute, setAttributes, setAttributes |
| Field Detail |
|---|
protected final String type
protected volatile String host
protected volatile String remoteAddress
protected volatile List<String> remoteAddresses
protected volatile int remotePort
protected volatile String path
protected volatile String sessionId
protected AtomicLong readMessages
protected AtomicLong writtenMessages
protected AtomicLong droppedMessages
protected volatile Map<String,Object> params
protected volatile IClient client
protected volatile Scope scope
protected Set<IBasicScope> basicScopes
protected volatile boolean closed
| Constructor Detail |
|---|
public BaseConnection(String type,
String host,
String remoteAddress,
int remotePort,
String path,
String sessionId,
Map<String,Object> params)
type - Connection typehost - HostremoteAddress - Remote addressremotePort - Remote portpath - Scope path on serversessionId - Session idparams - Params passed from client| Method Detail |
|---|
public Lock getReadLock()
public Lock getWriteLock()
public void initialize(IClient client)
initialize in interface ConnectionMBeaninitialize in interface IConnectionclient - Client bound to connectionpublic String getType()
IConnection
getType in interface ConnectionMBeangetType in interface IConnectionpublic String getHost()
IConnection
getHost in interface ConnectionMBeangetHost in interface IConnectionpublic String getRemoteAddress()
IConnection
getRemoteAddress in interface ConnectionMBeangetRemoteAddress in interface IConnectionpublic List<String> getRemoteAddresses()
IConnection
getRemoteAddresses in interface ConnectionMBeangetRemoteAddresses in interface IConnectionpublic int getRemotePort()
IConnection
getRemotePort in interface ConnectionMBeangetRemotePort in interface IConnectionpublic String getPath()
IConnection
getPath in interface ConnectionMBeangetPath in interface IConnectionpublic String getSessionId()
IConnectionnull.
getSessionId in interface ConnectionMBeangetSessionId in interface IConnectionpublic Map<String,Object> getConnectParams()
getConnectParams in interface ConnectionMBeangetConnectParams in interface IConnectionpublic IClient getClient()
IConnection
getClient in interface ConnectionMBeangetClient in interface IConnectionpublic boolean isConnected()
isConnected in interface ConnectionMBeanisConnected in interface IConnectionpublic boolean connect(IScope newScope)
connect in interface ConnectionMBeanconnect in interface IConnectionnewScope - New scope
public boolean connect(IScope newScope,
Object[] params)
connect in interface ConnectionMBeanconnect in interface IConnectionnewScope - New scopeparams - Parameters to connect with
public IScope getScope()
IConnection
getScope in interface ConnectionMBeangetScope in interface IConnectionpublic void close()
close in interface ConnectionMBeanclose in interface IConnectionpublic void notifyEvent(IEvent event)
notifyEvent in interface IEventListenerevent - Eventpublic void dispatchEvent(IEvent event)
dispatchEvent in interface IEventDispatcherevent - Eventpublic boolean handleEvent(IEvent event)
handleEvent in interface IEventHandlerevent - Event
public Iterator<IBasicScope> getBasicScopes()
IConnection
getBasicScopes in interface ConnectionMBeangetBasicScopes in interface IConnectionpublic void registerBasicScope(IBasicScope basicScope)
basicScope - Basic scope to registerpublic void unregisterBasicScope(IBasicScope basicScope)
basicScope - Unregister basic scopepublic abstract long getReadBytes()
IConnection
getReadBytes in interface ConnectionMBeangetReadBytes in interface IConnectionpublic abstract long getWrittenBytes()
IConnection
getWrittenBytes in interface ConnectionMBeangetWrittenBytes in interface IConnectionpublic long getReadMessages()
IConnection
getReadMessages in interface ConnectionMBeangetReadMessages in interface IConnectionpublic long getWrittenMessages()
IConnection
getWrittenMessages in interface ConnectionMBeangetWrittenMessages in interface IConnectionpublic long getDroppedMessages()
IConnection
getDroppedMessages in interface ConnectionMBeangetDroppedMessages in interface IConnectionpublic long getPendingMessages()
IConnection
getPendingMessages in interface ConnectionMBeangetPendingMessages in interface IConnectionpublic long getPendingVideoMessages(int streamId)
streamId - the id you want to know about
public long getClientBytesRead()
getClientBytesRead in interface IConnectionBytesRead
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||