Class ServerSettings
- java.lang.Object
- com.iizix.prop.GProp<GProp<?>[]>
- com.iizix.prop.PropCnr
- com.iizix.server.prop.ServerSettings
- All Implemented Interfaces:
IServerSettings,EventListener,IGProp<GProp<?>[]>,IPropCnr,java.lang.Cloneable
- Direct Known Subclasses:
EditorServerSettings
public class ServerSettings extends PropCnr implements IServerSettings
This property is a container that holds the required settings for the server to operate and initialize itself with.
Field Summary
Fields Modifier and Type Field Description static java.lang.StringALLOW_UPLOADFlag to allow file upload, default false.static java.lang.StringAUTH_BASICAuthentication required: basic.static java.lang.StringCONFIG_FILE_DEFAULT_BASE_NAMEDefault base name without file extension of the iiziServer configuration file: "config".static java.lang.StringCONFIG_FILE_DEFAULT_NAMEDefault name of the iiziServer configuration file: "config.iiziServer".static java.lang.StringCONFIG_FILE_EXTThe extension of the iiziServer configuration file: ".iiziServer".static java.lang.StringDB_AUTO_CREATEDatabase tables auto-creation flag, default true.static java.lang.StringDB_AUTO_STARTDatabase server auto-start (Derby Database Server running on same machine), default true.static java.lang.StringDB_DIRECTORYDatabase directory (local embedded Derby), default "db".static java.lang.StringDB_HOSTDatabase server host name or address (remote Derby).static java.lang.StringDB_MAX_FILE_AGEMaximum age of cached database files: milliseconds.static java.lang.StringDB_MAX_FILE_COUNTMaximum number of cached database files.static java.lang.StringDB_PORTDatabase server port number, default 1527.static longDEFAULT_DB_MAX_FILE_AGEDefault maximum age of cached database files: 90 days or 7_776_000_000 milliseconds.static intDEFAULT_DB_MAX_FILE_COUNTDefault maximum number of cached database files: 10_000.static java.lang.StringDEFAULT_FILE_PROVIDER_ROOTThe default directory for the file provider root.static intDEFAULT_LOG_HISTORY_SIZEDefault history size = 500.static intDEFAULT_LOG_LEVELDefault log level = ILog.INFO.static java.lang.StringDEFAULT_LOGFILE_NAMEDefault log file name.static intDEFAULT_MAX_CONCURRENT_THUMBNAILS_COUNTThe default maximum count of current thumbnail requests to "urlbox.io", default 5.static intDEFAULT_MAX_HISTORY_LOCATIONThe default maximum history size for geolocation entries per user.static intDEFAULT_MAX_LOGFILE_SIZEDefault max log file size in MB = 50 MB, undefined = unlimited (-1).static intDEFAULT_MAX_SERVER_KEY_AGEDefault value for maximum server key age: 90 days.static intDEFAULT_MAX_UPLOAD_SIZEDefault maximum upload size: 50 MB.static java.lang.StringDEFAULT_SERVER_CONFIG_ENVThe default server configuration environment.static java.lang.StringDEFAULT_UPLOAD_DIRECTORYDefault directory name for file upload = "uploads";static java.lang.StringDIR_LISTProperty name for "directory listing allowed".static java.lang.StringDORMANT_TIMEOUTTimeout before an app session is disposed of when no more client sessions are present, default 10 minutes.static java.lang.StringEXTERNAL_SERVER_URLProperty name for external server URL, including protocol and potential port number (if different from protocol port).static java.lang.StringFILE_PROVIDER_ROOTRoot directory relative the server's current directory where to place external files provided for remote usage over the web server.static java.lang.StringGZIPThe Gzip boolean setting.static java.lang.StringHEARTBEAT_INTERVALHeartbeat interval in seconds to keep communication link up, default 45 seconds.static java.lang.StringIDLE_TIMEOUTTimeout before a client session is disposed when it has not processes any transactions, default 2 hours.static java.lang.StringLOG_COMPRESSOld log compression: 0=none, 1=gzip (default), 2=xz.static java.lang.StringLOG_HISTORY_SIZEThe history size.static java.lang.StringLOG_LEVELLog level.static java.lang.StringLOG_TO_CONSOLELog to console.static java.lang.StringLOGFILE_NAMELog file name.static java.lang.StringMAX_CONCURRENT_THUMBNAILS_COUNTThe maximum count of current thumbnail requests to "urlbox.io", default 10.static java.lang.StringMAX_HISTORY_LOCATIONThe maximum history size for geolocation entries per user.static java.lang.StringMAX_LOGFILE_SIZEMax size of log file before new file.static java.lang.StringMAX_SERVER_KEY_AGEMaximum server key age in days: "maxServerKeyAge".static java.lang.StringMAX_UPLOAD_SIZEMaximum upload size in MB.static java.lang.StringREALMThe authentication realm.static java.lang.StringREALM_PROPERTIESThe file name for authentication realm properties, default "authentication-realm-properties.txt" in the current directory of the server.static java.lang.StringTRANS_CACHE_COUNTProperty name of "count of strings in transactional cache".static java.lang.StringTRANS_CACHE_MAXProperty name of "maximum string length of a transactional cache".static java.lang.StringTRANS_CACHE_MINProperty name of "minimum string length of a transactional cache".static java.lang.StringUPLOAD_DIRECTORYDirectory name for file upload.static java.lang.StringURLBOX_IO_API_KEYThe "urlbox.io" API key.static java.lang.StringWS_IDLE_TIMEOUTThe web server maximum thread idle time settings.static java.lang.StringWS_MAX_THREADSThe web server maximum number of threads setting.static java.lang.StringWS_MIN_THREADSThe web server minimum number of threads setting.static java.lang.StringWS_RESERVED_THREADSThe 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_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
Constructors Constructor Description ServerSettings()Creates the server settings without a name.ServerSettings(Atom atom)Creates the server settings with a name.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddPredefinedProps()Adds the predefined containers for identifications, fields and actions.ServerSettingsclone()Creates a clone out of this property.protected PolicyPropscreatePolicyProps(Atom atom)Creates a policy property with the specified atom name.PasswordPolicygetAdministratorPasswordPolicy()Gets the password policy for administrators.java.lang.StringgetAuthenticationRealm()Gets the realm for authentication.int[]getCacheParams()Gets the cache parameters as 3 integers in an array, param[0] is minLength, param[1] is maxLength, param[2] is count.longgetClientDormantTimeout()Timeout before an app session is disposed of when no more client sessions are present, default 10 minutes.longgetClientHeartBeatInterval()Heartbeat interval in seconds to keep communication link up, default 45 seconds.longgetClientIdleTimeout()Gets the timeout before a client session is disposed when it has not processes any transactions, default 2 hours.longgetDBCacheMaxFileAge()Gets the maximum file age of cached database files.intgetDBCacheMaxFileCount()Gets the maximum number of cached database files.java.lang.StringgetDefaultServerConfigurationEnvironmentName()Gets the default Server configuration environment name.java.lang.StringgetDescription()Gets the description of the Server.java.lang.StringgetExternalHostName()Gets the external server URL, including protocol and potential port number (if different from protocol port).java.lang.StringgetFileProviderRoot()Gets the root directory relative the server's current directory where to place external files provided for remote usage over the web server.java.lang.StringgetFileUploadStagingDirectory()Gets the upload directory where files are placed in a staging area.LetsEncryptDomain[]getLetsEncryptDomains()Gets the Let's Encrypt domains.java.lang.StringgetLogFileName()Gets the log file name.intgetLogHistorySize()Gets the history size for events kept in-memory for the server administration program to retrieve.intgetLogLevel()Gets the log level to use.booleangetLogToConsole()Logging output also to console.MailSendergetMailSender(java.lang.String name, java.util.concurrent.ExecutorService executorService, java.io.File baseDir)Gets the mail sender with the specified name.intgetMaxConcurrentThumbnailsRequests()The maximum count of current thumbnail requests to "urlbox.io", default 5.intgetMaximumGeolocationHistorySizePerUser()Gets the maximum number of geolocation entries per user in the history.longgetMaximumLogFileSize()Gets the maximum log file size.intgetMaximumServerKeyAge()Gets the maximum server key age in days.intgetMaximumUploadFileSize()Returns the maximum size of any uploaded file in MB.WebServerPortConfig[]getPortConfigurations()Gets the configured ports.java.lang.StringgetRealmPropertiesFileName()Gets the file name for the authentication realm properties.java.lang.StringgetRegionLocationAPIKey(java.lang.String providerName)Gets the API key for a region location service provider.intgetRegionLocationGlobalCacheSize()Gets the global cache size for the region location service providers.java.lang.StringgetRootDirectory()Gets the root directory for external files.ServerConfigEnvPropsgetServerConfigEnvironment(java.lang.String name)Gets the configuration environment of a name.ServerConfigEnvProps[]getServerConfigEnvironments()Gets the array of configuration environments present.java.lang.StringgetUrlboxIOAPIKey()Gets the "urlbox.io" API key.PasswordPolicygetUserPasswordPolicy()Gets the password policy for users.intgetWSIdleTimeout()Get the web server maximum thread idle time, default is 60 seconds, 60_000 milliseconds.intgetWSMaxThreads()Get the web server maximum number of threads, default is 200.intgetWSMinThreads()Get the web server minimum number of threads, default is 8.intgetWSReservedThreads()Get the web server number of reserved threads, default to -1.booleanisBasicAuthenticationEnabled()Checks if basic authentication should be used.booleanisDirectoryListingAllowed()Flag for directory listing allowed.booleanisFileUploadEnabled()Checks if file upload is enabled or not.voidonApplicationLoad(AppFactory app)Called when the application is loaded.voidonApplicationSessionStarted(AppSessionGyro appGyro)Called when an application is instantiated and started by a user session.voidonApplicationSessionStopped(AppSessionGyro appGyro)Called when an application is stopped.voidonApplicationUnload(AppFactory app)Called when the application is unloaded.protected voidonServerSettingsChanged()Called when loaded to update the ServerProps instance.voidsetCacheParams(int minLength, int maxLength, int count)Sets the parameters for cache: minLength, maxLength, count.booleansetExternalHostName(java.lang.String extServerURL)Sets the external server URL, including protocol and potential port number (if different from protocol port).booleansetRootDirectory(java.lang.String root)Sets the root directory for external files.booleanuseGzip()Flag if Gzip compression should be used in the web server.booleanverify(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, doVirtualizePropCnr, 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, getReferences, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasFocus, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, isSibling, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropDispose, onPropRemoved, onPropTreeInitialized, onReferenceEvent, 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, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, extendsClone, 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, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParent, getTreeLock, hasChanged, 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, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropValueSet, onRemoteEvent, onVirtualizationCompleted, onVirtualized, 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, verifyHasPropertyItem, 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, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, 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, verifyHasPropertyItem, warning, warning, warning
Methods inherited from interface com.iizix.prop.IPropCnr
canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized
Field Detail
CONFIG_FILE_EXT
public static final java.lang.String CONFIG_FILE_EXT
The extension of the iiziServer configuration file: ".iiziServer".- See Also:
- Constant Field Values
CONFIG_FILE_DEFAULT_BASE_NAME
public static final java.lang.String CONFIG_FILE_DEFAULT_BASE_NAME
Default base name without file extension of the iiziServer configuration file: "config".- See Also:
- Constant Field Values
CONFIG_FILE_DEFAULT_NAME
public static final java.lang.String CONFIG_FILE_DEFAULT_NAME
Default name of the iiziServer configuration file: "config.iiziServer".- See Also:
- Constant Field Values
DEFAULT_SERVER_CONFIG_ENV
public static final java.lang.String DEFAULT_SERVER_CONFIG_ENV
The default server configuration environment.- See Also:
- Constant Field Values
IDLE_TIMEOUT
public static final java.lang.String 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:
- Constant Field Values
DORMANT_TIMEOUT
public static final java.lang.String 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:
- Constant Field Values
HEARTBEAT_INTERVAL
public static final java.lang.String HEARTBEAT_INTERVAL
Heartbeat interval in seconds to keep communication link up, default 45 seconds. Range is 30 seconds to 5 minutes.- See Also:
- Constant Field Values
TRANS_CACHE_MIN
public static final java.lang.String TRANS_CACHE_MIN
Property name of "minimum string length of a transactional cache".- See Also:
- Constant Field Values
TRANS_CACHE_MAX
public static final java.lang.String TRANS_CACHE_MAX
Property name of "maximum string length of a transactional cache".- See Also:
- Constant Field Values
TRANS_CACHE_COUNT
public static final java.lang.String TRANS_CACHE_COUNT
Property name of "count of strings in transactional cache".- See Also:
- Constant Field Values
EXTERNAL_SERVER_URL
public static final java.lang.String 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:
- Constant Field Values
DIR_LIST
public static final java.lang.String DIR_LIST
Property name for "directory listing allowed".- See Also:
- Constant Field Values
GZIP
public static final java.lang.String GZIP
The Gzip boolean setting.- See Also:
- Constant Field Values
WS_IDLE_TIMEOUT
public static final java.lang.String WS_IDLE_TIMEOUT
The web server maximum thread idle time settings.- See Also:
- Constant Field Values
WS_MAX_THREADS
public static final java.lang.String WS_MAX_THREADS
The web server maximum number of threads setting.- See Also:
- Constant Field Values
WS_MIN_THREADS
public static final java.lang.String WS_MIN_THREADS
The web server minimum number of threads setting.- See Also:
- Constant Field Values
WS_RESERVED_THREADS
public static final java.lang.String WS_RESERVED_THREADS
The web server number of reserved threads setting.- See Also:
- Constant Field Values
REALM
public static final java.lang.String REALM
The authentication realm.- See Also:
- Constant Field Values
REALM_PROPERTIES
public static final java.lang.String REALM_PROPERTIES
The file name for authentication realm properties, default "authentication-realm-properties.txt" in the current directory of the server.- See Also:
- Constant Field Values
AUTH_BASIC
public static final java.lang.String AUTH_BASIC
Authentication required: basic.- See Also:
- Constant Field Values
MAX_SERVER_KEY_AGE
public static final java.lang.String MAX_SERVER_KEY_AGE
Maximum server key age in days: "maxServerKeyAge".- See Also:
- Constant Field Values
DEFAULT_MAX_SERVER_KEY_AGE
public static final int DEFAULT_MAX_SERVER_KEY_AGE
Default value for maximum server key age: 90 days.- See Also:
- Constant Field Values
FILE_PROVIDER_ROOT
public static final java.lang.String 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:
- Constant Field Values
DEFAULT_FILE_PROVIDER_ROOT
public static final java.lang.String DEFAULT_FILE_PROVIDER_ROOT
The default directory for the file provider root.- See Also:
- Constant Field Values
URLBOX_IO_API_KEY
public static final java.lang.String 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:
- Constant Field Values
MAX_CONCURRENT_THUMBNAILS_COUNT
public static final java.lang.String 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:
- Constant Field Values
DEFAULT_MAX_CONCURRENT_THUMBNAILS_COUNT
public static final int DEFAULT_MAX_CONCURRENT_THUMBNAILS_COUNT
The default maximum count of current thumbnail requests to "urlbox.io", default 5.- See Also:
- Constant Field Values
MAX_HISTORY_LOCATION
public static final java.lang.String MAX_HISTORY_LOCATION
The maximum history size for geolocation entries per user.- See Also:
- Constant Field Values
DEFAULT_MAX_HISTORY_LOCATION
public static final int DEFAULT_MAX_HISTORY_LOCATION
The default maximum history size for geolocation entries per user.- See Also:
- Constant Field Values
DB_AUTO_CREATE
public static final java.lang.String DB_AUTO_CREATE
Database tables auto-creation flag, default true.- See Also:
- Constant Field Values
DB_DIRECTORY
public static final java.lang.String DB_DIRECTORY
Database directory (local embedded Derby), default "db".- See Also:
- Constant Field Values
DB_HOST
public static final java.lang.String DB_HOST
Database server host name or address (remote Derby).- See Also:
- Constant Field Values
DB_PORT
public static final java.lang.String DB_PORT
Database server port number, default 1527.- See Also:
- Constant Field Values
DB_AUTO_START
public static final java.lang.String DB_AUTO_START
Database server auto-start (Derby Database Server running on same machine), default true.- See Also:
- Constant Field Values
DB_MAX_FILE_COUNT
public static final java.lang.String DB_MAX_FILE_COUNT
Maximum number of cached database files.- See Also:
- Constant Field Values
DEFAULT_DB_MAX_FILE_COUNT
public static final int DEFAULT_DB_MAX_FILE_COUNT
Default maximum number of cached database files: 10_000.- See Also:
- Constant Field Values
DB_MAX_FILE_AGE
public static final java.lang.String DB_MAX_FILE_AGE
Maximum age of cached database files: milliseconds.- See Also:
- Constant Field Values
DEFAULT_DB_MAX_FILE_AGE
public static final long DEFAULT_DB_MAX_FILE_AGE
Default maximum age of cached database files: 90 days or 7_776_000_000 milliseconds.- See Also:
- Constant Field Values
LOGFILE_NAME
public static final java.lang.String LOGFILE_NAME
Log file name.- See Also:
- Constant Field Values
DEFAULT_LOGFILE_NAME
public static final java.lang.String DEFAULT_LOGFILE_NAME
Default log file name.- See Also:
- Constant Field Values
MAX_LOGFILE_SIZE
public static final java.lang.String MAX_LOGFILE_SIZE
Max size of log file before new file.- See Also:
- Constant Field Values
DEFAULT_MAX_LOGFILE_SIZE
public static final int DEFAULT_MAX_LOGFILE_SIZE
Default max log file size in MB = 50 MB, undefined = unlimited (-1).- See Also:
- Constant Field Values
LOG_LEVEL
public static final java.lang.String LOG_LEVEL
Log level.- See Also:
- Constant Field Values
DEFAULT_LOG_LEVEL
public static final int DEFAULT_LOG_LEVEL
Default log level = ILog.INFO.- See Also:
- Constant Field Values
LOG_TO_CONSOLE
public static final java.lang.String LOG_TO_CONSOLE
Log to console.- See Also:
- Constant Field Values
LOG_HISTORY_SIZE
public static final java.lang.String LOG_HISTORY_SIZE
The history size.- See Also:
- Constant Field Values
LOG_COMPRESS
public static final java.lang.String LOG_COMPRESS
Old log compression: 0=none, 1=gzip (default), 2=xz.- See Also:
- Constant Field Values
DEFAULT_LOG_HISTORY_SIZE
public static final int DEFAULT_LOG_HISTORY_SIZE
Default history size = 500.- See Also:
- Constant Field Values
ALLOW_UPLOAD
public static final java.lang.String ALLOW_UPLOAD
Flag to allow file upload, default false.- See Also:
- Constant Field Values
MAX_UPLOAD_SIZE
public static final java.lang.String MAX_UPLOAD_SIZE
Maximum upload size in MB.- See Also:
- Constant Field Values
DEFAULT_MAX_UPLOAD_SIZE
public static final int DEFAULT_MAX_UPLOAD_SIZE
Default maximum upload size: 50 MB.- See Also:
- Constant Field Values
UPLOAD_DIRECTORY
public static final java.lang.String UPLOAD_DIRECTORY
Directory name for file upload.- See Also:
- Constant Field Values
DEFAULT_UPLOAD_DIRECTORY
public static final java.lang.String DEFAULT_UPLOAD_DIRECTORY
Default directory name for file upload = "uploads";- See Also:
- Constant Field Values
Constructor Detail
ServerSettings
public ServerSettings()
Creates the server settings without a name. The name must be set in all cases using thesetPropertyAtomcall.
ServerSettings
public ServerSettings(Atom atom)
Creates the server settings with a name.- Parameters:
atom- The name of the property.
Method Detail
addPredefinedProps
protected void addPredefinedProps() throws PropExceptionAdds the predefined containers for identifications, fields and actions. This method is overridden fully by the Editor versions of the class.- Overrides:
addPredefinedPropsin classPropCnr- Throws:
PropException- for property exceptions.
clone
public ServerSettings 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
public java.lang.String getDescription()
Gets the description of the Server.- Specified by:
getDescriptionin interfaceIServerSettings- Returns:
- The description, "iiziServer" for default.
getLogFileName
public java.lang.String 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 isILogtoILog.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
public PasswordPolicy getAdministratorPasswordPolicy()
Gets the password policy for administrators.- Returns:
- The password policy settings for administrators.
getUserPasswordPolicy
public PasswordPolicy getUserPasswordPolicy()
Gets the password policy for users.- Returns:
- The password policy settings for normal users.
createPolicyProps
protected PolicyProps createPolicyProps(Atom atom)
Creates a policy property with the specified atom name.- Parameters:
atom- The atom name.- Returns:
- The policy property.
setExternalHostName
public boolean setExternalHostName(java.lang.String extServerURL)
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:
java.lang.NullPointerException- If extHostName is null.java.lang.IllegalArgumentException- If extHostName is empty or not valid.
getExternalHostName
public java.lang.String 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
public boolean setRootDirectory(java.lang.String root) throws java.io.IOExceptionSets 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:
java.io.IOException- If the directory does not exist.
getRootDirectory
public java.lang.String getRootDirectory()
Gets the root directory for external files. If the directory doesn't exist it will be created.- Specified by:
getRootDirectoryin interfaceIServerSettings- Returns:
- The root directory or "/iiziServer/root" (of the current drive for Windows) 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.
isDirectoryListingAllowed
public boolean isDirectoryListingAllowed()
Flag for directory listing allowed.- Specified by:
isDirectoryListingAllowedin 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:
useGzipin 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:
getWSMaxThreadsin 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:
getWSMinThreadsin interfaceIServerSettings- Returns:
- Minimum number of threads.
getWSReservedThreads
public int getWSReservedThreads()
Get the web server number of reserved threads, default to -1. Range is -1, or 8-64. An out-of-range value will give the default -1.- Specified by:
getWSReservedThreadsin 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:
getWSIdleTimeoutin interfaceIServerSettings- Returns:
- Max idle time in ms.
getFileProviderRoot
public java.lang.String 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
public java.lang.String getRealmPropertiesFileName()
Gets the file name for the authentication realm properties.- Specified by:
getRealmPropertiesFileNamein interfaceIServerSettings- Returns:
- The file name, or "authentication-realm-properties.txt" if undefined.
getAuthenticationRealm
public java.lang.String getAuthenticationRealm()
Gets the realm for authentication.- Specified by:
getAuthenticationRealmin 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:
isBasicAuthenticationEnabledin interfaceIServerSettings- Returns:
- The flag for authentication enabled.
getUrlboxIOAPIKey
public java.lang.String 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
public java.lang.String 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:
java.lang.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=80, count=700 if nothing is specified.
- Specified by:
getCacheParamsin interfaceIServerSettings- Returns:
- Array of 3 integer parameters, param[0] is minLength, param[1] is maxLength, param[2] is count.
getPortConfigurations
public WebServerPortConfig[] getPortConfigurations()
Gets the configured ports.- Specified by:
getPortConfigurationsin interfaceIServerSettings- Returns:
- The array of server port configurations.
getLetsEncryptDomains
public LetsEncryptDomain[] getLetsEncryptDomains()
Gets the Let's Encrypt domains.- Returns:
- The array of Let's Encrypt domains.
getDefaultServerConfigurationEnvironmentName
public java.lang.String 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
public ServerConfigEnvProps getServerConfigEnvironment(java.lang.String name)
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
public ServerConfigEnvProps[] 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
public boolean verify(PropVerification verification)
Verifies this property container. The check performed is the extension of classes and that no circular reference is present.
onApplicationLoad
public void onApplicationLoad(AppFactory app) throws ServerApplicationSetupException
Called when the application is loaded.- Parameters:
app- The application factory.- Throws:
ServerApplicationSetupException- For setup exceptions.
onApplicationUnload
public void onApplicationUnload(AppFactory app)
Called when the application is unloaded.- Parameters:
app- The application begin unloaded.
onApplicationSessionStarted
public void onApplicationSessionStarted(AppSessionGyro appGyro)
Called when an application is instantiated and started by a user session.
onApplicationSessionStopped
public void onApplicationSessionStopped(AppSessionGyro appGyro)
Called when an application is stopped.
getMailSender
public MailSender getMailSender(java.lang.String name, java.util.concurrent.ExecutorService executorService, java.io.File baseDir) throws NotFoundException, AddressException, NoSuchProviderException, java.io.IOException
Gets the mail sender with the specified name.- Parameters:
name- The mail properties name,nullfor 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.java.io.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
public java.lang.String getRegionLocationAPIKey(java.lang.String providerName)
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.