## org.red5.server.net.rtmp
Class RTMPMinaConnection

    java.lang.Object
      org.red5.server.AttributeStore
          org.red5.server.BaseConnection
              org.red5.server.net.rtmp.RTMPConnection
                  org.red5.server.net.rtmp.RTMPMinaConnection

All Implemented Interfaces:
  AttributeStoreMBean, ConnectionMBean, IEventDispatcher, IEventHandler, IEventListener, IAttributeStore, ICastingAttributeStore, IConnection, ICoreObject, IServiceCapableConnection, IStreamCapableConnection, RTMPMinaConnectionMBean

Direct Known Subclasses:
  EdgeRTMPMinaConnection

    public class RTMPMinaConnection

extends RTMPConnection
implements RTMPMinaConnectionMBean

Represents an RTMP connection using Mina.

Author:
  Paul Gregoire
See Also:
  "http://mina.apache.org/report/trunk/apidocs/org/apache/mina/core/session/IoSession.html"

Nested Class Summary

Nested classes/interfaces inherited from interface org.red5.server.api.IConnection
`IConnection.Encoding`

Field Summary
`protected static Logger` `log`

Fields inherited from class org.red5.server.net.rtmp.RTMPConnection
`bytesReadInterval, clientId, nextBytesRead, RTMP_CONNECTION_KEY, RTMP_ENCRYPTED, RTMP_HANDSHAKE, RTMP_NON_ENCRYPTED, state`

Fields inherited from class org.red5.server.BaseConnection
`basicScopes, client, closed, droppedMessages, host, params, path, readMessages, remoteAddress, remoteAddresses, remotePort, scope, sessionId, type, writtenMessages`

Fields inherited from class org.red5.server.AttributeStore
`attributes`

Fields inherited from interface org.red5.server.api.IConnection
`PERSISTENT, POLLING, TRANSIENT`

Constructor Summary
`RTMPMinaConnection()` Constructs a new RTMPMinaConnection.

Method Summary
`void` `close()` Closes connection
`boolean` `connect(IScope newScope, Object[] params)` Connect to another scope on server with given parameters
`IoSession` `getIoSession()` Return MINA I/O session.
`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` `getWrittenBytes()` Total number of bytes written to the connection.
`void` `invokeMethod(String method)`
`boolean` `isConnected()` Check whether connection is alive
`protected void` `onInactive()` Inactive state event handler.
`void` `rawWrite(IoBuffer out)` Write raw byte buffer.
`void` `setIoSession(IoSession protocolSession)` Setter for MINA I/O session (connection).
`void` `write(Packet out)` Write packet.

Methods inherited from class org.red5.server.net.rtmp.RTMPConnection

`addClientStream, closeChannel, createOutputStream, createStreamName, deleteStreamById, getChannel, getClientBytesRead, getEncoding, getId, getInvokeId, getLastPingTime, getNextAvailableChannelId, getPendingCall, getPendingVideoMessages, getState, getStateCode, getStreamByChannelId, getStreamById, getStreamIdForChannel, getStreams, getUsedStreamCount, invoke, invoke, invoke, invoke, invoke, invoke, isChannelUsed, messageDropped, messageReceived, messageSent, newBroadcastStream, newPlaylistSubscriberStream, newSingleItemSubscriberStream, notify, notify, notify, notify, ping, ping, pingReceived, receivedBytesRead, registerDeferredResult, registerPendingCall, rememberStreamBufferDuration, removeClientStream, reserveStreamId, retrievePendingCall, setId, setMaxHandshakeTimeout, setMaxInactivity, setPingInterval, setSchedulingService, setState, setStateCode, setup, startRoundTripMeasurement, startWaitForHandshake, toString, unregisterDeferredResult, unreserveStreamId, updateBytesRead, writingMessage`

Methods inherited from class org.red5.server.BaseConnection
`connect, dispatchEvent, getBasicScopes, getClient, getConnectParams, getDroppedMessages, getHost, getPath, getReadLock, getReadMessages, getRemoteAddress, getRemoteAddresses, getRemotePort, getScope, getSessionId, getType, getWriteLock, getWrittenMessages, handleEvent, initialize, notifyEvent, registerBasicScope, unregisterBasicScope`

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, wait, wait, wait`

Methods inherited from interface org.red5.server.net.rtmp.RTMPMinaConnectionMBean
`getConnectParams, getDroppedMessages, getHost, getPath, getPendingVideoMessages, getReadMessages, getRemoteAddress, getRemoteAddresses, getRemotePort, getSessionId, getType, getWrittenMessages`

Methods inherited from interface org.red5.server.api.IConnection
`connect, getBasicScopes, getClient, getConnectParams, getDroppedMessages, getHost, getPath, getReadMessages, getRemoteAddress, getRemoteAddresses, getRemotePort, getScope, getSessionId, getType, getWrittenMessages, initialize`

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

### log

    protected static Logger log

Constructor Detail

### RTMPMinaConnection

    public RTMPMinaConnection()

  Constructs a new RTMPMinaConnection.

Method Detail

### close

    public void close()

  Closes connection

  Specified by:
    `close` in interface `ConnectionMBean`
  Specified by:
    `close` in interface `IConnection`
  Specified by:
    `close` in interface `RTMPMinaConnectionMBean`
  Overrides:
    `close` in class `RTMPConnection`

### connect

    public boolean connect(IScope newScope,
                           Object[] params)

  Description copied from class: `BaseConnection`
  Connect to another scope on server with given parameters

  Specified by:
    `connect` in interface `ConnectionMBean`
  Specified by:
    `connect` in interface `IConnection`
  Overrides:
    `connect` in class `RTMPConnection`
  Parameters:
    `newScope` - New scope
    `params` - Parameters to connect with
  Returns:
    true on success, false otherwise

### getIoSession

    public IoSession getIoSession()

  Return MINA I/O session.

  Returns:
    MINA O/I session, connection between two end-points

### getPendingMessages

    public long getPendingMessages()

  Total number of messages that are pending to be sent to the connection.

  Specified by:
    `getPendingMessages` in interface `ConnectionMBean`
  Specified by:
    `getPendingMessages` in interface `IConnection`
  Specified by:
    `getPendingMessages` in interface `RTMPMinaConnectionMBean`
  Overrides:
    `getPendingMessages` in class `BaseConnection`
  Returns:
    pending messages

### getReadBytes

    public long getReadBytes()

  Total number of bytes read from the connection.

  Specified by:
    `getReadBytes` in interface `ConnectionMBean`
  Specified by:
    `getReadBytes` in interface `IConnection`
  Specified by:
    `getReadBytes` in interface `RTMPMinaConnectionMBean`
  Overrides:
    `getReadBytes` in class `RTMPConnection`
  Returns:
    bytes read

### getWrittenBytes

    public long getWrittenBytes()

  Total number of bytes written to the connection.

  Specified by:
    `getWrittenBytes` in interface `ConnectionMBean`
  Specified by:
    `getWrittenBytes` in interface `IConnection`
  Specified by:
    `getWrittenBytes` in interface `RTMPMinaConnectionMBean`
  Overrides:
    `getWrittenBytes` in class `RTMPConnection`
  Returns:
    bytes written

### invokeMethod

    public void invokeMethod(String method)

  Specified by:
    `invokeMethod` in interface `RTMPMinaConnectionMBean`

### isConnected

    public boolean isConnected()

  Check whether connection is alive

  Specified by:
    `isConnected` in interface `ConnectionMBean`
  Specified by:
    `isConnected` in interface `IConnection`
  Specified by:
    `isConnected` in interface `RTMPMinaConnectionMBean`
  Overrides:
    `isConnected` in class `BaseConnection`
  Returns:
    true if connection is bound to scope, false otherwise

### onInactive

    protected void onInactive()

  Inactive state event handler.

  Specified by:
    `onInactive` in class `RTMPConnection`

### rawWrite

    public void rawWrite(IoBuffer out)

  Write raw byte buffer.

  Specified by:
    `rawWrite` in class `RTMPConnection`
  Parameters:
    `out` - IoBuffer

### setIoSession

    public void setIoSession(IoSession protocolSession)

  Setter for MINA I/O session (connection).

  Parameters:
    `protocolSession` - Protocol session

### write

    public void write(Packet out)

  Write packet.

  Specified by:
    `write` in class `RTMPConnection`
  Parameters:
    `out` - Packet

Copyright © 2006-2010 The Red5 Project