Package org.red5.server.api
Class Red5
java.lang.Object
org.red5.server.api.Red5
Utility class for accessing Red5 API objects.
This class uses a thread local, and will be setup by the service invoker.
The code below shows various uses.
IConnection conn = Red5.getConnectionLocal(); Red5 r5 = new Red5(); IScope scope = r5.getScope(); conn = r5.getConnection(); r5 = new Red5(conn); IClient client = r5.getClient();
- Author:
- The Red5 Project, Luke Hubbard (luke@codegent.com), Paul Gregoire (mondain@gmail.com), Tiago Daniel Jacobs (os@tdj.cc)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IntegerServer capabilitiesConnection local to the current threadData version for NetStatusEventsstatic final StringServer version for fmsVer requestsstatic intTarget for ChunkSize messaging in RTMP.static final StringServer version with revision -
Constructor Summary
ConstructorsConstructorDescriptionRed5()Create a new Red5 object using the connection local to the current thread A bit of magic that lets you access the red5 scope from anywhereRed5(IConnection conn) Create a new Red5 object using given connection. -
Method Summary
Modifier and TypeMethodDescriptionstatic Red5from(CompositeData cd) Allows for reconstruction via CompositeData.static IntegerGet the clientGet the connection object.static IConnectionGet the connection associated with the current thread.Get the spring application contextstatic Objectstatic StringReturns the current version for fmsVer requestsgetScope()Get the scopestatic intReturns the target chunk size.static longReturns server uptime in milliseconds.static StringReturns the current version with revision numberstatic booleanisDebug()Returns true if java debugging was detected.static booleanstatic voidsetConnectionLocal(IConnection connection) Setter for connectionstatic voidsetPluginsReady(boolean pluginsReady) Plugins ready flag.static voidsetTargetChunkSize(int targetChunkSize) Sets the target chunk size to use for publish and play invocations.
-
Field Details
-
conn
Connection local to the current thread -
VERSION
Server version with revision- See Also:
-
FMS_VERSION
Server version for fmsVer requests- See Also:
-
CAPABILITIES
Server capabilities -
targetChunkSize
public static int targetChunkSizeTarget for ChunkSize messaging in RTMP. Defaulting to 128 which is the original FMS setting, until modifying this is more throughly tested. -
DATA_VERSION
Data version for NetStatusEvents
-
-
Constructor Details
-
Red5
Create a new Red5 object using given connection.- Parameters:
conn- Connection object.
-
Red5
public Red5()Create a new Red5 object using the connection local to the current thread A bit of magic that lets you access the red5 scope from anywhere
-
-
Method Details
-
setConnectionLocal
Setter for connection- Parameters:
connection- Thread local connection
-
getConnectionLocal
Get the connection associated with the current thread. This method allows you to get connection object local to current thread. When you need to get a connection associated with event handler and so forth, this method provides you with it.- Returns:
- Connection object
-
getConnection
Get the connection object.- Returns:
- Connection object
-
getScope
Get the scope- Returns:
- Scope object
-
getClient
Get the client- Returns:
- Client object
-
getContext
Get the spring application context- Returns:
- Application context
-
getVersion
Returns the current version with revision number- Returns:
- String version
-
getFMSVersion
Returns the current version for fmsVer requests- Returns:
- String fms version
-
getCapabilities
-
getDataVersion
-
isDebug
public static boolean isDebug()Returns true if java debugging was detected.- Returns:
- true if debugging, false otherwise
-
getUpTime
public static long getUpTime()Returns server uptime in milliseconds.- Returns:
- String version
-
from
Allows for reconstruction via CompositeData.- Parameters:
cd- composite data- Returns:
- Red5 class instance
-
setTargetChunkSize
public static void setTargetChunkSize(int targetChunkSize) Sets the target chunk size to use for publish and play invocations. Default is 128.- Parameters:
targetChunkSize- the chunk size to use
-
getTargetChunkSize
public static int getTargetChunkSize()Returns the target chunk size.- Returns:
- targetChunkSize
-
setPluginsReady
public static void setPluginsReady(boolean pluginsReady) Plugins ready flag. This is set to true when the PluginLauncher has completed loading all plugins. -
isPluginsReady
public static boolean isPluginsReady()
-