diff --git a/enterprise/cloud.oracle/external/binaries-list b/enterprise/cloud.oracle/external/binaries-list
index ecd1327b51b7..194a2c6741d2 100644
--- a/enterprise/cloud.oracle/external/binaries-list
+++ b/enterprise/cloud.oracle/external/binaries-list
@@ -27,6 +27,11 @@ E46F0CE2219BBCDA94B87D4CB4EF4166DAF6C925 com.oracle.oci.sdk:oci-java-sdk-identit
A8B7EBCA334E8145469A8FE0365C02A2727218EE com.oracle.oci.sdk:oci-java-sdk-common-httpclient:3.25.3
AECECCD95E5ED92C73E455B7BA4AC714229041EE com.oracle.oci.sdk:oci-java-sdk-common-httpclient-jersey:3.25.3
0CEE99CE7AA783353D19C56AC9F1AD72485DDBE8 com.oracle.oci.sdk:oci-java-sdk-addons-apache-configurator-jersey:3.25.3
+7084E5AE185230ACB52943C4AA0D0B8B890686A4 com.oracle.oci.sdk:oci-java-sdk-objectstorage:3.25.3
+D9918C04C60741D1BBEFBCC82E9D3B8BE690D412 com.oracle.oci.sdk:oci-java-sdk-objectstorage-generated:3.25.3
+3088420C75219556F803B55D8B71B96D29D1FC80 com.oracle.oci.sdk:oci-java-sdk-objectstorage-extensions:3.25.3
+A7D98B96CEA17F78E4BB9270B4A60FEBFACF6C78 com.oracle.oci.sdk:oci-java-sdk-core:3.25.3
+2236737DDF39CA3A3BABDB58B41F50C47E861EA7 com.oracle.oci.sdk:oci-java-sdk-containerengine:3.25.3
E5F6CAE5CA7ECAAC1EC2827A9E2D65AE2869CADA org.apache.httpcomponents:httpclient:4.5.13
853B96D3AFBB7BF8CC303FE27EE96836A10C1834 org.apache.httpcomponents:httpcore:4.4.13
diff --git a/enterprise/cloud.oracle/external/oci-java-sdk-3.25.3-license.txt b/enterprise/cloud.oracle/external/oci-java-sdk-3.25.3-license.txt
index 45069662ffdd..77fab270b8f5 100644
--- a/enterprise/cloud.oracle/external/oci-java-sdk-3.25.3-license.txt
+++ b/enterprise/cloud.oracle/external/oci-java-sdk-3.25.3-license.txt
@@ -3,7 +3,7 @@ Description: Oracle Cloud Infrastructure SDK for Java
Origin: https://github.com/oracle/oci-java-sdk
Version: 3.25.3
License: UPL-Apache-2.0
-Files: oci-java-sdk-circuitbreaker-3.25.3.jar, oci-java-sdk-common-3.25.3.jar, oci-java-sdk-database-3.25.3.jar, oci-java-sdk-identity-3.25.3.jar, oci-java-sdk-workrequests-3.25.3.jar, oci-java-sdk-adm-3.25.3.jar, oci-java-sdk-devops-3.25.3.jar, oci-java-sdk-addons-apache-configurator-jersey-3.25.3.jar, oci-java-sdk-common-httpclient-3.25.3.jar, oci-java-sdk-common-httpclient-jersey-3.25.3.jar oci-java-sdk-keymanagement-3.25.3.jar oci-java-sdk-vault-3.25.3.jar
+Files: oci-java-sdk-circuitbreaker-3.25.3.jar, oci-java-sdk-common-3.25.3.jar, oci-java-sdk-database-3.25.3.jar, oci-java-sdk-identity-3.25.3.jar, oci-java-sdk-workrequests-3.25.3.jar, oci-java-sdk-adm-3.25.3.jar, oci-java-sdk-devops-3.25.3.jar, oci-java-sdk-addons-apache-configurator-jersey-3.25.3.jar, oci-java-sdk-common-httpclient-3.25.3.jar, oci-java-sdk-common-httpclient-jersey-3.25.3.jar oci-java-sdk-keymanagement-3.25.3.jar oci-java-sdk-vault-3.25.3.jar oci-java-sdk-containerengine-3.25.3.jar oci-java-sdk-core-3.25.3.jar oci-java-sdk-objectstorage-3.25.3.jar oci-java-sdk-objectstorage-extensions-3.25.3.jar oci-java-sdk-objectstorage-generated-3.25.3.jar
Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
diff --git a/enterprise/cloud.oracle/nbproject/project.properties b/enterprise/cloud.oracle/nbproject/project.properties
index 28ad8d55af47..bb5a4e607fb5 100644
--- a/enterprise/cloud.oracle/nbproject/project.properties
+++ b/enterprise/cloud.oracle/nbproject/project.properties
@@ -28,6 +28,11 @@ release.external/oci-java-sdk-adm-3.25.3.jar=modules/ext/oci-java-sdk-adm-3.25.3
release.external/oci-java-sdk-common-httpclient-3.25.3.jar=modules/ext/oci-java-sdk-common-httpclient-3.25.3.jar
release.external/oci-java-sdk-common-httpclient-jersey-3.25.3.jar=modules/ext/oci-java-sdk-common-httpclient-jersey-3.25.3.jar
release.external/oci-java-sdk-addons-apache-configurator-jersey-3.25.3.jar=modules/ext/oci-java-sdk-addons-apache-configurator-jersey-3.25.3.jar
+release.external/oci-java-sdk-objectstorage-3.25.3.jar=modules/ext/oci-java-sdk-objectstorage-3.25.3.jar
+release.external/oci-java-sdk-objectstorage-generated-3.25.3.jar=modules/ext/oci-java-sdk-objectstorage-generated-3.25.3.jar
+release.external/oci-java-sdk-objectstorage-extensions-3.25.3.jar=modules/ext/oci-java-sdk-objectstorage-extensions-3.25.3.jar
+release.external/oci-java-sdk-core-3.25.3.jar=modules/ext/oci-java-sdk-core-3.25.3.jar
+release.external/oci-java-sdk-containerengine-3.25.3.jar=modules/ext/oci-java-sdk-containerengine-3.25.3.jar
release.external/httpclient-4.5.13.jar=modules/ext/httpclient-4.5.13.jar
release.external/httpcore-4.4.13.jar=modules/ext/httpcore-4.4.13.jar
release.external/javassist-3.25.0-GA.jar=modules/ext/javassist-3.25.0-GA.jar
@@ -35,6 +40,6 @@ release.external/resilience4j-circuitbreaker-1.7.1.jar=modules/ext/resilience4j-
release.external/resilience4j-core-1.7.1.jar=modules/ext/resilience4j-core-1.7.1.jar
release.external/vavr-0.10.2.jar=modules/ext/vavr-0.10.2.jar
release.external/vavr-match-0.10.2.jar=modules/ext/vavr-match-0.10.2.jar
-javac.source=1.8
+javac.source=11
javac.compilerargs=-Xlint -Xlint:-serial
spec.version.base.fatal.warning=false
diff --git a/enterprise/cloud.oracle/nbproject/project.xml b/enterprise/cloud.oracle/nbproject/project.xml
index c955b267452a..bf9b52d4f7eb 100644
--- a/enterprise/cloud.oracle/nbproject/project.xml
+++ b/enterprise/cloud.oracle/nbproject/project.xml
@@ -279,6 +279,26 @@
ext/oci-java-sdk-addons-apache-configurator-jersey-3.25.3.jar
external/oci-java-sdk-addons-apache-configurator-jersey-3.25.3.jar
+
+ ext/oci-java-sdk-objectstorage-3.25.3.jar
+ external/oci-java-sdk-objectstorage-3.25.3.jar
+
+
+ ext/oci-java-sdk-objectstorage-generated-3.25.3.jar
+ external/oci-java-sdk-objectstorage-generated-3.25.3.jar
+
+
+ ext/oci-java-sdk-objectstorage-extensions-3.25.3.jar
+ external/oci-java-sdk-objectstorage-extensions-3.25.3.jar
+
+
+ ext/oci-java-sdk-core-3.25.3.jar
+ external/oci-java-sdk-core-3.25.3.jar
+
+
+ ext/oci-java-sdk-containerengine-3.25.3.jar
+ external/oci-java-sdk-containerengine-3.25.3.jar
+
ext/httpclient-4.5.13.jar
external/httpclient-4.5.13.jar
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java
index e70745c95c1a..b79e2cd705d8 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java
@@ -208,7 +208,8 @@ public NotifyDescriptor createInput(NotifyDescriptor.ComposedInput input, int nu
AbstractPasswordPanel.generatePassword(),
(String) result.get(USERNAME),
((String) result.get(PASSWORD)).toCharArray(),
- selectedDatabase.getKey().getValue());
+ selectedDatabase.getKey().getValue(),
+ selectedDatabase.getCompartmentId());
action.addConnection(info);
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
@@ -269,9 +270,9 @@ private abstract class FlatCompartmentItem extends CompartmentItem {
private String flatName;
private FlatCompartmentItem(Compartment ociComp) {
- super(OCID.of(ociComp.getId(), "Compartment"), ociComp.getName()); // NOI18N
+ super(OCID.of(ociComp.getId(), "Compartment"), ociComp.getCompartmentId(), ociComp.getName()); // NOI18N
setDescription(ociComp.getDescription());
- parentId = OCID.of(ociComp.getCompartmentId(), "Compartment"); // NOI18N
+ parentId = OCID.of(ociComp.getCompartmentId(), "Compartment"); // NOI18N
}
public String getName() {
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVault.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVault.java
index 1c324b94ac10..dc0bba1aee65 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVault.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVault.java
@@ -710,6 +710,7 @@ private void addDbConnectionToVault(Result item) {
put("Username", context.getUser()); //NOI18N
put("Password", item.password); //NOI18N
put("OCID", (String) context.getConnectionProperties().get("OCID")); //NOI18N
+ put("CompartmentOCID", (String) context.getConnectionProperties().get("CompartmentOCID")); //NOI18N
put("wallet_Password", UUID.randomUUID().toString()); //NOI18N
}
};
@@ -953,7 +954,7 @@ private static abstract class FlatCompartmentItem extends CompartmentItem {
private String flatName;
private FlatCompartmentItem(Compartment ociComp) {
- super(OCID.of(ociComp.getId(), "Compartment"), ociComp.getName()); // NOI18N
+ super(OCID.of(ociComp.getId(), "Compartment"), ociComp.getCompartmentId(), ociComp.getName()); // NOI18N
setDescription(ociComp.getDescription());
parentId = OCID.of(ociComp.getCompartmentId(), "Compartment"); // NOI18N
}
@@ -991,6 +992,7 @@ protected static Map getDevopsProjects(String compart
}
return projects.stream()
.map(p -> new DevopsProjectItem(OCID.of(p.getId(), "DevopsProject"), // NOI18N
+ compartmentId,
p.getName()))
.collect(Collectors.toMap(DevopsProjectItem::getName, Function.identity()));
}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletAction.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletAction.java
index 2718c4c44ccd..56cdcf99004e 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletAction.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletAction.java
@@ -150,6 +150,7 @@ void addConnection(DownloadWalletDialog.WalletInfo p) {
}
Properties props = new Properties();
props.put("OCID", p.getOcid()); //NOI18N
+ props.put("CompartmentOCID", p.getOcid()); //NOI18N
String dbUrl = MessageFormat.format(URL_TEMPLATE, connectionName, BaseUtilities.escapeParameters(new String[] { walletPath.toString() }));
DatabaseConnection dbConn = DatabaseConnection.create(
drivers[0],
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletDialog.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletDialog.java
index 65602dbd146e..8b84c7d42209 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletDialog.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletDialog.java
@@ -92,7 +92,7 @@ static Optional showDialog(OCIItem db) {
String dbUser = dlgPanel.dbUserField.getText();
char[] dbPasswd = dlgPanel.dbPasswordField.getPassword();
NbPreferences.forModule(DownloadWalletAction.class).put(LAST_USED_DIR, path); //NOI18N
- return Optional.of(new WalletInfo(path, generatePassword(), dbUser, dbPasswd, db.getKey().getValue()));
+ return Optional.of(new WalletInfo(path, generatePassword(), dbUser, dbPasswd, db.getKey().getValue(), db.getCompartmentId()));
}
} else {
try {
@@ -111,7 +111,7 @@ static Optional showDialog(OCIItem db) {
return Optional.empty();
}
char[] password = inp.getInputText().toCharArray();
- return Optional.of(new WalletInfo(walletsDir.getAbsolutePath(), generatePassword(), username, password, db.getKey().getValue()));
+ return Optional.of(new WalletInfo(walletsDir.getAbsolutePath(), generatePassword(), username, password, db.getKey().getValue(), db.getCompartmentId()));
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
@@ -302,18 +302,20 @@ public void changedUpdate(DocumentEvent e) {
}
static class WalletInfo {
- private String path;
- private char[] walletPassword;
- private String dbUser;
+ private final String path;
+ private final char[] walletPassword;
+ private final String dbUser;
private char[] dbPassword;
- private String ocid;
+ private final String ocid;
+ private final String comaprtmentId;
- public WalletInfo(String path, char[] walletPassword, String dbUser, char[] dbPassword, String ocid) {
+ public WalletInfo(String path, char[] walletPassword, String dbUser, char[] dbPassword, String ocid, String comaprtmentOcid) {
this.path = path;
this.walletPassword = walletPassword;
this.dbUser = dbUser;
this.dbPassword = dbPassword;
this.ocid = ocid;
+ this.comaprtmentId = comaprtmentOcid;
}
public String getPath() {
@@ -335,6 +337,10 @@ public char[] getDbPassword() {
public String getOcid() {
return ocid;
}
+
+ public String getComaprtmentId() {
+ return comaprtmentId;
+ }
}
// Variables declaration - do not modify//GEN-BEGIN:variables
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/KnowledgeBaseItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/KnowledgeBaseItem.java
index 1dffd5c9133f..ac6120559c83 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/KnowledgeBaseItem.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/KnowledgeBaseItem.java
@@ -42,19 +42,13 @@ public class KnowledgeBaseItem extends OCIItem implements URLProvider{
private static Map>> itemInstances = new HashMap<>();
protected final Date timeUpdated;
- protected final String compartmentId;
public KnowledgeBaseItem(OCID id, String compartmentId, String displayName, Date timeUpdated) {
- super(id, displayName);
+ super(id, compartmentId, displayName);
this.timeUpdated = timeUpdated;
- this.compartmentId = compartmentId;
registerItem();
}
- public String getCompartmentId() {
- return compartmentId;
- }
-
void registerItem() {
synchronized (KnowledgeBaseItem.class) {
itemInstances.computeIfAbsent(getKey(), x -> new ArrayList<>()).add(new WeakReference<>(this));
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/KnowledgeBaseNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/KnowledgeBaseNode.java
index 637f29296e34..b482ea39d11c 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/KnowledgeBaseNode.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/KnowledgeBaseNode.java
@@ -19,6 +19,7 @@
package org.netbeans.modules.cloud.oracle.adm;
import com.oracle.bmc.adm.ApplicationDependencyManagementClient;
+import com.oracle.bmc.adm.model.KnowledgeBase;
import com.oracle.bmc.adm.model.KnowledgeBaseSummary;
import com.oracle.bmc.adm.requests.ListKnowledgeBasesRequest;
import com.oracle.bmc.adm.responses.ListKnowledgeBasesResponse;
@@ -83,12 +84,15 @@ public static ChildrenProvider.SessionAware
= session.newClient(ApplicationDependencyManagementClient.class)) {
ListKnowledgeBasesRequest request = ListKnowledgeBasesRequest.builder()
- .compartmentId(compartment.getKey().getValue()).build();
+ .compartmentId(compartment.getKey().getValue())
+ .lifecycleState(KnowledgeBase.LifecycleState.Active)
+ .build();
ListKnowledgeBasesResponse response = client.listKnowledgeBases(request);
List projects = response.getKnowledgeBaseCollection().getItems();
- return projects.stream().map(p -> new KnowledgeBaseItem(
+ return projects.stream()
+ .map(p -> new KnowledgeBaseItem(
OCID.of(p.getId(), "KnowledgeBase"), // NOI18N
- p.getCompartmentId(),
+ compartment.getKey().getValue(),
p.getDisplayName(), p.getTimeUpdated())).collect(Collectors.toList());
}
};
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/ProjectVulnerability.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/ProjectVulnerability.java
index 03449d860c06..cb7083a94e75 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/ProjectVulnerability.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/ProjectVulnerability.java
@@ -107,7 +107,7 @@ public KnowledgeBaseItem getProjectKnowledgeBase() {
item = new KnowledgeBaseItem(
OCID.of(p.getId(), "KnowledgeBase"), // NOI18N
- p.getCompartmentId(),
+ p.getCompartmentId(), //NOI18N
p.getDisplayName(), p.getTimeUpdated()
);
} catch (IllegalArgumentException | BmcException ex) {
@@ -186,8 +186,8 @@ public CompletableFuture findKnowledgeBase(String knowledgeBa
* + presented in the IDE UI.
*/
static class KnowledgeBaseItemProxy extends KnowledgeBaseItem {
- public KnowledgeBaseItemProxy(OCID id, String compartmentId, String displayName, Date timeUpdated) {
- super(id, compartmentId, displayName, timeUpdated);
+ public KnowledgeBaseItemProxy(OCID id, String compartmenId, String displayName, Date timeUpdated) {
+ super(id, compartmenId, displayName, timeUpdated);
}
@Override
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java
index 68adc66efa5f..665015a64572 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java
@@ -694,7 +694,7 @@ public AuditResult vulnerabilityAudit(Project project, AuditOptions auditOptions
auditOptions.setAuditName(projectDisplayName);
}
try {
- return doFindVulnerability(project, kbItem.compartmentId, kbItem.getKey().getValue(),
+ return doFindVulnerability(project, kbItem.getCompartmentId(), kbItem.getKey().getValue(),
projectDisplayName, auditOptions, progressHandle, remoteCall);
} finally {
if (remoteCall.get()) {
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SuggestedItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SuggestedItem.java
new file mode 100644
index 000000000000..6bbe876d1dec
--- /dev/null
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SuggestedItem.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.cloud.oracle.assets;
+
+import org.netbeans.modules.cloud.oracle.items.OCID;
+import org.netbeans.modules.cloud.oracle.items.OCIItem;
+
+/**
+ *
+ * @author Jan Horvath
+ */
+public final class SuggestedItem extends OCIItem {
+
+ private final String path;
+
+ public SuggestedItem(String path, String name) {
+ super(OCID.of("", "Suggested"), null, name); //NOI18N
+ this.path = path;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SuggestedNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SuggestedNode.java
new file mode 100644
index 000000000000..90e2eea92093
--- /dev/null
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SuggestedNode.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.cloud.oracle.assets;
+
+import org.netbeans.modules.cloud.oracle.NodeProvider;
+import org.netbeans.modules.cloud.oracle.OCINode;
+import org.netbeans.modules.cloud.oracle.items.OCIItem;
+
+/**
+ *
+ * @author Jan Horvath
+ */
+public class SuggestedNode extends OCINode {
+
+ private static final String SUGGEST_ICON = "org/netbeans/modules/cloud/oracle/resources/suggest.svg"; // NOI18N
+
+ public SuggestedNode(OCIItem item) {
+ super(item);
+ setName(item.getName());
+ setDisplayName(item.getName());
+ setIconBaseWithExtension(SUGGEST_ICON);
+ setShortDescription(item.getDescription());
+ }
+
+ public static NodeProvider createNode() {
+ return SuggestedNode::new;
+ }
+
+}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/bucket/BucketItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/bucket/BucketItem.java
new file mode 100644
index 000000000000..1dcdbf1ea078
--- /dev/null
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/bucket/BucketItem.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.cloud.oracle.bucket;
+
+import org.netbeans.modules.cloud.oracle.items.OCID;
+import org.netbeans.modules.cloud.oracle.items.OCIItem;
+
+/**
+ *
+ * @author Jan Horvath
+ */
+public final class BucketItem extends OCIItem {
+
+ private String namespace;
+
+ public BucketItem(OCID id, String compartmentId, String name, String namespace) {
+ super(id, compartmentId, name);
+ this.namespace = namespace;
+ }
+
+ public BucketItem() {
+ super();
+ }
+
+ public String getNamespace() {
+ return namespace;
+ }
+
+ @Override
+ public int maxInProject() {
+ return Integer.MAX_VALUE;
+ }
+
+}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/bucket/BucketNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/bucket/BucketNode.java
new file mode 100644
index 000000000000..0ef8a9b6db81
--- /dev/null
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/bucket/BucketNode.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.cloud.oracle.bucket;
+
+import com.oracle.bmc.objectstorage.ObjectStorageClient;
+import com.oracle.bmc.objectstorage.requests.ListBucketsRequest;
+import java.util.stream.Collectors;
+import org.netbeans.modules.cloud.oracle.ChildrenProvider;
+import org.netbeans.modules.cloud.oracle.NodeProvider;
+import org.netbeans.modules.cloud.oracle.OCIManager;
+import org.netbeans.modules.cloud.oracle.OCINode;
+import org.netbeans.modules.cloud.oracle.compartment.CompartmentItem;
+import org.netbeans.modules.cloud.oracle.items.OCID;
+import org.openide.util.NbBundle;
+
+/**
+ *
+ * @author Jan Horvath
+ */
+@NbBundle.Messages({
+ "BcuketDesc=Bucket: {0}"
+})
+public class BucketNode extends OCINode {
+
+ private static final String BUCKET_ICON = "org/netbeans/modules/cloud/oracle/resources/bucket.svg"; // NOI18N
+
+ public BucketNode(BucketItem bucket) {
+ super(bucket);
+ setName(bucket.getName());
+ setDisplayName(bucket.getName());
+ setIconBaseWithExtension(BUCKET_ICON);
+ setShortDescription(Bundle.BcuketDesc(bucket.getName()));
+ }
+
+ public static NodeProvider createNode() {
+ return BucketNode::new;
+ }
+
+ /**
+ * Retrieves list of Vaults belonging to a given Compartment.
+ *
+ * @return Returns {@code ChildrenProvider} which fetches List of
+ * {@code BucketItem} for given {@code CompartmentItem}
+ */
+ public static ChildrenProvider.SessionAware getBuckets() {
+ return (compartmentId, session) -> {
+ ObjectStorageClient client = session.newClient(ObjectStorageClient.class);
+
+ ListBucketsRequest listBucketsRequest = ListBucketsRequest.builder()
+ .compartmentId(compartmentId.getKey().getValue())
+ .namespaceName(session.getTenantId())
+ .limit(88)
+ .build();
+
+ return client.listBuckets(listBucketsRequest)
+ .getItems()
+ .stream()
+ .map(d -> new BucketItem(
+ OCID.of(d.getName(), "Bucket"), //NOI18N
+ compartmentId.getKey().getValue(),
+ d.getName(),
+ d.getNamespace())
+ )
+ .collect(Collectors.toList());
+ };
+ }
+
+}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compartment/CompartmentItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compartment/CompartmentItem.java
index f8f3c89a35b8..d39f8016b07c 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compartment/CompartmentItem.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compartment/CompartmentItem.java
@@ -27,8 +27,8 @@
*/
public class CompartmentItem extends OCIItem {
- public CompartmentItem(OCID id, String name) {
- super(id, name);
+ public CompartmentItem(OCID id, String compartmentId, String name) {
+ super(id, compartmentId, name);
}
}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compartment/CompartmentNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compartment/CompartmentNode.java
index d199e732a202..524a3f150553 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compartment/CompartmentNode.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compartment/CompartmentNode.java
@@ -79,7 +79,7 @@ public static ChildrenProvider.SessionAware getCompart
.page(nextPageToken)
.build());
response.getItems().stream()
- .map(c -> new CompartmentItem(OCID.of(c.getId(), "Compartment"), c.getName())) // NOI18N
+ .map(c -> new CompartmentItem(OCID.of(c.getId(), "Compartment"), parent.getKey().getValue(), c.getName())) // NOI18N
.collect(Collectors.toCollection(() -> compartments));
nextPageToken = response.getOpcNextPage();
} while (nextPageToken != null);
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ClusterItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ClusterItem.java
new file mode 100644
index 000000000000..883ee7eeb079
--- /dev/null
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ClusterItem.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.cloud.oracle.compute;
+
+import org.netbeans.modules.cloud.oracle.items.OCID;
+import org.netbeans.modules.cloud.oracle.items.OCIItem;
+
+/**
+ *
+ * @author Jan Horvath
+ */
+public class ClusterItem extends OCIItem {
+
+ public ClusterItem(OCID id, String compartmentId, String name) {
+ super(id, compartmentId, name);
+ }
+
+
+}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ClusterNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ClusterNode.java
new file mode 100644
index 000000000000..27bdbe6abe54
--- /dev/null
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ClusterNode.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.cloud.oracle.compute;
+
+import com.oracle.bmc.containerengine.ContainerEngineClient;
+import com.oracle.bmc.containerengine.requests.ListClustersRequest;
+import com.oracle.bmc.core.model.Instance;
+import com.oracle.bmc.objectstorage.ObjectStorageClient;
+import java.util.stream.Collectors;
+import org.netbeans.modules.cloud.oracle.ChildrenProvider;
+import org.netbeans.modules.cloud.oracle.NodeProvider;
+import org.netbeans.modules.cloud.oracle.OCIManager;
+import org.netbeans.modules.cloud.oracle.OCINode;
+import org.netbeans.modules.cloud.oracle.compartment.CompartmentItem;
+import org.netbeans.modules.cloud.oracle.items.OCID;
+import org.openide.util.NbBundle;
+
+/**
+ *
+ * @author Jan Horvath
+ */
+@NbBundle.Messages({
+ "ClusterDesc=Cluster: {0}"
+})
+public class ClusterNode extends OCINode {
+ private static final String CLUSTER_ICON = "org/netbeans/modules/cloud/oracle/resources/cluster.svg"; // NOI18N
+
+ public ClusterNode(ClusterItem cluster) {
+ super(cluster);
+ setName(cluster.getName());
+ setDisplayName(cluster.getName());
+ setIconBaseWithExtension(CLUSTER_ICON);
+ setShortDescription(Bundle.ClusterDesc(cluster.getName()));
+ }
+
+ public static NodeProvider createNode() {
+ return ClusterNode::new;
+ }
+
+ /**
+ * Retrieves list of Vaults belonging to a given Compartment.
+ *
+ * @return Returns {@code ChildrenProvider} which fetches List of
+ * {@code BucketItem} for given {@code CompartmentItem}
+ */
+ public static ChildrenProvider.SessionAware getClusters() {
+ return (compartmentId, session) -> {
+ ContainerEngineClient client = session.newClient(ContainerEngineClient.class);
+
+ ListClustersRequest listClustersRequest = ListClustersRequest.builder()
+ .compartmentId(compartmentId.getKey().getValue())
+ .limit(88)
+ .build();
+
+ return client.listClusters(listClustersRequest)
+ .getItems()
+ .stream()
+ .filter(c -> !c.getLifecycleState().equals(Instance.LifecycleState.Terminated))
+ .map(d -> new ClusterItem(
+ OCID.of(d.getId(), "Cluster"), //NOI18N
+compartmentId.getCompartmentId(),
+ d.getName()
+ ))
+ .collect(Collectors.toList());
+ };
+ }
+}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceItem.java
new file mode 100644
index 000000000000..759abceac756
--- /dev/null
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceItem.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.cloud.oracle.compute;
+
+import org.netbeans.modules.cloud.oracle.items.OCID;
+import org.netbeans.modules.cloud.oracle.items.OCIItem;
+
+/**
+ *
+ * @author Jan Horvath
+ */
+public class ComputeInstanceItem extends OCIItem {
+
+ public ComputeInstanceItem(OCID id, String compartmentId, String name) {
+ super(id, compartmentId, name);
+ }
+
+
+
+}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceNode.java
new file mode 100644
index 000000000000..da72966760a2
--- /dev/null
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceNode.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.cloud.oracle.compute;
+
+import com.oracle.bmc.containerengine.ContainerEngineClient;
+import com.oracle.bmc.core.ComputeClient;
+import com.oracle.bmc.core.model.Instance;
+import com.oracle.bmc.core.requests.ListInstancesRequest;
+import java.util.stream.Collectors;
+import org.netbeans.modules.cloud.oracle.ChildrenProvider;
+import org.netbeans.modules.cloud.oracle.NodeProvider;
+import org.netbeans.modules.cloud.oracle.OCIManager;
+import org.netbeans.modules.cloud.oracle.OCINode;
+import org.netbeans.modules.cloud.oracle.compartment.CompartmentItem;
+import org.netbeans.modules.cloud.oracle.items.OCID;
+
+/**
+ *
+ * @author Jan Horvath
+ */
+public class ComputeInstanceNode extends OCINode {
+ private static final String COMPUTE_INSTANCE_ICON = "org/netbeans/modules/cloud/oracle/resources/computeinstance.svg"; // NOI18N
+
+ public ComputeInstanceNode(ComputeInstanceItem instance) {
+ super(instance);
+ setName(instance.getName());
+ setDisplayName(instance.getName());
+ setIconBaseWithExtension(COMPUTE_INSTANCE_ICON);
+ setShortDescription("Compute Instance: " + instance.getName());
+ }
+
+ public static NodeProvider createNode() {
+ return ComputeInstanceNode::new;
+ }
+
+ /**
+ * Retrieves list of Vaults belonging to a given Compartment.
+ *
+ * @return Returns {@code ChildrenProvider} which fetches List of
+ * {@code BucketItem} for given {@code CompartmentItem}
+ */
+ public static ChildrenProvider.SessionAware getComputeInstances() {
+ return (compartmentId, session) -> {
+ ComputeClient client = session.newClient(ComputeClient.class);
+
+ ListInstancesRequest listInstancesRequest = ListInstancesRequest.builder()
+ .compartmentId(compartmentId.getKey().getValue())
+ .limit(88)
+ .build();
+
+ return client.listInstances(listInstancesRequest)
+ .getItems()
+ .stream()
+ .filter(c -> !c.getLifecycleState().equals(Instance.LifecycleState.Terminated))
+ .filter(c -> !c.getFreeformTags().containsKey("OKEnodePoolName"))
+ .map(d -> new ComputeInstanceItem(
+ OCID.of(d.getId(), "ComputeInstance"), //NOI18N
+ compartmentId.getKey().getValue(),
+ d.getDisplayName()
+ ))
+ .collect(Collectors.toList());
+ };
+ }
+
+}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseItem.java
index f71c5cc6ccb1..b696da1ec9ab 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseItem.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseItem.java
@@ -29,8 +29,8 @@ public class DatabaseItem extends OCIItem {
private final String serviceUrl;
private final String connectionName;
- public DatabaseItem(OCID id, String name, String serviceUrl, String connectionName) {
- super(id, name);
+ public DatabaseItem(OCID id, String compartmentId, String name, String serviceUrl, String connectionName) {
+ super(id, compartmentId, name);
this.serviceUrl = serviceUrl;
this.connectionName = connectionName;
}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseNode.java
index c3ee9ad84b42..4fb5cecfd65d 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseNode.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseNode.java
@@ -81,6 +81,7 @@ public static ChildrenProvider getDatabases() {
List profiles = d.getConnectionStrings().getProfiles();
DatabaseItem item = new DatabaseItem(
OCID.of(d.getId(), "Databases"), //NOI18N
+ compartmentId.getKey().getValue(),
d.getDbName(),
d.getConnectionUrls().getOrdsUrl()+SERVICE_CONSOLE_SUFFIX,
getConnectionName(profiles));
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildPipelineItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildPipelineItem.java
index 4dbdb19a6ab4..17628c5cf281 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildPipelineItem.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildPipelineItem.java
@@ -28,16 +28,16 @@
*/
public class BuildPipelineItem extends OCIItem {
- public BuildPipelineItem(OCID id, String name) {
- super(id, name);
+ public BuildPipelineItem(OCID id, String compartmentId, String name) {
+ super(id, compartmentId, name);
}
public static class BuildPipelineFolder extends OCIItem {
private final List pipelines;
- public BuildPipelineFolder(OCID project, String name, List pipelines) {
- super(project, name);
+ public BuildPipelineFolder(OCID project, String compartmentId, String name, List pipelines) {
+ super(project, compartmentId, name);
this.pipelines = pipelines;
}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildPipelineNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildPipelineNode.java
index f489d3b997f4..942828e4121f 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildPipelineNode.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildPipelineNode.java
@@ -60,9 +60,10 @@ public static ChildrenProvider.SessionAware projects = response.getBuildPipelineCollection().getItems();
return Collections.singletonList(
new BuildPipelineItem.BuildPipelineFolder(OCID.of(project.getKey().getValue(), "BuildPipelineFolder"),
+ project.getCompartmentId(),
Bundle.BuildPipelines(),
projects.stream()
- .map(p -> new BuildPipelineItem(OCID.of(p.getId(), "BuildPipeline"), p.getDisplayName())) // NOI18N
+ .map(p -> new BuildPipelineItem(OCID.of(p.getId(), "BuildPipeline"), project.getCompartmentId(), p.getDisplayName())) // NOI18N
.collect(Collectors.toList()))
);
}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildRunFolderItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildRunFolderItem.java
index cef0a6867806..693744afc5a1 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildRunFolderItem.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildRunFolderItem.java
@@ -27,8 +27,8 @@
*/
public class BuildRunFolderItem extends OCIItem {
- public BuildRunFolderItem(OCID project, String name) {
- super(project, name);
+ public BuildRunFolderItem(OCID project, String compartmentId, String name) {
+ super(project, compartmentId, name);
}
}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildRunItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildRunItem.java
index 4de90afcabfc..91f4dbf3c56d 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildRunItem.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildRunItem.java
@@ -29,8 +29,8 @@ public class BuildRunItem extends OCIItem {
private final String lifecycleState;
- public BuildRunItem(OCID id, String name, String lifecycleState) {
- super(id, name);
+ public BuildRunItem(OCID id, String compartmentId, String name, String lifecycleState) {
+ super(id, compartmentId, name);
this.lifecycleState = lifecycleState;
}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildRunNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildRunNode.java
index 24aae54f626e..20ad0f24dad9 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildRunNode.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/BuildRunNode.java
@@ -65,7 +65,7 @@ public static NodeProvider createNode() {
public static ChildrenProvider listBuildRuns() {
return project -> Collections.singletonList(
- new BuildRunFolderItem(OCID.of(project.getKey().getValue(), "BuildRunFolder"), Bundle.BuildRuns())
+ new BuildRunFolderItem(OCID.of(project.getKey().getValue(), "BuildRunFolder"), project.getCompartmentId(), Bundle.BuildRuns())
);
}
@@ -82,6 +82,7 @@ public static ChildrenProvider expandBuildRuns
return projects.stream()
.map(p -> new BuildRunItem(
OCID.of(p.getId(), "BuildRun"),
+ project.getCompartmentId(),
p.getDisplayName(),
p.getLifecycleState().getValue()
))
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DeployArtifactItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DeployArtifactItem.java
index 81a0028a7c07..753af98220ee 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DeployArtifactItem.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DeployArtifactItem.java
@@ -28,16 +28,16 @@
*/
public class DeployArtifactItem extends OCIItem {
- public DeployArtifactItem(OCID id, String name) {
- super(id, name);
+ public DeployArtifactItem(OCID id, String compartmentId, String name) {
+ super(id, compartmentId, name);
}
public static class DeployArtifactFolder extends OCIItem {
private final List artifacts;
- public DeployArtifactFolder(OCID project, String name, List artifacts) {
- super(project, name);
+ public DeployArtifactFolder(OCID project, String compartmentId, String name, List artifacts) {
+ super(project, compartmentId, name);
this.artifacts = artifacts;
}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DeployArtifactNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DeployArtifactNode.java
index 0da6a6ea5a8d..c8bcd09df91a 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DeployArtifactNode.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DeployArtifactNode.java
@@ -62,9 +62,10 @@ public static ChildrenProvider projects = response.getDeployArtifactCollection().getItems();
return Collections.singletonList(
new DeployArtifactItem.DeployArtifactFolder(OCID.of(project.getKey().getValue(), "DeployArtifactFolder"),
+ project.getCompartmentId(),
Bundle.DeployArtifacts(),
projects.stream()
- .map(p -> new DeployArtifactItem(OCID.of(p.getId(), "DeployArtifact"), p.getDisplayName()))
+ .map(p -> new DeployArtifactItem(OCID.of(p.getId(), "DeployArtifact"), project.getCompartmentId(), p.getDisplayName()))
.collect(Collectors.toList()))
);
}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DevopsProjectItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DevopsProjectItem.java
index 1df5e7a81c8e..2c3993aaa6a8 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DevopsProjectItem.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DevopsProjectItem.java
@@ -27,8 +27,8 @@
*/
public class DevopsProjectItem extends OCIItem {
- public DevopsProjectItem(OCID id, String name) {
- super(id, name);
+ public DevopsProjectItem(OCID id, String compartmentId, String name) {
+ super(id, compartmentId, name);
}
@Override
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DevopsProjectNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DevopsProjectNode.java
index 5bdea3dfca2c..cad1d5f26e96 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DevopsProjectNode.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/DevopsProjectNode.java
@@ -68,6 +68,7 @@ public static ChildrenProvider listDevopsPro
}
return projects.stream().map(p -> new DevopsProjectItem(OCID.of(p.getId(), "DevopsProject"),
+ compartmentId.getKey().getValue(),
p.getName())).collect(Collectors.toList());
}
};
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/RepositoryItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/RepositoryItem.java
index 5ee033822f1b..8eea18f9f8c8 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/RepositoryItem.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/RepositoryItem.java
@@ -28,16 +28,16 @@
*/
public class RepositoryItem extends OCIItem {
- public RepositoryItem(OCID id, String name) {
- super(id, name);
+ public RepositoryItem(OCID id, String compartmentId, String name) {
+ super(id, compartmentId, name);
}
public static class RepositoryFolder extends OCIItem {
private final List repositories;
- public RepositoryFolder(OCID project, String name, List repositories) {
- super(project, name);
+ public RepositoryFolder(OCID project, String compartmentId, String name, List repositories) {
+ super(project, compartmentId, name);
this.repositories = repositories;
}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/RepositoryNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/RepositoryNode.java
index f53c59a4b22d..604ecb8b1958 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/RepositoryNode.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/devops/RepositoryNode.java
@@ -63,9 +63,10 @@ public static ChildrenProvider listReposito
List projects = response.getRepositoryCollection().getItems();
return Collections.singletonList(
new RepositoryFolder(OCID.of(project.getKey().getValue(), "RepositoryFolder"),
+ project.getCompartmentId(),
Bundle.Repositories(),
projects.stream()
- .map(p -> new RepositoryItem(OCID.of(p.getId(), "Repository"), p.getName()))
+ .map(p -> new RepositoryItem(OCID.of(p.getId(), "Repository"), project.getCompartmentId(), p.getName()))
.collect(Collectors.toList()))
);
}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/OCIItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/OCIItem.java
index cf27724f3845..d01a8fb1cee3 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/OCIItem.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/OCIItem.java
@@ -30,6 +30,7 @@
public abstract class OCIItem {
final OCID id;
final String name;
+ final String compartmentId;
String description;
ChangeSupport changeSupport;
@@ -37,16 +38,18 @@ public abstract class OCIItem {
* Construct a new {@code OCIItem}.
*
* @param id OCID of the item
+ * @param compartmentId OCID of the compartmentId
* @param name Name of the item
*/
- public OCIItem(OCID id, String name) {
+ public OCIItem(OCID id, String compartmentId, String name) {
this.id = id;
this.name = name;
+ this.compartmentId = compartmentId;
changeSupport = new ChangeSupport(this);
}
public OCIItem() {
- this(null, null);
+ this(null, null, null);
}
/**
@@ -76,6 +79,15 @@ public String getDescription() {
return description;
}
+ /**
+ * OCID of the compartmentId.
+ *
+ * @return OCID of the compartmentId
+ */
+ public String getCompartmentId() {
+ return compartmentId;
+ }
+
/**
* Short description of the item.
*
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/TenancyItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/TenancyItem.java
index 74727a8c05a4..1350064a5213 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/TenancyItem.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/TenancyItem.java
@@ -25,7 +25,7 @@
public class TenancyItem extends OCIItem {
public TenancyItem(OCID id, String name) {
- super(id, name);
+ super(id, null, name);
}
public TenancyItem() {
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/bucket.svg b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/bucket.svg
new file mode 100644
index 000000000000..98403a24370c
--- /dev/null
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/bucket.svg
@@ -0,0 +1,133 @@
+
+
+
+
+
+
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/cluster.svg b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/cluster.svg
new file mode 100644
index 000000000000..98403a24370c
--- /dev/null
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/cluster.svg
@@ -0,0 +1,133 @@
+
+
+
+
+
+
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/computeinstance.svg b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/computeinstance.svg
new file mode 100644
index 000000000000..98403a24370c
--- /dev/null
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/computeinstance.svg
@@ -0,0 +1,133 @@
+
+
+
+
+
+
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/layer.xml b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/layer.xml
index 63cffaa5b71a..41a3f4ec7574 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/layer.xml
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/layer.xml
@@ -34,6 +34,20 @@
+
+
+
+
+
+
+
+
@@ -59,6 +73,15 @@
+
+
+
+
+
+
+
+
+
@@ -165,6 +188,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/suggest.svg b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/suggest.svg
new file mode 100644
index 000000000000..98403a24370c
--- /dev/null
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/suggest.svg
@@ -0,0 +1,133 @@
+
+
+
+
+
+
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyItem.java
index 927b474e4e0d..d1653ac1c0d6 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyItem.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyItem.java
@@ -26,21 +26,15 @@
* @author Jan Horvath
*/
public class KeyItem extends OCIItem {
- String compartmentId;
- public KeyItem(OCID id, String name, String compartmentId) {
- super(id, name);
- this.compartmentId = compartmentId;
+ public KeyItem(OCID id, String compartmentId, String name) {
+ super(id, compartmentId, name);
}
public KeyItem() {
super();
}
- public String getCompartmentId() {
- return compartmentId;
- }
-
@Override
public int maxInProject() {
return Integer.MAX_VALUE;
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyNode.java
index 7726949845e2..ca7f5f390bc5 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyNode.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyNode.java
@@ -58,16 +58,16 @@ public static NodeProvider createNode() {
*
* @return Returns {@code ChildrenProvider} which fetches List of {@code KeyItem} for given {@code VaultItem}
*/
- public static ChildrenProvider getKeys() {
- return vault -> {
+ public static ChildrenProvider.SessionAware getKeys() {
+ return (vault, session) -> {
Vault v = Vault.builder()
- .compartmentId(vault.compartmentId)
+ .compartmentId(vault.getCompartmentId())
.id(vault.getKey().getValue())
.managementEndpoint(vault.managementEndpoint)
.build();
KmsManagementClient client = KmsManagementClient.builder()
.vault(v)
- .build(OCIManager.getDefault().getActiveProfile().getConfigProvider());
+ .build(session.getAuthenticationProvider());
ListKeysRequest listKeysRequest = ListKeysRequest.builder()
.compartmentId(vault.getCompartmentId())
.limit(88)
@@ -78,8 +78,8 @@ public static ChildrenProvider getKeys() {
.stream()
.map(d -> new KeyItem(
OCID.of(d.getId(), "Vault/Key"), //NOI18N
- d.getDisplayName(),
- d.getCompartmentId())
+ d.getCompartmentId(),
+ d.getDisplayName())
)
.collect(Collectors.toList());
};
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretItem.java
index 74d739089eee..a4643bb4e510 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretItem.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretItem.java
@@ -26,21 +26,15 @@
* @author Jan Horvath
*/
public class SecretItem extends OCIItem {
- String compartmentId;
- public SecretItem(OCID id, String name, String compartmentId) {
- super(id, name);
- this.compartmentId = compartmentId;
+ public SecretItem(OCID id, String compartmentId, String name) {
+ super(id, compartmentId, name);
}
public SecretItem() {
super();
}
- public String getCompartmentId() {
- return compartmentId;
- }
-
@Override
public int maxInProject() {
return Integer.MAX_VALUE;
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretNode.java
index e679f385b584..f597e27a805f 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretNode.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretNode.java
@@ -18,6 +18,7 @@
*/
package org.netbeans.modules.cloud.oracle.vault;
+import com.oracle.bmc.keymanagement.KmsVaultClient;
import com.oracle.bmc.vault.VaultsClient;
import com.oracle.bmc.vault.requests.ListSecretsRequest;
import java.util.stream.Collectors;
@@ -52,9 +53,9 @@ public static NodeProvider createNode() {
*
* @@return Returns {@code ChildrenProvider} which fetches List of {@code SecretItem} for given {@code VaultItem}
*/
- public static ChildrenProvider getSecrets() {
- return vault -> {
- VaultsClient client = VaultsClient.builder().build(getDefault().getActiveProfile().getConfigProvider());
+ public static ChildrenProvider.SessionAware getSecrets() {
+ return (vault, session) -> {
+ VaultsClient client = session.newClient(VaultsClient.class);
ListSecretsRequest listSecretsRequest = ListSecretsRequest.builder()
.compartmentId(vault.getCompartmentId())
@@ -67,8 +68,8 @@ public static ChildrenProvider getSecrets() {
.stream()
.map(d -> new SecretItem(
OCID.of(d.getId(), "Vault/Secret"), //NOI18N
- d.getSecretName(),
- d.getCompartmentId())
+ d.getCompartmentId(),
+ d.getSecretName())
)
.collect(Collectors.toList());
};
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultItem.java
index caba8cc5cfb3..ca3e0b729541 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultItem.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultItem.java
@@ -26,12 +26,10 @@
* @author Jan Horvath
*/
public class VaultItem extends OCIItem {
- String compartmentId;
String managementEndpoint;
- public VaultItem(OCID id, String name, String compartmentId, String managementEndpoint) {
- super(id, name);
- this.compartmentId = compartmentId;
+ public VaultItem(OCID id, String compartment, String name, String managementEndpoint) {
+ super(id, compartment, name);
this.managementEndpoint = managementEndpoint;
}
@@ -39,10 +37,6 @@ public VaultItem() {
super();
}
- public String getCompartmentId() {
- return compartmentId;
- }
-
public String getManagementEndpoint() {
return managementEndpoint;
}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultNode.java
index 9d26a4e15e72..26237eae6221 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultNode.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultNode.java
@@ -18,7 +18,10 @@
*/
package org.netbeans.modules.cloud.oracle.vault;
+import com.oracle.bmc.identity.Identity;
+import com.oracle.bmc.identity.IdentityClient;
import com.oracle.bmc.keymanagement.KmsVaultClient;
+import com.oracle.bmc.keymanagement.model.VaultSummary;
import com.oracle.bmc.keymanagement.requests.ListVaultsRequest;
import java.util.stream.Collectors;
import org.netbeans.modules.cloud.oracle.ChildrenProvider;
@@ -34,6 +37,7 @@
* @author Jan Horvath
*/
@NbBundle.Messages({
+ "OCIVault=OCI Vault: {0}"
})
public class VaultNode extends OCINode {
private static final String VAULT_ICON = "org/netbeans/modules/cloud/oracle/resources/vault.svg"; // NOI18N
@@ -43,7 +47,7 @@ public VaultNode(VaultItem vault) {
setName(vault.getName());
setDisplayName(vault.getName());
setIconBaseWithExtension(VAULT_ICON);
- setShortDescription(vault.getDescription());
+ setShortDescription(Bundle.OCIVault(vault.getName()));
}
public static NodeProvider createNode() {
@@ -55,9 +59,9 @@ public static NodeProvider createNode() {
*
* @return Returns {@code ChildrenProvider} which fetches List of {@code VaultItem} for given {@code CompartmentItem}
*/
- public static ChildrenProvider getVaults() {
- return compartmentId -> {
- KmsVaultClient client = KmsVaultClient.builder().build(OCIManager.getDefault().getActiveProfile().getConfigProvider());
+ public static ChildrenProvider.SessionAware getVaults() {
+ return (compartmentId, session) -> {
+ KmsVaultClient client = session.newClient(KmsVaultClient.class);
ListVaultsRequest listVaultsRequest = ListVaultsRequest.builder()
.compartmentId(compartmentId.getKey().getValue())
@@ -67,10 +71,11 @@ public static ChildrenProvider getVaults() {
return client.listVaults(listVaultsRequest)
.getItems()
.stream()
+ .filter(v -> v.getLifecycleState().equals(VaultSummary.LifecycleState.Active))
.map(d -> new VaultItem(
OCID.of(d.getId(), "Vault"), //NOI18N
+ d.getCompartmentId(), //NOI18N
d.getDisplayName(),
- d.getCompartmentId(),
d.getManagementEndpoint())
)
.collect(Collectors.toList());