Package de.espirit.firstspirit.access
Interface AdminService
public interface AdminService
FirstSpirit AdminService functions.
Use
Use
getService(AdminService.class)
to request an instance of this service.- Since:
- 2.3
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createDatabaseLayer
(Layer layer) Creates a new database layer.createDatabaseLayer
(String name) Creates a new database layer.createLanguage
(String abbreviation, String name) Create a new language.createLanguage
(String abbreviation, String name, Locale locale) Create a new language.void
deleteLanguage
(Language language) Deletes the given language template on the serverProvides access to the connection.@Nullable Layer
getDatabaseLayer
(String name) Returns the specified database layer ornull
if it doesn't exist.Layer[]
Returns all database layers.Provides the access object for installed fonts.getLanguage
(String abbreviation) Returns the given language ornull
.Get all languages.Returns the server'sProjectStorage
.Provides the access object for schedule management.Provides access to the registry for script engine support.Deprecated.getServerInfo
(String name, String property, boolean noCache) Get server related information from server-registered MBeans.String[]
getUsedLayers
(ZipFile exportFile) Get used database layers.Returns the server'sUserStorage
.boolean
isMBeanInstanceOf
(String name, String classString) Checks if a server-registered MBean exists and is instanceof the specified class.void
removeDatabaseLayer
(Layer layer) Removes a database layer.void
removeDatabaseLayer
(String name) Removes a database layer.void
Initiates shutdown of the FIRSTspirit Server with exit code 23.void
Signal that the external server backup is finished.void
serverBackupPrepare
(long prepareTimeout, long backupTimeout) Call this method to signal the server to prepare for an external server backup.void
setDatabaseLayer
(Layer layer) Save changes made on a database layer.void
setLanguage
(Language language) Write back changed language to the server.boolean
stopMaintenance
(long scheduleEntryId) Deprecated, for removal: This API element is subject to removal in a future version.since 5.2.518, 5.2.605 - useMaintenanceModeAgent.stopMaintenanceMode(MaintenanceModeInfo)
.void
Initiates shutdown of the FIRSTspirit Server.void
Tests the given layer parameters by connecting the sql server.
-
Method Details
-
getProjectStorage
ProjectStorage getProjectStorage()Returns the server'sProjectStorage
.- Returns:
- server's
ProjectStorage
. - Since:
- 4.0.17
-
getUserStorage
UserStorage getUserStorage()Returns the server'sUserStorage
.- 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.since 4.0.17 - useConnection.getServerConfiguration()
Returns server properties.- Returns:
- server properties.
- Since:
- 4.0.17
-
getUsedLayers
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
Create a new language. The lowered abbreviation is taken as language code. The abbreviation must be unique.- Parameters:
abbreviation
- language abbreviationname
- the name- Returns:
- the new language
- Throws:
IllegalArgumentException
- if a language with the given abbreviation already existsSecurityException
- if the user isn't theserver admin
- Since:
- 2.3
-
createLanguage
Create a new language.- Parameters:
abbreviation
- language abbreviationname
- the namelocale
- 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 existsSecurityException
- if the user isn't theserver admin
- Since:
- 3.0.13
-
setLanguage
Write back changed language to the server.- Parameters:
language
- the changed language- Throws:
SecurityException
- if the user isn't theserver admin
- Since:
- 4.0.17
-
deleteLanguage
Deletes the given language template on the server- Parameters:
language
- the language to delete- Throws:
SecurityException
- if the user isn't theserver admin
- Since:
- 4.0.17
-
getLanguage
Returns the given language ornull
.- Since:
- 4.0.17
-
getLanguages
Get all languages.- Returns:
- the languages
- Since:
- 4.0.17
-
getDatabaseLayer
Returns the specified database layer ornull
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
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 theserver admin
- Since:
- 3.0.86
-
createDatabaseLayer
Creates a new database layer.- Parameters:
layer
- Layer.- Throws:
IllegalArgumentException
- if a layer with this name already exists.SecurityException
- if the user isn't theserver admin
- Since:
- 4.0.17
-
testDatabaseLayer
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
Removes a database layer.- Parameters:
name
- Layer to remove.- Throws:
IllegalArgumentException
- if the layer doesn't exist.SecurityException
- if the user isn't theserver admin
- Since:
- 4.0.17
-
removeDatabaseLayer
Removes a database layer.- Parameters:
layer
- Layer to remove.- Throws:
IllegalArgumentException
- if the layer doesn't exist.SecurityException
- if the user isn't theserver admin
- Since:
- 3.0.86
-
setDatabaseLayer
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 theserver 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 theserver 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 theserver admin
- Since:
- 4.0.19
-
getConnection
Connection getConnection()Provides access to the connection.- Returns:
- The bound connection.
- Since:
- 4.0.17
-
getServerInfo
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
- Providetrue
to prevent that a cached value is returned.- Returns:
- The stored value or
null
. - Since:
- 4.0.17
-
isMBeanInstanceOf
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
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 aTimeoutException
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).
CallserverBackupDone()
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 noserverBackupDone()
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, for removal: This API element is subject to removal in a future version.since 5.2.518, 5.2.605 - useMaintenanceModeAgent.stopMaintenanceMode(MaintenanceModeInfo)
.Stop server maintenance mode started by a specific serverScheduleEntry
.- Parameters:
scheduleEntryId
- The id of the serverScheduleEntry
which started the server maintenance mode- Returns:
- Returns
true
if the server maintenance mode was successfully stopped - Since:
- 5.2.301
-
Connection.getServerConfiguration()