Class ServerSettings

java.lang.Object
io.antmedia.settings.ServerSettings
All Implemented Interfaces:
Serializable, Aware, ApplicationContextAware

@PropertySource("/conf/red5.properties") public class ServerSettings extends Object implements ApplicationContextAware, Serializable
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • BEAN_NAME

      public static final String BEAN_NAME
      See Also:
    • SETTINGS_HEART_BEAT_ENABLED

      private static final String SETTINGS_HEART_BEAT_ENABLED
      See Also:
    • SETTINGS_USE_GLOBAL_IP

      private static final String SETTINGS_USE_GLOBAL_IP
      See Also:
    • SETTINGS_PROXY_ADDRESS

      private static final String SETTINGS_PROXY_ADDRESS
      See Also:
    • SETTINGS_NODE_GROUP

      private static final String SETTINGS_NODE_GROUP
      See Also:
    • LOG_LEVEL_ALL

      public static final String LOG_LEVEL_ALL
      See Also:
    • LOG_LEVEL_TRACE

      public static final String LOG_LEVEL_TRACE
      See Also:
    • LOG_LEVEL_DEBUG

      public static final String LOG_LEVEL_DEBUG
      See Also:
    • LOG_LEVEL_INFO

      public static final String LOG_LEVEL_INFO
      See Also:
    • LOG_LEVEL_WARN

      public static final String LOG_LEVEL_WARN
      See Also:
    • LOG_LEVEL_ERROR

      public static final String LOG_LEVEL_ERROR
      See Also:
    • LOG_LEVEL_OFF

      public static final String LOG_LEVEL_OFF
      See Also:
    • DEFAULT_NODE_GROUP

      public static final String DEFAULT_NODE_GROUP
      See Also:
    • SETTINGS_CPU_MEASUREMENT_PERIOD_MS

      private static final String SETTINGS_CPU_MEASUREMENT_PERIOD_MS
      See Also:
    • SETTINGS_CPU_MEASUREMENT_WINDOW_SIZE

      private static final String SETTINGS_CPU_MEASUREMENT_WINDOW_SIZE
      See Also:
    • SETTINGS_SERVER_DEFAULT_HTTP_PORT

      private static final String SETTINGS_SERVER_DEFAULT_HTTP_PORT
      See Also:
    • SETTINGS_ORIGIN_PORT

      private static final String SETTINGS_ORIGIN_PORT
      See Also:
    • SETTINGS_SRT_PORT

      private static final String SETTINGS_SRT_PORT
      See Also:
    • SETTINGS_RTMP_PORT

      private static final String SETTINGS_RTMP_PORT
      See Also:
    • ALLOWED_DASH_BOARD_CIDR

      private static final String ALLOWED_DASH_BOARD_CIDR
      See Also:
    • SETTINGS_NATIVE_LOG_LEVEL

      private static final String SETTINGS_NATIVE_LOG_LEVEL
      See Also:
    • SETTINGS_LOG_LEVEL

      private static final String SETTINGS_LOG_LEVEL
      See Also:
    • SETTINGS_LICENSE_KEY

      private static final String SETTINGS_LICENSE_KEY
      See Also:
    • SETTINGS_SERVER_NAME

      private static final String SETTINGS_SERVER_NAME
      See Also:
    • SETTINGS_MARKET_PLACE_NAME

      private static final String SETTINGS_MARKET_PLACE_NAME
      See Also:
    • SETTINGS_JWT_SERVER_SECRET_KEY

      public static final String SETTINGS_JWT_SERVER_SECRET_KEY
      See Also:
    • SETTINGS_JWT_SERVER_CONTROL_ENABLED

      public static final String SETTINGS_JWT_SERVER_CONTROL_ENABLED
      jwt server filter control
      See Also:
    • SETTINGS_JWKS_URL

      public static final String SETTINGS_JWKS_URL
      See Also:
    • SETTINGS_SERVER_STATUS_WEBHOOK_URL

      private static final String SETTINGS_SERVER_STATUS_WEBHOOK_URL
      See Also:
    • allowedDashboardCIDR

      @Value("${server.allowed_dashboard_CIDR:\'0.0.0.0/0\'}") private String allowedDashboardCIDR
      The IP filter that is allowed to access the web panel of Ant Media Server
    • allowedCIDRList

      private transient Queue<org.apache.catalina.util.NetMask> allowedCIDRList
    • logger

      private static org.slf4j.Logger logger
    • localHostAddress

      private static String localHostAddress
    • globalHostAddress

      private static String globalHostAddress
    • hostAddress

      private String hostAddress
    • serverName

      @Value("${server.name:#{null}}") private String serverName
      Fully Qualified Domain Name of the Server. It's used in SSL as well.
    • licenceKey

      @Value("${server.licence_key:#{null}}") private String licenceKey
      Customer License Key
    • buildForMarket

      private boolean buildForMarket
      The setting for customized marketplace build. It's initialized by getting the value from the LicenceBean
    • marketplace

      @Value("${server.marketplace:#{null}}") private String marketplace
      Name of the marketplace
    • logLevel

      @Value("${logLevel:\'INFO\'}") private String logLevel
    • offlineLicense

      private boolean offlineLicense
      if the license is offline. It checks license key against hardware So license key should be provided by Ant Media specifically. It's initialized by getting the value from the LicenceBean
    • nativeLogLevel

      @Value("${nativeLogLevel:\'ERROR\'}") private String nativeLogLevel
      Native Log Level is used for ffmpeg and WebRTC logs
    • heartbeatEnabled

      @Value("${server.heartbeatEnabled:true}") private boolean heartbeatEnabled
      Enable heart beat for Ant Media Server
    • useGlobalIp

      @Value("${useGlobalIp:false}") private boolean useGlobalIp
      Use global IP address for especially in cluster communication
    • proxyAddress

      @Value("${proxy.address:#{null}}") private String proxyAddress
      The proxy IP address and port for license checking. If there is a proxy in front of Ant Media Server(reverse proxy) please enter its IP and port The format will be : for example: 192.168.0.1:3012
    • nodeGroup

      @Value("${nodeGroup:default}") private String nodeGroup
    • webrtcLogLevel

      private Logging.Severity webrtcLogLevel
    • cpuMeasurementPeriodMs

      @Value("${server.cpu_measurement_period_ms:1000}") private int cpuMeasurementPeriodMs
      CPU load is measured for every period and this measurement is used to understand if server has enough CPU to handle new requests
    • cpuMeasurementWindowSize

      @Value("${server.cpu_measurement_window_size:5}") private int cpuMeasurementWindowSize
      Measured CPU load are added to a list with this size and average of the measure CPU loads are calculated. It's used to check CPU has enough CPU resource
    • defaultHttpPort

      @Value("${http.port:5080}") private int defaultHttpPort
      Server default HTTP port It's 5080 by default
    • jwtServerControlEnabled

      @Value("${server.jwtServerControlEnabled:false}") private boolean jwtServerControlEnabled
      Server JWT Control Enabled to access the REST API of the web panel
    • jwtServerSecretKey

      @Value("${server.jwtServerSecretKey:#{null}}") private String jwtServerSecretKey
      Server JWT secret key "afw7Zz9MqvLiheA5X3GFEKvLWb1JTKC2"
    • jwksURL

      @Value("${server.jwksURL:#{null}}") private String jwksURL
    • originServerPort

      @Value("${server.origin_port:5000}") private int originServerPort
      The port that is opened by origin in cluster mode. Edges are connected to the origin through this port.
    • srtPort

      @Value("${server.srt_port:4200}") private int srtPort
      The SRT port that server opens to listen incoming SRT connections
    • appIngestsSrtStreamsWithoutStreamId

      @Value("${appIngestsSrtStreamsWithoutStreamId:LiveApp}") private String appIngestsSrtStreamsWithoutStreamId
      Nme of the application which will ingestthe SRT Streams that don't have streamid.
    • sslEnabled

      private boolean sslEnabled
    • rtmpPort

      @Value("${rtmp.port:1935}") private int rtmpPort
      The RTMP port that server opens to listen incoming RTMP connections
    • serverStatusWebHookURL

      @Value("${server.statusWebHookURL:#{null}}") private String serverStatusWebHookURL
      Server status webhook url. It's called for several errors such - high resource usage - Unexpected shutdown
  • Constructor Details

    • ServerSettings

      public ServerSettings()
  • Method Details

    • getJwksURL

      public String getJwksURL()
    • setJwksURL

      public void setJwksURL(String jwksURL)
    • isBuildForMarket

      public boolean isBuildForMarket()
    • setBuildForMarket

      public void setBuildForMarket(boolean buildForMarket)
    • getLicenceKey

      public String getLicenceKey()
    • setLicenceKey

      public void setLicenceKey(String licenceKey)
    • getServerName

      public String getServerName()
    • setServerName

      public void setServerName(String serverName)
    • getLogLevel

      public String getLogLevel()
    • setLogLevel

      public void setLogLevel(String logLevel)
    • isHeartbeatEnabled

      public boolean isHeartbeatEnabled()
    • setHeartbeatEnabled

      public void setHeartbeatEnabled(boolean heartbeatEnabled)
    • getHostAddress

      public String getHostAddress()
    • getGlobalHostAddress

      public static String getGlobalHostAddress()
    • getNetworkInterfaces

      public static Enumeration<NetworkInterface> getNetworkInterfaces() throws SocketException
      Throws:
      SocketException
    • getNoneLoopbackHostAddress

      public static InetAddress getNoneLoopbackHostAddress()
    • isLoopBackOrDown

      public static boolean isLoopBackOrDown(NetworkInterface networkInterface) throws SocketException
      Throws:
      SocketException
    • getAddress

      public static InetAddress getAddress(Enumeration<InetAddress> inetAddresses)
    • getLocalHostAddress

      public static String getLocalHostAddress()
    • setApplicationContext

      public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
      Specified by:
      setApplicationContext in interface ApplicationContextAware
      Throws:
      BeansException
    • getHostAddressFromEnvironment

      public String getHostAddressFromEnvironment()
    • isUseGlobalIp

      public boolean isUseGlobalIp()
    • setUseGlobalIp

      public void setUseGlobalIp(boolean useGlobalIp)
    • setProxyAddress

      public void setProxyAddress(String proxyAddress)
    • getProxyAddress

      public String getProxyAddress()
    • setAllowedDashboardCIDR

      public void setAllowedDashboardCIDR(String allowedDashboardCIDR)
      the getAllowedCIDRList and setAllowedCIDRList are synchronized because ArrayList may throw concurrent modification
      Parameters:
      allowedDashboardCIDR -
    • getAllowedDashboardCIDR

      public String getAllowedDashboardCIDR()
    • getAllowedCIDRList

      public Queue<org.apache.catalina.util.NetMask> getAllowedCIDRList()
    • fillFromInput

      private List<String> fillFromInput(String input, Queue<org.apache.catalina.util.NetMask> target)
      Fill a NetMask list from a string input containing a comma-separated list of (hopefully valid) NetMasks.
      Parameters:
      input - The input string
      target - The list to fill
      Returns:
      a string list of processing errors (empty when no errors)
    • getNativeLogLevel

      public String getNativeLogLevel()
    • setNativeLogLevel

      public void setNativeLogLevel(String nativeLogLevel)
    • getWebRTCLogLevel

      public Logging.Severity getWebRTCLogLevel()
    • getNodeGroup

      public String getNodeGroup()
    • setNodeGroup

      public void setNodeGroup(String nodeGroup)
    • getCpuMeasurementPeriodMs

      public int getCpuMeasurementPeriodMs()
    • setCpuMeasurementPeriodMs

      public void setCpuMeasurementPeriodMs(int cpuMeasurementPeriodMs)
    • getCpuMeasurementWindowSize

      public int getCpuMeasurementWindowSize()
    • setCpuMeasurementWindowSize

      public void setCpuMeasurementWindowSize(int cpuMeasurementWindowSize)
    • getDefaultHttpPort

      public int getDefaultHttpPort()
    • setDefaultHttpPort

      public void setDefaultHttpPort(int defaultHttpPort)
    • getOriginServerPort

      public int getOriginServerPort()
    • setOriginServerPort

      public void setOriginServerPort(int originServerPort)
    • getSrtPort

      public int getSrtPort()
    • setSrtPort

      public void setSrtPort(int srtPort)
    • getRtmpPort

      public int getRtmpPort()
    • getMarketplace

      public String getMarketplace()
    • setMarketplace

      public void setMarketplace(String marketplace)
    • getJwtServerSecretKey

      public String getJwtServerSecretKey()
    • setJwtServerSecretKey

      public void setJwtServerSecretKey(String jwtServerSecretKey)
    • isJwtServerControlEnabled

      public boolean isJwtServerControlEnabled()
    • setJwtServerControlEnabled

      public void setJwtServerControlEnabled(boolean jwtServerControlEnabled)
    • isSslEnabled

      public boolean isSslEnabled()
    • setSslEnabled

      public void setSslEnabled(boolean sslEnabled)
    • getServerStatusWebHookURL

      public String getServerStatusWebHookURL()
    • setServerStatusWebHookURL

      public void setServerStatusWebHookURL(String serverStatusWebHookURL)
    • isOfflineLicense

      public boolean isOfflineLicense()
    • setOfflineLicense

      public void setOfflineLicense(boolean offlineLicense)
    • getAppIngestsSrtStreamsWithoutStreamId

      public String getAppIngestsSrtStreamsWithoutStreamId()
    • setAppIngestsSrtStreamsWithoutStreamId

      public void setAppIngestsSrtStreamsWithoutStreamId(String appIngestsSrtStreamsWithoutStreamId)