Interface AdminService


public interface AdminService
FirstSpirit AdminService functions.
Use getService(AdminService.class) to request an instance of this service.
Since:
2.3
See Also:
  • Method Details

    • getProjectStorage

      ProjectStorage getProjectStorage()
      Returns the server's ProjectStorage.
      Returns:
      server's ProjectStorage.
      Since:
      4.0.17
    • getUserStorage

      UserStorage getUserStorage()
      Returns the server's UserStorage.
      Returns:
      server's UserStorage.
      Since:
      4.0.17
    • getScheduleStorage

      ScheduleStorage getScheduleStorage()
      Provides the access object for schedule management.
      Returns:
      The schedule storage.
      Since:
      4.0.17
    • getFontStorage

      FontStorage getFontStorage()
      Provides the access object for installed fonts.
      Returns:
      The font storage.
      Since:
      4.0.17
    • getScriptEngineRegistry

      ScriptEngineRegistry getScriptEngineRegistry()
      Provides access to the registry for script engine support.
      Returns:
      The script engine registry.
      Since:
      4.0.120
    • getServerConfiguration

      @Deprecated ServerConfiguration getServerConfiguration()
      Deprecated.
      Returns server properties.
      Returns:
      server properties.
      Since:
      4.0.17
    • getUsedLayers

      String[] getUsedLayers(ZipFile exportFile) throws IOException
      Get used database layers.
      Parameters:
      exportFile - The export zip file
      Returns:
      String array of database layer names
      Throws:
      IOException - if an I/O error occurs
      Since:
      3.0.87
    • createLanguage

      Language createLanguage(String abbreviation, String name)
      Create a new language. The lowered abbreviation is taken as language code. The abbreviation must be unique.
      Parameters:
      abbreviation - language abbreviation
      name - the name
      Returns:
      the new language
      Throws:
      IllegalArgumentException - if a language with the given abbreviation already exists
      SecurityException - if the user isn't the server admin
      Since:
      2.3
    • createLanguage

      Language createLanguage(String abbreviation, String name, Locale locale)
      Create a new language.
      Parameters:
      abbreviation - language abbreviation
      name - the name
      locale - the locale, can contain a language different from the lowered abbreviation, additional country and region information
      Returns:
      the new language
      Throws:
      IllegalArgumentException - if a language with the given abbreviation already exists
      SecurityException - if the user isn't the server admin
      Since:
      3.0.13
    • setLanguage

      void setLanguage(Language language)
      Write back changed language to the server.
      Parameters:
      language - the changed language
      Throws:
      SecurityException - if the user isn't the server admin
      Since:
      4.0.17
    • deleteLanguage

      void deleteLanguage(Language language)
      Deletes the given language template on the server
      Parameters:
      language - the language to delete
      Throws:
      SecurityException - if the user isn't the server admin
      Since:
      4.0.17
    • getLanguage

      Language getLanguage(String abbreviation)
      Returns the given language or null.
      Since:
      4.0.17
    • getLanguages

      List<Language> getLanguages()
      Get all languages.
      Returns:
      the languages
      Since:
      4.0.17
    • getDatabaseLayer

      @Nullable @Nullable Layer getDatabaseLayer(String name)
      Returns the specified database layer or null if it doesn't exist.
      Parameters:
      name - Layer name.
      Returns:
      Specified layer or null.
      Since:
      4.0.17
    • getDatabaseLayers

      Layer[] getDatabaseLayers()
      Returns all database layers.
      Returns:
      All known layers.
      Since:
      3.0.86
    • createDatabaseLayer

      Layer createDatabaseLayer(String name)
      Creates a new database layer.
      Parameters:
      name - Layer name
      Returns:
      New layer.
      Throws:
      IllegalArgumentException - if a layer with this name already exists.
      SecurityException - if the user isn't the server admin
      Since:
      3.0.86
    • createDatabaseLayer

      void createDatabaseLayer(Layer layer)
      Creates a new database layer.
      Parameters:
      layer - Layer.
      Throws:
      IllegalArgumentException - if a layer with this name already exists.
      SecurityException - if the user isn't the server admin
      Since:
      4.0.17
    • testDatabaseLayer

      void testDatabaseLayer(ConnectionConfiguration config) throws SQLException
      Tests the given layer parameters by connecting the sql server. If no exception occurs, the connection is valid.
      Parameters:
      config - Layer parameters to test.
      Throws:
      SQLException - if any occurs during the test.
      Since:
      4.0.17
    • removeDatabaseLayer

      void removeDatabaseLayer(String name)
      Removes a database layer.
      Parameters:
      name - Layer to remove.
      Throws:
      IllegalArgumentException - if the layer doesn't exist.
      SecurityException - if the user isn't the server admin
      Since:
      4.0.17
    • removeDatabaseLayer

      void removeDatabaseLayer(Layer layer)
      Removes a database layer.
      Parameters:
      layer - Layer to remove.
      Throws:
      IllegalArgumentException - if the layer doesn't exist.
      SecurityException - if the user isn't the server admin
      Since:
      3.0.86
    • setDatabaseLayer

      void setDatabaseLayer(Layer layer)
      Save changes made on a database layer.
      Parameters:
      layer - Layer to save.
      Throws:
      IllegalArgumentException - if the layer doesn't exist.
      SecurityException - if the user isn't the server admin
      Since:
      3.0.86
    • stopServer

      void stopServer()
      Initiates shutdown of the FIRSTspirit Server.
      WARNING: All clients will lose their connection to the server!
      Throws:
      SecurityException - if the user isn't the server admin
      Since:
      4.0.17
    • restartServer

      void restartServer()
      Initiates shutdown of the FIRSTspirit Server with exit code 23. This will restart the Server if it runs with the wrapper - in default config of the wrapper exit code 23 will restart the server
      WARNING: All clients will lose their connection to the server!
      Throws:
      SecurityException - if the user isn't the server admin
      Since:
      4.0.19
    • getConnection

      Connection getConnection()
      Provides access to the connection.
      Returns:
      The bound connection.
      Since:
      4.0.17
    • getServerInfo

      Object getServerInfo(String name, String property, boolean noCache)
      Get server related information from server-registered MBeans. Will first try to access an operation with the given (full) method name. If no such method exists, tries to request an attribute with the given name.
      Parameters:
      name - The name of the information providing MBean.
      property - The name of the operation or the attribute to get the value of.
      noCache - Provide true to prevent that a cached value is returned.
      Returns:
      The stored value or null.
      Since:
      4.0.17
    • isMBeanInstanceOf

      boolean isMBeanInstanceOf(String name, String classString)
      Checks if a server-registered MBean exists and is instanceof the specified class. For example: To get ProcessCpuTime, the OperatingSystem MBean must be instanceof "com.sun.management.OperatingSystemMXBean" - use this method to check.
      Parameters:
      name - The name of the information providing MBean.
      classString - The class name of the mbean, that should be expected
      Returns:
      true if the operation is supported, false otherwise
      Since:
      4.0.63
    • serverBackupPrepare

      void serverBackupPrepare(long prepareTimeout, long backupTimeout) throws TimeoutException
      Call this method to signal the server to prepare for an external server backup. The server tries to prepare for the backup within the given prepareTimeout. If preparation wasn't successful within the prepareTimeout a TimeoutException will be thrown.
      After successful preparation the server will run in backup mode (e.g. reject client requests) for the time specified by backupTimeout. Within this time slot the external backup should be processed. After the time specified by backupTimeout the server will resume normal operation (e.g. allow client calls).
      Call serverBackupDone() to signal the server finishing of external backup.
      Parameters:
      prepareTimeout - The global timeout for the prepare process (in milliseconds)
      backupTimeout - After this period (given in milliseconds) the listeners continue with their normal work, even if no serverBackupDone() has been signaled
      Throws:
      TimeoutException - if given prepareTimeout is hit
      Since:
      4.2.6
      See Also:
    • serverBackupDone

      void serverBackupDone()
      Signal that the external server backup is finished. After calling this method the server will return from backup mode and resume normal operation (e.g. allow client requests).
      Since:
      4.2.6
      See Also:
    • stopMaintenance

      @Deprecated(forRemoval=true) boolean stopMaintenance(long scheduleEntryId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Stop server maintenance mode started by a specific server ScheduleEntry.
      Parameters:
      scheduleEntryId - The id of the server ScheduleEntry which started the server maintenance mode
      Returns:
      Returns true if the server maintenance mode was successfully stopped
      Since:
      5.2.301