Search in sources :

Example 1 with IHadoopSubnodeRepositoryContentHandler

use of org.talend.repository.hadoopcluster.ui.viewer.handler.IHadoopSubnodeRepositoryContentHandler in project tbd-studio-se by Talend.

the class HCRepositoryUtil method getRepositoryTypeOfHadoopSubItem.

public static String getRepositoryTypeOfHadoopSubItem(Item item) {
    if (item instanceof DatabaseConnectionItem) {
        DatabaseConnectionItem dbItem = (DatabaseConnectionItem) item;
        DatabaseConnection dbConnection = (DatabaseConnection) dbItem.getConnection();
        return dbConnection.getDatabaseType().toUpperCase();
    }
    for (IHadoopSubnodeRepositoryContentHandler handler : HadoopSubnodeRepositoryContentManager.getHandlers()) {
        if (handler.isProcess(item) && handler.getProcessType() != null) {
            return handler.getProcessType().getType().toUpperCase();
        }
    }
    return null;
}
Also used : IHadoopSubnodeRepositoryContentHandler(org.talend.repository.hadoopcluster.ui.viewer.handler.IHadoopSubnodeRepositoryContentHandler) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) DatabaseConnectionItem(org.talend.core.model.properties.DatabaseConnectionItem)

Aggregations

DatabaseConnection (org.talend.core.model.metadata.builder.connection.DatabaseConnection)1 DatabaseConnectionItem (org.talend.core.model.properties.DatabaseConnectionItem)1 IHadoopSubnodeRepositoryContentHandler (org.talend.repository.hadoopcluster.ui.viewer.handler.IHadoopSubnodeRepositoryContentHandler)1