Class ServerFeatureUtil
- java.lang.Object
-
- io.openliberty.tools.common.plugins.util.AbstractContainerSupportUtil
-
- io.openliberty.tools.common.plugins.util.ServerFeatureUtil
-
- All Implemented Interfaces:
CommonLoggerI
- Direct Known Subclasses:
InstallFeatureUtil,PrepareFeatureUtil
public abstract class ServerFeatureUtil extends AbstractContainerSupportUtil implements CommonLoggerI
Utility class to determine server features
-
-
Field Summary
Fields Modifier and Type Field Description static StringINSTALL_MAP_ARTIFACT_IDstatic StringOPEN_LIBERTY_GROUP_IDstatic StringREPOSITORY_RESOLVER_ARTIFACT_IDstatic StringSERVER_CONFIG_DIRstatic StringSHARED_APP_DIRstatic StringSHARED_CONFIG_DIRstatic StringSHARED_RESOURCES_DIRstatic StringSHARED_STACKGROUP_DIRprotected booleansuppressLogsstatic StringUSR_EXTENSION_DIRstatic StringWLP_INSTALL_DIRstatic StringWLP_USER_DIR
-
Constructor Summary
Constructors Constructor Description ServerFeatureUtil()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voiddebug(String msg)Log debugabstract voiddebug(String msg, Throwable e)Log debugabstract voiddebug(Throwable e)Log debugabstract voiderror(String msg)Log errorabstract voiderror(String msg, Throwable e)Log errorMap<String,File>getLibertyDirectoryPropertyFiles()Set<String>getServerFeatures(File serverDirectory, File serverXmlFile, Map<String,File> libertyDirPropFiles, Set<String> dropinsFilesToIgnore)Get the set of features defined in the server.xmlSet<String>getServerFeatures(File serverDirectory, Map<String,File> libertyDirPropFiles)Get the set of features defined in the server.xmlSet<String>getServerFeatures(File serverDirectory, Map<String,File> libertyDirPropFiles, Set<String> dropinsFilesToIgnore)Get the set of features defined in the server.xmlSet<String>getServerXmlFeatures(Set<String> origResult, File serverDirectory, File serverFile, Properties bootstrapProperties, List<File> parsedXmls)Adds features from the given server file into the origResult or a new set if origResult is null.protected FilegetUserExtensionPath()abstract voidinfo(String msg)Log infoabstract booleanisDebugEnabled()Returns whether debug is enabled by the current loggervoidsetLibertyDirectoryPropertyFiles(Map<String,File> libertyDirPropFiles)voidsetLowerCaseFeatures(boolean val)Indicate whether the feature names should be converted to lower case.voidsetSuppressLogs(boolean val)Indicate whether the info and warning messages should not be displayed.abstract voidwarn(String msg)Log warning-
Methods inherited from class io.openliberty.tools.common.plugins.util.AbstractContainerSupportUtil
execDockerCmd, readStdOut
-
-
-
-
Field Detail
-
OPEN_LIBERTY_GROUP_ID
public static final String OPEN_LIBERTY_GROUP_ID
- See Also:
- Constant Field Values
-
REPOSITORY_RESOLVER_ARTIFACT_ID
public static final String REPOSITORY_RESOLVER_ARTIFACT_ID
- See Also:
- Constant Field Values
-
INSTALL_MAP_ARTIFACT_ID
public static final String INSTALL_MAP_ARTIFACT_ID
- See Also:
- Constant Field Values
-
WLP_INSTALL_DIR
public static final String WLP_INSTALL_DIR
- See Also:
- Constant Field Values
-
WLP_USER_DIR
public static final String WLP_USER_DIR
- See Also:
- Constant Field Values
-
USR_EXTENSION_DIR
public static final String USR_EXTENSION_DIR
- See Also:
- Constant Field Values
-
SHARED_APP_DIR
public static final String SHARED_APP_DIR
- See Also:
- Constant Field Values
-
SHARED_CONFIG_DIR
public static final String SHARED_CONFIG_DIR
- See Also:
- Constant Field Values
-
SHARED_RESOURCES_DIR
public static final String SHARED_RESOURCES_DIR
- See Also:
- Constant Field Values
-
SHARED_STACKGROUP_DIR
public static final String SHARED_STACKGROUP_DIR
- See Also:
- Constant Field Values
-
SERVER_CONFIG_DIR
public static final String SERVER_CONFIG_DIR
- See Also:
- Constant Field Values
-
suppressLogs
protected boolean suppressLogs
-
-
Method Detail
-
debug
public abstract void debug(String msg)
Log debug- Specified by:
debugin interfaceCommonLoggerI- Specified by:
debugin classAbstractContainerSupportUtil- Parameters:
msg-
-
debug
public abstract void debug(String msg, Throwable e)
Log debug- Specified by:
debugin interfaceCommonLoggerI- Parameters:
msg-e-
-
debug
public abstract void debug(Throwable e)
Log debug- Specified by:
debugin interfaceCommonLoggerI- Parameters:
e-
-
warn
public abstract void warn(String msg)
Log warning- Specified by:
warnin interfaceCommonLoggerI- Parameters:
msg-
-
info
public abstract void info(String msg)
Log info- Specified by:
infoin interfaceCommonLoggerI- Parameters:
msg-
-
error
public abstract void error(String msg)
Log error- Specified by:
errorin interfaceCommonLoggerI- Parameters:
msg-
-
error
public abstract void error(String msg, Throwable e)
Log error- Specified by:
errorin classAbstractContainerSupportUtil- Parameters:
msg-e-
-
isDebugEnabled
public abstract boolean isDebugEnabled()
Returns whether debug is enabled by the current logger- Specified by:
isDebugEnabledin interfaceCommonLoggerI- Returns:
- whether debug is enabled
-
setLibertyDirectoryPropertyFiles
public void setLibertyDirectoryPropertyFiles(Map<String,File> libertyDirPropFiles)
-
getServerFeatures
public Set<String> getServerFeatures(File serverDirectory, File serverXmlFile, Map<String,File> libertyDirPropFiles, Set<String> dropinsFilesToIgnore)
Get the set of features defined in the server.xml- Parameters:
serverDirectory- The server directory containing the server.xmlserverXmlFile- The server.xml filelibertyDirPropFiles- Map of Liberty directory properties to the actual File for each directorydropinsFilesToIgnore- A set of file names under configDropins/overrides or configDropins/defaults to ignore- Returns:
- the set of features that should be installed from server.xml, or empty set if nothing should be installed or null if there are no valid xml files or they have no featureManager section
-
getServerFeatures
public Set<String> getServerFeatures(File serverDirectory, Map<String,File> libertyDirPropFiles, Set<String> dropinsFilesToIgnore)
Get the set of features defined in the server.xml- Parameters:
serverDirectory- The server directory containing the server.xmllibertyDirPropFiles- Map of Liberty directory properties to the actual File for each directorydropinsFilesToIgnore- A set of file names under configDropins/overrides or configDropins/defaults to ignore- Returns:
- the set of features that should be installed from server.xml, or empty set if nothing should be installed or null if there are no valid xml files or they have no featureManager section
-
getServerFeatures
public Set<String> getServerFeatures(File serverDirectory, Map<String,File> libertyDirPropFiles)
Get the set of features defined in the server.xml- Parameters:
serverDirectory- The server directory containing the server.xmllibertyDirPropFiles- Map of Liberty directory properties to the actual File for each directory- Returns:
- the set of features that should be installed from server.xml, or empty set if nothing should be installed or null if there are no valid xml files or they have no featureManager section
-
setLowerCaseFeatures
public void setLowerCaseFeatures(boolean val)
Indicate whether the feature names should be converted to lower case. The default is to make all the names lower case.- Parameters:
val- boolean false to indicate names should remain mixed case as defined in Liberty. True indicates the names will be folded to lower case.
-
setSuppressLogs
public void setSuppressLogs(boolean val)
Indicate whether the info and warning messages should not be displayed. Used as part of the dev mode flow to avoid flooding the console.- Parameters:
val- boolean true to indicate that info and warning log messages should be not displayed.
-
getServerXmlFeatures
public Set<String> getServerXmlFeatures(Set<String> origResult, File serverDirectory, File serverFile, Properties bootstrapProperties, List<File> parsedXmls)
Adds features from the given server file into the origResult or a new set if origResult is null.- Parameters:
origResult- The features that have been parsed so far.serverDirectory- The server directory containing the server.xml.serverFile- The server XML file.bootstrapProperties- The properties defined in bootstrap.properties.parsedXmls- The list of XML files that have been parsed so far.- Returns:
- The set of features to install, or empty set if the cumulatively parsed xml files only have featureManager sections but no features to install, or null if there are no valid xml files or they have no featureManager section
-
getUserExtensionPath
protected File getUserExtensionPath()
-
-