Introduce error handling in StartupService
[nonrtric.git] / policy-agent / src / main / java / org / oransc / policyagent / repository / Ric.java
index 68b07aa..98c497f 100644 (file)
@@ -144,14 +144,20 @@ public class Ric {
     /**
      * Checks if a type is supported by this Ric.
      *
-     * @param type the type to check if it is supported.
+     * @param typeName the name of the type to check if it is supported.
      *
-     * @return true if the given type issupported by this Ric, false otherwise.
+     * @return true if the given type is supported by this Ric, false otherwise.
      */
     public boolean isSupportingType(String typeName) {
         return supportedPolicyTypes.containsKey(typeName);
     }
 
+    @Override
+    public String toString() {
+        return Ric.class.getSimpleName() + ": " + "name: " + name() + ", state: " + state + ", baseUrl: "
+            + ricConfig.baseUrl() + ", managedNodes: " + ricConfig.managedElementIds();
+    }
+
     /**
      * Represents the states possible for a Ric.
      */
@@ -165,12 +171,8 @@ public class Ric {
          */
         ACTIVE,
         /**
-         * Something is wrong with the Ric.
-         */
-        FAULTY,
-        /**
-         * The node is unreachable at the moment.
+         * The Ric cannot be contacted.
          */
-        UNREACHABLE
+        NOT_REACHABLE
     }
 }