Skip to content

Commit

Permalink
Server instance should only rely on OMAG config document
Browse files Browse the repository at this point in the history
Signed-off-by: Ljupcho Palashevski <lpalashevski@gmail.com>
  • Loading branch information
lpalashevski committed Sep 8, 2023
1 parent 8b92d50 commit 29a4040
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ public void run(ApplicationArguments args) {
*/
@EventListener(ContextClosedEvent.class)
private void onContextClosedEvent() {
//TODO: Improvement required: the name of the server should be taken for the configuration.
if (configHelper.getOmagServerConfig().getLocalServerName() != null) {
if (configHelper.getOmagServerConfig() != null) {
LOG.info("Application stopped, deactivating server: {}", configHelper.getOmagServerConfig().getLocalServerName());
operationalServices.deactivateTemporarilyServerList(configHelper.getServerProperties().getDefaultUser(), List.of(configHelper.getOmagServerConfig().getLocalServerName()));
operationalServices.deactivateTemporarilyServerList(configHelper.getOmagServerConfig().getLocalServerUserId(), List.of(configHelper.getOmagServerConfig().getLocalServerName()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ public class OMAGServerProperties {
// @NotNull
private Resource serverConfigFile;

/**
* Configures the default user parameter used to activate the OMAG server instance using platform operational services.
* @see org.odpi.openmetadata.platformservices.server.OMAGServerOperationalServices#activateWithSuppliedConfig(String, String, OMAGServerConfig)
*/
@Value("${omag.server-user:${omag.server.user:system}}")
private String defaultUser;


/**
* Server bean represents simplified OMAG server configuration model used for YAML based application configuration.
*/
Expand Down

0 comments on commit 29a4040

Please sign in to comment.