diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main')
-rw-r--r-- | openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/errors/RetrieveServiceTemplateFromDbErrorBuilder.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/errors/RetrieveServiceTemplateFromDbErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/errors/RetrieveServiceTemplateFromDbErrorBuilder.java new file mode 100644 index 0000000000..f47eca3b50 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/errors/RetrieveServiceTemplateFromDbErrorBuilder.java @@ -0,0 +1,18 @@ +package org.openecomp.core.model.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +public class RetrieveServiceTemplateFromDbErrorBuilder extends BaseErrorBuilder { + private static final String CANT_RETRIEVE_SERVICE_TEMPLATE = "Could not retrirve service " + + "template named %s. Reason - %s"; + private static final String CREATE_SERVICE_TEMPLATE = "CREATE_SERVICE_TEMPLATE"; + + public RetrieveServiceTemplateFromDbErrorBuilder(String serviceTemplateName, + String reason){ + this.getErrorCodeBuilder() + .withCategory(ErrorCategory.APPLICATION) + .withId(CREATE_SERVICE_TEMPLATE) + .withMessage(String.format(CANT_RETRIEVE_SERVICE_TEMPLATE, serviceTemplateName, reason)); + } +} |