Package io.antmedia.console
Class AdminApplication
java.lang.Object
org.red5.server.adapter.AbstractScopeAdapter
org.red5.server.adapter.StatefulScopeWrappingAdapter
org.red5.server.adapter.MultiThreadedApplicationAdapter
io.antmedia.console.AdminApplication
- All Implemented Interfaces:
IEventHandler
,IAttributeStore
,ISchedulingService
,IScopeAware
,IScopeHandler
,IScopeService
,IBroadcastStreamService
,IOnDemandStreamService
,IStreamSecurityService
,ISubscriberStreamService
,IStreamAwareScopeHandler
,ApplicationMXBean
,AttributeStoreMXBean
Sample application that uses the client manager.
- Author:
- The Red5 Project (red5@osflash.org)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
private IClusterNotifier
private ConsoleDataStoreFactory
private boolean
private static final int
private static final org.slf4j.Logger
private IScope
private io.vertx.core.Vertx
private WarDeployer
Fields inherited from class org.red5.server.adapter.MultiThreadedApplicationAdapter
logger, schedulingService
Fields inherited from class org.red5.server.adapter.StatefulScopeWrappingAdapter
plugins, scope
Fields inherited from interface org.red5.server.api.service.IBroadcastStreamService
BROADCAST_STREAM_SERVICE
Fields inherited from interface org.red5.server.api.service.IOnDemandStreamService
BEAN_NAME
Fields inherited from interface org.red5.server.api.scheduling.ISchedulingService
BEAN_NAME
Fields inherited from interface org.red5.server.api.service.IStreamSecurityService
BEAN_NAME
Fields inherited from interface org.red5.server.api.service.ISubscriberStreamService
BEAN_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Called once on scope (that is, application or application room) start.boolean
connect
(IConnection conn, IScope scope, Object[] params) Returns connection result for given scope and parameters.boolean
createApplication
(String appName, String warFileFullPath) boolean
createApplicationWithURL
(String appName, String warFileURI, String secretKey) boolean
deleteApplication
(String appName, boolean deleteDB) boolean
deleteVoDStream
(String appname, String streamName) void
disconnect
(IConnection conn, IScope scope) Returns disconnection result for given scope and parameters.downloadWarFile
(String appName, String warFileUrl, String jwtSecretKey) getApplicationAdaptor
(IScope appScope) getApplicationContext
(String scopeName) int
getAppLiveStreamCount
(IScope appScope) getAppLiveStreams
(String name) org.apache.http.impl.client.CloseableHttpClient
static String
getProcess
(String command) getProcessBuilder
(String[] parametersToRun) private IScope
private IScope
getScopes
(IGlobalScope root, String scopeName) Gt only application scopeprivate long
getStorage
(String name) int
int
int
getVoDCount
(IScope appScope) static File
getWarFileInTmpDirectory
(String warFileName) static String
getWarName
(String appName) boolean
runCommand
(String command) boolean
runCreateAppScript
(String appName) boolean
runCreateAppScript
(String appName, boolean isCluster, String dbConnectionUrl, String dbUser, String dbPass, String warFileName) boolean
runDeleteAppScript
(String appName) static File
saveWARFile
(String appName, InputStream inputStream) void
setDataStoreFactory
(ConsoleDataStoreFactory dataStoreFactory) void
setVertx
(io.vertx.core.Vertx vertx) void
setWarDeployer
(WarDeployer warDeployer) Methods inherited from class org.red5.server.adapter.MultiThreadedApplicationAdapter
addListener, addScheduledJob, addScheduledJobAfterDelay, addScheduledOnceJob, addScheduledOnceJob, appConnect, appDisconnect, appJoin, appLeave, appStop, connect, FCPublish, FCSubscribe, FCUnpublish, FCUnpublish, getBroadcastStream, getBroadcastStreamNames, getClientTTL, getGhostConnsCleanupPeriod, getListeners, getOnDemandStream, getScheduledJobNames, getStreamLength, getStreamPlaybackSecurity, getStreamPublishSecurity, getSubscriberStream, handleEvent, hasBroadcastStream, hasOnDemandStream, join, leave, measureBandwidth, measureBandwidth, pauseScheduledJob, registerStreamPlaybackSecurity, registerStreamPublishSecurity, rejectClient, rejectClient, removeListener, removeScheduledJob, resumeScheduledJob, roomConnect, roomDisconnect, roomJoin, roomLeave, roomStart, roomStop, setClientTTL, setGhostConnsCleanupPeriod, start, startTransmit, stop, stopTransmit, stopTransmit, streamBroadcastClose, streamBroadcastStart, streamPlayItemPause, streamPlayItemPlay, streamPlayItemResume, streamPlayItemSeek, streamPlayItemStop, streamPublishStart, streamRecordStart, streamRecordStop, streamSubscriberClose, streamSubscriberStart, unregisterStreamPlaybackSecurity, unregisterStreamPublishSecurity
Methods inherited from class org.red5.server.adapter.StatefulScopeWrappingAdapter
createChildScope, getAttribute, getAttribute, getAttributeNames, getAttributes, getChildScope, getChildScopeNames, getClients, getConnections, getContext, getDepth, getName, getParent, getPath, getPlugins, getResource, getResources, getScope, hasAttribute, hasChildScope, hasParent, lookupConnections, removeAttribute, removeAttributes, setAttribute, setAttributes, setAttributes, setPlugins, setScope, size
Methods inherited from class org.red5.server.adapter.AbstractScopeAdapter
addChildScope, checkBandwidth, checkBandwidthUp, removeChildScope, serviceCall, setCanCallService, setCanConnect, setCanStart, setJoin
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.scope.IScopeHandler
addChildScope, removeChildScope, serviceCall
-
Field Details
-
JWT_TOKEN_TIMEOUT_MS
private static final int JWT_TOKEN_TIMEOUT_MS- See Also:
-
log
private static final org.slf4j.Logger log -
APP_NAME
- See Also:
-
dataStoreFactory
-
rootScope
-
vertx
private io.vertx.core.Vertx vertx -
warDeployer
-
isCluster
private boolean isCluster -
clusterNotifier
-
currentApplicationCreationProcesses
-
-
Constructor Details
-
AdminApplication
public AdminApplication()
-
-
Method Details
-
appStart
Description copied from class:MultiThreadedApplicationAdapter
Called once on scope (that is, application or application room) start. You overrideMultiThreadedApplicationAdapter.appStart(IScope)
orMultiThreadedApplicationAdapter.roomStart(IScope)
in your application to make it act the way you want.- Specified by:
appStart
in interfaceApplicationMXBean
- Overrides:
appStart
in classMultiThreadedApplicationAdapter
- Parameters:
app
- Application scope object- Returns:
true
if scope can be started,false
otherwise
-
createApplicationWithURL
-
connect
Returns connection result for given scope and parameters. Whether the scope is room or app level scope, this method distinguishes it and acts accordingly. You overrideMultiThreadedApplicationAdapter.appConnect(IConnection, Object[])
orMultiThreadedApplicationAdapter.roomConnect(IConnection, Object[])
in your application to make it act the way you want.- Specified by:
connect
in interfaceIScopeHandler
- Overrides:
connect
in classMultiThreadedApplicationAdapter
- Parameters:
conn
- Connection objectscope
- Scopeparams
- List of params passed to connection handler- Returns:
true
if connect is successful,false
otherwise
-
disconnect
Returns disconnection result for given scope and parameters. Whether the scope is room or app level scope, this method distinguishes it and acts accordingly.- Specified by:
disconnect
in interfaceIScopeHandler
- Overrides:
disconnect
in classMultiThreadedApplicationAdapter
- Parameters:
conn
- Connection objectscope
- Scope
-
getRootScope
-
getTotalLiveStreamSize
public int getTotalLiveStreamSize() -
getApplicationInfo
-
getApplicationAdaptor
-
getStorage
-
getVoDCount
-
getAppLiveStreams
-
deleteVoDStream
-
getApplications
-
getTotalConnectionSize
public int getTotalConnectionSize() -
getApplicationContext
-
getScope
-
getScopes
Gt only application scope- Parameters:
root
-scopeName
-- Returns:
- IScope the requested scope
-
getDataStoreFactory
-
setDataStoreFactory
-
getAppLiveStreamCount
-
createApplication
-
getCurrentApplicationCreationProcesses
-
getJavaTmpDirectory
-
getWarFileInTmpDirectory
-
getWarName
-
saveWARFile
-
getHttpClient
public org.apache.http.impl.client.CloseableHttpClient getHttpClient() -
downloadWarFile
public File downloadWarFile(String appName, String warFileUrl, String jwtSecretKey) throws IOException - Throws:
IOException
-
deleteApplication
-
runCreateAppScript
-
runCreateAppScript
-
runDeleteAppScript
-
getClusterNotifier
-
runCommand
-
getProcess
- Throws:
IOException
-
getProcessBuilder
-
setVertx
public void setVertx(io.vertx.core.Vertx vertx) -
setWarDeployer
-