f47eca3b50ec0be3350571e15ecca5a5fd1c3fb4
[sdc.git] /
1 package org.openecomp.core.model.errors;
2
3 import org.openecomp.sdc.common.errors.BaseErrorBuilder;
4 import org.openecomp.sdc.common.errors.ErrorCategory;
5
6 public class RetrieveServiceTemplateFromDbErrorBuilder extends BaseErrorBuilder {
7   private static final String CANT_RETRIEVE_SERVICE_TEMPLATE = "Could not retrirve service " +
8       "template named %s. Reason - %s";
9   private static final String CREATE_SERVICE_TEMPLATE = "CREATE_SERVICE_TEMPLATE";
10
11   public RetrieveServiceTemplateFromDbErrorBuilder(String serviceTemplateName,
12                                                    String reason){
13     this.getErrorCodeBuilder()
14         .withCategory(ErrorCategory.APPLICATION)
15         .withId(CREATE_SERVICE_TEMPLATE)
16         .withMessage(String.format(CANT_RETRIEVE_SERVICE_TEMPLATE, serviceTemplateName, reason));
17   }
18 }