Class RestServiceV2

java.lang.Object
io.antmedia.console.rest.CommonRestService
io.antmedia.console.rest.RestServiceV2

@Component @Path("/v2") public class RestServiceV2 extends CommonRestService
  • Constructor Details

    • RestServiceV2

      public RestServiceV2()
  • Method Details

    • addUser

      @POST @Path("/users") @Produces("application/json") @Consumes("application/json") public Result addUser(User user)
      Description copied from class: CommonRestService
      Add user account on db. Username must be unique, if there is a user with the same name, user will not be created userType = 0 means ready only account userType = 1 means read-write account Post method should be used. application/json form parameters - case sensitive "userName", "password", "userType
      Overrides:
      addUser in class CommonRestService
      Parameters:
      user - : The user to be added
      Returns:
      JSON data if user is added success will be true if user is not added success will be false if user is not added, errorId = 1 means username already exist
    • editUser

      @PUT @Path("/users") @Produces("application/json") @Consumes("application/json") public Result editUser(User user)
      Overrides:
      editUser in class CommonRestService
    • deleteUser

      @DELETE @Path("/users/{username}") @Produces("application/json") @Consumes("application/x-www-form-urlencoded") public Result deleteUser(@PathParam("username") String userName)
      Overrides:
      deleteUser in class CommonRestService
    • getBlockedStatus

      @GET @Consumes("application/json") @Path("/users/{usermail}/blocked") @Produces("application/json") public Result getBlockedStatus(@PathParam("usermail") String usermail)
      Overrides:
      getBlockedStatus in class CommonRestService
    • getUserList

      @GET @Path("/user-list") @Produces("application/json") public List<User> getUserList()
      Overrides:
      getUserList in class CommonRestService
    • isAdmin

      @GET @Path("/admin-status") @Produces("application/json") @Consumes("application/json") public Result isAdmin()
      Overrides:
      isAdmin in class CommonRestService
    • addInitialUser

      @POST @Path("/users/initial") @Produces("application/json") @Consumes("application/json") public Result addInitialUser(User user)
      Overrides:
      addInitialUser in class CommonRestService
    • isFirstLogin

      @GET @Path("/first-login-status") @Produces("application/json") @Consumes("application/json") public Result isFirstLogin()
      Overrides:
      isFirstLogin in class CommonRestService
    • authenticateUser

      @POST @Path("/users/authenticate") @Produces("application/json") @Consumes("application/json") public Result authenticateUser(User user)
      Description copied from class: CommonRestService
      Authenticates user with userName and password
      Overrides:
      authenticateUser in class CommonRestService
      Parameters:
      user - : The User object to be authenticated
      Returns:
      json that shows user is authenticated or not
    • deleteSession

      @DELETE @Path("/users/logout") @Produces("application/json") @Consumes("application/json") public Result deleteSession()
      Overrides:
      deleteSession in class CommonRestService
    • changeUserPassword

      @POST @Path("/users/password") @Produces("application/json") @Consumes("application/json") public Result changeUserPassword(User user)
      Overrides:
      changeUserPassword in class CommonRestService
    • isAuthenticatedRest

      @GET @Path("/authentication-status") @Produces("application/json") public Result isAuthenticatedRest()
      Overrides:
      isAuthenticatedRest in class CommonRestService
    • getSystemInfo

      @GET @Path("/system-status") @Produces("application/json") public String getSystemInfo()
      Overrides:
      getSystemInfo in class CommonRestService
    • getJVMMemoryInfo

      @GET @Path("/jvm-memory-status") @Produces("application/json") public String getJVMMemoryInfo()
      Overrides:
      getJVMMemoryInfo in class CommonRestService
    • getSystemMemoryInfo

      @GET @Path("/system-memory-status") @Produces("application/json") public String getSystemMemoryInfo()
      Overrides:
      getSystemMemoryInfo in class CommonRestService
    • getFileSystemInfo

      @GET @Path("/file-system-status") @Produces("application/json") public String getFileSystemInfo()
      Overrides:
      getFileSystemInfo in class CommonRestService
    • getCPUInfo

      @GET @Path("/cpu-status") @Produces("application/json") public String getCPUInfo()
      Description copied from class: CommonRestService
      getProcessCpuTime: microseconds CPU time used by the process getSystemCpuLoad: "% recent cpu usage" for the whole system. getProcessCpuLoad: "% recent cpu usage" for the Java Virtual Machine process.
      Overrides:
      getCPUInfo in class CommonRestService
      Returns:
      the CPU load info
    • getThreadDump

      @GET @Path("/thread-dump") @Produces("text/plain") public String getThreadDump()
      Overrides:
      getThreadDump in class CommonRestService
    • getThreadDumpJSON

      @GET @Path("/thread-dump-json") @Produces("application/json") public String getThreadDumpJSON()
      Overrides:
      getThreadDumpJSON in class CommonRestService
    • getThreadsInfo

      @GET @Path("/threads") @Produces("application/json") public String getThreadsInfo()
      Overrides:
      getThreadsInfo in class CommonRestService
    • getHeapDump

      @GET @Path("/heap-dump") @Produces("application/octet-stream") public jakarta.ws.rs.core.Response getHeapDump()
      Overrides:
      getHeapDump in class CommonRestService
    • getServerTime

      @GET @Path("/server-time") @Produces("application/json") public String getServerTime()
      Description copied from class: CommonRestService
      Return server uptime and startime in milliseconds
      Overrides:
      getServerTime in class CommonRestService
      Returns:
      JSON object contains the server uptime and start time
    • getSystemResourcesInfo

      @GET @Path("/system-resources") @Produces("application/json") public String getSystemResourcesInfo()
      Overrides:
      getSystemResourcesInfo in class CommonRestService
    • getGPUInfo

      @GET @Path("/gpu-status") @Produces("application/json") public String getGPUInfo()
      Overrides:
      getGPUInfo in class CommonRestService
    • getVersion

      @GET @Path("/version") @Produces("application/json") public String getVersion()
      Overrides:
      getVersion in class CommonRestService
    • triggerGc

      @POST @Path("/system/gc") @Produces("application/json") public Result triggerGc()
    • getApplications

      @GET @Path("/applications") @Produces("application/json") public String getApplications()
      Overrides:
      getApplications in class CommonRestService
    • getTotalLiveStreamSize

      @GET @Path("/live-clients-size") @Produces("application/json") public String getTotalLiveStreamSize()
    • getApplicationInfo

      @GET @Path("/applications-info") @Produces("application/json") public String getApplicationInfo()
      Overrides:
      getApplicationInfo in class CommonRestService
    • getAppLiveStreams

      @GET @Path("/applications/live-streams/{appname}") @Produces("application/json") public String getAppLiveStreams(@PathParam("appname") String name)
      Description copied from class: CommonRestService
      Refactor remove this function and use ProxyServlet to get this info Before deleting check web panel does not use it
      Overrides:
      getAppLiveStreams in class CommonRestService
      Parameters:
      name - : application name
      Returns:
      live streams in the application
    • changeSettings

      @POST @Path("/applications/settings/{appname}") @Produces("application/json") @Consumes("application/json") public String changeSettings(@PathParam("appname") String appname, AppSettings newSettings)
      Overrides:
      changeSettings in class CommonRestService
    • isShutdownProperly

      @GET @Path("/shutdown-proper-status") @Produces("application/json") @Consumes("application/json") public jakarta.ws.rs.core.Response isShutdownProperly(@QueryParam("appNames") String appNamesArray)
      Overrides:
      isShutdownProperly in class CommonRestService
    • setShutdownStatus

      @GET @Path("/shutdown-properly") @Produces("application/json") @Consumes("application/json") public boolean setShutdownStatus(@QueryParam("appNames") String appNamesArray)
      Overrides:
      setShutdownStatus in class CommonRestService
    • changeServerSettings

      @POST @Path("/server-settings") @Produces("application/json") @Consumes("application/json") public String changeServerSettings(ServerSettings serverSettings)
      Overrides:
      changeServerSettings in class CommonRestService
    • configureSsl

      @POST @Path("/ssl-settings") @Consumes("multipart/form-data") @Produces("application/json") public Result configureSsl(@QueryParam("domain") String domain, @QueryParam("type") String type, InputStream fullChainFile, org.glassfish.jersey.media.multipart.FormDataContentDisposition fullChainFileDetail, InputStream privateKeyFile, org.glassfish.jersey.media.multipart.FormDataContentDisposition privateKeyFileDetail, InputStream chainFile, org.glassfish.jersey.media.multipart.FormDataContentDisposition chainFileDetail)
      Overrides:
      configureSsl in class CommonRestService
    • isEnterpriseEdition

      @GET @Path("/enterprise-edition") @Produces("application/json") public Result isEnterpriseEdition()
      Overrides:
      isEnterpriseEdition in class CommonRestService
    • getSettings

      @GET @Path("/applications/settings/{appname}") @Produces("application/json") public AppSettings getSettings(@PathParam("appname") String appname)
      Overrides:
      getSettings in class CommonRestService
    • getServerSettings

      @GET @Path("/server-settings") @Produces("application/json") public ServerSettings getServerSettings()
      Overrides:
      getServerSettings in class CommonRestService
    • getLicenceStatus

      @GET @Path("/licence-status") @Produces("application/json") @Consumes("application/json") public Licence getLicenceStatus(@QueryParam("key") String key)
      Overrides:
      getLicenceStatus in class CommonRestService
    • getLicenceStatus

      @GET @Path("/last-licence-status") @Produces("application/json") @Consumes("application/json") public Licence getLicenceStatus()
      Overrides:
      getLicenceStatus in class CommonRestService
    • resetBroadcast

      @POST @Path("/applications/{appname}/reset") @Produces("application/json") @Consumes("application/json") public Result resetBroadcast(@PathParam("appname") String appname)
      Description copied from class: CommonRestService
      This method resets the viewers counts and broadcast status in the db. This should be used to recover db after server crashes. It's not intended to use to ignore the crash
      Overrides:
      resetBroadcast in class CommonRestService
      Parameters:
      appname - the application name that broadcasts will be reset
      Returns:
    • isInClusterMode

      @GET @Path("/cluster-mode-status") @Produces("application/json") public Result isInClusterMode()
      Overrides:
      isInClusterMode in class CommonRestService
    • getLogFile

      @GET @Path("/log-file/{offsetSize}/{charSize}") @Produces("application/json") public String getLogFile(@PathParam("charSize") int charSize, @QueryParam("logType") String logType, @PathParam("offsetSize") long offsetSize) throws IOException
      Overrides:
      getLogFile in class CommonRestService
      Throws:
      IOException
    • createApplication

      @POST @Consumes("application/json") @Path("/applications/{appName}") @Produces("application/json") public Result createApplication(@PathParam("appName") String appName)
    • createApplication

      @PUT @Consumes("multipart/form-data") @Path("/applications/{appName}") @Produces("application/json") public Result createApplication(@PathParam("appName") String appName, InputStream inputStream)
      Overrides:
      createApplication in class CommonRestService
    • isApplicationExists

      public boolean isApplicationExists(String appName)
    • deleteApplication

      @DELETE @Path("/applications/{appName}") @Produces("application/json") public Result deleteApplication(@PathParam("appName") String appName, @QueryParam("deleteDB") boolean deleteDB)
      Overrides:
      deleteApplication in class CommonRestService
    • liveness

      @GET @Path("/liveness") @Produces("application/json") public jakarta.ws.rs.core.Response liveness()
    • getHostname

      public String getHostname()