Interface CometConfigurationLocal
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe Constant ENV_PLACEHOLDER_PROPERTY SESSION_PREFIX + "placeholder"static final StringThe Constant ENV_SUBJECT_PROPERTY SESSION_PREFIX + "subject"static final StringThe Constant INDEX_FILENAME "index.xml"static final StringThe Constant JNDINAME "java:global/CometConfiguration/CometConfiguration!com.priint.pubserver.comet.config.CometConfigurationLocal".static final StringThe mapped name of the CometConfiguration Pluginstatic final StringThe Constant NAME_SEPARATOR "-"static final StringThe Constant PROJECT_FILENAME "cometproject.xml"static final StringThe Constant SESSION_CLIENT_PROPERTY SESSION_PREFIX + "client"static final StringThe Constant SESSION_LANGUAGE_PROPERTY SESSION_PREFIX + "language"static final StringThe Constant SESSION_PREFIX "cometConfiguration::".static final StringThe Constant SESSION_PROJECT_PROPERTY SESSION_PREFIX + "project"static final StringThe Constant SESSION_REGION_PROPERTY SESSION_PREFIX + "region"static final StringThe Constant SESSION_UI_LANGUAGE_PROPERTY SESSION_PREFIX + "ui_language" -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDependency(PluginConfigDataHandler container, PluginConfigDataHandler dependentItem, PluginConfigDependencyRestriction restriction) Add a dependency to a configuration item.checkCScriptSyntax(String projectIdentifier) Check CScript syntax This is a PluginMethod.MethodType.CONFIGURATION_COMET_PROJECT_CHECK method intended to be run e.g.checkForBrokenDependencies(String projectIdentifier) Check for broken dependencies in a comet project repository.
This is a PluginMethod.MethodType.CONFIGURATION_CHECK method intended to be run e.g.checkForDuplicateIDs(String projectIdentifier) Check for duplicate IDs in a comet project repository.
This is a PluginMethod.MethodType.CONFIGURATION_CHECK method intended to be run e.g.checkForNotConnectorCheckCometProject(String projectIdentifier) Check for not connector check comet project.checkForNotcScriptExampleCometProject(String projectIdentifier) Check for notc script example comet project.checkForNotDataProviderCometProject(String projectIdentifier) Check for not data provider comet project.checkForNotExistingEntityModelForCometProject(String projectIdentifier) Check for not existing entity model for comet project.checkForNotExistingPanelActionLabelCometProject(String projectIdentifier) Check for not existing panel action label comet project.checkForNotExistingPanelActionStatementCometProject(String projectIdentifier) Check for not existing panel action statement comet project.checkForNotExistingPlaceholderDataProviderSelectionCheckCometProject(String projectIdentifier) Check for not existing placeholder data provider selection check comet project.checkForNotPlaceholderDataMappingMethodCometProject(String projectIdentifier) Check for not placeholder data mapping method comet project.checkForNotPlaceholderDataQueryMethodCometProject(String projectIdentifier) Check for not placeholder data query method comet project.checkForNotPlaceholderEntityCometProject(String projectIdentifier) Check for not placeholder entity comet project.checkTypeIntegrity(String projectIdentifier) Check for type integrity, i.e., if all required dependent files for certain types exist, if all type or field constraints are fulfilled etc.
This is a PluginMethod.MethodType.CONFIGURATION_CHECK method intended to be run e.g.createAnonymousSession(String name, long maxIdleTimeInMillis) Create a new and anonymous session.createOrUpdateConfig(PluginConfigDataHandler container) Creates or updates a configurationvoidCreates the or update config list.voiddeleteCometConfiguration(String projectIdentifier) Delete comet configuration.duplicateCometConfiguration(String values) Deprecated.duplicateCometConfiguration(String sourceProject, String newIdentifier, String newLabel, String newClient, String newDescription) Duplicate comet configuration.voidEnd transaction mode and persist all modifications.booleanexistsInRepository(PluginConfigDataHandler container) Check, if an item already exists in the repository.
This will return false for items only existing in current transactions and not persisted yet.<T extends CometEntity>
PluginConfigDataHandlerfindByIdAndClass(int id, Class<T> containerClass) Finds a particular configurationGet the repository path for a particular item.
Returns the absolute path respecting all client and project hierarchy.getAbsolutePath(String relativePath) Gets the absolute path.getConfigPath(String relativePath) Calculates the absolute configuration path for a given session and relative path.
This is the root directory of the current Comet configuration.<T extends CometEntity>
List<PluginConfigDataHandler>getDependentItems(PluginConfigDataHandler container, Class<T> clazz) Get dependent configuration items of a specific class.<T extends CometEntity>
PluginConfigDataHandlerGets a single item of a specific class and URI<T extends CometEntity>
List<PluginConfigDataHandler>Gets items of a specific classintGets a new unique ID.getProject(String projectName) Get a CometProject identified by the given name.Get the list of comet project registered on startup or created / imported on runtime.Get the language (if set) for the current session.Get the CometProject for the current session.Get the region resp.booleanTell, whether a transaction is currently active or not.Start a CometConfiguration session.voidLogin pre check.voidlogout()Stop a CometConfiguration session.voidremoveConfig(PluginConfigDataHandler container) Delete a configuration item.voidrepairAddBackwardDependency(String path, String dependencyName) Repair add backward dependency.voidrepairAddConfigToIndex(String path) Repair add config to index.voidRepair add index to project.voidrepairChangeDependencyRestriction(String path, String dependencyName, String restriction) Repair change dependency restriction.voidrepairChangeFieldIdValue(String configPath, String fieldName, String oldValue) Repair change field id value.voidrepairDeleteDependency(String path, String dependencyName) Repair delete dependency.voidRepair delete orphaned child or twin.voidrepairRecreateWithNewId(String configPath, String fieldName) Repair recreate with new id.voidReset the applicationvoidsetSessionContext(String client, String project, String language, String region) Set the context of this session.voidsetSessionContext4LoginLocal(String sessionId, String client, String project, String language, String region) Sets the session context 4 login local.voidStart transaction mode.
-
Field Details
-
JNDINAME
The Constant JNDINAME "java:global/CometConfiguration/CometConfiguration!com.priint.pubserver.comet.config.CometConfigurationLocal".- See Also:
-
MAPPED_NAME
The mapped name of the CometConfiguration Plugin
Use this name when requesting a Plugin instance from the PluginManager
.- See Also:
-
SESSION_PREFIX
The Constant SESSION_PREFIX "cometConfiguration::".- See Also:
-
SESSION_CLIENT_PROPERTY
The Constant SESSION_CLIENT_PROPERTY SESSION_PREFIX + "client"- See Also:
-
SESSION_PROJECT_PROPERTY
The Constant SESSION_PROJECT_PROPERTY SESSION_PREFIX + "project"- See Also:
-
SESSION_LANGUAGE_PROPERTY
The Constant SESSION_LANGUAGE_PROPERTY SESSION_PREFIX + "language"- See Also:
-
SESSION_UI_LANGUAGE_PROPERTY
The Constant SESSION_UI_LANGUAGE_PROPERTY SESSION_PREFIX + "ui_language"- See Also:
-
SESSION_REGION_PROPERTY
The Constant SESSION_REGION_PROPERTY SESSION_PREFIX + "region"- See Also:
-
ENV_PLACEHOLDER_PROPERTY
The Constant ENV_PLACEHOLDER_PROPERTY SESSION_PREFIX + "placeholder"- See Also:
-
ENV_SUBJECT_PROPERTY
The Constant ENV_SUBJECT_PROPERTY SESSION_PREFIX + "subject"- See Also:
-
PROJECT_FILENAME
The Constant PROJECT_FILENAME "cometproject.xml"- See Also:
-
INDEX_FILENAME
The Constant INDEX_FILENAME "index.xml"- See Also:
-
NAME_SEPARATOR
The Constant NAME_SEPARATOR "-"- See Also:
-
-
Method Details
-
createAnonymousSession
Create a new and anonymous session.- Parameters:
name- - login namemaxIdleTimeInMillis- new session will expire after this time- Returns:
- session id of anonymous session
- Throws:
CometException- the comet exception
-
addDependency
void addDependency(PluginConfigDataHandler container, PluginConfigDataHandler dependentItem, PluginConfigDependencyRestriction restriction) throws CometException, InvalidSessionException Add a dependency to a configuration item.
If this particular dependency already exists, nothing will happen. If this dependency does not yet exist, it will be added and persisted (i.e. saved to the repository)
- Parameters:
container- the containerdependentItem- the dependent itemrestriction- the restriction- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
checkForBrokenDependencies
CheckResult checkForBrokenDependencies(String projectIdentifier) throws CometException, InvalidSessionException Check for broken dependencies in a comet project repository.
This is a PluginMethod.MethodType.CONFIGURATION_CHECK method intended to be run e.g. from the Ison client "Check rules" view.
- Parameters:
projectIdentifier- the project identifier- Returns:
- CheckResult
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
checkForDuplicateIDs
CheckResult checkForDuplicateIDs(String projectIdentifier) throws CometException, InvalidSessionException Check for duplicate IDs in a comet project repository.
This is a PluginMethod.MethodType.CONFIGURATION_CHECK method intended to be run e.g. from the Ison client "Check rules" view.- Parameters:
projectIdentifier- the project identifier- Returns:
- CheckResult
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
checkTypeIntegrity
CheckResult checkTypeIntegrity(String projectIdentifier) throws CometException, InvalidSessionException Check for type integrity, i.e., if all required dependent files for certain types exist, if all type or field constraints are fulfilled etc.
This is a PluginMethod.MethodType.CONFIGURATION_CHECK method intended to be run e.g. from the Ison client "Check rules" view.
- Parameters:
projectIdentifier- the project identifier- Returns:
- CheckResult
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
checkCScriptSyntax
CheckResult checkCScriptSyntax(String projectIdentifier) throws CometException, InvalidSessionException Check CScript syntax This is a PluginMethod.MethodType.CONFIGURATION_COMET_PROJECT_CHECK method intended to be run e.g. from the PRIINT Suite Validation Panel
- Parameters:
projectIdentifier- the project identifier- Returns:
- CheckResult
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
createOrUpdateConfig
PluginConfigDataHandler createOrUpdateConfig(PluginConfigDataHandler container) throws CometException, InvalidSessionException Creates or updates a configuration
.- Parameters:
container- the container- Returns:
- the updated configuration
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
endTransaction
End transaction mode and persist all modifications. If currently no transaction is active, an Exception will be raised.
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
existsInRepository
boolean existsInRepository(PluginConfigDataHandler container) throws CometException, InvalidSessionException Check, if an item already exists in the repository.
This will return false for items only existing in current transactions and not persisted yet. The method also returns false for items, that have been deleted.- Parameters:
container- the container- Returns:
- true, if item exists AND is alive
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
findByIdAndClass
<T extends CometEntity> PluginConfigDataHandler findByIdAndClass(int id, Class<T> containerClass) throws CometException, InvalidSessionException Finds a particular configuration
.- Type Parameters:
T- the generic type- Parameters:
id- the idcontainerClass- the container class- Returns:
- the configuration item or null, if not found
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
getAbsoluteContainerPath
String getAbsoluteContainerPath(PluginConfigDataHandler item) throws CometException, InvalidSessionException Get the repository path for a particular item.
Returns the absolute path respecting all client and project hierarchy.Usually there is no need to call this method, because the following code should give the same result:
PluginConfigDataHandler handler; String path = handler.getProperties().getPath();However, if the configuration properties are incomplete or not existing (e.g. if you just created a new configuration), the path for this item can be calculated - provided that this is a valid configuration item within the Comet repository.- Parameters:
item- the item- Returns:
- absolute path of this configuration item
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
getConfigPath
Calculates the absolute configuration path for a given session and relative path.
This is the root directory of the current Comet configuration. The path depends on the client and Comet project choosen for this session.- Parameters:
relativePath- the relative path- Returns:
- configuration root for this session
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
getDependentItems
<T extends CometEntity> List<PluginConfigDataHandler> getDependentItems(PluginConfigDataHandler container, Class<T> clazz) throws CometException, InvalidSessionException Get dependent configuration items of a specific class.
- Type Parameters:
T- the generic type- Parameters:
container- the containerclazz- the clazz- Returns:
- dependent items of a specific class
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
getItem
<T extends CometEntity> PluginConfigDataHandler getItem(String uri, Class<T> clazz) throws CometException, InvalidSessionException Gets a single item of a specific class and URI
.- Type Parameters:
T- the generic type- Parameters:
uri- the uriclazz-- Returns:
- the configuration of this class stored at the given URI.
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
getItems
<T extends CometEntity> List<PluginConfigDataHandler> getItems(Class<T> clazz) throws CometException, InvalidSessionException Gets items of a specific class
.- Type Parameters:
T- the generic type- Parameters:
clazz- the clazz- Returns:
- configuration items of the given class
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
getNewId
Gets a new unique ID.
- Parameters:
externId- the extern idclazz- the clazz- Returns:
- a new, unique ID
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
getProject
Get a CometProject identified by the given name. If this project does not exist, an Exception is thrown.
The CometProject provides information such as client name, entity model etc.- Parameters:
projectName- the project name- Returns:
- the comet project
- Throws:
CometException- if no such project existsInvalidSessionException- the invalid session exception
-
getRegisteredCometProjects
Get the list of comet project registered on startup or created / imported on runtime.
- Returns:
- list (set) of comet projects
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
getSessionLanguage
Get the language (if set) for the current session.
- Returns:
- language for this session
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
getSessionProject
Get the CometProject for the current session.
- Returns:
- CometProject for the current session
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
getSessionRegion
Get the region resp. country for the current session
- Returns:
- region / country for this session
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
isTransactionActive
Tell, whether a transaction is currently active or not.
- Returns:
- true, if a transaction is active, false if not.
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
login
Start a CometConfiguration session. This is just a shortcut for the SessionManagerRemote.login() method in the PubServerKernel, in case you write applications on top of the CometConfiguration EJB and you don't want to setup another EJB client just to call the login method from SessionManager
- Parameters:
user- the userpassword- the password- Returns:
- sessionId, if login succeeds
- Throws:
CometException- if login fails
-
logout
Stop a CometConfiguration session. This is just a shortcut for the SessionManagerRemote.logout() method in the PubServerKernel, in case you write applications on top of the CometConfiguration EJB and you don't want to setup another EJB client just to call the logout method from SessionManager
- Throws:
CometException- if logout fails (e.g. no such session)InvalidSessionException- the invalid session exception
-
removeConfig
Delete a configuration item.
- Parameters:
container- the container- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
repairAddBackwardDependency
void repairAddBackwardDependency(String path, String dependencyName) throws CometException, InvalidSessionException Repair add backward dependency.- Parameters:
path- the pathdependencyName- the dependency name- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
repairAddConfigToIndex
Repair add config to index.- Parameters:
path- the path- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
repairAddIndexToProject
Repair add index to project.- Parameters:
path- the path- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
repairChangeDependencyRestriction
void repairChangeDependencyRestriction(String path, String dependencyName, String restriction) throws CometException, InvalidSessionException Repair change dependency restriction.- Parameters:
path- the pathdependencyName- the dependency namerestriction- the restriction- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
repairChangeFieldIdValue
void repairChangeFieldIdValue(String configPath, String fieldName, String oldValue) throws CometException, InvalidSessionException Repair change field id value.- Parameters:
configPath- the config pathfieldName- the field nameoldValue- the old value- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
repairDeleteDependency
void repairDeleteDependency(String path, String dependencyName) throws CometException, InvalidSessionException Repair delete dependency.- Parameters:
path- the pathdependencyName- the dependency name- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
repairDeleteOrphanedChildOrTwin
Repair delete orphaned child or twin.- Parameters:
path- the path- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
repairRecreateWithNewId
void repairRecreateWithNewId(String configPath, String fieldName) throws CometException, InvalidSessionException Repair recreate with new id.- Parameters:
configPath- the config pathfieldName- the field name- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
resetApplication
Reset the application
This method is mainly intended for testing purposes. In regular operation there should be no need to reset the application. All caches are cleared and startup procedures are executed.
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
setSessionContext
void setSessionContext(String client, String project, String language, String region) throws CometException, InvalidSessionException Set the context of this session.- client defaults to "Default"
- project is an arbitrary string
- Parameters:
client- the clientproject- the projectlanguage- the languageregion- the region- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
startTransaction
Start transaction mode. In transaction mode all modifications will be cached (rather than persisted in the repository).
Only one transaction can be active per session at the time, if transaction mode is already active, an Exception will be raised.- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
duplicateCometConfiguration
@Deprecated String duplicateCometConfiguration(String values) throws CometException, InvalidSessionException Deprecated.Duplicate comet configuration.- Parameters:
values- the values- Returns:
- the string
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
duplicateCometConfiguration
String duplicateCometConfiguration(String sourceProject, String newIdentifier, String newLabel, String newClient, String newDescription) throws CometException, InvalidSessionException Duplicate comet configuration.- Parameters:
sourceProject- the source projectnewIdentifier- the new identifiernewLabel- the new labelnewClient- the new clientnewDescription- the new description- Returns:
- the string
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
deleteCometConfiguration
void deleteCometConfiguration(String projectIdentifier) throws CometException, InvalidSessionException Delete comet configuration.- Parameters:
projectIdentifier- the project identifier- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
checkForNotExistingEntityModelForCometProject
CheckResult checkForNotExistingEntityModelForCometProject(String projectIdentifier) throws CometException, InvalidSessionException Check for not existing entity model for comet project.- Parameters:
projectIdentifier- the project identifier- Returns:
- the check result
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
checkForNotExistingPanelActionLabelCometProject
CheckResult checkForNotExistingPanelActionLabelCometProject(String projectIdentifier) throws CometException, InvalidSessionException Check for not existing panel action label comet project.- Parameters:
projectIdentifier- the project identifier- Returns:
- the check result
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
checkForNotExistingPanelActionStatementCometProject
CheckResult checkForNotExistingPanelActionStatementCometProject(String projectIdentifier) throws CometException, InvalidSessionException Check for not existing panel action statement comet project.- Parameters:
projectIdentifier- the project identifier- Returns:
- the check result
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
checkForNotExistingPlaceholderDataProviderSelectionCheckCometProject
CheckResult checkForNotExistingPlaceholderDataProviderSelectionCheckCometProject(String projectIdentifier) throws CometException, InvalidSessionException Check for not existing placeholder data provider selection check comet project.- Parameters:
projectIdentifier- the project identifier- Returns:
- the check result
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
checkForNotPlaceholderEntityCometProject
CheckResult checkForNotPlaceholderEntityCometProject(String projectIdentifier) throws CometException, InvalidSessionException Check for not placeholder entity comet project.- Parameters:
projectIdentifier- the project identifier- Returns:
- the check result
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
checkForNotPlaceholderDataQueryMethodCometProject
CheckResult checkForNotPlaceholderDataQueryMethodCometProject(String projectIdentifier) throws CometException, InvalidSessionException Check for not placeholder data query method comet project.- Parameters:
projectIdentifier- the project identifier- Returns:
- the check result
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
checkForNotPlaceholderDataMappingMethodCometProject
CheckResult checkForNotPlaceholderDataMappingMethodCometProject(String projectIdentifier) throws CometException, InvalidSessionException Check for not placeholder data mapping method comet project.- Parameters:
projectIdentifier- the project identifier- Returns:
- the check result
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
checkForNotcScriptExampleCometProject
CheckResult checkForNotcScriptExampleCometProject(String projectIdentifier) throws CometException, InvalidSessionException Check for notc script example comet project.- Parameters:
projectIdentifier- the project identifier- Returns:
- the check result
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
checkForNotConnectorCheckCometProject
CheckResult checkForNotConnectorCheckCometProject(String projectIdentifier) throws CometException, InvalidSessionException Check for not connector check comet project.- Parameters:
projectIdentifier- the project identifier- Returns:
- the check result
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
checkForNotDataProviderCometProject
CheckResult checkForNotDataProviderCometProject(String projectIdentifier) throws CometException, InvalidSessionException Check for not data provider comet project.- Parameters:
projectIdentifier- the project identifier- Returns:
- the check result
- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
loginPreCheck
void loginPreCheck()Login pre check. -
createOrUpdateConfigList
void createOrUpdateConfigList(List<PluginConfigDataHandler> items) throws CometException, InvalidSessionException Creates the or update config list.- Parameters:
items- the items- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
setSessionContext4LoginLocal
void setSessionContext4LoginLocal(String sessionId, String client, String project, String language, String region) throws CometException, InvalidSessionException Sets the session context 4 login local.- Parameters:
sessionId- the session idclient- the clientproject- the projectlanguage- the languageregion- the region- Throws:
CometException- the comet exceptionInvalidSessionException- the invalid session exception
-
getAbsolutePath
Gets the absolute path.- Parameters:
relativePath- the relative path- Returns:
- the absolute path
- Throws:
InvalidSessionException- the invalid session exception
-