use of org.talend.metadata.managment.ui.utils.ExtendedNodeConnectionContextUtils.EHadoopParamName in project tbd-studio-se by Talend.
the class HadoopClusterContextHandler method setPropertiesForExistContextMode.
@Override
public void setPropertiesForExistContextMode(Connection connection, Set<IConnParamName> paramSet, Map<ContextItem, List<ConectionAdaptContextVariableModel>> adaptMap) {
if (connection == null) {
return;
}
if (connection instanceof HadoopClusterConnection) {
HadoopClusterConnection hadoopConn = (HadoopClusterConnection) connection;
ContextItem currentContext = null;
for (IConnParamName param : paramSet) {
if (param instanceof EHadoopParamName) {
String hadoopVariableName = null;
EHadoopParamName hadoopParam = (EHadoopParamName) param;
if (adaptMap != null && adaptMap.size() > 0) {
for (Map.Entry<ContextItem, List<ConectionAdaptContextVariableModel>> entry : adaptMap.entrySet()) {
currentContext = entry.getKey();
List<ConectionAdaptContextVariableModel> modelList = entry.getValue();
for (ConectionAdaptContextVariableModel model : modelList) {
if (model.getValue().equals(hadoopParam.name())) {
hadoopVariableName = model.getName();
break;
}
}
}
}
if (hadoopVariableName != null) {
hadoopVariableName = getCorrectVariableName(currentContext, hadoopVariableName, hadoopParam);
matchContextForAttribues(hadoopConn, hadoopParam, hadoopVariableName);
}
}
}
matchAdditionProperties(hadoopConn, adaptMap);
}
}
Aggregations