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 |
} |