This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 214647
Collapse All | Expand All

(-)a/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OracleInstance.java (-8 lines)
Lines 250-259 Link Here
250
        synchronized (this) {
250
        synchronized (this) {
251
            this.password = password;
251
            this.password = password;
252
            this.passwordLoaded = true;
252
            this.passwordLoaded = true;
253
            if (j2eeInstance != null) {
254
                j2eeInstance.getInstanceProperties().setProperty(
255
                                    InstanceProperties.PASSWORD_ATTR, password);
256
            }
257
        }
253
        }
258
        resetCache();
254
        resetCache();
259
    }
255
    }
Lines 262-271 Link Here
262
        synchronized (this) {
258
        synchronized (this) {
263
            this.user = user;
259
            this.user = user;
264
            this.userLoaded = true;
260
            this.userLoaded = true;
265
            if (j2eeInstance != null) {
266
                j2eeInstance.getInstanceProperties().setProperty(
267
                                    InstanceProperties.USERNAME_ATTR, user);
268
            }
269
        }
261
        }
270
        resetCache();
262
        resetCache();
271
    }
263
    }
(-)a/cloud.oracle/src/org/netbeans/modules/cloud/oracle/serverplugin/OracleDeploymentFactory.java (-10 / +22 lines)
Lines 50-55 Link Here
50
import org.netbeans.libs.oracle.cloud.sdkwrapper.api.ApplicationManager;
50
import org.netbeans.libs.oracle.cloud.sdkwrapper.api.ApplicationManager;
51
import org.netbeans.libs.oracle.cloud.sdkwrapper.exception.SDKException;
51
import org.netbeans.libs.oracle.cloud.sdkwrapper.exception.SDKException;
52
import org.netbeans.modules.cloud.oracle.OracleInstance;
52
import org.netbeans.modules.cloud.oracle.OracleInstance;
53
import org.netbeans.modules.cloud.oracle.OracleInstanceManager;
53
import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties;
54
import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties;
54
import org.openide.util.NbBundle;
55
import org.openide.util.NbBundle;
55
56
Lines 76-92 Link Here
76
    @Override
77
    @Override
77
    public DeploymentManager getDeploymentManager(String uri, String username,
78
    public DeploymentManager getDeploymentManager(String uri, String username,
78
            String password) throws DeploymentManagerCreationException {
79
            String password) throws DeploymentManagerCreationException {
80
        OracleInstance instance = findInstance(uri);
79
        InstanceProperties props = InstanceProperties.getInstanceProperties(uri);
81
        InstanceProperties props = InstanceProperties.getInstanceProperties(uri);
80
        ApplicationManager am;
82
        ApplicationManager am = null;
81
        try {
83
        if (instance != null) {
82
            am = OracleInstance.createApplicationManager(
84
            try {
83
                    props.getProperty(IP_ADMIN_URL), 
85
                am = OracleInstance.createApplicationManager(
84
                    username,
86
                        props.getProperty(IP_ADMIN_URL), 
85
                    password,
87
                        instance.getUser(),
86
                    CloudSDKHelper.getSDKFolder());
88
                        instance.getPassword(),
87
        } catch (SDKException e) {
89
                        CloudSDKHelper.getSDKFolder());
88
            LOG.log(Level.FINE, "cannot access SDK", e);
90
            } catch (SDKException e) {
89
            am = null;
91
                LOG.log(Level.FINE, "cannot access SDK", e);
92
            }
90
        }
93
        }
91
94
92
        return new OracleDeploymentManager(
95
        return new OracleDeploymentManager(
Lines 118-121 Link Here
118
        return "1.0"; // NOI18N
121
        return "1.0"; // NOI18N
119
    }
122
    }
120
    
123
    
124
    private OracleInstance findInstance(String id) {
125
        for (OracleInstance ai : OracleInstanceManager.getDefault().getInstances()) {
126
            if (id.equals(OracleJ2EEInstance.createURL(ai.getName(), ai.getIdentityDomain(), ai.getJavaServiceName()))) {
127
                return ai;
128
            }
129
        }
130
        return null;
131
    }
132
    
121
}
133
}
(-)a/cloud.oracle/src/org/netbeans/modules/cloud/oracle/serverplugin/OracleJ2EEServerInstanceProvider.java (-1 / +1 lines)
Lines 117-123 Link Here
117
                    props.put(OracleDeploymentFactory.IP_ADMIN_URL, ai.getAdminURL());
117
                    props.put(OracleDeploymentFactory.IP_ADMIN_URL, ai.getAdminURL());
118
                    props.put(OracleDeploymentFactory.IP_PREMISE_SERVICE_INSTANCE_ID, ai.getOnPremiseServerInstanceId());
118
                    props.put(OracleDeploymentFactory.IP_PREMISE_SERVICE_INSTANCE_ID, ai.getOnPremiseServerInstanceId());
119
                    ip = InstanceProperties.createInstancePropertiesNonPersistent(inst.getId(), 
119
                    ip = InstanceProperties.createInstancePropertiesNonPersistent(inst.getId(), 
120
                            ai.getUser(), ai.getPassword(), inst.getDisplayName(), props);
120
                            null, null, inst.getDisplayName(), props);
121
                } catch (InstanceCreationException ex) {
121
                } catch (InstanceCreationException ex) {
122
                    Exceptions.printStackTrace(ex);
122
                    Exceptions.printStackTrace(ex);
123
                }
123
                }

Return to bug 214647