|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IConnection
The connection object. Each connection has an associated client and scope. Connections may be persistent, polling, or transient. The aim of this interface is to provide basic connection methods shared between different types of connections Future subclasses: RTMPConnection, RemotingConnection, AJAXConnection, HttpConnection, etc
Nested Class Summary | |
---|---|
static class |
IConnection.Encoding
AMF version types, either AMF0 or AMF3. |
Field Summary | |
---|---|
static String |
PERSISTENT
Persistent connection type, eg RTMP. |
static String |
POLLING
Polling connection type, eg RTMPT. |
static String |
TRANSIENT
Transient connection type, eg Remoting, HTTP, etc. |
Method Summary | |
---|---|
void |
close()
Close this connection. |
boolean |
connect(IScope scope)
Try to connect to the scope. |
boolean |
connect(IScope scope,
Object[] params)
Try to connect to the scope with a list of connection parameters. |
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 the parameters that were given in the call to "connect". |
long |
getDroppedMessages()
Total number of messages that have been dropped. |
IConnection.Encoding |
getEncoding()
Get the object encoding (AMF version) for this connection. |
String |
getHost()
Get the hostname that the client is connected to. |
int |
getLastPingTime()
Return roundtrip time of last ping command. |
String |
getPath()
Get the path for this connection. |
long |
getPendingMessages()
Total number of messages that are pending to be sent to the connection. |
long |
getReadBytes()
Total number of bytes read from the connection. |
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. |
long |
getWrittenBytes()
Total number of bytes written to the connection. |
long |
getWrittenMessages()
Total number of messages written to the connection. |
void |
initialize(IClient client)
Initialize the connection. |
boolean |
isConnected()
Is the client connected to the scope. |
void |
ping()
Start measuring the roundtrip time for a packet on the connection. |
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 |
Methods inherited from interface org.red5.server.api.event.IEventDispatcher |
---|
dispatchEvent |
Methods inherited from interface org.red5.server.api.event.IEventHandler |
---|
handleEvent |
Methods inherited from interface org.red5.server.api.event.IEventListener |
---|
notifyEvent |
Field Detail |
---|
static final String PERSISTENT
static final String POLLING
static final String TRANSIENT
Method Detail |
---|
String getType()
getType
in interface ConnectionMBean
IConnection.Encoding getEncoding()
void initialize(IClient client)
initialize
in interface ConnectionMBean
client
- Client object associated with connectionboolean connect(IScope scope)
connect
in interface ConnectionMBean
scope
- Scope object
true
on success, false
otherwiseboolean connect(IScope scope, Object[] params)
connect
in interface ConnectionMBean
params
- Connections parametersscope
- Scope object
true
on success, false
otherwiseboolean isConnected()
true
for persistent and polling connections, false
for transient.
isConnected
in interface ConnectionMBean
true
if the connection is persistent or polling,
otherwise false
void close()
close
in interface ConnectionMBean
Map<String,Object> getConnectParams()
getConnectParams
in interface ConnectionMBean
IClient getClient()
getClient
in interface ConnectionMBean
String getHost()
getHost
in interface ConnectionMBean
String getRemoteAddress()
getRemoteAddress
in interface ConnectionMBean
List<String> getRemoteAddresses()
getRemoteAddresses
in interface ConnectionMBean
int getRemotePort()
getRemotePort
in interface ConnectionMBean
String getPath()
getPath
in interface ConnectionMBean
String getSessionId()
null
.
getSessionId
in interface ConnectionMBean
long getReadBytes()
getReadBytes
in interface ConnectionMBean
long getWrittenBytes()
getWrittenBytes
in interface ConnectionMBean
long getReadMessages()
getReadMessages
in interface ConnectionMBean
long getWrittenMessages()
getWrittenMessages
in interface ConnectionMBean
long getDroppedMessages()
getDroppedMessages
in interface ConnectionMBean
long getPendingMessages()
getPendingMessages
in interface ConnectionMBean
long getClientBytesRead()
BytesRead
void ping()
ping
in interface ConnectionMBean
int getLastPingTime()
getLastPingTime
in interface ConnectionMBean
IScope getScope()
getScope
in interface ConnectionMBean
Iterator<IBasicScope> getBasicScopes()
getBasicScopes
in interface ConnectionMBean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |