use of org.talend.hadoop.distribution.dynamic.pref.IDynamicDistributionPreference in project tbd-studio-se by Talend.
the class AbstractDependencyResolver method getLatestVersion.
@Override
public String getLatestVersion(String groupId, String artifactId, String baseVersion, String topVersion, IDynamicMonitor monitor) throws Exception {
IDynamicDistributionPreference preference = configuration.getPreference();
String remoteRepositoryUrl = preference.getRepository();
String username = null;
String password = null;
if (!preference.isAnonymous()) {
username = preference.getUsername();
password = preference.getPassword();
}
String localRepositoryPath = getLocalRepositoryPath();
return DynamicDistributionAetherUtils.getHighestVersion(remoteRepositoryUrl, username, password, localRepositoryPath, groupId, artifactId, null, null, monitor);
}
use of org.talend.hadoop.distribution.dynamic.pref.IDynamicDistributionPreference in project tbd-studio-se by Talend.
the class AbstractDependencyResolver method listHadoopVersions.
@Override
public List<String> listHadoopVersions(String baseVersion, String topVersion, IDynamicMonitor monitor) throws Exception {
// $NON-NLS-1$
String groupId = "org.apache.hadoop";
// $NON-NLS-1$
String artifactId = "hadoop-client";
DynamicConfiguration configuration = getConfiguration();
IDynamicDistributionPreference preference = configuration.getPreference();
String remoteRepositoryUrl = preference.getRepository();
String username = null;
String password = null;
if (!preference.isAnonymous()) {
username = preference.getUsername();
password = preference.getPassword();
}
String localRepositoryPath = getLocalRepositoryPath();
List<String> versionRange = DynamicDistributionAetherUtils.versionRange(remoteRepositoryUrl, username, password, localRepositoryPath, groupId, artifactId, baseVersion, topVersion, monitor);
return getCleanHadoopVersion(versionRange);
}
use of org.talend.hadoop.distribution.dynamic.pref.IDynamicDistributionPreference in project tbd-studio-se by Talend.
the class AbstractDependencyResolver method getDependencyVersionByHadoopVersion.
@Override
public String getDependencyVersionByHadoopVersion(String groupId, String artifactId, IDynamicMonitor monitor) throws Exception {
DynamicConfiguration configuration = getConfiguration();
String distributionVersion = configuration.getVersion();
IDynamicDistributionPreference preference = configuration.getPreference();
String remoteRepositoryUrl = preference.getRepository();
String username = null;
String password = null;
if (!preference.isAnonymous()) {
username = preference.getUsername();
password = preference.getPassword();
}
String localRepositoryPath = getLocalRepositoryPath();
List<String> versionRange = DynamicDistributionAetherUtils.versionRange(remoteRepositoryUrl, username, password, localRepositoryPath, groupId, artifactId, null, null, monitor);
String dependencyVersion = getVersionByHadoopVersion(versionRange, distributionVersion);
return dependencyVersion;
}
use of org.talend.hadoop.distribution.dynamic.pref.IDynamicDistributionPreference in project tbd-studio-se by Talend.
the class DynamicDistributionManager method getPreferencePaths.
@Override
public Collection<String> getPreferencePaths() {
if (dynamicDistributionPreferencePaths.isEmpty()) {
try {
ProjectManager pm = ProjectManager.getInstance();
List<Project> allProjects = new ArrayList<>();
List<Project> allReferenceProjects = pm.getAllReferencedProjects();
if (allReferenceProjects != null && !allReferenceProjects.isEmpty()) {
allProjects.addAll(allReferenceProjects);
}
allProjects.add(pm.getCurrentProject());
List<IDynamicDistributionsGroup> groups = getDynamicDistributionsGroups();
for (Project project : allProjects) {
for (IDynamicDistributionsGroup distributionGroup : groups) {
try {
IDynamicDistributionPreference preference = distributionGroup.getDynamicDistributionPreference(project);
String preferencePath = preference.getPreferencePath();
if (StringUtils.isNotEmpty(preferencePath)) {
dynamicDistributionPreferencePaths.add(preferencePath);
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
return dynamicDistributionPreferencePaths;
}
use of org.talend.hadoop.distribution.dynamic.pref.IDynamicDistributionPreference in project tbd-studio-se by Talend.
the class DynamicDistributionPreferenceForm method loadRepositorySetupGroup.
private void loadRepositorySetupGroup() throws Exception {
IDynamicDistributionsGroup selectedSetupDistriGroup = getSelectedSetupDynamicDistriGroup();
if (selectedSetupDistriGroup != null) {
IDynamicDistributionPreference dynamicDistributionPreference = selectedSetupDistriGroup.getDynamicDistributionPreference(ProjectManager.getInstance().getCurrentProject());
boolean overrideDefaultSetup = dynamicDistributionPreference.overrideDefaultSetup();
String repositoryUrl = dynamicDistributionPreference.getRepository();
boolean isAnonymous = dynamicDistributionPreference.isAnonymous();
String username = dynamicDistributionPreference.getUsername();
String password = dynamicDistributionPreference.getPassword();
overrideDefaultSetupBtn.setSelection(overrideDefaultSetup);
repositoryText.setText(repositoryUrl);
anonymousBtn.setSelection(isAnonymous);
userText.setText(username);
passwordText.setText(password);
} else {
// exception case, disable all
overrideDefaultSetupBtn.setEnabled(false);
enableRepositoryText(false);
anonymousBtn.setEnabled(false);
enableUserPassword(false);
}
}
Aggregations