EAC Components 3.2.2

com.endeca.soleng.eac.toolkit.component
Class ConfigManagerComponent

java.lang.Object
  extended by com.endeca.soleng.eac.toolkit.base.EacElement
      extended by com.endeca.soleng.eac.toolkit.base.Provisionable
          extended by com.endeca.soleng.eac.toolkit.component.CustomComponent
              extended by com.endeca.soleng.eac.toolkit.component.ConfigManagerComponent

public class ConfigManagerComponent
extends com.endeca.soleng.eac.toolkit.component.CustomComponent

This custom component represents a configuration manager, which interacts with disparate configuration sources to retrieve and merge configuration files. This implementation handles integration with Web Studio's config store as well as a Dev Studio-maintained configuration source. Though this is "provisioned" like a component in the app configuration, this object's provisioning is stored as a set of custom properties (key value pairs) on the provisioned host on which this component runs.


Field Summary
 
Fields inherited from class com.endeca.soleng.eac.toolkit.base.EacElement
appName, dataPrefix, eacHost, eacPort, elementId, lockManager, logDir, sslEnabled, workingDir
 
Constructor Summary
ConfigManagerComponent()
          Constructor for the Config Manager custom component.
 
Method Summary
 void cleanDirs()
          Cleans the component's directories.
 void downloadWsConfig()
          Downloads Web Studio configuration to WS config directory.
 void downloadWsConfig(boolean filterInactive)
          Downloads Web Studio configuration to WS config directory.
 void downloadWsDgraphConfig()
          Downloads Web Studio dgraph configuration WS temp directory.
 void downloadWsDgraphConfig(boolean filterInactive)
          Downloads Web Studio dgraph configuration WS temp directory.
 void fetchDsConfig()
          Retrieves Dev Studio config from the DS config directory and delivers it to the merged config directory.
 void fetchMergedConfig()
          Retrieves configuration from disparate sources and merges into the merged config directory.
 void fetchWsConfig()
          Retrieves Web Studio config from the WS config directory and delivers it to the merged config directory.
 java.lang.String getDsConfigDir()
           
 java.lang.String getMergedConfigDir()
           
 java.lang.String getWsConfigDir()
           
 java.lang.String getWsDgraphConfigDir()
           
 java.lang.String getWsHost()
           
 java.util.List<java.lang.String> getWsMaintainedFiles()
           
 java.lang.String getWsPort()
           
 java.lang.String getWsTempDir()
           
 boolean isSkipTestingForFilesDuringCleanup()
          Retrieves the boolean indicating whether directory cleanup should use the default behavior of first testing for non-empty directory contents, or if that test should be skipped.
 boolean isWebStudioEnabled()
           
 void removeDefinition()
           
 void removeWsConfig()
          Removes any instance configuration files in Web Studio associated with this application.
 void updateWsConfig()
          Updates Web Studio with the latest configuration.
 void updateWsDimensions()
          Updates Web Studio with the latest post-Forge dimensions.
 
Methods inherited from class com.endeca.soleng.eac.toolkit.component.CustomComponent
buildEacStub, getCustomDirectories, getHost, getHostId, getProperties, getProperty, isDefined, isDefinitionChanged, setCustomDirectories, setDefinition, setHostId, setProperties, updateDefinition
 
Methods inherited from class com.endeca.soleng.eac.toolkit.base.Provisionable
getAppDefinitionFromEac, getCachedAppDefinition, getProvisioningPort, invalidateCachedAppDefinition, setCachedAppDefinition
 
Methods inherited from class com.endeca.soleng.eac.toolkit.base.EacElement
getAppName, getDataPrefix, getEacHost, getEacPort, getElementId, getLockManager, getLogDir, getWorkingDir, isSslEnabled, setAppName, setDataPrefix, setEacHost, setEacPort, setElementId, setLockManager, setLogDir, setSslEnabled, setWorkingDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigManagerComponent

public ConfigManagerComponent()
Constructor for the Config Manager custom component.

Method Detail

cleanDirs

public void cleanDirs()
               throws com.endeca.soleng.eac.toolkit.exception.AppConfigurationException,
                      com.endeca.soleng.eac.toolkit.exception.EacCommunicationException,
                      com.endeca.soleng.eac.toolkit.exception.EacComponentControlException
Cleans the component's directories. Specifically, the webStudioTempDir directory is cleaned.

Throws:
com.endeca.soleng.eac.toolkit.exception.AppConfigurationException
com.endeca.soleng.eac.toolkit.exception.EacCommunicationException
com.endeca.soleng.eac.toolkit.exception.EacComponentControlException

fetchMergedConfig

public void fetchMergedConfig()
                       throws com.endeca.soleng.eac.toolkit.exception.AppConfigurationException,
                              com.endeca.soleng.eac.toolkit.exception.EacCommunicationException,
                              com.endeca.soleng.eac.toolkit.exception.EacComponentControlException
Retrieves configuration from disparate sources and merges into the merged config directory. This implementation retrieves all files from the dev studio config directory and only those files that are maintained in Web Studio according to config, overwriting the dev studio versions of those web studio maintained files.

Throws:
com.endeca.soleng.eac.toolkit.exception.EacComponentControlException
com.endeca.soleng.eac.toolkit.exception.EacCommunicationException
com.endeca.soleng.eac.toolkit.exception.AppConfigurationException

fetchDsConfig

public void fetchDsConfig()
                   throws com.endeca.soleng.eac.toolkit.exception.AppConfigurationException,
                          com.endeca.soleng.eac.toolkit.exception.EacCommunicationException,
                          com.endeca.soleng.eac.toolkit.exception.EacComponentControlException
Retrieves Dev Studio config from the DS config directory and delivers it to the merged config directory.

Throws:
com.endeca.soleng.eac.toolkit.exception.AppConfigurationException
com.endeca.soleng.eac.toolkit.exception.EacCommunicationException
com.endeca.soleng.eac.toolkit.exception.EacComponentControlException

fetchWsConfig

public void fetchWsConfig()
                   throws com.endeca.soleng.eac.toolkit.exception.AppConfigurationException,
                          com.endeca.soleng.eac.toolkit.exception.EacCommunicationException,
                          com.endeca.soleng.eac.toolkit.exception.EacComponentControlException
Retrieves Web Studio config from the WS config directory and delivers it to the merged config directory.

Throws:
com.endeca.soleng.eac.toolkit.exception.AppConfigurationException
com.endeca.soleng.eac.toolkit.exception.EacCommunicationException
com.endeca.soleng.eac.toolkit.exception.EacComponentControlException

downloadWsConfig

public void downloadWsConfig()
                      throws com.endeca.soleng.eac.toolkit.exception.EacCommunicationException,
                             com.endeca.soleng.eac.toolkit.exception.EacComponentControlException,
                             com.endeca.soleng.eac.toolkit.exception.AppConfigurationException
Downloads Web Studio configuration to WS config directory. Behavior is to download only Web Studio config files and to filter inactive merch rules. Equivalent of #downloadWsConfig(true).

Throws:
com.endeca.soleng.eac.toolkit.exception.EacCommunicationException
com.endeca.soleng.eac.toolkit.exception.EacComponentControlException
com.endeca.soleng.eac.toolkit.exception.AppConfigurationException

downloadWsConfig

public void downloadWsConfig(boolean filterInactive)
                      throws com.endeca.soleng.eac.toolkit.exception.EacCommunicationException,
                             com.endeca.soleng.eac.toolkit.exception.EacComponentControlException,
                             com.endeca.soleng.eac.toolkit.exception.AppConfigurationException
Downloads Web Studio configuration to WS config directory. Behavior is to download only Web Studio config files. Whether inactive merch rules are downloaded is controlled by the boolean param.

Parameters:
filterInactive - true if inactive merch rules should not be downloaded.
Throws:
com.endeca.soleng.eac.toolkit.exception.EacCommunicationException
com.endeca.soleng.eac.toolkit.exception.EacComponentControlException
com.endeca.soleng.eac.toolkit.exception.AppConfigurationException

downloadWsDgraphConfig

public void downloadWsDgraphConfig()
                            throws com.endeca.soleng.eac.toolkit.exception.EacCommunicationException,
                                   com.endeca.soleng.eac.toolkit.exception.EacComponentControlException,
                                   com.endeca.soleng.eac.toolkit.exception.AppConfigurationException
Downloads Web Studio dgraph configuration WS temp directory. Behavior is to download only Web Studio config files that can be hot-updated (without baseline)in the dgraph, as determined by the emgr_update "get_mdex_settings" action. Inactive merch rules are filtered. Configuration files are moved from the temp directory to the Web Studio dgraph config directory, respecting the list of files configured to be maintained in WS. That is, only files named (or matching a wildcard pattern) as wsMaintainedFiles end up in the WS dgraph config director. Equivalent of #downloadWsDgraphConfig(true).

Throws:
com.endeca.soleng.eac.toolkit.exception.EacCommunicationException
com.endeca.soleng.eac.toolkit.exception.EacComponentControlException
com.endeca.soleng.eac.toolkit.exception.AppConfigurationException

downloadWsDgraphConfig

public void downloadWsDgraphConfig(boolean filterInactive)
                            throws com.endeca.soleng.eac.toolkit.exception.EacCommunicationException,
                                   com.endeca.soleng.eac.toolkit.exception.EacComponentControlException,
                                   com.endeca.soleng.eac.toolkit.exception.AppConfigurationException
Downloads Web Studio dgraph configuration WS temp directory. Behavior is to download only Web Studio config files that can be hot-updated (without baseline)in the dgraph, as determined by the emgr_update "get_mdex_settings" action. Boolean param determines whether inactive merch rules are filtered. Configuration files are moved from the temp directory to the Web Studio dgraph config directory, respecting the list of files configured to be maintained in WS. That is, only files named (or matching a wildcard pattern) as wsMaintainedFiles end up in the WS dgraph config director.

Throws:
com.endeca.soleng.eac.toolkit.exception.EacCommunicationException
com.endeca.soleng.eac.toolkit.exception.EacComponentControlException
com.endeca.soleng.eac.toolkit.exception.AppConfigurationException

updateWsConfig

public void updateWsConfig()
                    throws com.endeca.soleng.eac.toolkit.exception.EacCommunicationException,
                           com.endeca.soleng.eac.toolkit.exception.EacComponentControlException,
                           com.endeca.soleng.eac.toolkit.exception.AppConfigurationException
Updates Web Studio with the latest configuration. This implementation downloads any files that are currently in Web Studio, merges them (per the merge configuration defined for the fetchMergedConfig method) and then uploads the full config to Web Studio. Effectively, this means that all of the files that are not maintained by Web Studio are updated to match the most recent files in the Dev Studio config directory. This method does not attempt to break Web Studio locks and will fail if any are held. This type of coordination is expected to be handled by the user invoking this method.

Throws:
com.endeca.soleng.eac.toolkit.exception.EacCommunicationException
com.endeca.soleng.eac.toolkit.exception.EacComponentControlException
com.endeca.soleng.eac.toolkit.exception.AppConfigurationException

removeWsConfig

public void removeWsConfig()
Removes any instance configuration files in Web Studio associated with this application. This method will exit if no Web Studio host or port is configured and will catch utility invocation failures, log them, and exit gracefully.

Throws:
com.endeca.soleng.eac.toolkit.exception.EacCommunicationException
com.endeca.soleng.eac.toolkit.exception.AppConfigurationException

updateWsDimensions

public void updateWsDimensions()
                        throws com.endeca.soleng.eac.toolkit.exception.EacCommunicationException,
                               com.endeca.soleng.eac.toolkit.exception.EacComponentControlException,
                               com.endeca.soleng.eac.toolkit.exception.AppConfigurationException
Updates Web Studio with the latest post-Forge dimensions. This implementation looks for a file named [dataPrefix].dimensions.xml* in the webStudioTempDir directory. If no such file is found, a file with any prefix that includes "dimensions.xml" is uploaded. This should support files with any prefix, giving precedence to the one that matches the configured data prefix, as well as compressed (.xml.gz) and uncompressed (.xml) versions of the file.

Throws:
com.endeca.soleng.eac.toolkit.exception.EacCommunicationException
com.endeca.soleng.eac.toolkit.exception.EacComponentControlException
com.endeca.soleng.eac.toolkit.exception.AppConfigurationException

removeDefinition

public void removeDefinition()
                      throws com.endeca.soleng.eac.toolkit.exception.EacCommunicationException,
                             com.endeca.soleng.eac.toolkit.exception.EacComponentControlException
Overrides:
removeDefinition in class com.endeca.soleng.eac.toolkit.component.CustomComponent
Throws:
com.endeca.soleng.eac.toolkit.exception.EacCommunicationException
com.endeca.soleng.eac.toolkit.exception.EacComponentControlException

getDsConfigDir

public java.lang.String getDsConfigDir()

getWsConfigDir

public java.lang.String getWsConfigDir()

getWsDgraphConfigDir

public java.lang.String getWsDgraphConfigDir()

getWsPort

public java.lang.String getWsPort()

getWsHost

public java.lang.String getWsHost()

isWebStudioEnabled

public boolean isWebStudioEnabled()

getWsTempDir

public java.lang.String getWsTempDir()

getMergedConfigDir

public java.lang.String getMergedConfigDir()

getWsMaintainedFiles

public java.util.List<java.lang.String> getWsMaintainedFiles()

isSkipTestingForFilesDuringCleanup

public boolean isSkipTestingForFilesDuringCleanup()
Retrieves the boolean indicating whether directory cleanup should use the default behavior of first testing for non-empty directory contents, or if that test should be skipped. If no value exists or if the value does not parse as a boolean, the default value of "false" is returned. If "true" is specified, CleanDirUtility invocations will skip the test and will attempt to clean directories even if they are empty.

Returns:
Returns boolean indicator of whether cleanup should skip checking directory contents, as configured in property "skipTestingForFilesDuringCleanup."

EAC Components 3.2.2

Copyright © 2006, 2012, Oracle and/or its affiliates. All rights reserved.
@VERSION
PRODUCT: EAC Components (eacComponents)
VERSION: 3.2.2
BUILD:   NONEDEV
ARCH_OS: n/a
DATE:    2012-02-28T13:13:23-0500