Class PrepareFeatureUtil
- java.lang.Object
-
- io.openliberty.tools.common.plugins.util.AbstractContainerSupportUtil
-
- io.openliberty.tools.common.plugins.util.ServerFeatureUtil
-
- io.openliberty.tools.common.plugins.util.PrepareFeatureUtil
-
- All Implemented Interfaces:
CommonLoggerI
public abstract class PrepareFeatureUtil extends ServerFeatureUtil
-
-
Field Summary
Fields Modifier and Type Field Description static StringFEATURES_JSON_ARTIFACT_IDstatic StringINSTALL_MAP_ARTIFACT_IDstatic StringOPEN_LIBERTY_GROUP_ID-
Fields inherited from class io.openliberty.tools.common.plugins.util.ServerFeatureUtil
REPOSITORY_RESOLVER_ARTIFACT_ID, SERVER_CONFIG_DIR, SHARED_APP_DIR, SHARED_CONFIG_DIR, SHARED_RESOURCES_DIR, SHARED_STACKGROUP_DIR, suppressLogs, USR_EXTENSION_DIR, WLP_INSTALL_DIR, WLP_USER_DIR
-
-
Constructor Summary
Constructors Constructor Description PrepareFeatureUtil(File installDirectory, String openLibertyVersion)
-
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 FiledownloadArtifact(String groupId, String artifactId, String type, String version)Download the artifact from the specified Maven coordinates, or retrieve it from the cache if it already exists.abstract voiderror(String msg)Log errorabstract voiderror(String msg, Throwable e)Log errorFilegenerateJson(String targetJsonFile, Map<File,String> esaFileMap)Generate JSON at targetJsonFile location for the list of ESAs in esaFiles under the given groupIdStringgetOverrideBundleDescriptor(String groupId, String artifactId)Download the override bundle from the repository with the given groupId and artifactId, corresponding to the latest version in the range between the current Open Liberty version (inclusive) and the next version (exclusive).abstract voidinfo(String msg)Log infoabstract booleanisDebugEnabled()Returns whether debug is enabled by the current loggervoidprepareFeatures(List<String> featureBOMs)voidprovideJsonFileDependency(File file, String groupId, String version)Provide the file dependency of the generated JSON file for Gradle pluginabstract voidwarn(String msg)Log warning-
Methods inherited from class io.openliberty.tools.common.plugins.util.ServerFeatureUtil
getLibertyDirectoryPropertyFiles, getServerFeatures, getServerFeatures, getServerFeatures, getServerXmlFeatures, getUserExtensionPath, setLibertyDirectoryPropertyFiles, setLowerCaseFeatures, setSuppressLogs
-
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
-
INSTALL_MAP_ARTIFACT_ID
public static final String INSTALL_MAP_ARTIFACT_ID
- See Also:
- Constant Field Values
-
FEATURES_JSON_ARTIFACT_ID
public static final String FEATURES_JSON_ARTIFACT_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PrepareFeatureUtil
public PrepareFeatureUtil(File installDirectory, String openLibertyVersion) throws PluginScenarioException, PluginExecutionException
-
-
Method Detail
-
prepareFeatures
public void prepareFeatures(List<String> featureBOMs) throws PluginExecutionException
- Throws:
PluginExecutionException
-
generateJson
public File generateJson(String targetJsonFile, Map<File,String> esaFileMap) throws PluginExecutionException
Generate JSON at targetJsonFile location for the list of ESAs in esaFiles under the given groupId- Parameters:
targetJsonFile- The target file location for the resulting JSONesaFileMap- Map of esa Files to their groupIds- Throws:
PluginExecutionException- Throws an error if unable to generate JSON
-
getOverrideBundleDescriptor
public String getOverrideBundleDescriptor(String groupId, String artifactId) throws PluginExecutionException
Download the override bundle from the repository with the given groupId and artifactId, corresponding to the latest version in the range between the current Open Liberty version (inclusive) and the next version (exclusive). Returns a string in the format "filepath;BundleName" where BundleName is the bundle symbolic name from its manifest.- Parameters:
groupId- the groupId of the bundle to downloadartifactId- the artifactId of the bundle to download- Returns:
- a String representing the bundle in filepath;BundleName format
- Throws:
PluginExecutionException
-
provideJsonFileDependency
public void provideJsonFileDependency(File file, String groupId, String version)
Provide the file dependency of the generated JSON file for Gradle plugin- Parameters:
file- The Features JSON filegroupId- The groupIdversion- The version
-
debug
public abstract void debug(String msg)
Log debug- Specified by:
debugin interfaceCommonLoggerI- Specified by:
debugin classServerFeatureUtil- Parameters:
msg-
-
debug
public abstract void debug(String msg, Throwable e)
Log debug- Specified by:
debugin interfaceCommonLoggerI- Specified by:
debugin classServerFeatureUtil- Parameters:
msg-e-
-
debug
public abstract void debug(Throwable e)
Log debug- Specified by:
debugin interfaceCommonLoggerI- Specified by:
debugin classServerFeatureUtil- Parameters:
e-
-
warn
public abstract void warn(String msg)
Log warning- Specified by:
warnin interfaceCommonLoggerI- Specified by:
warnin classServerFeatureUtil- Parameters:
msg-
-
info
public abstract void info(String msg)
Log info- Specified by:
infoin interfaceCommonLoggerI- Specified by:
infoin classServerFeatureUtil- Parameters:
msg-
-
error
public abstract void error(String msg)
Log error- Specified by:
errorin interfaceCommonLoggerI- Specified by:
errorin classServerFeatureUtil- Parameters:
msg-
-
error
public abstract void error(String msg, Throwable e)
Log error- Specified by:
errorin classServerFeatureUtil- Parameters:
msg-e-
-
isDebugEnabled
public abstract boolean isDebugEnabled()
Returns whether debug is enabled by the current logger- Specified by:
isDebugEnabledin interfaceCommonLoggerI- Specified by:
isDebugEnabledin classServerFeatureUtil- Returns:
- whether debug is enabled
-
downloadArtifact
public abstract File downloadArtifact(String groupId, String artifactId, String type, String version) throws PluginExecutionException
Download the artifact from the specified Maven coordinates, or retrieve it from the cache if it already exists.- Parameters:
groupId- The group IDartifactId- The artifact IDtype- The type e.g. esaversion- The version- Returns:
- The file corresponding to the downloaded artifact
- Throws:
PluginExecutionException- If the artifact could not be downloaded
-
-