use of org.talend.core.model.repository.IRepositoryTypeProcessor in project tdi-studio-se by Talend.
the class DatabaseTypeFilter method getHadoopSubMultiRepTypeProcessor.
private IRepositoryTypeProcessor getHadoopSubMultiRepTypeProcessor(String[] repTypes) {
IHadoopClusterService hadoopClusterService = HadoopRepositoryUtil.getHadoopClusterService();
if (hadoopClusterService != null) {
List<String> repTypeList = new ArrayList<String>();
Map<String, Object> attributes = new HashMap<String, Object>();
for (String repType : repTypes) {
Map<String, Object> attr = parseAttributes(repType);
if (attr == null) {
repTypeList.add(repType);
} else {
attributes.putAll(attr);
}
}
IRepositoryTypeProcessor processor = hadoopClusterService.getHadoopSubMultiRepTypeProcessor(repTypeList.toArray(new String[0]));
processor.setAttributes(attributes);
return processor;
}
return null;
}
use of org.talend.core.model.repository.IRepositoryTypeProcessor in project tdi-studio-se by Talend.
the class DatabaseTypeFilter method createTypeProcessor.
/**
* bqian create the correct TypeProcessor according to the type.
*
* @return
*/
private IRepositoryTypeProcessor createTypeProcessor() {
for (IRepositoryContentHandler handler : RepositoryContentManager.getHandlers()) {
IRepositoryTypeProcessor processor = handler.getRepositoryTypeProcessor(repositoryType);
if (processor != null) {
return processor;
}
}
if (repositoryType != null && repositoryType.contains("|")) {
//$NON-NLS-1$
//$NON-NLS-1$
String[] repTypes = repositoryType.split("\\|");
IRepositoryTypeProcessor hadoopTypeProcessor = getHadoopSubMultiRepTypeProcessor(repTypes);
if (hadoopTypeProcessor != null) {
return hadoopTypeProcessor;
}
}
if (type == null && repositoryTypes != null) {
return new MetadataMultiTypeProcessor(repositoryTypes);
}
if (type == ERepositoryObjectType.PROCESS) {
return new JobTypeProcessor(repositoryType);
}
if (type == ERepositoryObjectType.METADATA) {
return new RepositoryTypeProcessor(repositoryType);
}
if (type == ERepositoryObjectType.METADATA_CON_TABLE) {
return new SchemaTypeProcessor(repositoryType);
}
if (type == ERepositoryObjectType.METADATA_CON_QUERY) {
return new QueryTypeProcessor(repositoryType);
}
if (type == ERepositoryObjectType.METADATA_SAP_FUNCTION) {
return new SAPFunctionProcessor(repositoryType);
}
if (type == ERepositoryObjectType.CONTEXT) {
return new ContextTypeProcessor(repositoryType);
}
if (type == ERepositoryObjectType.METADATA_HEADER_FOOTER) {
return new HeaderFooterTypeProcessor(repositoryType);
}
if (type == ERepositoryObjectType.METADATA_VALIDATION_RULES) {
return new ValidationRuleTypeProcessor(repositoryType, elem);
}
//$NON-NLS-1$
throw new IllegalArgumentException(Messages.getString("RepositoryReviewDialog.0", type));
}
Aggregations