sdedic commented on code in PR #7929:
URL: https://github.com/apache/netbeans/pull/7929#discussion_r1825779945


##########
enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceItem.java:
##########
@@ -26,12 +26,19 @@
 import org.netbeans.modules.cloud.oracle.items.OCID;
 import org.netbeans.modules.cloud.oracle.items.OCIItem;
 import org.openide.util.Exceptions;
+import org.openide.util.NbBundle;
+import org.netbeans.modules.cloud.oracle.assets.Validator;
 
 /**
  *
  * @author Jan Horvath
  */
-public final class ComputeInstanceItem extends OCIItem implements URLProvider {
[email protected]({
+    "SuggestAmpere=The Compute Instance has a different architecture than the 
local machine. Container images built on the local machine may not be 
compatible with this Compute Instance. Please consider creating a Compute 
Instance with an AmpereĀ® shape.",
+    "SuggestIntel=The Compute Instance has a different architecture than the 
local machine. Container images built on the local machine may not be 
compatible with this Compute Instance. Please consider creating a Compute 
Instance with an AmpereĀ® shape."

Review Comment:
   Copypaste typo -- should suggest Intel.



##########
enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/CloudAssets.java:
##########
@@ -145,6 +145,16 @@ public synchronized void addItem(OCIItem newItem) {
                 .filter(i -> 
i.getKey().getPath().equals(newItem.getKey().getPath()))
                 .count();
         if (newItem.maxInProject() > presentCount && 
isTenancyCompatible(newItem, true)) {

Review Comment:
   Q: how the caller knows that `addItem` rejected the request to add an item ?



##########
enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/Validator.java:
##########
@@ -0,0 +1,58 @@
+/*
+ * 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;
+
+/**
+ * Validates if the implementing class is suitable for adding to {@link 
CloudAssets}.
+ * The validation result is represented by {@link Result}, which includes a 
{@link ValidationStatus}
+ * indicating the outcome of the validation.
+ *
+ * <p>The possible validation states are:
+ * <ul>
+ *   <li>{@link ValidationStatus#VALID} - Indicates that the item is suitable 
for adding to {@link CloudAssets}
+ *       without any warnings or restrictions.</li>
+ *   <li>{@link ValidationStatus#WARN} - Indicates that the item may be added 
to {@link CloudAssets},
+ *       but with a warning message to notify the user of potential 
issues.</li>
+ *   <li>{@link ValidationStatus#BLOCK} - Indicates that the item cannot be 
added to {@link CloudAssets}.
+ *       A warning message will be shown, and the addition process will be 
blocked.</li>
+ * </ul>
+ * 
+ * @author Jan Horvath
+ */
+public interface Validator {
+
+    enum ValidationStatus {
+        VALID, WARN, BLOCK

Review Comment:
   Nitpick: why not usual validation statuses - OK, WARNING, ERROR ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to