use of org.talend.metadata.managment.ui.utils.ExtendedNodeConnectionContextUtils.EHadoopParamName in project tbd-studio-se by Talend.
the class HCatalogContextHandler method setPropertiesForContextMode.
@Override
public void setPropertiesForContextMode(String prefixName, Connection connection, Set<IConnParamName> paramSet) {
if (connection == null) {
return;
}
if (connection instanceof HCatalogConnection) {
HCatalogConnection conn = (HCatalogConnection) connection;
String originalVariableName = prefixName + ConnectionContextHelper.LINE;
String hadoopVariableName = null;
for (IConnParamName param : paramSet) {
if (param instanceof EHadoopParamName) {
EHadoopParamName hcatalogConnectionParam = (EHadoopParamName) param;
originalVariableName = prefixName + ConnectionContextHelper.LINE;
hadoopVariableName = originalVariableName + hcatalogConnectionParam;
matchContextForAttribues(conn, hcatalogConnectionParam, hadoopVariableName);
}
}
String hadoopProperties = conn.getHadoopProperties();
List<Map<String, Object>> propertiesAfterContext = transformHadoopPropertiesForContextMode(HadoopRepositoryUtil.getHadoopPropertiesList(hadoopProperties), prefixName);
conn.setHadoopProperties(HadoopRepositoryUtil.getHadoopPropertiesJsonStr(propertiesAfterContext));
}
}
use of org.talend.metadata.managment.ui.utils.ExtendedNodeConnectionContextUtils.EHadoopParamName in project tbd-studio-se by Talend.
the class HCatalogContextHandler method setPropertiesForExistContextMode.
@Override
public void setPropertiesForExistContextMode(Connection connection, Set<IConnParamName> paramSet, Map<ContextItem, List<ConectionAdaptContextVariableModel>> adaptMap) {
if (connection == null) {
return;
}
if (connection instanceof HCatalogConnection) {
HCatalogConnection hcatalogConn = (HCatalogConnection) connection;
ContextItem currentContext = null;
for (IConnParamName param : paramSet) {
if (param instanceof EHadoopParamName) {
String hcatalogVariableName = null;
EHadoopParamName hcatalogParam = (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(hcatalogParam.name())) {
hcatalogVariableName = model.getName();
break;
}
}
}
}
if (hcatalogVariableName != null) {
hcatalogVariableName = getCorrectVariableName(currentContext, hcatalogVariableName, hcatalogParam);
matchContextForAttribues(hcatalogConn, hcatalogParam, hcatalogVariableName);
}
}
}
matchAdditionProperties(hcatalogConn, adaptMap);
}
}
use of org.talend.metadata.managment.ui.utils.ExtendedNodeConnectionContextUtils.EHadoopParamName in project tbd-studio-se by Talend.
the class HCatalogContextHandler method matchContextForAttribues.
@Override
protected void matchContextForAttribues(Connection conn, IConnParamName paramName, String hcatalogVariableName) {
HCatalogConnection hcatalogConn = (HCatalogConnection) conn;
EHadoopParamName hcatalogParam = (EHadoopParamName) paramName;
switch(hcatalogParam) {
case HCatalogHostName:
hcatalogConn.setHostName(ContextParameterUtils.getNewScriptCode(hcatalogVariableName, LANGUAGE));
break;
case HCatalogPort:
hcatalogConn.setPort(ContextParameterUtils.getNewScriptCode(hcatalogVariableName, LANGUAGE));
break;
case HCatalogUser:
hcatalogConn.setUserName(ContextParameterUtils.getNewScriptCode(hcatalogVariableName, LANGUAGE));
break;
case HCatalogPassword:
hcatalogConn.setPassword(ContextParameterUtils.getNewScriptCode(hcatalogVariableName, LANGUAGE));
break;
case HCatalogKerPrin:
hcatalogConn.setKrbPrincipal(ContextParameterUtils.getNewScriptCode(hcatalogVariableName, LANGUAGE));
break;
case HCatalogRealm:
hcatalogConn.setKrbRealm(ContextParameterUtils.getNewScriptCode(hcatalogVariableName, LANGUAGE));
break;
case HCatalogDatabase:
hcatalogConn.setDatabase(ContextParameterUtils.getNewScriptCode(hcatalogVariableName, LANGUAGE));
break;
case HcataLogRowSeparator:
hcatalogConn.setRowSeparator(ContextParameterUtils.getNewScriptCode(hcatalogVariableName, LANGUAGE));
break;
case HcatalogFileSeparator:
hcatalogConn.setFieldSeparator(ContextParameterUtils.getNewScriptCode(hcatalogVariableName, LANGUAGE));
break;
default:
}
}
use of org.talend.metadata.managment.ui.utils.ExtendedNodeConnectionContextUtils.EHadoopParamName in project tbd-studio-se by Talend.
the class HdfsContextHandler method setPropertiesForContextMode.
@Override
public void setPropertiesForContextMode(String prefixName, Connection connection, Set<IConnParamName> paramSet) {
if (connection == null) {
return;
}
if (connection instanceof HDFSConnection) {
HDFSConnection hdfsConn = (HDFSConnection) connection;
String originalVariableName = prefixName + ConnectionContextHelper.LINE;
String hdfsVariableName = null;
for (IConnParamName param : paramSet) {
if (param instanceof EHadoopParamName) {
EHadoopParamName hdfsConnectionParam = (EHadoopParamName) param;
originalVariableName = prefixName + ConnectionContextHelper.LINE;
hdfsVariableName = originalVariableName + hdfsConnectionParam;
matchContextForAttribues(hdfsConn, hdfsConnectionParam, hdfsVariableName);
}
}
String hadoopProperties = hdfsConn.getHadoopProperties();
List<Map<String, Object>> propertiesAfterContext = transformHadoopPropertiesForContextMode(HadoopRepositoryUtil.getHadoopPropertiesList(hadoopProperties), prefixName);
hdfsConn.setHadoopProperties(HadoopRepositoryUtil.getHadoopPropertiesJsonStr(propertiesAfterContext));
}
}
use of org.talend.metadata.managment.ui.utils.ExtendedNodeConnectionContextUtils.EHadoopParamName in project tbd-studio-se by Talend.
the class HdfsContextHandler method matchContextForAttribues.
@Override
protected void matchContextForAttribues(Connection conn, IConnParamName paramName, String hdfsVariableName) {
HDFSConnection hdfsConn = (HDFSConnection) conn;
EHadoopParamName hdfsParam = (EHadoopParamName) paramName;
switch(hdfsParam) {
case HdfsUser:
hdfsConn.setUserName(ContextParameterUtils.getNewScriptCode(hdfsVariableName, LANGUAGE));
break;
case HdfsRowSeparator:
hdfsConn.setRowSeparator(ContextParameterUtils.getNewScriptCode(hdfsVariableName, LANGUAGE));
break;
case HdfsFileSeparator:
hdfsConn.setFieldSeparator(ContextParameterUtils.getNewScriptCode(hdfsVariableName, LANGUAGE));
break;
case HdfsRowHeader:
hdfsConn.setHeaderValue(ContextParameterUtils.getNewScriptCode(hdfsVariableName, LANGUAGE));
break;
default:
}
}
Aggregations