Search in sources :

Example 1 with XtentisServerObjectsRetriever

use of com.amalto.workbench.providers.XtentisServerObjectsRetriever in project tmdm-studio-se by Talend.

the class DataClusterComposite method getRealTreeParent.

private TreeParent getRealTreeParent() {
    TreeParent treeParent = null;
    TreeObject xObject = getXObject();
    if (xObject != null) {
        TreeParent serverRoot = xObject.getServerRoot();
        UserInfo user = serverRoot.getUser();
        String serverName = serverRoot.getName();
        String password = user.getPassword();
        String url = user.getServerUrl();
        String username = user.getUsername();
        final XtentisServerObjectsRetriever retriever = new XtentisServerObjectsRetriever(serverName, url, username, password);
        retriever.setRetriveWSObject(true);
        try {
            retriever.run(new NullProgressMonitor());
            // get the real server root as the treeParent
            treeParent = retriever.getServerRoot();
        } catch (InvocationTargetException e) {
            log.error(e.getMessage(), e);
        } catch (InterruptedException e) {
            log.error(e.getMessage(), e);
        }
    }
    return treeParent;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) XtentisServerObjectsRetriever(com.amalto.workbench.providers.XtentisServerObjectsRetriever) TreeParent(com.amalto.workbench.models.TreeParent) TreeObject(com.amalto.workbench.models.TreeObject) UserInfo(com.amalto.workbench.utils.UserInfo) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 2 with XtentisServerObjectsRetriever

use of com.amalto.workbench.providers.XtentisServerObjectsRetriever in project tmdm-studio-se by Talend.

the class DataClusterBrowserMainPage method getRealTreeParent.

// The ending| bug:21784
private TreeParent getRealTreeParent() {
    TreeParent treeParent = null;
    TreeObject xObject = getXObject();
    if (xObject != null) {
        TreeParent serverRoot = xObject.getServerRoot();
        UserInfo user = serverRoot.getUser();
        String serverName = serverRoot.getName();
        String password = user.getPassword();
        String url = user.getServerUrl();
        String username = user.getUsername();
        final XtentisServerObjectsRetriever retriever = new XtentisServerObjectsRetriever(serverName, url, username, password);
        retriever.setRetriveWSObject(true);
        try {
            retriever.run(new NullProgressMonitor());
            // get the real server root as the treeParent
            treeParent = retriever.getServerRoot();
        } catch (InvocationTargetException e) {
            log.error(e.getMessage(), e);
        } catch (InterruptedException e) {
            log.error(e.getMessage(), e);
        }
    }
    return treeParent;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) XtentisServerObjectsRetriever(com.amalto.workbench.providers.XtentisServerObjectsRetriever) TreeParent(com.amalto.workbench.models.TreeParent) TreeObject(com.amalto.workbench.models.TreeObject) UserInfo(com.amalto.workbench.utils.UserInfo) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

TreeObject (com.amalto.workbench.models.TreeObject)2 TreeParent (com.amalto.workbench.models.TreeParent)2 XtentisServerObjectsRetriever (com.amalto.workbench.providers.XtentisServerObjectsRetriever)2 UserInfo (com.amalto.workbench.utils.UserInfo)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)2