public abstract class InstallFeatureUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
INSTALL_MAP_ARTIFACT_ID |
static String |
OPEN_LIBERTY_GROUP_ID |
static String |
REPOSITORY_RESOLVER_ARTIFACT_ID |
| Constructor and Description |
|---|
InstallFeatureUtil(File installDirectory,
String from,
String to,
Set<String> pluginListedEsas)
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
|
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.
|
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.
|
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).
|
Set<String> |
getServerFeatures(File serverDirectory)
Get the set of features defined in the server.xml
|
abstract void |
info(String msg)
Log info
|
void |
installFeatures(boolean isAcceptLicense,
List<String> featuresToInstall)
Resolve, download, and install features from a Maven repository.
|
abstract boolean |
isDebugEnabled()
Returns whether debug is enabled by the current logger
|
static String |
productInfo(File installDirectory,
String action)
Runs the productInfo command and returns the output
|
abstract void |
warn(String msg)
Log warning
|
public static final String OPEN_LIBERTY_GROUP_ID
public static final String REPOSITORY_RESOLVER_ARTIFACT_ID
public static final String INSTALL_MAP_ARTIFACT_ID
public InstallFeatureUtil(File installDirectory, String from, String to, Set<String> pluginListedEsas) 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 specifiedPluginScenarioException - If the current scenario is not supportedPluginExecutionException - If properties files cannot be found in the installDirectory/lib/versionspublic abstract void debug(String msg)
msg - public abstract void debug(Throwable e)
e - public abstract void warn(String msg)
msg - public abstract void info(String msg)
msg - 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 Set<String> getServerFeatures(File serverDirectory)
serverDirectory - The server directory containing the server.xmlpublic 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> featuresToInstall)
throws PluginExecutionException
jsonRepos - JSON files, each containing an array of metadata for all
features in a Liberty release.featuresToInstall - 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 © 2018 the original author or authors.