2 * Copyright 2016-2017, Nokia Corporation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.direct;
19 import com.nokia.cbam.lcm.v32.model.VnfInfo;
20 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.api.IGrantManager;
21 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.spring.Conditions;
22 import org.onap.vnfmdriver.model.GrantVNFResponseVim;
23 import org.onap.vnfmdriver.model.VnfHealRequest;
24 import org.onap.vnfmdriver.model.VnfScaleRequest;
25 import org.slf4j.Logger;
26 import org.springframework.context.annotation.Conditional;
27 import org.springframework.stereotype.Component;
29 import static org.slf4j.LoggerFactory.getLogger;
32 * Responsible for handling granting before the execution of a VNF operation in case of direct integration
35 @Conditional(value = Conditions.UseForDirect.class)
36 public class GrantlessGrantManager implements IGrantManager {
37 private static Logger logger = getLogger(GrantlessGrantManager.class);
40 public void requestGrantForHeal(String vnfmId, String vnfId, String vimId, String onapCsarId, VnfHealRequest request, String jobId) {
45 public void requestGrantForScale(String vnfmId, String vnfId, String vimId, String onapCsarId, VnfScaleRequest request, String jobId) {
50 public void requestGrantForTerminate(String vnfmId, String vnfId, String vimId, String onapVnfdId, VnfInfo vnf, String jobId) {
55 public GrantVNFResponseVim requestGrantForInstantiate(String vnfmId, String vnfId, String vimId, String onapVnfdId, String instantiationLevelId, String cbamVnfdContent, String jobId) {
57 GrantVNFResponseVim grantResponse = new GrantVNFResponseVim();
58 grantResponse.setVimId(vimId);
62 private void noGrantRequested() {
63 logger.info("No grant is requested in direct mode");