public abstract class InstallFeatureUtil extends ServerFeatureUtil
| Modifier and Type | Class and Description |
|---|---|
static class |
InstallFeatureUtil.ProductProperties |
| Modifier and Type | Field and Description |
|---|---|
static String |
ANY_CONFLICT |
static String |
CONFLICT |
static String |
CONFLICT_MESSAGE |
static Pattern |
conflictPattern |
static String |
DIFF_MODEL_CONFLICT |
static String |
EE_CONFLICT |
static String |
INCOMPATIBLE_SINGLETON |
static String |
INSTALL_MAP_ARTIFACT_ID |
static String |
MISSING_MULTIPLE_DEPENDENT |
static String |
OPEN_LIBERTY_GROUP_ID |
static String |
REPOSITORY_RESOLVER_ARTIFACT_ID |
static String |
SAME_INDIRECT_MODEL_CONFLICT |
static String |
SAME_MODEL_CONFLICT |
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 and Description |
|---|
InstallFeatureUtil(File installDirectory,
String from,
String to,
Set<String> pluginListedEsas,
List<InstallFeatureUtil.ProductProperties> propertiesList,
String openLibertyVersion,
String containerName,
List<String> additionalJsons)
Initialize the utility and check for unsupported scenarios.
|
| Modifier and Type | Method and Description |
|---|---|
static Set<String> |
combineToSet(Collection<String>... collections)
Combine the given String collections into a set using case-insensitive
matching.
|
static boolean |
containsIgnoreCase(Collection<String> reference,
Collection<String> target)
Returns whether the reference collection contains all of the strings in the
target collection, ignoring case.
|
abstract void |
debug(String msg)
Log debug
|
abstract void |
debug(String msg,
Throwable e)
Log debug
|
abstract void |
debug(Throwable e)
Log debug
|
abstract File |
downloadArtifact(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 void |
error(String msg)
Log error
|
abstract void |
error(String msg,
Throwable e)
Log error
|
static String |
extractSymbolicName(File jar)
Extracts the bundle symbolic name from the jar manifest.
|
static File |
getMapBasedInstallKernelJar(File dir)
Find latest install map jar from specified directory
|
static String |
getNextProductVersion(String version)
Gets the next product version number.
|
static Set<String> |
getOpenLibertyFeatureSet(Set<File> jsons)
Gets the set of all Open Liberty features by scanning the product JSONs.
|
static String |
getOpenLibertyVersion(List<InstallFeatureUtil.ProductProperties> propList) |
String |
getOverrideBundleDescriptor(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 void |
info(String msg)
Log info
|
void |
installFeatures(boolean isAcceptLicense,
List<String> featuresList)
Resolve, download, and install features from a Maven repository.
|
abstract boolean |
isDebugEnabled()
Returns whether debug is enabled by the current logger
|
static boolean |
isOpenLibertyBetaVersion(String olVersion) |
static List<InstallFeatureUtil.ProductProperties> |
loadProperties(File installDir) |
static String |
productInfo(File installDirectory,
String action)
Runs the productInfo command and returns the output
Made public static for tests to use in LMP/LGP
|
abstract void |
warn(String msg)
Log warning
|
getServerFeatures, getServerFeatures, getServerFeatures, getServerXmlFeatures, setLowerCaseFeatures, setSuppressLogsexecDockerCmd, readStdOutpublic static final String OPEN_LIBERTY_GROUP_ID
public static final String REPOSITORY_RESOLVER_ARTIFACT_ID
public static final String INSTALL_MAP_ARTIFACT_ID
public static final String CONFLICT
public static final String INCOMPATIBLE_SINGLETON
public static final String MISSING_MULTIPLE_DEPENDENT
public static final String SAME_MODEL_CONFLICT
public static final String DIFF_MODEL_CONFLICT
public static final String SAME_INDIRECT_MODEL_CONFLICT
public static final String EE_CONFLICT
public static final String ANY_CONFLICT
public static final Pattern conflictPattern
public static final String CONFLICT_MESSAGE
public InstallFeatureUtil(File installDirectory, String from, String to, Set<String> pluginListedEsas, List<InstallFeatureUtil.ProductProperties> propertiesList, String openLibertyVersion, String containerName, List<String> additionalJsons) throws PluginScenarioException, PluginExecutionException
installDirectory - The install directoryfrom - The "from" parameter specified in the plugin
configuration, or null if not specifiedto - The "to" parameter specified in the plugin
configuration, or null if not specifiedpluginListedEsas - The list of ESAs specified in the plugin
configuration, or null if not specifiedpropertiesList - The list of product properties installed with the
Open Liberty runtimeopenLibertyVersion - The version of the Open Liberty runtimecontainerName - The container name if the features should be
installed in a container. Otherwise null.additionalJsons - The list of additional JSONS to search
for features fromPluginScenarioException - If the current scenario is not supportedPluginExecutionException - If properties files cannot be found in the
installDirectory/lib/versionspublic abstract void debug(String msg)
debug in class ServerFeatureUtilmsg - public abstract void debug(String msg, Throwable e)
debug in class ServerFeatureUtilmsg - e - public abstract void debug(Throwable e)
debug in class ServerFeatureUtile - public abstract void warn(String msg)
warn in class ServerFeatureUtilmsg - public abstract void info(String msg)
info in class ServerFeatureUtilmsg - public abstract void error(String msg)
msg - public abstract void error(String msg, Throwable e)
error in class AbstractContainerSupportUtilmsg - e - public abstract boolean isDebugEnabled()
public abstract File downloadArtifact(String groupId, String artifactId, String type, String version) throws PluginExecutionException
groupId - The group IDartifactId - The artifact IDtype - The type e.g. esaversion - The versionPluginExecutionException - If the artifact could not be downloaded@SafeVarargs public static Set<String> combineToSet(Collection<String>... collections)
collections - a collection of stringspublic static List<InstallFeatureUtil.ProductProperties> loadProperties(File installDir) throws PluginExecutionException
PluginExecutionExceptionpublic static String getOpenLibertyVersion(List<InstallFeatureUtil.ProductProperties> propList)
public static boolean isOpenLibertyBetaVersion(String olVersion)
public static Set<String> getOpenLibertyFeatureSet(Set<File> jsons) throws PluginExecutionException
jsons - The set of product JSON files to scanPluginExecutionException - if any of the JSONs could not be foundpublic static boolean containsIgnoreCase(Collection<String> reference, Collection<String> target)
reference - The reference collectiontarget - The target collectionpublic void installFeatures(boolean isAcceptLicense,
List<String> featuresList)
throws PluginExecutionException
jsonRepos - JSON files, each containing an array of metadata for
all features in a Liberty release.featuresList - The list of features to install.PluginExecutionException - if any of the features could not be
installedpublic String getOverrideBundleDescriptor(String groupId, String artifactId) throws PluginExecutionException
groupId - the groupId of the bundle to downloadartifactId - the artifactId of the bundle to downloadPluginExecutionExceptionpublic static String getNextProductVersion(String version) throws PluginExecutionException
version - the product versionPluginExecutionExceptionpublic static String extractSymbolicName(File jar) throws PluginExecutionException
jar - the jar from which the symbolic name will be extractedPluginExecutionExceptionpublic static File getMapBasedInstallKernelJar(File dir)
public static String productInfo(File installDirectory, String action) throws PluginExecutionException
installDirectory - The directory of the installed runtimeaction - The action to perform for the productInfo commandPluginExecutionException - if the exit value of the command was not 0Copyright © 2022 the original author or authors.