Class QInstance
java.lang.Object
com.kingsrook.qqq.backend.core.model.metadata.QInstance
Container for all meta-data in a running instance of a QQQ application.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(TopLevelMetaDataInterface metaData) voidaddApp(QAppMetaData app) voidaddAuditHandler(QAuditHandlerMetaData handler) Add an audit handler to the instance.voidaddAutomationProvider(QAutomationProviderMetaData automationProvider) voidaddBackend(QBackendMetaData backend) voidaddJoin(QJoinMetaData join) voidaddMessagingProvider(QMessagingProviderMetaData messagingProvider) voidaddPossibleValueSource(QPossibleValueSource possibleValueSource) voidaddProcess(QProcessMetaData process) voidaddQBit(QBitMetaData qBitMetaData) voidaddQueue(QQueueMetaData queue) voidaddQueueProvider(QQueueProviderMetaData queueProvider) voidaddReport(QReportMetaData report) voidaddSchedulableType(SchedulableType schedulableType) voidaddScheduler(QSchedulerMetaData scheduler) voidaddSecurityKeyType(QSecurityKeyType securityKeyType) addSupplementalCustomizer(SupplementalCustomizerType type, QCodeReference customizer) Fluent adder to supplementalCustomizersvoidaddTable(QTableMetaData table) voidaddWidget(QWidgetMetaDataInterface widget) Find an authentication provider for a specific scope.getApps()Getter for appsGetter for auditHandlersgetAuditHandlersForTable(String tableName, AuditHandlerType handlerType) Get audit handlers for a specific table and handler type.Getter for authenticationgetAutomationProvider(String name) Getter for automationProvidersgetBackend(String name) getBackendForTable(String tableName) Get the backend for a given table nameGetter for backendsGetter for brandingGetter for defaultAuditRulesGetter for defaultPermissionRulesGetter for defaultTimeZoneIdGetter for deploymentModeGetter for enforcePermissionsInCoreActions (may be null, meaning "not configured" - see CorePermissionEnforcer.isInstanceEnforcementEnabled for the effective value).Getter for environmentValuesGetter for failOnMetaDataProducerError - if true, MetaDataProducerHelper throws when it can't use or run a meta-data producer, instead of logging a warning.booleanGetter for hasBeenValidatedGetter for helpContentGetter for homeAppName - the app whose dashboard a frontend shows as the instance's home page (e.g., at /app/); null for the frontend's own default.getJoins()Getter for joinsgetMessagingProvider(String name) Getter for messagingProvidersGetter for metaDataActionCustomizergetPossibleValueSource(String name) Getter for possibleValueSourcesgetProcess(String name) Getter for processesgetProcessesForTable(String tableName) Get the list of processes associated with a given table nameGetter for processLifecycleListeners - code references to ProcessLifecycleListenerInterface implementations.getProcessPath(String processName) Get the full path to a process - note - this will be regardless of whether or not the active session/user has access to the process.getProcessStep(String processName, String functionName) getQBits()Getter for qBitsgetQueueProvider(String name) Getter for queueProvidersGetter for queuesGetter for recordChangeListenersGetter for recordSearchProvider - a code reference to a RecordSearchProviderInterface implementation, which RecordSearchAction asks to search the tables it claims (null - the default - searches every table with the default search over its search fields).Getter for reportsGetter for runtimeServices - code references to QRuntimeServiceInterface implementations, which an application launcher starts (in this order) after the server, and stops (in reverse order) at shutdown.getSchedulableType(String name) Getter for schedulableTypesgetScheduler(String name) Getter for schedulersGet all registered scoped authentication providers.getSecurityKeyType(String name) Getter for securityKeyTypesGetter for a supplemental customizer based on typeGetter for supplementalCustomizersGetter for supplementalMetaDataGetter for supplementalMetaDataGetter for tableCustomizersgetTableCustomizers(TableCustomizers tableCustomizer) Getter for tableCustomizersgetTablePath(String tableName) Get the full path to a table - note - this will be regardless of whether or not the active session/user has access to the table.Getter for tablesbooleancheck if the instance is currently running validation.Getter for widgetsvoidregisterAuthenticationProvider(AuthScope scope, QAuthenticationMetaData authMetaData) Register an authentication provider for a specific scope.voidremoveHelpContent(String slot, Set<HelpRole> roles) remove a helpContent for a slot based on its set of rolesvoidreplaceTables(Map<String, QTableMetaData> replacements, QInstanceValidationKey key) Replace existing, validated tables atomically; keep startup validation state.voidsetApps(Map<String, QAppMetaData> apps) Setter for appsvoidsetAuditHandlers(Map<String, QAuditHandlerMetaData> auditHandlers) Setter for auditHandlersvoidsetAutomationProviders(Map<String, QAutomationProviderMetaData> automationProviders) Setter for automationProvidersvoidsetBackends(Map<String, QBackendMetaData> backends) Setter for backendsvoidsetBranding(QBrandingMetaData branding) Setter for brandingvoidsetDefaultAuditRules(QAuditRules defaultAuditRules) Setter for defaultAuditRulesvoidsetDefaultPermissionRules(QPermissionRules defaultPermissionRules) Setter for defaultPermissionRulesvoidsetDefaultTimeZoneId(String defaultTimeZoneId) Setter for defaultTimeZoneIdvoidsetDeploymentMode(String deploymentMode) Setter for deploymentModevoidsetEnforcePermissionsInCoreActions(Boolean enforcePermissionsInCoreActions) Setter for enforcePermissionsInCoreActionsvoidsetEnvironmentValues(Map<String, String> environmentValues) Setter for environmentValuesvoidsetFailOnMetaDataProducerError(Boolean failOnMetaDataProducerError) Setter for failOnMetaDataProducerErrorvoidIf pass a QInstanceValidationKey (which can only be instantiated by the validator), then the validationState will be set to COMPLETE.voidsetHelpContent(Map<String, List<QHelpContent>> helpContent) Setter for helpContentvoidsetHomeAppName(String homeAppName) Setter for homeAppNamevoidsetJoinGraph(QInstanceValidationKey key, JoinGraph joinGraph) Only the validation (and enrichment) code should set the instance's joinGraph so, we take a package-only-constructable validation key as a param along with the joinGraph - and we throw IllegalArgumentException if a non-null key is given.voidsetJoins(Map<String, QJoinMetaData> joins) Setter for joinsvoidsetMessagingProviders(Map<String, QMessagingProviderMetaData> messagingProviders) Setter for messagingProvidersvoidsetMetaDataActionCustomizer(QCodeReference metaDataActionCustomizer) Setter for metaDataActionCustomizervoidsetPossibleValueSources(Map<String, QPossibleValueSource> possibleValueSources) Setter for possibleValueSourcesvoidsetProcesses(Map<String, QProcessMetaData> processes) Setter for processesvoidsetProcessLifecycleListeners(List<QCodeReference> processLifecycleListeners) Setter for processLifecycleListenersvoidsetQBits(Map<String, QBitMetaData> qBits) Setter for qBitsvoidsetQueueProviders(Map<String, QQueueProviderMetaData> queueProviders) Setter for queueProvidersvoidsetQueues(Map<String, QQueueMetaData> queues) Setter for queuesvoidsetRecordChangeListeners(List<QCodeReference> recordChangeListeners) Setter for recordChangeListenersvoidsetRecordSearchProvider(QCodeReference recordSearchProvider) Setter for recordSearchProvidervoidsetReports(Map<String, QReportMetaData> reports) Setter for reportsvoidsetRuntimeServices(List<QCodeReference> runtimeServices) Setter for runtimeServicesvoidsetSchedulableTypes(Map<String, SchedulableType> schedulableTypes) Setter for schedulableTypesvoidsetSchedulers(Map<String, QSchedulerMetaData> schedulers) Setter for schedulersvoidsetSecurityKeyTypes(Map<String, QSecurityKeyType> securityKeyTypes) Setter for securityKeyTypesvoidsetSupplementalCustomizers(Map<SupplementalCustomizerType, QCodeReference> supplementalCustomizers) Setter for supplementalCustomizersvoidsetSupplementalMetaData(Map<String, QSupplementalInstanceMetaData> supplementalMetaData) Setter for supplementalMetaDatavoidsetTableCustomizers(ListingHash<String, QCodeReference> tableCustomizers) Setter for tableCustomizersvoidsetTables(Map<String, QTableMetaData> tables) Setter for tablesvoidIf pass a QInstanceValidationKey (which can only be instantiated by the validator), then the validationState set to RUNNING.voidsetWidgets(Map<String, QWidgetMetaDataInterface> widgets) Setter for widgetswithAuditHandler(QAuditHandlerMetaData handler) Fluent setter to add a single audit handlerwithAuditHandlers(Map<String, QAuditHandlerMetaData> auditHandlers) Fluent setter for auditHandlerswithDefaultAuditRules(QAuditRules defaultAuditRules) Fluent setter for defaultAuditRuleswithDefaultPermissionRules(QPermissionRules defaultPermissionRules) Fluent setter for defaultPermissionRuleswithDefaultTimeZoneId(String defaultTimeZoneId) Fluent setter for defaultTimeZoneIdwithDeploymentMode(String deploymentMode) Fluent setter for deploymentModewithEnforcePermissionsInCoreActions(Boolean enforcePermissionsInCoreActions) Fluent setter for enforcePermissionsInCoreActions - set to true so that core actions enforce table/process/widget/report permissions and field security locks themselves, for every entry point (not only the middlewares).withFailOnMetaDataProducerError(Boolean failOnMetaDataProducerError) Fluent setter for failOnMetaDataProducerError - set to true before running MetaDataProducerHelper, so a failing producer stops startup instead of being logged as a warning and skipped.withHelpContent(String slot, QHelpContent helpContent) Fluent setter for adding 1 helpContent (for a slot)withHelpContent(Map<String, List<QHelpContent>> helpContent) Fluent setter for helpContentwithHomeAppName(String homeAppName) Fluent setter for homeAppNamewithInstanceDefaultAuthentication(QAuthenticationMetaData authMetaData) Fluent setter for instance default authentication.withMetaDataActionCustomizer(QCodeReference metaDataActionCustomizer) Fluent setter for metaDataActionCustomizerwithProcessLifecycleListener(QCodeReference processLifecycleListener) Fluent method to add one process lifecycle listener (a code reference to a ProcessLifecycleListenerInterface implementation).withProcessLifecycleListeners(List<QCodeReference> processLifecycleListeners) Fluent setter for processLifecycleListenerswithQBits(Map<String, QBitMetaData> qBits) Fluent setter for qBitswithRecordChangeListener(QCodeReference recordChangeListener) Add a RecordChangeListenerInterface, which InsertAction, UpdateAction and DeleteAction call with the records they write successfully.withRecordSearchProvider(QCodeReference recordSearchProvider) Fluent setter for recordSearchProvider - a code reference to a RecordSearchProviderInterface implementation.withRuntimeService(QCodeReference runtimeService) Fluent method to add one runtime service (a code reference to a QRuntimeServiceInterface implementation).withSupplementalCustomizers(Map<SupplementalCustomizerType, QCodeReference> supplementalCustomizers) Fluent setter for supplementalCustomizerswithSupplementalMetaData(QSupplementalInstanceMetaData supplementalMetaData) Fluent setter for supplementalMetaDatawithSupplementalMetaData(Map<String, QSupplementalInstanceMetaData> supplementalMetaData) Fluent setter for supplementalMetaDatawithTableCustomizer(TableCustomizers tableCustomizer, QCodeReference customizer) withTableCustomizer(String role, QCodeReference customizer) withTableCustomizers(ListingHash<String, QCodeReference> tableCustomizers) Fluent setter for tableCustomizers
-
Field Details
-
helpContent
-
-
Constructor Details
-
QInstance
public QInstance()
-
-
Method Details
-
getBackendForTable
Get the backend for a given table name -
getProcessesForTable
Get the list of processes associated with a given table name -
getTablePath
Get the full path to a table - note - this will be regardless of whether or not the active session/user has access to the table. You may want to also call PermissionsHelper.getPermissionCheckResult to confirm if user has permission.- Throws:
QException
-
getProcessPath
Get the full path to a process - note - this will be regardless of whether or not the active session/user has access to the process. You may want to also call PermissionsHelper.getPermissionCheckResult to confirm if user has permission.- Throws:
QException
-
addBackend
-
getBackend
-
getBackends
Getter for backends -
setBackends
Setter for backends -
replaceTables
Replace existing, validated tables atomically; keep startup validation state. -
addTable
-
getTable
-
getTables
Getter for tables -
setTables
Setter for tables -
addJoin
-
getJoin
-
getJoins
Getter for joins -
setJoins
Setter for joins -
addPossibleValueSource
-
getPossibleValueSource
-
getPossibleValueSources
Getter for possibleValueSources -
setPossibleValueSources
Setter for possibleValueSources -
getProcessStep
-
addProcess
-
getProcess
-
getProcesses
Getter for processes -
setProcesses
Setter for processes -
addApp
-
getApp
-
getApps
Getter for apps -
setApps
Setter for apps -
addReport
-
getReport
-
getReports
Getter for reports -
setReports
Setter for reports -
getSupplementalCustomizer
Getter for a supplemental customizer based on type- See Also:
-
getSupplementalCustomizers
Getter for supplementalCustomizers- See Also:
-
setSupplementalCustomizers
public void setSupplementalCustomizers(Map<SupplementalCustomizerType, QCodeReference> supplementalCustomizers) Setter for supplementalCustomizers- See Also:
-
addSupplementalCustomizer
public QInstance addSupplementalCustomizer(SupplementalCustomizerType type, QCodeReference customizer) Fluent adder to supplementalCustomizers- See Also:
-
withSupplementalCustomizers
public QInstance withSupplementalCustomizers(Map<SupplementalCustomizerType, QCodeReference> supplementalCustomizers) Fluent setter for supplementalCustomizers- Parameters:
supplementalCustomizers- Map of supplemental customizer types to QCodeReference instances, allowing customizers to be applied to various QQQ components, e.g. RunAdHocScriptCustomizers- Returns:
- this
-
addSecurityKeyType
-
getSecurityKeyType
-
getSecurityKeyTypes
Getter for securityKeyTypes -
setSecurityKeyTypes
Setter for securityKeyTypes -
addAutomationProvider
-
getAutomationProvider
-
getAutomationProviders
Getter for automationProviders -
setAutomationProviders
Setter for automationProviders -
addMessagingProvider
-
getMessagingProvider
-
getMessagingProviders
Getter for messagingProviders -
setMessagingProviders
Setter for messagingProviders -
getHasBeenValidated
public boolean getHasBeenValidated()Getter for hasBeenValidated -
setHasBeenValidated
If pass a QInstanceValidationKey (which can only be instantiated by the validator), then the validationState will be set to COMPLETE. Else, if passed a null, the validationState will be reset to PENDING. e.g., to re-trigger validation (can be useful in tests). -
setValidationIsRunning
If pass a QInstanceValidationKey (which can only be instantiated by the validator), then the validationState set to RUNNING. -
getValidationIsRunning
public boolean getValidationIsRunning()check if the instance is currently running validation. -
getBranding
Getter for branding -
setBranding
Setter for branding -
getAuthentication
Getter for authentication -
withInstanceDefaultAuthentication
Fluent setter for instance default authentication.This is a convenience method that registers the authentication provider under the instance default scope. Equivalent to calling:
registerAuthenticationProvider(AuthScope.instanceDefault(), authMetaData)- Parameters:
authMetaData- The authentication metadata to register as instance default- Returns:
- This QInstance for method chaining
-
registerAuthenticationProvider
Register an authentication provider for a specific scope.Scopes allow different authentication providers to be registered for different parts of the application (instance default, specific APIs, or route providers). The resolver will check scopes in order of specificity when resolving authentication for a request.
- Parameters:
scope- The scope to register the provider for (must not be null)authMetaData- The authentication metadata to register (must not be null)
-
findAuthenticationProvider
Find an authentication provider for a specific scope.- Parameters:
scope- The scope to look up (must not be null)- Returns:
- Optional containing the authentication metadata if found, empty otherwise
-
getScopedAuthenticationProviders
Get all registered scoped authentication providers.- Returns:
- Unmodifiable map of all scoped authentication providers
-
getWidgets
Getter for widgets -
setWidgets
Setter for widgets -
addWidget
-
getWidget
-
addQueueProvider
-
getQueueProvider
-
getQueueProviders
Getter for queueProviders -
setQueueProviders
Setter for queueProviders -
addQueue
-
getQueue
-
getQueues
Getter for queues -
setQueues
Setter for queues -
getEnvironmentValues
-
setEnvironmentValues
-
getHomeAppName
Getter for homeAppName - the app whose dashboard a frontend shows as the instance's home page (e.g., at /app/); null for the frontend's own default. -
setHomeAppName
Setter for homeAppName -
withHomeAppName
-
getDefaultPermissionRules
Getter for defaultPermissionRules -
setDefaultPermissionRules
Setter for defaultPermissionRules -
withDefaultPermissionRules
Fluent setter for defaultPermissionRules -
setDefaultTimeZoneId
Setter for defaultTimeZoneId -
withDefaultTimeZoneId
-
getDefaultTimeZoneId
Getter for defaultTimeZoneId -
getAllowedSecurityKeyNames
-
getDefaultAuditRules
Getter for defaultAuditRules -
setDefaultAuditRules
Setter for defaultAuditRules -
withDefaultAuditRules
Fluent setter for defaultAuditRules -
getSupplementalMetaData
Getter for supplementalMetaData -
getSupplementalMetaData
Getter for supplementalMetaData -
setSupplementalMetaData
Setter for supplementalMetaData -
withSupplementalMetaData
public QInstance withSupplementalMetaData(Map<String, QSupplementalInstanceMetaData> supplementalMetaData) Fluent setter for supplementalMetaData -
withSupplementalMetaData
Fluent setter for supplementalMetaData -
getJoinGraph
-
setJoinGraph
public void setJoinGraph(QInstanceValidationKey key, JoinGraph joinGraph) throws IllegalArgumentException Only the validation (and enrichment) code should set the instance's joinGraph so, we take a package-only-constructable validation key as a param along with the joinGraph - and we throw IllegalArgumentException if a non-null key is given.- Throws:
IllegalArgumentException
-
getDeploymentMode
Getter for deploymentMode -
setDeploymentMode
Setter for deploymentMode -
withDeploymentMode
-
add
-
addScheduler
-
getScheduler
-
getSchedulers
Getter for schedulers -
setSchedulers
Setter for schedulers -
addSchedulableType
-
getSchedulableType
-
getSchedulableTypes
Getter for schedulableTypes -
setSchedulableTypes
Setter for schedulableTypes -
getHelpContent
Getter for helpContent -
setHelpContent
Setter for helpContent -
withHelpContent
Fluent setter for helpContent -
withHelpContent
Fluent setter for adding 1 helpContent (for a slot) -
removeHelpContent
-
addQBit
-
getQBits
Getter for qBits -
setQBits
Setter for qBits -
withQBits
Fluent setter for qBits -
getMetaDataActionCustomizer
Getter for metaDataActionCustomizer -
setMetaDataActionCustomizer
Setter for metaDataActionCustomizer -
withMetaDataActionCustomizer
Fluent setter for metaDataActionCustomizer -
getTableCustomizers
Getter for tableCustomizers -
setTableCustomizers
Setter for tableCustomizers -
withTableCustomizers
Fluent setter for tableCustomizers -
withTableCustomizer
-
withTableCustomizer
-
getTableCustomizers
Getter for tableCustomizers -
getRecordChangeListeners
Getter for recordChangeListeners -
setRecordChangeListeners
Setter for recordChangeListeners -
withRecordChangeListener
Add a RecordChangeListenerInterface, which InsertAction, UpdateAction and DeleteAction call with the records they write successfully. -
addAuditHandler
Add an audit handler to the instance. -
getAuditHandlers
Getter for auditHandlers -
setAuditHandlers
Setter for auditHandlers -
withAuditHandlers
Fluent setter for auditHandlers -
withAuditHandler
Fluent setter to add a single audit handler -
getAuditHandlersForTable
public List<QAuditHandlerMetaData> getAuditHandlersForTable(String tableName, AuditHandlerType handlerType) Get audit handlers for a specific table and handler type. Returns global handlers (no tableNames set) plus handlers for this table. -
getProcessLifecycleListeners
Getter for processLifecycleListeners - code references to ProcessLifecycleListenerInterface implementations. -
setProcessLifecycleListeners
Setter for processLifecycleListeners -
withProcessLifecycleListeners
Fluent setter for processLifecycleListeners -
withProcessLifecycleListener
Fluent method to add one process lifecycle listener (a code reference to a ProcessLifecycleListenerInterface implementation). -
getRuntimeServices
Getter for runtimeServices - code references to QRuntimeServiceInterface implementations, which an application launcher starts (in this order) after the server, and stops (in reverse order) at shutdown. -
setRuntimeServices
Setter for runtimeServices -
withRuntimeService
Fluent method to add one runtime service (a code reference to a QRuntimeServiceInterface implementation). -
getRecordSearchProvider
Getter for recordSearchProvider - a code reference to a RecordSearchProviderInterface implementation, which RecordSearchAction asks to search the tables it claims (null - the default - searches every table with the default search over its search fields). -
setRecordSearchProvider
Setter for recordSearchProvider -
withRecordSearchProvider
Fluent setter for recordSearchProvider - a code reference to a RecordSearchProviderInterface implementation. -
getFailOnMetaDataProducerError
Getter for failOnMetaDataProducerError - if true, MetaDataProducerHelper throws when it can't use or run a meta-data producer, instead of logging a warning. -
setFailOnMetaDataProducerError
Setter for failOnMetaDataProducerError -
withFailOnMetaDataProducerError
-
getEnforcePermissionsInCoreActions
Getter for enforcePermissionsInCoreActions (may be null, meaning "not configured" - see CorePermissionEnforcer.isInstanceEnforcementEnabled for the effective value). -
setEnforcePermissionsInCoreActions
Setter for enforcePermissionsInCoreActions -
withEnforcePermissionsInCoreActions
Fluent setter for enforcePermissionsInCoreActions - set to true so that core actions enforce table/process/widget/report permissions and field security locks themselves, for every entry point (not only the middlewares).
-