Class ServerSettings
- All Implemented Interfaces:
IServerSettings
,EventListener
,IGProp<GProp<?>[]>
,IPropCnr
,Cloneable
- Direct Known Subclasses:
EditorServerSettings
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Flag to allow file upload, default false.static final String
Authentication required: basic.static final String
Default base name without file extension of the iiziServer configuration file: "config".static final String
Default name of the iiziServer configuration file: "config.iiziServer".static final String
The extension of the iiziServer configuration file: ".iiziServer".static final String
Database tables auto-creation flag, default true.static final String
Database server auto-start (Derby Database Server running on same machine), default true.static final String
Database directory (local embedded Derby), default "db".static final String
Database server host name or address (remote Derby).static final String
Maximum age of cached database files: milliseconds.static final String
Maximum number of cached database files.static final String
Database server port number, default 1527.static final long
Default maximum age of cached database files: 90 days or 7_776_000_000 milliseconds.static final int
Default maximum number of cached database files: 10_000.static final String
The default directory for the file provider root.static final int
Default history size = 500.static final int
Default log level = ILog.INFO.static final String
Default log file name.static final int
The default maximum count of current thumbnail requests to "urlbox.io", default 5.static final int
The default maximum history size for geolocation entries per user.static final int
Default max log file size in MB = 50 MB, undefined = unlimited (-1).static final int
Default value for maximum server key age: 90 days.static final int
Default maximum upload size: 50 MB.static final String
The default server configuration environment.static final String
Default directory name for file upload = "uploads";static final String
Property name for "directory listing allowed".static final String
Timeout before an app session is disposed of when no more client sessions are present, default 10 minutes.static final String
Property name for external server URL, including protocol and potential port number (if different from protocol port).static final String
Root directory relative the server's current directory where to place external files provided for remote usage over the web server.static final String
The Gzip boolean setting.static final String
Heartbeat interval in seconds to keep communication link up, default 45 seconds.static final String
Timeout before a client session is disposed when it has not processes any transactions, default 2 hours.static final String
Old log compression: 0=none, 1=gzip (default), 2=xz.static final String
The history size.static final String
Log level.static final String
Log to console.static final String
Log file name.static final String
The maximum count of current thumbnail requests to "urlbox.io", default 10.static final String
The maximum history size for geolocation entries per user.static final String
Max size of log file before new file.static final String
Maximum server key age in days: "maxServerKeyAge".static final String
Maximum upload size in MB.static final String
The authentication realm.static final String
The file name for authentication realm properties, default "authentication-realm-properties.txt" in the current directory of the server.static final String
The return code to use when web server receives HTTP requests to redirect to HTTPS.static final String
Property name of "count of strings in transactional cache".static final String
Property name of "maximum string length of a transactional cache".static final String
Property name of "minimum string length of a transactional cache".static final String
Directory name for file upload.static final String
The "urlbox.io" API key.static final String
The web server maximum thread idle time settings.static final String
Property name for the logger directory for web server log files.static final String
Property name for the number of days to retain web server log files.static final String
Property name for the time zone ID for logging web server requests.static final String
The web server maximum number of threads setting.static final String
The web server minimum number of threads setting.static final String
The web server number of reserved threads setting.Fields inherited from class com.iizix.prop.PropCnr
EMPTY, EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_ID
Fields inherited from class com.iizix.prop.GProp
GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2
Fields inherited from interface com.iizix.prop.IGProp
EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_INCLUDE_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
Constructor Summary
ConstructorDescriptionCreates the server settings without a name.ServerSettings
(Atom atom) Creates the server settings with a name.Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds the predefined containers for identifications, fields and actions.clone()
Creates a clone out of this property.protected PolicyProps
createPolicyProps
(Atom atom) Creates a policy property with the specified atom name.Gets the password policy for administrators.Gets the realm for authentication.int[]
Gets the cache parameters as 3 integers in an array, param[0] is minLength, param[1] is maxLength, param[2] is count.long
Timeout before an app session is disposed of when no more client sessions are present, default 10 minutes.long
Heartbeat interval in seconds to keep communication link up, default 45 seconds.long
Gets the timeout before a client session is disposed when it has not processes any transactions, default 2 hours.long
Gets the maximum file age of cached database files.int
Gets the maximum number of cached database files.Gets the default Server configuration environment name.Gets the description of the Server.Gets the external server URL, including protocol and potential port number (if different from protocol port).Gets the root directory relative the server's current directory where to place external files provided for remote usage over the web server.Gets the upload directory where files are placed in a staging area.Gets the Let's Encrypt domains.Gets the log file name.int
Gets the history size for events kept in-memory for the server administration program to retrieve.int
Gets the log level to use.boolean
Logging output also to console.getMailSender
(String name, ExecutorService executorService, File baseDir) Gets the mail sender with the specified name.int
The maximum count of current thumbnail requests to "urlbox.io", default 5.int
Gets the maximum number of geolocation entries per user in the history.long
Gets the maximum log file size.int
Gets the maximum server key age in days.int
Returns the maximum size of any uploaded file in MB.Gets the configured ports.Gets the file name for the authentication realm properties.getRegionLocationAPIKey
(String providerName) Gets the API key for a region location service provider.int
Gets the global cache size for the region location service providers.Gets the root directory for external files.Gets the configuration environment of a name.Gets the array of configuration environments present.Gets the "urlbox.io" API key.Gets the password policy for users.int
Get the web server maximum thread idle time, default is 60 seconds, 60_000 milliseconds.Gets the logger directory for web server log files.int
Gets the number of days to retain web server log files.Gets the time zone ID for logging web server requests.int
Get the web server maximum number of threads, default is 200.int
Get the web server minimum number of threads, default is 8.int
The return code to use when web server receives HTTP requests to redirect to HTTPS.int
Get the web server number of reserved threads, default to -1.boolean
Checks if basic authentication should be used.boolean
Flag for directory listing allowed.boolean
Checks if file upload is enabled or not.void
Called when the application is loaded.void
Called when an application is instantiated and started by a user session.void
Called when an application is stopped.void
Called when the application is unloaded.protected void
Called when loaded to update the ServerProps instance.void
setCacheParams
(int minLength, int maxLength, int count) Sets the parameters for cache: minLength, maxLength, count.boolean
setDescription
(String descr) Sets the description of the server.boolean
setExternalHostName
(String extServerURL) Sets the external server URL, including protocol and potential port number (if different from protocol port).boolean
setRootDirectory
(String root) Sets the root directory for external files.boolean
useGzip()
Flag if Gzip compression should be used in the web server.boolean
verify
(PropVerification verification) Verifies this property container.Methods inherited from class com.iizix.prop.PropCnr
__transferChildProps, addProp, addProp, addProp2, addProp2, appendPropValue, canRequestFocus, completeVirtualize, containsProp, containsProp, convertLoadedProp, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, enablePropCommunication, enablePropHashMap, equalsTree, equalsTree, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsContainer, getExtendsError, getExtendsName, getExtendsOverride, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getPredefinedProps, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue0, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasFocus, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropDispose, onPropRemoved, onPropTreeInitialized, onReferenceEvent, onVirtualContainerCreated, onVirtualizationCompleted, paramString, prepare, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, replaceProps, requestFocus, requestFocus, requestFocusEx, requestFocusEx, resolveReferences, resolveRuntimeReferences, setBool, setBool, setBool, setBool, setCreateRequiredProp, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, shouldCreateProps, shouldSerializeToXML, toElementString, toNativeValue0, usePropHashMap, usesPropIndex, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verifyInternalUseOnly, verifyTree, virtualize
Methods inherited from class com.iizix.prop.GProp
addPropError, addPropListener, appendProp, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferencePropNameNoAssert, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParentNoAssert, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, isSibling, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropValueSet, onRemoteEvent, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.iizix.prop.IGProp
addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, isSibling, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onEventSelf, onRemoteEvent, removePropError, removePropListener, renameProp, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning
Methods inherited from interface com.iizix.prop.IPropCnr
canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized
Field Details
CONFIG_FILE_EXT
The extension of the iiziServer configuration file: ".iiziServer".- See Also:
CONFIG_FILE_DEFAULT_BASE_NAME
Default base name without file extension of the iiziServer configuration file: "config".- See Also:
CONFIG_FILE_DEFAULT_NAME
Default name of the iiziServer configuration file: "config.iiziServer".- See Also:
DEFAULT_SERVER_CONFIG_ENV
The default server configuration environment.- See Also:
IDLE_TIMEOUT
Timeout before a client session is disposed when it has not processes any transactions, default 2 hours. Range is 2 minutes to 2 days. The idle timeout includes dormant session timeout.- See Also:
DORMANT_TIMEOUT
Timeout before an app session is disposed of when no more client sessions are present, default 10 minutes. Range is 30 seconds to 12 hours.- See Also:
HEARTBEAT_INTERVAL
Heartbeat interval in seconds to keep communication link up, default 45 seconds. Range is 30 seconds to 5 minutes.- See Also:
TRANS_CACHE_MIN
Property name of "minimum string length of a transactional cache".- See Also:
TRANS_CACHE_MAX
Property name of "maximum string length of a transactional cache".- See Also:
TRANS_CACHE_COUNT
Property name of "count of strings in transactional cache".- See Also:
REDIRECT_CODE_HTTP_to_HTTPS
The return code to use when web server receives HTTP requests to redirect to HTTPS. Can be 0 = no redirection, 301 = moved permanently, 302 = moved temporarily (default).- See Also:
EXTERNAL_SERVER_URL
Property name for external server URL, including protocol and potential port number (if different from protocol port).This setting must be set if the retrieval of the local host name e.g. does not include the domain DNS suffix, or that the name is known on external nets differently than on the internal network. This host name is typically used for the OAuth 2.0 authentication callback URL's.
- See Also:
WS_LOG_DIR
Property name for the logger directory for web server log files.- See Also:
WS_LOG_RETAIN_DAYS
Property name for the number of days to retain web server log files.- See Also:
WS_LOG_TIME_ZONE
Property name for the time zone ID for logging web server requests.- See Also:
DIR_LIST
Property name for "directory listing allowed".- See Also:
GZIP
The Gzip boolean setting.- See Also:
WS_IDLE_TIMEOUT
The web server maximum thread idle time settings.- See Also:
WS_MAX_THREADS
The web server maximum number of threads setting.- See Also:
WS_MIN_THREADS
The web server minimum number of threads setting.- See Also:
WS_RESERVED_THREADS
The web server number of reserved threads setting.- See Also:
REALM
The authentication realm.- See Also:
REALM_PROPERTIES
The file name for authentication realm properties, default "authentication-realm-properties.txt" in the current directory of the server.- See Also:
AUTH_BASIC
Authentication required: basic.- See Also:
MAX_SERVER_KEY_AGE
Maximum server key age in days: "maxServerKeyAge".- See Also:
DEFAULT_MAX_SERVER_KEY_AGE
public static final int DEFAULT_MAX_SERVER_KEY_AGEDefault value for maximum server key age: 90 days.- See Also:
FILE_PROVIDER_ROOT
Root directory relative the server's current directory where to place external files provided for remote usage over the web server.- See Also:
DEFAULT_FILE_PROVIDER_ROOT
The default directory for the file provider root.- See Also:
URLBOX_IO_API_KEY
The "urlbox.io" API key. You will find this key on your Dashboard when you login to "urlbox.io".- See Also:
MAX_CONCURRENT_THUMBNAILS_COUNT
The maximum count of current thumbnail requests to "urlbox.io", default 10.Be careful not to exceed your quota, there are different plans available.
- See Also:
DEFAULT_MAX_CONCURRENT_THUMBNAILS_COUNT
public static final int DEFAULT_MAX_CONCURRENT_THUMBNAILS_COUNTThe default maximum count of current thumbnail requests to "urlbox.io", default 5.- See Also:
MAX_HISTORY_LOCATION
The maximum history size for geolocation entries per user.- See Also:
DEFAULT_MAX_HISTORY_LOCATION
public static final int DEFAULT_MAX_HISTORY_LOCATIONThe default maximum history size for geolocation entries per user.- See Also:
DB_AUTO_CREATE
Database tables auto-creation flag, default true.- See Also:
DB_DIRECTORY
Database directory (local embedded Derby), default "db".- See Also:
DB_HOST
Database server host name or address (remote Derby).- See Also:
DB_PORT
Database server port number, default 1527.- See Also:
DB_AUTO_START
Database server auto-start (Derby Database Server running on same machine), default true.- See Also:
DB_MAX_FILE_COUNT
Maximum number of cached database files.- See Also:
DEFAULT_DB_MAX_FILE_COUNT
public static final int DEFAULT_DB_MAX_FILE_COUNTDefault maximum number of cached database files: 10_000.- See Also:
DB_MAX_FILE_AGE
Maximum age of cached database files: milliseconds.- See Also:
DEFAULT_DB_MAX_FILE_AGE
public static final long DEFAULT_DB_MAX_FILE_AGEDefault maximum age of cached database files: 90 days or 7_776_000_000 milliseconds.- See Also:
LOGFILE_NAME
Log file name.- See Also:
DEFAULT_LOGFILE_NAME
Default log file name.- See Also:
MAX_LOGFILE_SIZE
Max size of log file before new file.- See Also:
DEFAULT_MAX_LOGFILE_SIZE
public static final int DEFAULT_MAX_LOGFILE_SIZEDefault max log file size in MB = 50 MB, undefined = unlimited (-1).- See Also:
LOG_LEVEL
Log level.- See Also:
DEFAULT_LOG_LEVEL
public static final int DEFAULT_LOG_LEVELDefault log level = ILog.INFO.- See Also:
LOG_TO_CONSOLE
Log to console.- See Also:
LOG_HISTORY_SIZE
The history size.- See Also:
LOG_COMPRESS
Old log compression: 0=none, 1=gzip (default), 2=xz.- See Also:
DEFAULT_LOG_HISTORY_SIZE
public static final int DEFAULT_LOG_HISTORY_SIZEDefault history size = 500.- See Also:
ALLOW_UPLOAD
Flag to allow file upload, default false.- See Also:
MAX_UPLOAD_SIZE
Maximum upload size in MB.- See Also:
DEFAULT_MAX_UPLOAD_SIZE
public static final int DEFAULT_MAX_UPLOAD_SIZEDefault maximum upload size: 50 MB.- See Also:
UPLOAD_DIRECTORY
Directory name for file upload.- See Also:
DEFAULT_UPLOAD_DIRECTORY
Default directory name for file upload = "uploads";- See Also:
Constructor Details
ServerSettings
public ServerSettings()Creates the server settings without a name. The name must be set in all cases using thesetPropertyAtom
call.ServerSettings
Creates the server settings with a name.- Parameters:
atom
- The name of the property.
Method Details
addPredefinedProps
Adds the predefined containers for identifications, fields and actions. This method is overridden fully by the Editor versions of the class.- Overrides:
addPredefinedProps
in classPropCnr
- Throws:
PropException
- for property exceptions.
clone
Creates a clone out of this property. The cloning is overridden by the subclasses in order to handle cloning of its class variables appropriately.getDescription
Gets the description of the Server.- Specified by:
getDescription
in interfaceIServerSettings
- Returns:
- The description, "iiziServer" for default.
setDescription
Sets the description of the server.- Parameters:
descr
- New server description, non-null.- Throws:
NullPointerException
- ifdescr
ifnull
.
getLogFileName
Gets the log file name.- Returns:
- The log file name, default "logs/server.log".
getMaximumLogFileSize
public long getMaximumLogFileSize()Gets the maximum log file size.- Returns:
- The maximum log file size, zero for no maximum.
getLogLevel
public int getLogLevel()Gets the log level to use.- Returns:
- The log level as defined in
, range isILog
toILog.SEVERE
.ILog.FINEST
getLogToConsole
public boolean getLogToConsole()Logging output also to console.- Returns:
- true to write log to console as well as to log file, default true.
getLogHistorySize
public int getLogHistorySize()Gets the history size for events kept in-memory for the server administration program to retrieve.- Returns:
- The number of events, minimum 100, maximum 5000, default 500.
getAdministratorPasswordPolicy
Gets the password policy for administrators.- Returns:
- The password policy settings for administrators.
getUserPasswordPolicy
Gets the password policy for users.- Returns:
- The password policy settings for normal users.
createPolicyProps
Creates a policy property with the specified atom name.- Parameters:
atom
- The atom name.- Returns:
- The policy property.
getWSRedirectCodeHTTP_to_HTTPS
public int getWSRedirectCodeHTTP_to_HTTPS()The return code to use when web server receives HTTP requests to redirect to HTTPS. Can be 0 = no redirection, 301 = moved permanently, 302 = moved temporarily (default).- Specified by:
getWSRedirectCodeHTTP_to_HTTPS
in interfaceIServerSettings
- Returns:
- A return code of 0, 301 or 302.
setExternalHostName
Sets the external server URL, including protocol and potential port number (if different from protocol port).This setting must be set if the retrieval of the local host name e.g. does not include the domain DNS suffix, or that the name is known on external nets differently than on the internal network. This host name is typically used for the OAuth 2.0 authentication callback URL's.
- Parameters:
extServerURL
- The URL to use.- Returns:
- true when this property container has been changed, false otherwise (or for error).
- Throws:
NullPointerException
- If extHostName is null.IllegalArgumentException
- If extHostName is empty or not valid.
getExternalHostName
Gets the external server URL, including protocol and potential port number (if different from protocol port).This setting must be set if the retrieval of the local host name e.g. does not include the domain DNS suffix, or that the name is known on external nets differently than on the internal network. This host name is typically used for the OAuth 2.0 authentication callback URL's.
- Returns:
- The URL, or null for none.
setRootDirectory
Sets the root directory for external files. This call is done from a server instance when e.g. the command line overrides the default root in the settings.- Parameters:
root
- The new root.- Returns:
- true when this property container has been changed, false otherwise (or for error).
- Throws:
IOException
- If the directory does not exist.
getRootDirectory
Gets the root directory for external files. If the directory doesn't exist it will be created.- Specified by:
getRootDirectory
in interfaceIServerSettings
- Returns:
- The root directory or "./root" if none is specified. The return String is
null
if the directory cannot be created if not present, or the root is not a readable and writable directory. At the same time, logging will occur.
getWSLogDirectory
Gets the logger directory for web server log files. If the directory doesn't exist it will be created.- Specified by:
getWSLogDirectory
in interfaceIServerSettings
- Returns:
- The root directory or "./logs/web" if none is specified. If the return code is
null
it is assumed no logging will be performed. - Throws:
IOException
- In case the web server log directory is not valid or cannot be created.
getWSLogsRetainDays
public int getWSLogsRetainDays()Gets the number of days to retain web server log files.- Specified by:
getWSLogsRetainDays
in interfaceIServerSettings
- Returns:
- The default is 14, set to zero to disable logging.
getWSLogTimeZone
Gets the time zone ID for logging web server requests.- Specified by:
getWSLogTimeZone
in interfaceIServerSettings
- Returns:
- The Time Zone ID, or GMT (default).
isDirectoryListingAllowed
public boolean isDirectoryListingAllowed()Flag for directory listing allowed.- Specified by:
isDirectoryListingAllowed
in interfaceIServerSettings
- Returns:
- The flag allowing directory listing of the web servers root and subdirectories, default false.
useGzip
public boolean useGzip()Flag if Gzip compression should be used in the web server.- Specified by:
useGzip
in interfaceIServerSettings
- Returns:
- true to enable Gzip (default), false otherwise.
getWSMaxThreads
public int getWSMaxThreads()Get the web server maximum number of threads, default is 200. Range is 20 to 1024, always larger or equal to the minimum threads. An out-of-range value will give the default.- Specified by:
getWSMaxThreads
in interfaceIServerSettings
- Returns:
- The maximum number of threads.
getWSMinThreads
public int getWSMinThreads()Get the web server minimum number of threads, default is 8. Range is 20 to 1024, always smaller or equal to the minimum threads. An out-of-range value will give the default.- Specified by:
getWSMinThreads
in interfaceIServerSettings
- Returns:
- Minimum number of threads.
getWSReservedThreads
public int getWSReservedThreads()Get the web server number of reserved threads, default to -1. Range is 8-64, or -1 for heuristically determined. An out-of-range value will give the default -1.- Specified by:
getWSReservedThreads
in interfaceIServerSettings
- Returns:
- Number of reserved threads or -1 for heuristically determined.
getWSIdleTimeout
public int getWSIdleTimeout()Get the web server maximum thread idle time, default is 60 seconds, 60_000 milliseconds. Range is 5_000 (5 seconds) to 300_000 (5 minutes). An out-of-range value will give the default.- Specified by:
getWSIdleTimeout
in interfaceIServerSettings
- Returns:
- Max idle time in ms.
getFileProviderRoot
Gets the root directory relative the server's current directory where to place external files provided for remote usage over the web server.- Returns:
- The root directory name, relative (or absolute path), "wsfiles" as default.
getRealmPropertiesFileName
Gets the file name for the authentication realm properties.- Specified by:
getRealmPropertiesFileName
in interfaceIServerSettings
- Returns:
- The file name, or "authentication-realm-properties.txt" if undefined.
getAuthenticationRealm
Gets the realm for authentication.- Specified by:
getAuthenticationRealm
in interfaceIServerSettings
- Returns:
- The realm string, "iiziServer Authentication" if not defined or empty String.
isBasicAuthenticationEnabled
public boolean isBasicAuthenticationEnabled()Checks if basic authentication should be used.- Specified by:
isBasicAuthenticationEnabled
in interfaceIServerSettings
- Returns:
- The flag for authentication enabled.
getUrlboxIOAPIKey
Gets the "urlbox.io" API key.You will find this key on your Dashboard when you login to "urlbox.io".
- Returns:
- The configured API key, empty string for none.
getMaxConcurrentThumbnailsRequests
public int getMaxConcurrentThumbnailsRequests()The maximum count of current thumbnail requests to "urlbox.io", default 5.Be careful not to exceed your quota, there are different plans available.
isFileUploadEnabled
public boolean isFileUploadEnabled()Checks if file upload is enabled or not.- Returns:
- The upload enablement flag, false by default.
getMaximumUploadFileSize
public int getMaximumUploadFileSize()Returns the maximum size of any uploaded file in MB.- Returns:
- The file size in MB, default 50 MB.
getFileUploadStagingDirectory
Gets the upload directory where files are placed in a staging area.- Returns:
- The directory name, relative the server's current directory.
getMaximumGeolocationHistorySizePerUser
public int getMaximumGeolocationHistorySizePerUser()Gets the maximum number of geolocation entries per user in the history.- Returns:
- The maximum number of locations, default 100, minimum 10, maximum 10000.
getClientIdleTimeout
public long getClientIdleTimeout()Gets the timeout before a client session is disposed when it has not processes any transactions, default 2 hours. Range is 2 minutes to 2 days. The idle timeout includes dormant session timeout.- Returns:
- Value in milliseconds.
getClientDormantTimeout
public long getClientDormantTimeout()Timeout before an app session is disposed of when no more client sessions are present, default 10 minutes. Range is 30 seconds to 12 hours.- Returns:
- Value in milliseconds.
getClientHeartBeatInterval
public long getClientHeartBeatInterval()Heartbeat interval in seconds to keep communication link up, default 45 seconds. Range is 30 seconds to 5 minutes.- Returns:
- Value in milliseconds (between 45_000L and 300_000L).
getMaximumServerKeyAge
public int getMaximumServerKeyAge()Gets the maximum server key age in days.- Returns:
- A value between 7 and 365 in days.
setCacheParams
public void setCacheParams(int minLength, int maxLength, int count) Sets the parameters for cache: minLength, maxLength, count.- Parameters:
minLength
- The minimum length for caching, 7 is the smallest value.maxLength
- The maximum length for caching, normally 80 or so (maximum 1024).count
- The count should normally be larger than 200 and smaller than 1000 (maximum 2048).- Throws:
IllegalArgumentException
- If arguments are not valid.
getCacheParams
public int[] getCacheParams()Gets the cache parameters as 3 integers in an array, param[0] is minLength, param[1] is maxLength, param[2] is count.The default values are minLength=7, maxLength=200, count=700 if nothing is specified.
- Specified by:
getCacheParams
in interfaceIServerSettings
- Returns:
- Array of 3 integer parameters, param[0] is minLength, param[1] is maxLength, param[2] is count.
getPortConfigurations
Gets the configured ports.- Specified by:
getPortConfigurations
in interfaceIServerSettings
- Returns:
- The array of server port configurations.
getLetsEncryptDomains
Gets the Let's Encrypt domains.- Returns:
- The array of Let's Encrypt domains.
getDefaultServerConfigurationEnvironmentName
Gets the default Server configuration environment name.- Returns:
- The defined default Server configuration environment name, or "default" if such definition is not done.
getServerConfigEnvironment
Gets the configuration environment of a name.- Parameters:
name
- The name (e.g. "test", "development" or "production"), or null for default configuration environment name.- Returns:
- The configuration setup, or null if not found.
getServerConfigEnvironments
Gets the array of configuration environments present.onServerSettingsChanged
protected void onServerSettingsChanged()Called when loaded to update the ServerProps instance.getDBCacheMaxFileCount
public int getDBCacheMaxFileCount()Gets the maximum number of cached database files.- Returns:
- Maximum number of files, minimum 100, default 10_000.
getDBCacheMaxFileAge
public long getDBCacheMaxFileAge()Gets the maximum file age of cached database files.- Returns:
- Maximum age in milliseconds of files: minimum 1 hour, default 90 days.
verify
Verifies this property container. The check performed is the extension of classes and that no circular reference is present.onApplicationLoad
Called when the application is loaded.- Parameters:
app
- The application factory.- Throws:
ServerApplicationSetupException
- For setup exceptions.
onApplicationUnload
Called when the application is unloaded.- Parameters:
app
- The application begin unloaded.
onApplicationSessionStarted
Called when an application is instantiated and started by a user session.onApplicationSessionStopped
Called when an application is stopped.getMailSender
public MailSender getMailSender(String name, ExecutorService executorService, File baseDir) throws NotFoundException, AddressException, NoSuchProviderException, IOException Gets the mail sender with the specified name.- Parameters:
name
- The mail properties name,null
for default.executorService
- The executor service.baseDir
- The base directory where the server is (generally current directory).- Returns:
- The mail sender.
- Throws:
NotFoundException
- If the mail sender is not found.IOException
- If the mail queue directory does not exist.NoSuchProviderException
- If the "smtp" or "smtps" providers do not exist!AddressException
- If the default sender failed to parse.
getRegionLocationGlobalCacheSize
public int getRegionLocationGlobalCacheSize()Gets the global cache size for the region location service providers.- Returns:
- A value between 100 and 100_000, default is 20_000.
getRegionLocationAPIKey
Gets the API key for a region location service provider.- Parameters:
providerName
- The provider name, e.g. "IPStack.com".- Returns:
- The API key, or null if not configured.