use of org.talend.commons.utils.data.container.RootContainer in project tdi-studio-se by Talend.
the class DBTreeProvider method getMetadataConnection.
/**
* @return MetadataConnection
*/
@SuppressWarnings("unchecked")
private Container getMetadataConnection() {
ProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
ProjectManager pManager = ProjectManager.getInstance();
Container container = null;
try {
container = factory.getMetadata(pManager.getCurrentProject(), ERepositoryObjectType.METADATA_CONNECTIONS);
pManager.retrieveReferencedProjects();
for (Project p : pManager.getAllReferencedProjects()) {
RootContainer rContainer = factory.getMetadata(p, ERepositoryObjectType.METADATA_CONNECTIONS);
if (container == null) {
container = rContainer;
} else if (rContainer != null) {
Iterator iterator = rContainer.absoluteKeySet().iterator();
while (iterator.hasNext()) {
Object id = iterator.next();
container.addMember(id, rContainer.getAbsoluteMember(id));
}
}
}
} catch (PersistenceException e) {
//$NON-NLS-1$
SqlBuilderPlugin.log(Messages.getString("DBTreeProvider.logMessage"), e);
} catch (BusinessException e) {
//$NON-NLS-1$
SqlBuilderPlugin.log(Messages.getString("DBTreeProvider.logMessage"), e);
}
return container;
}
Aggregations