Class ServerAppConfig
- All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, Cloneable
- Direct Known Subclasses:
EditorServerAppConfig
file name, the aliases, the description (Atom.DESCR), the groups and the ports.The property container parent is the ServerAppConfigs container of a ServerConfigEnvProps instance: the environment owns its applications. An application ID and every alias is unique among ALL IDs and aliases of ALL environments of the server configuration (a server runs several environments at once and an application reference carries no environment); ServerSettings.verify reports a duplicate, and the server does not start with one.
At the server's start every -app <id>[:alias...] -appjar <file> of the command line is added to the configuration IN MEMORY (not saved, isFromCommandLine()) unless the file already defines the application - the file wins, the command line's definition is logged INFO and ignored - and then ALL applications are loaded from the configuration, one path. An application loaded from Module project directories (-project, the debug server) is never written into the configuration; an entry of its ID carries its settings (groups, ports).
The groups of the configuration are the access rule of the application (T1-139, CC-SERVER-USERS-APP-ACCESS): a user signs in to the application only by an ENABLED group that is one of them, or by an enabled group that allows all applications (GroupInfo.areAllAppsAllowed()) - refusal(BasicUserInfo), applied by UserAuthentication.validateUser at every successful answer for an application. The configuration of a loaded application is found by of(AppFactory); an application that has none admits every user.
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe aliases of this app: a comma-separated list of application IDs that name this application besides its ID (the atom name of this container), e.g.static final StringFile name to application (Jar file name or directory path containing ".iiziModuleProject" file).static final StringThe groups of this app.static final StringThe Google Maps key of this application for Browser clients, set by the deployment (CC-FIX-MAPS-KEY-SERVER): an optional override, for this application alone, of the key of the application's distribution and of the environment'skey.static final StringThe port configurations this application is served on: a comma-separated list of port configuration names (WebServerPortConfig.NAME, by default a configuration's atom name, case-sensitive like every property name).Fields inherited from class PropCnr
EMPTY, EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_IDFields inherited from class 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_ATTR_STRING_SECRET, PROP_USER_1, PROP_USER_2Fields inherited from interface IGProp
EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_INCLUDE_PRIVATE, EQC_SAVE_FILE, EQC_SAVE_RELEVANT_ONLY, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATEConstructor Summary
ConstructorsConstructorDescriptionCreates the App configuration without a name.ServerAppConfig(Atom atom) Creates the App configuration with a name.Method Summary
Modifier and TypeMethodDescriptionclone()Clones the instance.static ServerAppConfigfind(ServerConfigEnvProps env, String appID) Finds the configuration of an application in a server configuration environment: the entry of that ID in the environment'sServerAppConfigscontainer, or, when the container holds none, a definition added directly to the environment at run time (a test, ServerAdmin's Add page until it writes into the container).Gets the aliases of this app.String[]Gets the alias names array of this app: trimmed, empty names dropped, duplicates dropped (case-sensitive, as application IDs are).getAppID()Gets the application ID: the atom name of this definition.Gets the description of the App configuration.Gets the file name to application (Jar file name or directory path containing ".iiziModuleProject" file).String[]Gets the group names array associated with this app.getGroups(boolean reload) Gets the groups for this app.Gets the app groups associated.Gets the Google Maps key of this application for Browser clients (CC-FIX-MAPS-KEY-SERVER).String[]Gets the port configuration names array of this app: trimmed, empty names dropped, duplicates dropped (case-sensitive, like every property name).Gets the port configuration names of this app.Gets the server configuration environment that owns this application definition.Gets the base server directory (current directory for server).booleanChecks if this definition was added in memory from the command line at the server's start (CC-FIX-APP-DEFINITIONS): such an entry is editable in ServerAdmin like one of the file and is written into the file when the configuration is saved.static booleanisServedOn(AppFactory app, PortConfig portConfig) The gate: decides whether a loaded application is served on the port configuration a request arrived on (PR-3: the LISTENING port configuration only, never the Host header).booleanisServedOn(String portConfigName) Decides whether this application is served on a port configuration, by name: served when itsportslist is empty or absent, else only when the name is in the list (case-sensitive).static booleanisServedOn(String[] portNames, String portConfigName) The rule ofisServedOn(String)on the names already split, so that its table of cases can be proven without a configuration.voidMarks this definition as added in memory from the command line.static ServerAppConfigof(AppFactory appFactory) Finds the configuration of a loaded application: the definition named as the application ID in theServerAppConfigscontainer of the server configuration environment the application runs in.protected voidCache invalidation required.refusal(BasicUserInfo user) Decides whether a user may use the application of this configuration, by the user's groups (T1-139): admitted when some ENABLED group of the user allows all applications (GroupInfo.areAllAppsAllowed()), or is one of thegroupsconfigured here - the wildcard "*" standing for every group, so that any enabled group admits.static StringThe rule ofrefusal(BasicUserInfo)on groups already read, so that its table of cases can be proven without a database.booleanverify(PropVerification verification) Verifies this property container.Methods inherited from class PropCnr
__transferChildProps, addPredefinedProps, 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, initializePropTree, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, isPropValueTreeLockNeeded, 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, virtualizeMethods inherited from class 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, hashCode, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropErrorPersisted, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropForEditorAtCreation, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropSaveRelevant, isPropSecret, isPropSecretCapable, isPropUSER, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, isSibling, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onEventSelf, onInitialize, onPrepare, 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, setPropSecret, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toShortString, toShortString, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warningMethods inherited from interface 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, warningMethods inherited from interface IPropCnr
canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized
Field Details
FILENAME
File name to application (Jar file name or directory path containing ".iiziModuleProject" file).- See Also:
GROUPS
ALIASES
The aliases of this app: a comma-separated list of application IDs that name this application besides its ID (the atom name of this container), e.g. in/app/<alias>/andapp=<alias>. Each alias is a valid application ID (IServer.validateAppID(String)) and unique among all IDs and aliases of the server configuration; the command line's-app id:alias1:alias2form gives the same aliases.- See Also:
PORTS
The port configurations this application is served on: a comma-separated list of port configuration names (WebServerPortConfig.NAME, by default a configuration's atom name, case-sensitive like every property name). The deployment decides, not the application module. An application that has NOServerAppConfigentry - for instance an application loaded from a database in a distributed deployment, where server-local port configuration names make no sense - is served on ALL port configurations. Empty or absentports= all ports (the default). A name that matches no port configuration matches nothing: the application is not served there, and never on all ports instead (fail closed). Module end points, such as/iizi/MLS.ws, are not applications and are outside this rule.- See Also:
KEY_GOOGLE_MAPS
The Google Maps key of this application for Browser clients, set by the deployment (CC-FIX-MAPS-KEY-SERVER): an optional override, for this application alone, of the key of the application's distribution and of the environment'skey. The server hands it to the application's distribution properties when the application is loaded (AppDefinition), where the map component reads it first; the environment's key is the fallback of both. Set in ServerAdmin's application page or in the file.- See Also:
Constructor Details
ServerAppConfig
public ServerAppConfig()Creates the App configuration without a name. The name must be set in all cases using thesetPropertyAtomcall.ServerAppConfig
Creates the App configuration with a name.- Parameters:
atom- The name of the property.
Method Details
getServerDirectory
Gets the base server directory (current directory for server).- Returns:
- The directory of the server.
onPropInvalidateCache
protected void onPropInvalidateCache()Cache invalidation required.- Overrides:
onPropInvalidateCachein classGProp<GProp<?>[]>
clone
Clones the instance.getFileName
Gets the file name to application (Jar file name or directory path containing ".iiziModuleProject" file).- Returns:
- The path, or null if not defined.
getDescription
Gets the description of the App configuration.- Returns:
- The description, or null if not defined.
getServerConfigEnvironment
Gets the server configuration environment that owns this application definition.- Returns:
- The environment, or null when the definition is not inside one.
getAppID
Gets the application ID: the atom name of this definition.- Returns:
- The application ID.
isFromCommandLine
public boolean isFromCommandLine()Checks if this definition was added in memory from the command line at the server's start (CC-FIX-APP-DEFINITIONS): such an entry is editable in ServerAdmin like one of the file and is written into the file when the configuration is saved.- Returns:
- true for an entry merged from the command line, false for one of the file.
markFromCommandLine
public void markFromCommandLine()Marks this definition as added in memory from the command line.getAliasesString
Gets the aliases of this app.- Returns:
- The aliases separated by commas, null for none.
getAliasNames
Gets the alias names array of this app: trimmed, empty names dropped, duplicates dropped (case-sensitive, as application IDs are).- Returns:
- An array of unique alias names, empty for none.
getPortsString
Gets the port configuration names of this app.- Returns:
- The port configuration names separated by commas, null for none (= all ports).
getPortNames
Gets the port configuration names array of this app: trimmed, empty names dropped, duplicates dropped (case-sensitive, like every property name).- Returns:
- An array of unique port configuration names, empty for none (= served on all ports).
getGroupsString
Gets the app groups associated.- Returns:
- The app groups separated by commas, null for none.
getKeyGoogleMaps
Gets the Google Maps key of this application for Browser clients (CC-FIX-MAPS-KEY-SERVER).- Returns:
- The key, or null for none (the application's distribution key, else the environment's, applies).
getGroupNames
Gets the group names array associated with this app.- Returns:
- An array of unique group names.
getGroups
Gets the groups for this app.- Parameters:
reload- Flag to reload the group informations from the database.- Returns:
- The groups for this app.
- Throws:
NotFoundException- If a group is not found.SQLException- For SQL errors.
of
Finds the configuration of a loaded application: the definition named as the application ID in theServerAppConfigscontainer of the server configuration environment the application runs in.- Parameters:
appFactory- The application.- Returns:
- The configuration, or null when the application has none - an application loaded from Module project directories (
-project) or fromIZS.APPSwithout one, which admits every user and is served on every port configuration.
find
Finds the configuration of an application in a server configuration environment: the entry of that ID in the environment'sServerAppConfigscontainer, or, when the container holds none, a definition added directly to the environment at run time (a test, ServerAdmin's Add page until it writes into the container). An alias is not looked up.- Parameters:
env- The environment, null for none.appID- The application ID.- Returns:
- The configuration, or null when the environment holds none of that name.
isServedOn
Decides whether this application is served on a port configuration, by name: served when itsportslist is empty or absent, else only when the name is in the list (case-sensitive). A null name - a connector built without a configuration name - is in no list.- Parameters:
portConfigName- The name of the port configuration the request arrived on, null for none.- Returns:
- true when served, false when refused.
isServedOn
The rule ofisServedOn(String)on the names already split, so that its table of cases can be proven without a configuration.- Parameters:
portNames- The port configuration names of the application, empty for all ports.portConfigName- The name of the port configuration the request arrived on, null for none.- Returns:
- true when served, false when refused.
isServedOn
The gate: decides whether a loaded application is served on the port configuration a request arrived on (PR-3: the LISTENING port configuration only, never the Host header). An application without a definition is served on every port configuration (PR-11); a request whose connector carries no port configuration (HTTP/3 before CC-FIX-APP-DEFINITIONS, a test server without one) is served only by an application whoseportslist is empty (D-19, fail closed); a name that matches no configuration matches nothing (PR-6).- Parameters:
app- The application, null for an unknown one - which is never served.portConfig- The port configuration of the request's connector, null for none.- Returns:
- true when served, false when refused: the caller answers as it answers an unknown application ID (PR-4).
refusal
Decides whether a user may use the application of this configuration, by the user's groups (T1-139): admitted when some ENABLED group of the user allows all applications (GroupInfo.areAllAppsAllowed()), or is one of thegroupsconfigured here - the wildcard "*" standing for every group, so that any enabled group admits. A configuration that names no group admits the "all apps" groups only; a configured name that is no group of the server admits nobody, and the reason says so: the verification of the settings flags it, and the administrator corrects it. A disabled group grants nothing, as everywhere. The groups are read from the database on every call: a sign-in is where the decision is taken, and a group disabled since must count.- Parameters:
user- The user, as read from the database.- Returns:
- null when admitted, otherwise the reason of the refusal, for the log - never for the client, which is answered
SigninResult.APP_ACCESS_DENIED. - Throws:
SQLException- For SQL errors reading the groups.
refusal
public static String refusal(String appID, GroupInfo[] allowed, String userName, GroupInfo[] groups) The rule ofrefusal(BasicUserInfo)on groups already read, so that its table of cases can be proven without a database.- Parameters:
appID- The application ID, for the reason.allowed- The groups the application allows, resolved: every group of the server for the wildcard, none for a configuration that names no group.userName- The user name, for the reason.groups- The groups of the user.- Returns:
- null when admitted, otherwise the reason of the refusal, naming the application, the user, the groups allowed and the user's groups.
verify
Verifies this property container. The check performed is the extension of classes and that no circular reference is present.