Format Java code with respect to ONAP Code Style
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / utils / E2EServiceUtils.java
1 /**
2  * Copyright (c) 2018 Huawei
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5  * the License. You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10  * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11  * specific language governing permissions and limitations under the License.
12  */
13
14 package org.onap.nbi.apis.serviceorder.utils;
15
16 import java.util.Map;
17
18 import org.onap.nbi.apis.serviceorder.model.orchestrator.ServiceOrderItemInfo;
19
20 public class E2EServiceUtils {
21     public static boolean isE2EService(ServiceOrderItemInfo serviceOrderItemInfo) {
22         Map<String, Object> sdcInfos = serviceOrderItemInfo.getCatalogResponse();
23         boolean e2eService = false;
24         if (sdcInfos.get("category") != null) {
25             String category = ((String) sdcInfos.get("category")).toLowerCase();
26             // Until SO comes up with one consolidated API for Service CRUD, ExtAPI has to be handle SO (serviceInstance
27             // and e2eServiceInstances )APIs for service CRUD
28             // All E2E Services are required to be created in SDC under category "E2E Services" until SO fixes the
29             // multiple API issue.
30             if (category.startsWith("e2e")) {
31                 e2eService = true;
32             }
33         }
34         return e2eService;
35     }
36
37 }