2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.openecomp.sdc.be.servlets;
22 import com.jcabi.aspects.Loggable;
23 import io.swagger.v3.oas.annotations.tags.Tag;
24 import lombok.AllArgsConstructor;
26 import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
27 import org.openecomp.sdc.be.components.impl.ResourceImportManager;
28 import org.openecomp.sdc.be.impl.ComponentsUtils;
29 import org.openecomp.sdc.be.impl.ServletUtils;
31 import javax.inject.Singleton;
32 import javax.ws.rs.Path;
35 * Root service (exposed at "/" path)
38 //upload Service model by Shiyong1989@hotmail.com
39 @Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
40 @Path("/v1/catalog/uploadservice")
41 @Tag(name = "SDCE-2 APIs")
43 public class ServiceUploadServlet extends AbstractValidationsServlet {
45 public static final String NORMATIVE_TYPE_SERVICE = "multipart";
46 public static final String CSAR_TYPE_SERVICE = "csar";
47 public static final String USER_TYPE_SERVICE = "user-service";
48 public static final String USER_TYPE_SERVICE_UI_IMPORT = "user-servcie-ui-import";
50 public ServiceUploadServlet(ComponentInstanceBusinessLogic componentInstanceBL,
51 ComponentsUtils componentsUtils, ServletUtils servletUtils, ResourceImportManager resourceImportManager) {
52 super(componentInstanceBL, componentsUtils, servletUtils, resourceImportManager);
57 public enum ServiceAuthorityTypeEnum {
58 NORMATIVE_TYPE_BE(NORMATIVE_TYPE_SERVICE, true, false),
59 USER_TYPE_BE(USER_TYPE_SERVICE, true, true),
60 USER_TYPE_UI(USER_TYPE_SERVICE_UI_IMPORT, false, true),
61 CSAR_TYPE_BE(CSAR_TYPE_SERVICE, true, true);
62 private final String urlPath;
63 private final boolean isBackEndImport;
64 private final boolean isUserTypeService;