X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fclamp%2Fclds%2Fmodel%2FCldsModel.java;h=62b10d44fc9e4f3631642e55ce955ae27fa24ed1;hb=af0fbf9edb92544380d40ab2cffb87c89831944f;hp=a830f938031fa643d090c754379110a7d2730b1e;hpb=5038c6dec6c51bdf7a5e4ff1d94ab5314c0eb3a3;p=clamp.git diff --git a/src/main/java/org/onap/clamp/clds/model/CldsModel.java b/src/main/java/org/onap/clamp/clds/model/CldsModel.java index a830f938..62b10d44 100644 --- a/src/main/java/org/onap/clamp/clds/model/CldsModel.java +++ b/src/main/java/org/onap/clamp/clds/model/CldsModel.java @@ -116,7 +116,7 @@ public class CldsModel { public boolean canInventoryCall() { boolean canCall = false; - /* Below checks the clds ecent is submit/resubmit */ + /* Below checks the clds event is submit/resubmit */ if ((event.isActionCd(CldsEvent.ACTION_SUBMIT) || event.isActionCd(CldsEvent.ACTION_RESUBMIT))) { canCall = true; @@ -225,7 +225,9 @@ public class CldsModel { /** * Determine permittedActionCd list using the actionCd from the current - * event. + * event. It's a states graph, given the next action that can be executed + * from the one that has been executed (described in the event object). + * ACTION_CREATE being the first one. */ private void determinePermittedActionCd() { String actionCd = getCurrentActionCd(); @@ -300,8 +302,9 @@ public class CldsModel { */ public static CldsModel createUsingControlName(String fullControlName) { if (fullControlName == null || fullControlName.length() < UUID_LENGTH) { - throw new BadRequestException("closed loop id / control name length, " + fullControlName.length() - + ", less than the minimum of: " + UUID_LENGTH); + throw new BadRequestException( + "closed loop id / control name length, " + (fullControlName != null ? fullControlName.length() : 0) + + ", less than the minimum of: " + UUID_LENGTH); } CldsModel model = new CldsModel(); model.setControlNamePrefix(fullControlName.substring(0, fullControlName.length() - UUID_LENGTH));